Recent Articles and Tutorials

Linux – number of cpus (lscpu)

Command lscpu to find number of cpus on linux $ lscpu lscpu Architecture: x86_64 CPU op-mode(s): 32-bit, 64-bit Byte Order: Little Endian CPU(s): 32 On-line read more

Android – enable system ui tuner

System ui tuner can be enable to Android Marshmallow, Nougat or Orio. It lets us customize more system ui settings on Android e.g. status bar read more

Python iterate dictionary

Iterate Python dictionary (associative arrays) Using keys It is not memory efficient for large dictionaries. Using values It is not memory efficient for large dictionaries. read more

Android – Show top processes using adb

To show top 5 processes by cpu $ adb shell top -m 5 -s cpu Sample outcome User 16%, System 3%, IOW 0%, IRQ 0% read more

WordPress – disable theme and plugin editing

Allowing theme editing from web can be prone to spam. To disable theme and plugin editor, add the following to wp-config.php define( ‘DISALLOW_FILE_EDIT’, true ); read more

Chrome enable webgl on old macbooks

Steps to enable WebGL on old MAcbook (e.g. later 2011) Visit chrome://settings and make sure under advanced settings > System > Use hardware available when read more

Mysql find slave lag

Command to find slave lag (on mysql slave): $ mysql -u root –password=PASSWORD -e “show slave status\G” | grep Seconds_Behind_Master Seconds_Behind_Master: 0

Git detached head

Create a detached head situation $ git branch * master $ git log –oneline 55fff69 v3 1fd2aa6 file1 $ git checkout 1fd2aa6 Note: checking out read more

Git – rename local branch

Git – rename local branch $ git branch -m oldname newname

Git display local HEAD location

Display HEAD pointer $ cat .git/HEAD ref: refs/heads/foo1 Display HEAD pointer (detached head case) $ cat .git/HEAD 1fd2aa6a8ff7205c91fde3d9557c6d67eeaf4eb1