How To Rename a Branch in Git Locally and Remotely

Author: , Posted on Wednesday, January 31st, 2018 at 6:56:50pm

Rename the old branch locally:
git branch -m oldBranch newBranch

Delete the old branch remotely:
git push origin :oldBranch

Push up the new branch, and make the local branch track with the new remote branch:
git push --set-upstream origin newBranch

How To Remove a Package Without the Dependencies (yum/rpm)

Author: , Posted on Tuesday, January 9th, 2018 at 9:59:48am

To remove a specific package without its dependencies use rpm:

1
2
rpm -qa | grep pecl
rpm -e --nodeps php55-pecl-jsonc php55-pecl-jsonc-devel
rpm -qa | grep pecl
rpm -e --nodeps php55-pecl-jsonc php55-pecl-jsonc-devel

As always, YMMV!

How To Fix MacOSX Yosemite 10.10 Memory Leaks via SMC and PRAM Resets

Author: , Posted on Thursday, January 4th, 2018 at 5:08:16pm

I was running out of memory constantly on Yosemite 10.10.5 and found the following article:
https://discussions.apple.com/message/26929324?start=555&tstart=0
Edited and reposted without permission below…

  1. Disconnect any external or secondary monitors, if any is present. The video memory allocation leak can also happen if you have a system with an integrated card, like Intel, with no external monitors attached.
  2. Shut down your machine and enter Safe Mode (press shift once you turn on your computer again More Info: How to access Safe Mode)
  3. In safe mode, fix your disk permissions.
  4. From Safe Mode turn off your machine again and reset your System Management Controller (SMC). There are different methods, depending on machine, to do this. To know what method applies to yours read the following guide: Intel-based Macs: Resetting the System Management Controller (SMC)

    These are the steps I followed to reset the SMC for my iMac 5K:

    • Choose Apple menu > Shut Down.
    • After your Mac shuts down, unplug the power cord.
    • Wait 15 seconds.
    • Plug the power cord back in.
    • Wait 5 seconds, then press the power button again to turn on your Mac.
  5. Once your machine completes a full boot after resetting the SMC turn it off again and reset your PRAM (THIS IS THE MOST IMPORTANT STEP, BUT THE PREVIOUS ONES ARE ESSENTIAL FOR THIS ONE TO WORK). The PRAM stores small bits of data that indicate our Apple computer how to interact with the devices connected to it, including monitors and video cards. It also affects software.
  6. To reset it you should hold the OPTION, COMMAND, P and R keys in your keyboard immediately after turning on your machine again.You’ll hear the start up chime, continue pressing the keys until the machine boots and the chime starts A SECOND TIME, then release. IF YOUR YOSEMITE INSTALLATION LOCKS UP AT A BLACK SCREEN AFTER THIS, DONT PANIC! It’s normal, just turn off your computer and let it boot again.
  7. Once you have fully booted, reconnect your external displays.

More info about PRAM: OS X Mavericks: Reset your computer’s PRAM
 
 

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 mysql57-test
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 mysql57-test
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