Wget with Firefox Cookies

I recently found myself needing to scrape information from a website that uses login credentials. The authentication and session information was available in several cookies, which Wget could use, if the cookies were stored in a plain text file. I used Firefox to login and set the cookies, but Firefox saves it’s cookies in an sqlite data file, which must be exported before Wget can use it. A quick Google search turned up a few possible methods using sqlite3, which I’ve adapted here to use with Wget.


Beautify Query Strings with Rewrites

I wanted to change the WordPress search query from /?s=value to /s/value, just to make the URL look a little prettier. There are two parts to this problem; The first, executing a search query from an /s/value URL, is easily addressed by a rewrite and proxy command. The second problem — how to rewrite a regular search query, but not a proxied search query — is a little tricker.


Update a Dynamic DNS IP with BIND

I wrote the following nsupdate-ddns.sh script to update the dynamic DNS entry for my laptop when switching network locations. There are several ways to execute a script like this automatically (cronjob, startup script, launcher, etc.) — I chose to use Sidekick for Mac OS X, which allows me to execute it when switching locations (either network or physical). This script can also generate the private authentication key needed by the DDNS server, and will display some sample configuration values. If you’re setting up a new DDNS server, you can use the examples to configure your dynamic zone file.


Date-Based Rewrites for Static CDN

Content Delivery Networks (CDN) have become very popular in the past several years. They offer an easy way to save bandwidth, and bring content physically closer to end-users. CDNs offer a variety of services, though pricing and features are usually tailored to larger content providers. As a smaller provider myself, using an ADSL line to host my websites — and as a SysAdmin who prefers to host his own content — I decided to mirror my static content, and redirect traffic as I needed. The following describes a solution to keeping all of content local, yet mirroring static content for faster delivery.