Shami's Blog

Sysadmin, Because Even Developers Need Heroes

FreeBSD SCP Chroot

2016-06-29 by Mohammad H. Al-Shami

Quick one here, if you want to create an SCP only user on FreeBSD just do the following

Read More...

Welcome To My New Blog

2016-06-14 by Mohammad H. Al-Shami

Update: I have since migrated to Hugo which seems to be better maintained and generally easier for me to update. I have also started using Texts more for editing Markdown

I haven’t been very active on this blog over the years, one of the reasons was Wordpress itself; As nice as it is, I grew sick of updates always breaking something. Another thing that always made me feel uneasy was the email I got every once and a while from my blog telling me it updated itself. True, this is good when people ignore their blogs but I didn’t feel in control of my own blog any more and sometimes I wouldn’t have enough time to debug any plugins that broke when the blog decided it was time for me to upgrade.

Read More...

Fixing Incorrect Encoding In MySQL Databases

2016-05-26 by Mohammad H. Al-Shami

I have recently faced an issue while migrating MySQL to a new server where non-English characters show up as gibberish. This was because UTF-8 text was saved in columns encoded as latin1. The solution is simple, convert the field into a BLOB and then back to text with the required type and encoding.

Read More...

Real-Time Network Traffic Stats On FreeBSD

2016-05-08 by Mohammad H. Al-Shami

Quick one here, to get real-time traffic stats on FreeBSD just run the following command

systat -ifstat

Copying Content From A Word Document To A CKEDitor

2016-05-03 by Mohammad H. Al-Shami

So I’ve been assisting a customer with their website and I was helping them with some data entry. Most of the content they sent me was in MS Word format. Copying the text directly to Drupal’s CKEditor had all formatting messed up so I was copying to notepad, copying from there to Drupal and then formatting manually. This turned out to be a nightmare when I had to copy 10 tables in a single page.

Read More...

'apt-get update' Failing After A Fresh Ubuntu 12.04 Installation

2016-05-02 by Mohammad H. Al-Shami

So I’m currently working with a customer that requires Ubuntu 12.04 for their servers since their apps were built and tested on that version, so every new install I run into the following issue

Read More...

Adding 'on behalf of' To Outgoing Emails With Postfix

2016-04-28 by Mohammad H. Al-Shami

I used to be a big fan of Mandrill. I used to use it as an email gateway for my personal servers. It’s easy to use and it’s cheap (Or free if you send less than 12,000 emails per month). I liked not having to setup SPF, DKIM, and DMARC for my small setups. Even for smaller clients I wouldn’t bother with that and just use Mandrill. Emails just show up with the following sender [email protected]; on behalf of; [email protected]

Read More...

Randomize Source IP Addresses With Postfix

2016-04-27 by Mohammad H. Al-Shami

Sometimes when you have a high number of outgoing messages services like Yahoo! and Gmail might block you. To prevent that you need to distribute your outgoing emails through a set of IPs. I used HAProxy for that along with a number of FreeBSD Jails. That solution is a bit tedious, even though after I started using Salt things became a bit easier it was still too complicated for my taste.

Read More...

Corrupted image_captcha In Drupal

2016-04-23 by Mohammad H. Al-Shami

I have noticed that the image_captcha Drupal module has been showing empty images on some of the websites I administer. When checking the cause of this I tried to view the image directly and got:

Read More...

Moving A Magento Instance To A New Domain

2016-04-21 by Mohammad H. Al-Shami

Quick one here, when you move a Magento instance to a new domain or URL it will keep redirecting to the old address. There is a quick fix

Read More...