/home » workblog

Relaying Qmail Through a Spam Filter

If you’re running a mail service on a web server so it can send out e-mail from contact forms, etc then you’ll want to make sure it’s relaying outbound mail through a spam filter, or it could be used to send spam if the forms get hijacked. For qmail, you just need to create /var/qmail/control/smtproutes and enter “:yourmailserver.com”, then restart. Make sure the spam filter is configured to allow the mail server to relay through it.

Memorable IP Address

If you’re troubleshooting a network’s uplink to the Internet and want a memorable external IP address to ping, then you can use 4.2.2.2, which is one of Verizon’s DNS servers.

Skipping Disk Check When Rebooting Linux Server

If you don’t run a disk check on a Linux server in awhile and you reboot, it may force a disk check, which can take 30+ minutes, and it’ll be offline the entire time. You can reboot and skip the check with shutdown -fr now or force a check with shutdown -Fr now. (via go2linux.org)

Natural Sorting for MySQL

MySQL doesn’t provide a way to perform natural sorting on a string, so if you have numbers in your data you may get results like this

Product 110
Product 120
Product 13
Product 140

There are a lot of hacks available, but all of the ones I’ve seen only work in specific circumstances. The only comprehensive solution I found to do the sorting in MySQL is Drupal’s natsort module. You don’t need to be running Drupal to use it, just issue the queries that create the function and it’s dependencies, and you can then call it in your regular queries. But, it requires MySQL 5, so if you’re working on an older server and your data doesn’t work with one of the hacks, then you’ll probably just have to do the natural sorting in your scripting language, using something like PHP’s natsort().

URL Parameters for Google Maps

Mapki has a detailed list of URL parameters for Google Maps. Setting daddr is useful when you want to create a link for a user to get directions. You can also control the zoom level, type of map (normal, satellite, terrain, etc), overlay information and lots of other things.

CMSMS Skeleton Module

Skeleton is a CMS Made Simple module you can use as the base for writing a new module. It has all the basic code in place already.

Convert Filenames to Lowercase on Linux

If you transfer files from a Windows server to a Linux one, you may get some broken links because Linux is case-sensative while Windows isn’t. You can rename all the files on the Linux server to their lowercase equivalents with this shell script from Linux Journal.


#!/bin/sh
# lowerit
# convert all file names in the current directory to lower case
# only operates on plain files--does not change the name of directories
# will ask for verification before overwriting an existing file
for x in `ls`
do
if [ ! -f $x ]; then
continue
fi
lc=`echo $x  | tr '[A-Z]' '[a-z]'`
if [ $lc != $x ]; then
mv -i $x $lc
fi
done

Blogging as Narcissism

Wordpress’s creator, Matt Mullenweg, expresses my sentiments on blogging exactly:

“I used to think constantly about building an audience for my blog but now my attitude is that if I’m not blogging for myself it’s not worth it. I don’t force myself to post once a day, I just do it when it feels natural. Sometimes people complain — ‘Write more about WordPress; we don’t want to see photos of kids in Vietnam’ — but I don’t really care.”

Tracking Project Hours/Deadlines

Lately I’ve been trying to work out a good process for quoting projects and tracking the billable hours and deadlines. I’ve had a couple large projects go over budget/deadline, and I think two of the main reasons are that I wasn’t realistic enough in the quote, and that I just wasn’t being intentional about monitoring the progress. My natural tendency is is to leave all the “business” stuff to my boss and just focus on doing my core job right, but I need to take those things into account because how I do my job has a direct impact on whether or not the ultimate project goals are met. With my anal-retentiveness I can easily spend 3 hours on something that could be done the “wrong” way in 30 minutes.

The client’s not gonna care if I take the time to properly slice up visual elements from the mockup and put them together in a flexible and semantically correct way — dealing with cross-browser positioning and PNG transparency issues — rather than just creating large chunks the way a WYSIWYG tool would. It’ll make me cringe, but It looks the same to them, and we’re just going to end up eating the cost if it goes over budget.

Of course, there are some things where taking shortcuts will cost you in the long-term, and there are some things that should always be done the right way, so you have to find a balance, taking all the factors into consideration on a case-by-case basis.

So, to try and fix this in the future I’ve made a couple changes. When quoting things, I’m trying to think in more detail about what will be involved in each line-item, and giving them a little more padding on top of that because of my tendency to under-estimate. I also think it’s important to have a line item for miscellaneous and unforeseeable things, equal to about 20% of the original estimation, and then make it clear to the client that additional requests during development that weren’t in the original quote will be billed on top of the spec’d work.

To track deadlines, I’ve just put reminders on my calendar for the major milestones, and set them to remind me a few weeks ahead of time so I see how close I am and make adjustments if needed.

To track hours, I’ve started adding more details in my task manager, ToDoList. I used to just add an entry for each item that needed to be done, but now I’m categorizing them into a folder for spec’d tasks that were in the quote and then another for additional requests. I’ve started listing the category on my timesheet, in addition to the project, so at the end of the week I can add those hours to a running tab in ToDoList and see how they compare to the quote. This also lets me know exactly how many hours were spent on additional requests, so we can properly bill for them.

Lightbox Clones

The Lightbox Clones Matrix is a list of scripts that do inline popups, ala Lightbox. You can filter by JavaScript frameworks and features.