Email Etiquette

Tuesday, 05/10/2010 ≅17:19 ©brainycat

My first email address had a a '!' instead of '@' in it. Back in the days of 300 baud uplinks and disks that cost tens of dollars per megabyte, people understood the value of brevity. In today's networks, where bandwidth flows like manna and storage space is as ubiquitous as dirt, people seem to think that every single communication they send needs to include a whole trove of wholly useless and irrelevant information.

This is my biggest email pet peeve ever:
bad signature

This, and other crucial lessons in email etiquette, are available at theoatmeal.com.



WordPress 2.8.4 update: 3 Files changed

Saturday, 15/08/2009 ≅13:42 ©brainycat

I updated wordpress for the (latest) critical security update. I can't find anywhere at wordpress.org to download a patch. So, I downloaded the whole 2MB tarball so I could update... three files, only one of which has new code. Here's what svn shows after merging 2.8.4 into 2.8.3:

U    wp-login.php
U    wp-includes/version.php
U    readme.html



WordPress 2.8.3 Upgrade: Success!

Monday, 10/08/2009 ≅07:56 ©brainycat

I fixed the bugs I flushed out. What happened is that my hack to get quarterly archives did in fact rely on $wpdb and the old taxonomy structure, so those calls were returning NULL results. I fixed it by doing away with the quarterly archives and deploying a dropdown with javascript.

My other bug was the pagination through archives. Sometime along the line, posts_nav_link() was deprecated in favor of next_posts_link() and previous_posts_link(). I swapped out those functions and voila, pagination happiness ensued.

In other news, I really do plan on updating this blog more regularly. I am TOTALLY sucked into twitter, though like any other interpersonal communication medium, it's important to limit how much space it gets in your life. I've been really good about staying away from it during the weekends. What I need to do is commit myself to a schedule of updating my blog at regular intervals. I have a pile of ideas I want to write about, but coding a new website, twitter, and life in general just keep getting in the way.



Blog Upgrade: WordPress 2.8.3 FAIL

Sunday, 09/08/2009 ≅13:03 ©brainycat

The wordpress team finally got the bugs worked out of the new release. So began the process of upgrading. I run all my sites off of svn, which makes life easier in several ways: I have backups, I can rollback changes, and I can hack at the software and keep my changes even as the vendors release new updates.

Of course, keeping my own changes means merging. I learned a lot about how svn works when I was trying to merge 2.8.3 into 2.7.1. First of all, when the docs indicate you should keep a /current directory with the vendor changes, they aren't kidding! I tried to skip /current, and just merge the 2.8.3 tarball into /trunk (where the live site lives). No dice. Svn indicated that nearly every file changed, some files got dropped, some files didn't get updated, and all manner of wonkeyness ensued.

Here's how I (recall I) got it to work:

  1. Backup your repo:
    svnadmin hotcopy /path/to/repo /path/to/backup
  2. /branches/wordpress/VERSION

    is the original tarball. Import the whole tarball, then delete the themes and commit again.

  3. /branches/wordpress/current

    is where svn "holds" or "tracks" the diffs between the versions. You will need to know the last REV you committed in VERSION-OLD (VOREV) and VERSION-NEW (VNREV), as well as the REV of your last commit in /trunk (TREV). After you've got two tarballs checked in, issue:

    $ svn merge /branches/wordpress/VERSION-OLD@(VOREV) \
    /branches/wordpress/VERSION-NEW@(VNREV) \
    /branches/wordpress/current
  4. Resolve conflicts.
  5. $ cd /branches/wordpress/current
    $ for x in $(svn status | grep \? | cut -c 8-); do svn add $x; done
    $ svn commit

    You will need to remember this revision number, we'll call it DIFFREV

  6. $ cd /trunk
    $ svn merge /branches/wordpress/current@DIFFREV ./@TREV
  7. Resolve conflicts.
  8. $ for x in $(svn status | grep \? | cut -c 8-); do svn add $x; done
    $ svn commit 

