How To Calculate Dates In Perl Using Date::Manip

Author: , September 18th, 2017

1 2 3 4 my $created_at  = ’2017-09-18T13:43:40Z’; my $marker      = DateCalc(’today’,’30 days ago’); my $cmp = Date_Cmp($created_at,$marker); if ($cmp < 0) { print "Older than marker!\n"; } else { print "Same date or later than marker\n"; } my $created_at = ’2017-09-18T13:43:40Z’; my $marker = DateCalc(‘today’,’30 days ago’); my $cmp = Date_Cmp($created_at,$marker); if […]

Host to Delete a Specific Email in Postfix on Linux

Author: , September 14th, 2017

root@outbound:/var/log # postqueue -p -Queue ID- –Size– —-Arrival Time—- -Sender/Recipient——- 593E2FC69D 3970 Tue Sep 12 23:15:36 MAILER-DAEMON (connect to yourDomain.com[10.10.10.10]:25: Connection timed out) yourUser@yourDomain.com — 4 Kbytes in 1 Request. root@outbound:/var/log # postsuper -d 593E2FC69D postsuper: 593E2FC69D: removed postsuper: Deleted: 1 message root@outbound:/var/log # postqueue -p Mail queue is empty

How To Watch https Calls to Apache 2.4 using Perl and mod_status

Author: , September 5th, 2017

Step 1: Enable Apache status and lock it down: Make sure mod_status is being loaded: grep -Rn mod_status /etc/httpd/* 1 /etc/httpd/conf.modules.d/00-base.conf:58:LoadModule status_module modules/mod_status.so /etc/httpd/conf.modules.d/00-base.conf:58:LoadModule status_module modules/mod_status.so Add support for the call just under the first DocumentRoot statement: vim /etc/httpd/conf/httpd.conf 1 2 3 4 5 6 <Location /server-status>     SetHandler server-status     Require ip […]

How To Fix WordPress Missing “Add New” Button in Plugins and Menu Choice “Dashboard > Updates”

Author: , April 17th, 2017

If you are missing either your “Dashboard > Updates” menu choice, or the “Add New” button or menu choice in the Plugins section, do this to correct it: Edit the wp-config.php file, and change two lines to be false instead of true: For example, here are the two lines fixed: 1 2 define(’DISALLOW_FILE_EDIT’, false); define(’DISALLOW_FILE_MODS’,false); […]

How To Associate All Log Files with MacVim

Author: , April 12th, 2017

You can associate a file extension with an app (such as MacVim) via the “Info dialog”. Just select the file and hit Cmd-i, then go to the “Open with” tab, select app and hit “Change all…”. This will change the default application for that file type.

How To Find the Grab Hand Move Tool in Preview

Author: , April 11th, 2017

Press Option+Space and the cursor will change to the grab hand move tool. Roll your mouse wheel for vertical scrolling, hold down shift to switch to horizontal scroll mode.

How To Fix Excel for Mac Arrow Keys Do Not Move Cell Cursor

Author: , April 5th, 2017

As per MS Support page: “My arrow keys don’t move from cell to cell” Press SHIFT+F14 to toggle the Scroll Lock to the off position. Applies To: Excel for Mac 2011 Cause: Scroll Lock is turned on and causing the arrow keys to scroll the workbook area. Solution: Turn off Scroll Lock. Typically, when a […]

How To Increase WordPress Memory After PHP Fatal error: Allowed memory size exhausted

Author: , February 13th, 2017

PHP Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 277644940 bytes) in /volumes/data/customer/wordpress/wp-content/plugins/searchwp/vendor/pdfparser/vendor/smalot/pdfparser/src/Smalot/PdfParser/Parser.php on line 72, referer: http://dev.thecustomer.com/index.php?swpnonce=1387006674.5392169952592578125000 To increase the PHP memory limit to 256MB, edit wp-config.php and add the following just before the line that says “That’s all, stop editing! Happy blogging.”: 1 define( ‘WP_MEMORY_LIMIT’, ’256M’ ); define( ‘WP_MEMORY_LIMIT’, […]

How To rsync Only Specific File Extensions

Author: , February 5th, 2017

rsync -avzn –progress –include=’*.png’ –include=’*/’ –exclude=’*’ /the/source/path/ user@theServer:/the/target/path/

How To Reduce the Size of a PDF Using Ghostscript

Author: , February 4th, 2017

Make sure you have Ghostscript installed, then: 1 gs -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS="/ebook" -sOutputFile=output.pdf input.pdf gs -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=”/ebook” -sOutputFile=output.pdf input.pdf -dPDFSETTINGS={value} where {value} is one of: /screen – the lowest resolution and lowest file size, fine for viewing on a screen /ebook – mid-range resolution and file size /printer – high-quality […]