Zipped Up

I’ve been concerned about MacMegasite’s bandwidth usage, so I’ve been looking into ways to reduce it. The first thing I did was re-compress the logo as an optimized gif, which reduced it from almost 12k to 4k, after trying several settings and comparing gif & png for size and quality.

Finally, I added gzip compression, which drastically reduces the page load time, and in a few days I should be able to see how it affects the bandwidth. It was simply a matter of adding the following lines to .htaccess:

   php_flag zlib.output_compression On
   php_value zlib.output_compression_level 5

I also made this same change to all of my other domains.

I’m not in danger of exceeding my bandwidth – I have 20G/month which I can distribute however I want between all of my domains. Right now I have 10G allocated to MacMegasite with the rest distributed among my other domains, which are well within their limits. For this month, MacMegasite is already over 7G. I can always allocate more bandwidth to it if necessary

CodeWarrior to XCode

I’ve spent the last week trying to get a CodeWarrior project that uses PowerPlant converted to XCode. I finally got it working today! I used XCode’s importer, but I also had to make a few changes to the PowerPlant code as well as change some of my own headers.

Preserving links when converting from PHP-Nuke to Drupal

When I converted MacMegasite to Drupal it broke all of the old article links. It seems that a lot of people were still using old URLs, probably from pages cached at search engines. The first thing I did was redirect article links, which was easy since the story IDs remained the same. The rule I added converted a URL containing sid=nnn to a URL of the form ?q=node/view/nnn. I originally had it test specifically for name=News and the full article URL, but I found that a lot of queries broke it. I finally settled on the most liberal rule which looks for any query containing ‘&sid=’.

Checking my access logs I found that a lot of people were using direct links to reviews, downloads, or polls. Since the IDs have changed and reviews are now an article topic, I simply redirect any URL to the home page for that content type.

Here’s the final set of rules I’m using now:

  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteCond %{QUERY_STRING} ^.*&sid=([^&]+)
  RewriteRule modules.php index.php?q=node/view/%1 [L]

  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteCond %{QUERY_STRING} ^name=Forums
  RewriteRule modules.php index.php?q=forum [L]

  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteCond %{QUERY_STRING} ^name=Downloads
  RewriteRule modules.php index.php?q=filestore2 [L]

  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteCond %{QUERY_STRING} ^name=Reviews
  RewriteRule modules.php index.php?q=article/reviews [L]

  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteCond %{QUERY_STRING} ^name=Surveys
  RewriteRule modules.php index.php?q=poll [L]

Converting from PHP-Nuke to Drupal

I found that I could preserve direct article links from the old Nuke site when I converted to Drupal by adding the following rewrite rule to my .htaccess:

  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteCond %{QUERY_STRING} ^name=News&file=article&sid=([^&]+)$
  RewriteRule modules.php index.php?q=node/view/%1 [L]

Goodbye to PHP-Nuke

I’ve thought about converting MacMegasite to Drupal and I’ve been working on the theme for a while. When MacMegasite got hacked today, I decided it’s finally time to dump Nuke and make the switch. I have a test site running on my home server and I’ve converted all of the users & stories to the new site. In the next day or so I plan to go live with it.

PHP Nuke is the most poorly written pile of crap ever. It does absolutely no error checking and is less secure than Windows. I was running the patched version from NukeCops and they still managed to hack it. I did the same conversion with WorldBeatPlanet a few months ago and learned a lot from it.

TinyELF 1.0

My first computer was a COSMAC ELF. Here’s an emulator for OS X.

The ELF was based on RCA’s 1802 processor, a very simple low-power CMOS CPU. It featured 16 general purpose registers (16 bits each) and a very simple clean instruction set: the first 4 bits of each 8 bit opcode specified the operation and the last 4 bits specified the register to use, or in a few cases branch condition or other special instructions. The ELF was programmed via a hex keypad and it was fairly easy to hand-code machine language.

Movable Type RIP

With MT being commercialized and the free version crippled, I’m considering moving to something else. I started with Radio Userland and later moved to MT for a more flexible open product. Now maybe it’s time to move on again. I’m considering maybe pMachine or Drupal (which I already use for a few other sites), or just using Blogger.

More at Metafilter and Brian Burnham.