Entries Categorized as 'How-To’s'

How To Revert a Single File to a Specific Commit Using git

Author: , March 18th, 2019

git log {path_and_file} git checkout {commit_hash} — {path_and_file} git checkout 8c7eae3f518bb7fd98eb6e8344270f02065d83ee — myFile.txt

How To Enable Opening a Terminal Window from the Current Finder Location in MacOS

Author: , February 16th, 2019

As of Mac OS X Lion 10.7, Terminal provides Services for opening a new terminal window or tab at the selected folder in Finder. They also work with absolute pathnames selected in text (in any application). You can enable these services with System Preferences > Keyboard > Keyboard Shortcuts > Services. Look for “New Terminal […]

How To Obtain a Public Key from an AWS .pem Private Key on Linux and Mac

Author: , February 4th, 2019

Use the ssh-keygen command on a computer to which you’ve downloaded your private key .pem file; for example: First, ensure permissions will allow ssh-keygen to work: chmod 600 /path/to/the/file/your-key-pair.pem Then generate an RSA public key: ssh-keygen -y -f /path/to/the/file/your-key-pair.pem > your-key-pair.pub

How To Reformat or Re-indent Files in VIM

Author: , January 11th, 2019

In the normal vim mode, typing gg=G will reindent the entire file. == will re-indent just the current line. http://vim.wikia.com/wiki/Fix_indentation

How To Include Custom jQuery in WordPress

Author: , December 20th, 2018

1 2 3 4 5 6 7 8 // include custom jQuery function wyz_include_custom_jquery() {       wp_deregister_script(’jquery’);     wp_enqueue_script(’jquery’, ‘https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js’, array(), null, true);   } add_action(’wp_enqueue_scripts’, ‘wyz_include_custom_jquery’); // include custom jQuery function wyz_include_custom_jquery() { wp_deregister_script(‘jquery’); wp_enqueue_script(‘jquery’, ‘https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js’, array(), null, true); } add_action(‘wp_enqueue_scripts’, ‘wyz_include_custom_jquery’);

How To Get the Structure of All Tables in a MySQL Database Using mysqldump

Author: , December 2nd, 2018

mysqldump -u {yourUserNameHere} -p –no-data –compact {yourDatabaseHere}

How To Disable Adobe Daemons Using launchctl on MacOS

Author: , November 18th, 2018

I installed an old version of Adobe software on my new Mac and as usual, it installed some daemons that are undesirable. Here is how I got rid of them via the Terminal. Note: Adobe installs daemons in the user context, so do this as your regular user login, not as root. shell> launchctl list […]

How To Test Nagios Remote NRPE Commands

Author: , September 27th, 2018

There are many things to configure in Nagios, especially when using custom check commands. Recently I needed to configure all of the Continuent Clustering Nagios checks. Once setup on the database side, I wanted to confirm that everything was working. Basics: Run a Remote NRPE Check To test a remote NRPE client command from a […]

How To Create a PayPal-styled Button Using CSS and HTML

Author: , August 31st, 2018

1 <button class="paypal-btn large" onclick="window.location=’https://www.yoursite.com/targetPage/’;return false">What a Great Button</button> <button class=”paypal-btn large” onclick=”window.location=’https://www.yoursite.com/targetPage/’;return false”>What a Great Button</button> 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 […]

How To Display Blog Pages for a Single Category

Author: , August 6th, 2018

Create a new page and set the page template to Blog. Add a new Custom Field to the page. Set the Name to the string query_args and the value to cat=NNN, where NNN is the ID of the desired category. Be sure to click Publish or Update when done. You can locate the Category ID […]