Recent Articles and Tutorials

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

Git display info of last commit (HEAD) in one line

Display last commit info from head in one line $ git log –pretty=format:”%h|%an|%ad|%s” -1 97d79ec|Dave Methvin|Mon Nov 9 17:49:01 2015 -0500|Dimensions: Empty sets should return read more

Git – display specific length commit hash

Display last commit from head to with specific commit hash length $ git log –pretty=format:”%h” –abbrev=7 -1 97d79ec

Git – Check if a hash is valid

Use git show and check for exit status $ git show -s 97d79ecf6b6 commit 97d79ecf6b6c5cc3c1485eb3c46e12986a978f57 Author: Dave Methvin Date: Mon Nov 9 17:49:01 2015 -0500 read more