How To Eject a Volume from the Terminal Command Line in MacOSX

Author: , December 8th, 2015

As always, YMMV…

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 Find the AWS Region and Availability Zone Via the CLI

Author: , June 30th, 2015

/opt/aws/bin/ec2-metadata | grep placement

How To Force Getopt::Long To Be Case Sensitive in Perl

Author: , March 19th, 2014

How To Speed Up Safari Page Display

Author: , March 16th, 2012

I just found this neat trick to speed up Safari by reducing the ‘Render Before Display’ time: 1. Quit Safari. 2. Launch Terminal.app 3. Type in the line below and then press {enter}: defaults write com.apple.Safari WebKitInitialTimedLayoutDelay 0.20 4. Quit Terminal and restart Safari

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

How To Filter Blank Lines With GREP

Author: , May 23rd, 2010

[code] # filter blank lines grep -hv "^$" * # filter blank lines and comments grep -hv ‘^#’ * | grep -hv "^$" # filter blank lines, and comments, then count number of lines grep -hv ‘^#’ * | grep -hv "^$" | wc -l [/code] Note – using FreeBSD’s version of grep. The “-h” […]