In the course of discovering this procedure, I blew my repo to pieces. Fortunately, I had made a copy. I logged into my server, cd /svn/REPONAME; rm -rf ./* and cp -r /path/to/backup/* . Unfortunately, my shell user doesn't have the same permissions as the svn user. I got all kinds of "unable to write journal" errors when I tried to commit from my working copy. I filed a ticket with my host, and they rectified the permissions in a few minutes.

<Unsolicited gushing about my hosting provider>
As an aside, I looked around at svn specific hosting, looking for a host that provided lots of space, not a lot of users, and had an environment where I wouldn't have to file a ticket everytime I restored a backup. I found that Dreamhost is clearly the most cost effective svn host. I couldn't find another hosting service that provides unlimited access to hooks. Most of the hosts are charging exorbitant amounts of money for more than 100MB of space, and at that level you're limited to one repo. By the time I could get into unlimited repos and at least a GB of disk space, I'd be spending nearly as much as I'm paying for my complete hosting package with two virtual private servers and unlimited disk and bandwidth.
</Unsolicited gushing about my hosting provider>

I also upgraded my plugins, but as I'm not hacking on any of those on this site, it was a simple matter of copying the tarball into /plugins/PLUGINNAME, adding new files with for x in $(svn status | grep \? | cut -c 8-); do svn add $x; done and then committing the changes.

All in all, I don't really notice a lot of difference with 2.8.3. I notice the updates to the plugins more, namely Twitter-Tools and All In One SEO pack. I still LOATHE the administrative interface; all that AJAX is glacially slow on Firefox in Linux. But, as I'm sure it's zippy in Safari, we can't expect it to change anytime soon. In a perfect world, you could build your admin interface with admin-template tags just like you do the front side. I was worried about the changes to the database, but since I use get_*() to call the DB, the changes are transparent to me. I am excited about learning more about page classes; if they do what I think they do, I can put them to good use shortly.

But then 14 hours later, when I was checking my site from my wife's pc, I noticed there are some bugs that popped up. My hack to list my archives quarterly doesn't work - something, somewhere appears to be returning NULL results. Also, the pagination is wonkeyed. Fortunately, rolling back to 2.7.1 is as easy as redefining DOCROOT and hotrestarting the server. Total rollback time: 45 seconds. Closer examination reveals my quarterly archives are still wonkeyed, probably due to the database updates. This is what I get for failing to test my development environment thoroughly.

At least I know enough never to trust a .0 release and never rely on automated installs. I feel sorry for the poor schleps who are using wordpress but don't have the background in development or system administration, and rely on the pretty buttons to run their site. From what I've seen on the net, a way to large number of those sites got hosed.



Why I haven’t blogged in 6 weeks

Tuesday, 14/07/2009 ≅22:54 ©brainycat

I got hooked on Twitter. I resisted for a long time, but once I found UberTwitter it was all over for me. I'm a slave to the timeline. I've also met some really great tweeps, some likeminded tweeps and a few braindead morons. Twitter reminds me of IRC back before other IM came around, when it was used as a generic stream of information and ideas that you could dip in and sample whenever you had a spare moment.

A few rules I've found handy:

  • I only follow payforpix ladies who send me a pic with "Owned by BrainyCat" written across their tits
  • I only follow tweeps who actually contribute content, instead of RT'ing everyone else
  • If they're so good at online marketing, why are they following me on twitter?
  • Brevity is the mother of eloquence. If you can't say it one tweet, don't say it.

I used the twitter-tools plugin, with a few minor modifications. I looked around, and while it's not a perfect solution, it does everything I need it to do: automagically post blogs to twitter, and shows my latest tweet. I may get around to improving it, but that's not too high on the list right now.

My greatest tweets so far:
#badtime4wood
Illiterate goatherders
Silverback

Anyways, I have a whole list of topics to write up. I may even be able to carve out time for them. But I expect I shall be blogging much more regularly now that I've glued my two sources of internet fame together.



New features at BrainyCat World Domination HQ

Sunday, 12/04/2009 ≅20:50 ©brainycat

First, I'm proud to announce the new gallery.brainycat.com site! It features several hundred images I've collected from the internet, mostly desktop wallpapers. Oddly, I don't change my own desktop wallpaper very often, but I collect them. Also, I've rendered them into the 15 most common mobile device screensizes, there's sure to be an image to spruce up your PDA or phone. You can email the image directly to your device or copy it to your pc then download it to your phone. I found the list of common device sizes at sender11, and I still need to go back and do some SEO optimization; gluing the device models to each picture size.

I've also included a gratuitious random image in the sidebar. A perfect example of a great use for regexps would be a way to tell gallery "if the album name contains *[N,n][S,s][F,f][W,w]*, exclude from random image pool". All in all though, it's a fantastic piece of software and I'm looking forward to helping the 3.x effort.

I've run across some limitations in gallery2. Gallery2 is fantastic if you have a series of albums of widely unique content with different thumbnail and display needs. Unfortunately, if you have a variety of nearly identical albums, it is quite a chore to configure each album one by one. I wish there was a way to use regexps to apply configurations to a set of nearly identical albums. I looked at the database, thinking I could cheat a little like I did with WordPress, but there's 63 tables in that database! Forgive me for a moment of laziness, and deciding to just get the site up the one sure way rather than spend a week trying to make sense of all the JOINS ON. I didn't want to crush my laptop by duplicating the 83MB database locally; there's a few hundred megs of images to track and it would take me as long to do it by hand than duplicate it locally to look for a programmatic solution.

I also provided links to the slackware packages I've built at /linux/slackware-packages. These are all original builds for software I couldn't find at slackbuilds.org or alien. Included are all the multimedia libraries I could find, rebuilds of k3b, k9copy and kaffeine to take advantage of the new libs, gimp2.6, a build of elvis that doesn't include X but allows syntax highlighting, and some other goodies. Unfortunately, my notes don't explain what depends on what very well. I know the media players will all want the media libraries and dvd libraries, and gimp wants the gcraw and the FFT libraries, but other than that I'm not really sure. I should probable elucidate the dependencies more clearly.

They are all built with the 686 processor optimizations, and I definitely notice a difference in the media playback and mp3 encoding with the optmizations.



Add Bookmarks to WordPress via the Database

Wednesday, 08/04/2009 ≅17:59 ©brainycat

I want to add links to the slackpackages I've built. The first step to doing properly is to get the links into the WordPress database. Given WP's fantastically crappy admin UI, this would take at least two hours if I did them by hand, and I would undoubtedly introduce numerous errors. I decided to write a script that would create SQL that I could import via phpmyadmin.
Piqued? Read on...



Another rev for brainycat.com

Wednesday, 25/02/2009 ≅21:13 ©brainycat

I just updated to version-1.5. This update includes numerous UI tweaks, expanded results per page with excerpts, links to tags, and a new structure for the pages.

This is the first update that really digs into the database. As well as the template updates, there is much work to be done massaging the database into shape. But it will be nice to take a break from php for a while and do some pointy-clicky.

And have some time to write more posts and SURF MORE! I am SOOO behind reading up my RSS and blogs and news. F1 season is right around the corner and I haven't even read any racing news in a week.



WordPress Upgrade to 2.7.1

Monday, 23/02/2009 ≅11:35 ©brainycat

As you may have noticed, I've made some changes to the site recently. I've gone to one post per page and fixed nearly 40 UI bugs in the last few days. Behind the scenes, I've also upgraded to WordPress 2.7.1 from 2.6.2. I never upgrade to x.0 releases. I'll let everyone else find the bugs and get the release that works properly out of the box.

So far I don't see what the big deal about 2.7.1 is. Aside from breaking some plugins (or obfuscating them so well I can't figure out where the new UI for them is), and having a glacially slow admin interface (yes, I installed gears) I really don't see any difference. Performance on the blog side seems about the same.

I would rather the admin side be a set of APIs, to which developers can create their own look/feel. I don't want whiz bang AJAX menus. I want quick and easy, and save my CPU cycles for other stuff.

Upgrading was seemless. I upgraded on my local development server, and found no problems. I updated all my plugins, still no issues. I pushed the updates (pulled from SVN?) to my development environment on my hosted server, still no difference. Updating the site was painless. I really wish the developers would tell me exactly what SQL queries are entailed during the "Updating your database..." phase. Additionally, the "automatic upgrade" option in the Tools menu scares me. I have my entire site (sans database, which gets backed up regularly elsewhere) in version control, so I download tarballs and integrate them into my trunk. I can forsee users who aren't using source control and are lazy with their backups going into hysterics when the update blows up their site. Hehehehe.

Here's my procedure for updating my site:

  1. tag a release in SVN
  2. backkup my database via phpMyAdmin and keep the file locally
  3. login to the shell on my hosted server (it's a shared box, but my server process is all mine)
  4. cd ~/DOCUMENTROOT
  5. svn checkout http://SVNURL/path/to/tag
  6. cp ./OLDVERSION/.htaccess ./NEWVERSION/
  7. cp ./OLDVERSION/wp-config ./NEWVERSION/
  8. ln -s ../media ./NEWVERSION/media
  9. login into my hosting provider's admin UI and change the SERVERROOT to ~/DOCROOT/NEWVERSION
  10. wait a few minutes while the records update and the processes respawn
  11. verify new installation

The whole process takes about 10 minutes, and it has a builtin backout plan: change SERVERROOT back to the last version, and reload the database if that blew up as well.



Unable to compile libphp5.so with 12.2 php.Slackbuild (trying to add mycrypt)

Wednesday, 18/02/2009 ≅08:45 ©brainycat

I originally posted this at LinuxQuestions.org. Funnily enough, it was a perfect example of what a coworker and I were talking about the other day. He's getting a technical degree in systems administration, and this quarter he has a unit on Linux. He's completely lost. He doesn't get it. He struggles with the GUI, and he's completely hopeless in the CLI. He was telling me how frustrated he is because he goes to the help forums (he doesn't know how to use IRC) and tries to ask questions, but he doesn't know the right questions to ask so he gets flamed. I told him I have exactly the opposite problem, in that by the time I'm reaching out for help most other users won't have a clue what's going on. It's not their fault, it's just a matter of experience.

Anyways, the thread is here. In a nutshell, I was trying to rebuild php5 with the mcrypt libraries included, and my system didn't want to build the dependencies (c-client from UW's imapd project) nor did it want to build libphp5.so. The build seemed to show that libtool may be misconfigured.

I've found a great deal on a new harddrive, so I won't be debugging this issue too much farther. I'm just looking at this install as a test run, taking lots of notes, so when I reinstall on the new drive it'll be speedy and simple. And with enough room to install some new OSs in VMWare.