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 Block an Entire TLD in Postfix

Author: , September 13th, 2016

Step 1. Execute the following two commands: postconf -e smtpd_sender_restrictions=pcre:/etc/postfix/rejected_domains postconf -e reject_unauth_destinations=pcre:/etc/postfix/rejected_domains If that doesn’t work, you may hand-edit main.cf and add/edit these lines: 1 2 smtpd_sender_restrictions=pcre:/etc/postfix/rejected_domains reject_unauth_destinations=pcre:/etc/postfix/rejected_domains smtpd_sender_restrictions=pcre:/etc/postfix/rejected_domains reject_unauth_destinations=pcre:/etc/postfix/rejected_domains Step 2. Create the regex filter file: vim /etc/postfix/rejected_domains 1 2 /\.top$/           REJECT No spam allowed from the .top […]

How To Export Apple Email Rules

Author: , November 10th, 2015

Quit Mail. Look for a file called MessageRules.plist under ~/Library/Mail. Depending on your Mail version it could be under ~/Library/Mail/V2/Maildata as well. Copy that file. It can be edited with vim or the PList editor. I find it much easier to work with as text in vim.

How To Select the Max Numeric in a Varchar Column in MySQL

Author: , October 2nd, 2015

I needed to automate the addition of new users with a sequential member’s ID in WordPress. Additionally, there were non-numeric entries in that column that had to be ignored. The wp_users.user_login column is a varchar(60) and so does not naturally handle numeric operations well at all. The solution is a combination of REGEXP and cast(): […]

How To Filter Blank Lines With GREP

Author: , May 23rd, 2010

Note – using FreeBSD’s version of grep. The “-h” argument tells grep to NOT print file names at the beginning of the line. The “-v” says to SKIP matched lines.