How To Upgrade MySQL from 5.5 to 5.7 on CentOS/AWS Linux

Author: , Posted on Thursday, December 7th, 2017 at 10:28:05am

START: Server version: 5.5.54-log MySQL Community Server (GPL)
FINISH: Server version: 5.7.20-log MySQL Community Server (GPL)

1
2
3
4
5
6
mysql --execute="SET GLOBAL innodb_fast_shutdown=0;"
service mysqld stop
yum remove mysql mysql-*
yum install mysql57-devel mysql57-server
service mysqld start
mysql_upgrade
mysql --execute="SET GLOBAL innodb_fast_shutdown=0;"
service mysqld stop
yum remove mysql mysql-*
yum install mysql57-devel mysql57-server
service mysqld start
mysql_upgrade

How To Change the root Password on MacOS High Sierra

Author: , Posted on Tuesday, November 28th, 2017 at 5:26:45pm
  1. Launch System Preferences
  2. Select Users & Groups
  3. Select Login Options
  4. Select Join next to Network Account Server
  5. Select Open Directory Utility
  6. Click the lock and enter your password to make changes
  7. In the menu bar of Directory Utility, select Change Root Password
  8. Create a strong, unique password

More Snow This Morning!

Author: , Posted on Friday, November 17th, 2017 at 8:10:43am

Another dusting, but oh so pretty!
images-of-snow-8

How To Redirect to https in Apache Using mod_rewrite

Author: , Posted on Friday, November 17th, 2017 at 8:08:55am
1
2
3
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}

First Snowfall of 2017

Author: , Posted on Tuesday, November 7th, 2017 at 12:52:40pm

I am SO happy to see the first snow!
images-of-snow-8

How To Create a Single Custom Post Type Template for Genesis in WordPress

Author: , Posted on Saturday, October 21st, 2017 at 8:37:25am

wordpress/wp-content/themes/yourTheme/single-yourCPTslug.php

1
2
3
4
5
6
7
8
9
10
11
add_action( 'genesis_before_entry_content', 'display_custom_fields' );
function display_custom_fields() {
    $jobTitle = get_field('_jobTitle') ?: '-';
    print <<<EOT
    <br style="clear:both"/>
    <p>Job Title: $jobTitle</p>
EOT;
}
 
// Genesis Loop
genesis();
add_action( 'genesis_before_entry_content', 'display_custom_fields' );
function display_custom_fields() {
	$jobTitle = get_field('_jobTitle') ?: '-';
	print <<<EOT
	<br style="clear:both"/>
	<p>Job Title: $jobTitle</p>
EOT;
}

// Genesis Loop
genesis();

How to Manage Remote Branches in Git

Author: , Posted on Thursday, October 19th, 2017 at 6:29:42am

Git does not download all branches unless you tell it to. Until then, they are ‘remote’ branches.

Use -r to list remote branches:
git branch -r
git fetch --all
git pull --all

If you see this error:
fatal: The current branch CT-37 has no upstream branch.

Push the current branch and set the remote as upstream:
git push --set-upstream origin CT-37

How To Revert a Single File in Git to Match the Master Branch

Author: , Posted on Thursday, October 19th, 2017 at 6:21:04am

If you want to revert the file to its state in master:

git checkout origin/master [filename]

How To Clean Up Lost Disk Space in MacOS High Sierra

Author: , Posted on Thursday, October 12th, 2017 at 10:17:46am

Reposted from https://mcbguru.blog/2017/10/12/macos-high-sierra-disk-space/

The new APFS creates snapshots during local Time Machine backups, and this can mean, especially if you’be been dealing with some large files, that when you delete them and empty the wastebasket, you don’t get your disk space back.
The key is to look at your local backups, and the easiest method for that is the tmutil command. In particular, check the list of local snapshots:

1
2
3
4
5
6
7
8
$ tmutil listlocalsnapshots /
com.apple.TimeMachine.2017-10-06-163649
com.apple.TimeMachine.2017-10-07-065814
com.apple.TimeMachine.2017-10-11-165349
com.apple.TimeMachine.2017-10-11-19345
com.apple.TimeMachine.2017-10-11-203645
com.apple.TimeMachine.2017-10-12-003803
com.apple.TimeMachine.2017-10-12-124712
$ tmutil listlocalsnapshots /
com.apple.TimeMachine.2017-10-06-163649
com.apple.TimeMachine.2017-10-07-065814
com.apple.TimeMachine.2017-10-11-165349
com.apple.TimeMachine.2017-10-11-19345
com.apple.TimeMachine.2017-10-11-203645
com.apple.TimeMachine.2017-10-12-003803
com.apple.TimeMachine.2017-10-12-124712

These are normally managed automatically using a combination of the date/age of the backup and the space they are using compared to how much disk space you need. All this happens automatically in the background for you.
But, if you’ve just done some house cleaning, or you’ve come back from using a lot of disk space and want to free it up, you’ll need to get rid of those old snapshots. You can do them individually using:
$ tmutil deletelocalsnapshots
But it’s easier to just purge the snapshots and specify how many you many want to get rid of. That will leave you with some recent snapshots but still recover some diskspace, for that, use this command:
$ tmutil thinlocalsnapshots [purgeamount] [urgency]
That [purgeamount] is how much space you want to recover in the process, and the [urgency] is a number (1-4) of how quickly you want the space recovered. Both are optional.
For me, I just ran the thinning and that left me with:

1
2
3
4
$ tmutil thinlocalsnapshots /
Thinned local snapshots:
2017-10-06-163649
2017-10-07-065814
$ tmutil thinlocalsnapshots /
Thinned local snapshots:
2017-10-06-163649
2017-10-07-065814

How To get haproxy status via socket using cli

Author: , Posted on Friday, October 6th, 2017 at 10:25:17am

echo "show stat" | nc -U /var/lib/haproxy/stats | cut -d "," -f 1,2,5-11,18,24,27,30,36,50,37,56,57,62 | column -s, -t