External file changes sync slow: The current inotify limit is too low

25 August 2018 | 1 min read

I get this message when waiting gradle task on my Android Studio 3

External file changes sync may be slow: The current inotify(7) watch limit is too low

WTF is this? After some google-fu , I found some official instruction from JetBrain. You can read here for more details.

Now, let’s check the current setting:

$ cat /proc/sys/fs/inotify/max_user_watches
8192

Does the current value are too small? Add new conf file..

$ sudo touch /etc/sysctl.d/60-jetbrains.conf

Open the file and add this lines

# Set inotify watch limit high enough for IntelliJ IDEA (PhpStorm, PyCharm, RubyMine, WebStorm).
# Create this file as /etc/sysctl.d/60-jetbrains.conf (Debian, Ubuntu), and
# run `sudo service procps start` or reboot.
# Source: https://confluence.jetbrains.com/display/IDEADEV/Inotify+Watches+Limit
# 
# More information resources:
# -$ man inotify # manpage
# -$ man sysctl.conf # manpage
# -$ cat /proc/sys/fs/inotify/max_user_watches # print current value in use

fs.inotify.max_user_watches = 524288

Let’s restart the systemd

$ sudo sysctl -p --system

Now, restart you IDE. It should be no complaint anymore ;d

Load Git-Bash as terminal on VSCODE

22 August 2018 | 1 min read

VSCODE

Hi there, If you are using VSCODE on Windows and prefer to use Git-Bash instead of Windows CMD as terminal, just add this snipet into your "user-setting" to override the default setting
{
  "terminal.integrated.shell.windows": "C:\\Program Files\\Git\\git-cmd.exe",
  "terminal.integrated.shellArgs.windows": ["--command=usr/bin/bash.exe","-l","-i"]
}

Then press Ctrl+` to open terminal on your VSCODE

Finding diff from terminal ouput and hexdumping chars

20 June 2018 | 1 min read

I know how to dump a string and check hex code via piping the output from terminal to hexdump for example :

$ echo ‘–allowerasing’ | hexdump -C
00000000  e2 80 98 e2 80 93 61 6c  6c 6f 77 65 72 61 73 69  |......allowerasi|
00000010  6e 67 e2 80 99 0a                                 |ng....|
00000016

But when comes to compare string, I cannot just use diff YY ZZ as like comparing files and I found out using dollar sign $(echo YY) are not acceptable and failed to process but I figure out the workaround, which is to use <(echo ZZ) to create temporary named pipes:

$ diff <(echo ‘‐‐allowerasing’ | hexdump -C) <(echo ‘–allowerasing’ | hexdump -C) 
1,3c1,3
< 00000000  e2 80 98 e2 80 90 e2 80  90 61 6c 6c 6f 77 65 72  |.........allower|
< 00000010  61 73 69 6e 67 e2 80 99  0a                       |asing....|
< 00000019
---
> 00000000  e2 80 98 e2 80 93 61 6c  6c 6f 77 65 72 61 73 69  |......allowerasi|
> 00000010  6e 67 e2 80 99 0a                                 |ng....|
> 00000016

Financial Freedom..123

30 May 2018 | 6 min read

Within past 2 years (since 2016) there is significant impact to Malaysia economy and thanks to the slower economy pace which burden our financial status right now, I truly starting to acknowledge the importance of budgeting or at least, saving more money!

There are no secrets to success. It is the result of preparation, hard work, and learning from failure Colin Powell

As the quote said, lets plan to achieve our financial goal.

(read more)

Fixing failed to load "pk-gtk-module" and "canberra-gtk-module"

29 May 2018 | 1 min read

Peace be upon you, I recently use VMware workstation for server simulation for upcoming project but I keep seeing this scrap message as below:

Gtk-Message: Failed to load module “pk-gtk-module”: libpk-gtk-module.so: cannot open shared object file: No such file or directory

Gtk-Message: Failed to load module “canberra-gtk-module”: libcanberra-gtk-module.so: cannot open shared object file: No such file or directory

I check out which package will provide me thus two library modules that needed :

$ dnf provides libpk-gtk-module.so
PackageKit-gtk3-module-1.1.9-3.fc28.i686 : Install fonts automatically using PackageKit
Repo        : fedora
Matched from:
Provide    : libpk-gtk-module.so

$ dnf provides libcanberra-gtk-module.so
Last metadata expiration check: 4 days, 17:34:05 ago on Fri 25 May 2018 05:56:22 AM +08.
libcanberra-gtk2-0.30-16.fc28.i686 : Gtk+ 2.x Bindings for libcanberra
Repo        : fedora
Matched from:
Provide    : libcanberra-gtk-module.so

But this two package already been installed inside my machine and seems this occurs because the requested gtk modules aren’t in any of the paths defined in /etc/ld.so.conf.d/* directory.

We need to created new gtk2.cnf (follow tutorial below).

$ sudo bash -c 'cat > /etc/ld.so.conf.d/gtk2.conf << 'EOF'
/usr/lib64/gtk-2.0/modules
EOF'
$ sudo ldconfig

Now you application (e.g VMware) should never show the same as previous gtk-message again when starting.