How To Convert UNIX Timestamps to Date using PHP CLI
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;’
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;’
awk ‘{sum+=$1}END{print sum}’ inputFile
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.
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.
1 2 |
$ mysql -u root mysql> |
To set the root password for the first time, use mysqladmin:
1 |
$ mysqladmin -u root password 'NewPasswordHere' |
However, if you want to change (or update) a root password, then […]
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):
1 2 3 4 5 6 7 8 9 10 11 |
include 'wp-config.php'; include 'wp-admin/includes/export.php'; ob_start(); export_wp(); $file = ob_get_contents(); ob_end_clean(); $fh = fopen("wordpress-" . date('Y-m-d') . ".xml", 'w'); fwrite($fh, $file); fclose($fh); |
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