How To Convert UNIX Timestamps to Date using PHP CLI

Author: , August 15th, 2015

For a quick visual check to see what the human-readable date is based on a UNIX timestamp integer: php -r ‘print date(“r”,1483228799);’ php -r ‘print strtotime(“1 Jan 2015”) – 1;’

How To Add a Column of Numbers Using AWK

Author: , January 1st, 2015

awk ‘{sum+=$1}END{print sum}’ inputFile

How To Show All Files in MacOSX Yosemite via Terminal

Author: , October 29th, 2014

SET THE DEFAULT TO SHOW Run this command in a Terminal window: defaults write com.apple.finder AppleShowAllFiles YES Relaunch Finder: Hold down the Option/ALT key on your keyboard, then right-click the Finder icon in the dock and select Relaunch. SET THE DEFAULT TO HIDE defaults write com.apple.finder AppleShowAllFiles NO then relaunch finder as above.

How To Change The Root Password In MySQL

Author: , October 26th, 2011

Using mysqladmin on the command line If you have never set a root password for MySQL server, the server does not require a password at all for connecting as root.

To set the root password for the first time, use mysqladmin:

However, if you want to change (or update) a root password, then […]

How To Export WordPress From The Command Line CLI

Author: , July 29th, 2011

Create a file called export.php in the wordpress top directory containing the following (remember to add the PHP tags at the top and bottom):

How To Install Multiple Perl Modules From The Command Line

Author: , July 14th, 2010

Create a text file containing the list of desired modules, one per line. Name it “modules.txt”. Then execute this command: for module in cat modules.txt; do echo $module; perl -MCPAN -e “install $module”; done