How To Convert An RSA Private Key to PEM Format

Author: , January 10th, 2020

How To Force vim to Convert Tabs to Spaces

Author: , November 26th, 2019

To create indents with 4 space characters which are entered by pressing the TAB key:

To make the above settings permanent add to your ~/.vimrc file. For more details on any of these see :help ‘optionname’ in vim (e.g. :help ‘tabstop’) tabstop The width of a hard tabstop measured in “spaces” — effectively the […]

How To Strip Windows Newlines in PHP

Author: , February 21st, 2018

$text = str_replace(“\r”, “”, $text);

How To Convert from mysql_ to mysqli_ in WordPress Plugins Easily

Author: , August 24th, 2016

As PHP deprecates old functions, sometimes code maintenance changes become required for long-running sites. As of PHP 5.5, the MySQL functions are deprecated and are removed in PHP 7! I recently had to convert multiple sites to mysqli PHP functions because a new server was running PHP 5.6 and the old server was on PHP […]

How To Easily Convert From Centigrade/Celsius to Fahrenheit

Author: , August 8th, 2016

The standard formula (F = 9/5C + 32) is not that easy to use. To create an easy estimate, simply double the Centigrade temp, then subtract the first digit of that result from the result, then add 32. The resulting estimate should not be more than 1 degree Fahrenheit off. Exact method yields a conversion […]

How To Create a PDF from Multiple Image Files on the Command Line

Author: , June 6th, 2016

convert myFile*.jpg myFile.pdf convert myFile*.png myFile.pdf

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 Batch Create Thumbnails Using mogrify

Author: , August 7th, 2013

I used the ImageMagick mogrify command to batch-create over 14,000 thumbnails easily. Since the default operation is to overwrite the originals, I chose to write the output files into a different directory with the -path option. Note the greater-than sign (>) after the 100×100 dimensions. This flag tells mogrify to only shrink images that have […]

How To Batch Convert MS Word doc to docx

Author: , June 28th, 2013

Many thanks to Robert Russell for his excellent conversion tip! I have recorded the procedure below in case that post ever goes away… Download the two required installation packages from Microsoft: Microsoft Office Migration Planning Manager Microsoft Office Compatibility Pack for Word, Excel, and PowerPoint File Formats Install both packages. Specify a place to install […]

How To Convert HTML Entity Codes To Plain Text

Author: , April 10th, 2012

Using Perl: use HTML::Entities; my $plainText = decode_entities(‘Put text to convert here’); Using PHP: $plainText = html_entity_decode(‘Put text to convert here’,ENT_QUOTES,’UTF-8′);