Technical

DNS, Lookupd and OS X

15 November 2007

Pre-Leopard the command to force OS X to flush and reload it’s DNS cache was: sudo lookupd -flushcache In Leopard, lookupd no longer exists. Instead force a DNS cache refresh with: sudo dscacheutil -flushcache

Read the full article →

OSX Scrollbars Top and Bottom

5 November 2007

In Terminal: defaults write "Apple Global Domain" AppleScrollBarVariant DoubleBoth

Read the full article →

MailAnnounce Applescript Source

9 October 2007

I have received several requests for the source of my MailAnnounce script that is able to speak the subject of mails using Mail.app and Applescript. Source for version 1 of the script is now available.

Read the full article →

rpmdb: unable to join the environment

10 September 2007

This weekend I was contacted by a client regarding a server that had run out of room on the main hard drive. Among the things that were corrupted by the drive filling up was the RPM database. When trying to query of upgrade any package, the error message rpmdb: unable to join the environment error: [...]

Read the full article →

Quickly Copy MySQL Database to Remote Host

31 August 2007

Copy an entire database: mysqldump LOCAL_DBNAME | ssh USER@REMOTE_HOST mysql -p REMOTE_DBNAME Copy a single table: mysqldump LOCAL_DBNAME LOCAL_TABLE | ssh USER@REMOTE_HOST -p REMOTE_DBNAME REMOTE_TABLE This shortcut only works if you can access the local DB without a password. If you have to login to both local and remote MySQL servers, the MySQL password prompts [...]

Read the full article →

PHP gethostbyname() and DNS

23 August 2007

For PHP’s gethostbyname() to work properly, the server’s DNS must be properly configured with available nameservers in /etc/resolv.conf (on Linux boxes). Without a work domain name resolution kit, gethostbyname() returns the hostname supplied to the function. Make sure /etc/resolv.conf contains several nameservers to query. The format is nameserver xxx.xxx.xxx.xxx nameserver yyy.yyy.yyy.yyy Where xxx.xxx.xxx.xxx and yyy.yyy.yyy.yyy [...]

Read the full article →

SSH-Keygen For Public Key Authentication

7 August 2007

ssh-keygen -t dsa -b 1024 [root@titan .ssh]# ssh-keygen -t dsa -b 1024 Generating public/private dsa key pair. Enter file in which to save the key (/root/.ssh/id_dsa): Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in /root/.ssh/id_dsa. Your public key has been saved in /root/.ssh/id_dsa.pub. The key fingerprint is: [...]

Read the full article →

Lighttpd vs thttpd Update3

7 August 2007

I have been asked several times recently about my original comparison of Lighttpd and thttpd and subsequent benchmarks for Lighttpd vs thttpd. I do not have updated benchmarks for these two. However, Lighttpd is still under active development with the latest release Lighttpd 1.4.16 dated 7/24/07. The most recent thttpd release has a newest file [...]

Read the full article →

Easily View PHP Errors on Yahoo Business Hosting

6 August 2007

I don’t often use Yahoo Business Hosting, but every once and a while I have a client who is already hosting their sites there. With all large monolithic hosting companies there are caveats to using their systems… PHP especially. Yahoo Hosting does not support .htaccess files and does not allow display of PHP error messages [...]

Read the full article →

PHP Stopwatch Class to Time and Log Script Execution

18 July 2007

Timing code execution is an often overlooked debugging tool. On a current large project we are doing a lot of work interfacing with multiple SOAP implementations on multiple servers and through multiple vendors. When script execution slows down considerably (or stops responding altogether) we needed to know which SOAP calls were causing the slowdown. Using [...]

Read the full article →