First, for anyone out there that’s pretty quick with vi, I’d recommend you check out the vimperator extension for FF if you haven’t already. It speeds up my sessions quite a bit.
It turns out vimperator sets the browser option browser.startup.page=3 for you every time you fire up your browser. You can see this in your vimperator’s options.js:
// start with saved session
storePreference("browser.startup.page", 3);
This ain’t my cup of tea for a few reasons and I’m not nuts about vimperator overriding what I’ve set in my about:config without asking or telling me. Anyway, you can override vimperator’s override.
In your ~/.vimperatorrc:
set! browser.startup.page=1
I had to remove a few hard drives from a few laptops this morning to do some swapping. Some of them went really easy, others, not so much. For quick comparison, here’s the basic stats on the hard drive removal process for each.
Mac PowerBook G4:
- Tools: #0 & #1 Phillips, 1.5 mm Allen wrench
- Screws: 34
- Connectors: 5
- 4 Keys
- Battery, ram cover, keyboard, front cover, hard drive casing
- 90 min
- High probability of inflicting cosmetic damage to laptop
- You need a guide, and plenty of organization and patience


HP OmniBook 9000:
- #1 Phillips
- 3 Screws
- 5 minutes

IBM T61p:
- #1 Phillips
- 5 Screws
- 5 minutes

IBM wins as having the most user-friendly design, followed closely by HP. Apple… uh, yeah right.
Apple’s products tend to be very user-friendly as long as you fit nicely into one of their predefined use cases… hard drive replacement apparently isn’t one of their use cases.
I ran across a peculiarity with google mail’s spam checking today. I’m running a bay area firewood delivery site for a buddy of mine, and it has, among other awesome features, an order form containing a few ‘phone’ strings. When the order form is submitted, an email is sent out to a private email list which is ran using google site’s email app.
I made a few changes to the email script, tested them in the dev environment, pushed the changes to production, then made one final test in the production environment… and holy snikes it doesn’t work! I don’t get an email at my google email list when I submit the order form. What?? It just worked 10 seconds ago on my dev site!
- Revert the production code.
- Recreate problem in my dev environment.
- Track down source of problem.
Long story short, it turns out if I send an email to an email list handled by the google sites email app, and if it contains the string ‘555 555 5555′ then it doesn’t go through. Or at least it gets delayed by 1 hour+. I haven’t seen any of them yet.
Change that ‘555 555 5555′ ever so slightly – say to ‘555 555 5554′ and it goes through in seconds. Who would a thunk it.
I guess spam often has ‘555 555 5555′ in it? Moral of the story is a) to not get that phone number and b) don’t use common strings like that in your testing. (email@email.com?) It can introduce unexpected variables.
I’ve got to do a presentation for a class tomorrow. I’m busting out a few slides using Open Office Impress, which is working ok. It can save as PPT so hopefully nobody on the other slide of the presentation will know it was made with that icky open source stuff.
I want it to look good. So I found a good template.
I cannot for the life of me figure out how to edit the “Your Name” and “Your Title” fields of this template using Open Office. If you know how, please tell me.
But! otp is an open format! It’s just some zipped up xml. So:
wget http://technology.chtsai.org/impress/xuhai.otp
unzip -d tmp xuhai.otp
cd tmp
grep -rl 'Your Name' ./*
vi styles.xml
..... do some editing here ....
zip -rm xuhai_more_better.otp ./*
mv ./xuhai_more_better.otp ../
cd ..
rmdir tmp
gnome-open xuhai_more_better.otp
Bam. No heavy Open Office needed. Why doesn’t everybody do their power points in vi?
A while back I had a few important (to me) bugs filed with PHP that had been fixed in trunk but hadn’t yet been released in an update. I wanted to be able to predict about when PHP’s next minor version would be released – but I didn’t find that info in an easily human-digestible format out there. Soooo… this script pumps out minor version release dates in a delumpishly simple format. Yum, yum.
#!/usr/bin/php
<?php
// this script pumps out version/date from php 5 changlog
$url = 'http://us3.php.net/ChangeLog-5.php';
$regex_version = '/^\<h3\>(.*)\<\/h3\>$/';
$regex_date = '/^\<b\>(.*)\<\/b\>$/';
$lines = file($url);
while(list($k, $v) = each($lines)) {
if (preg_match($regex_version, $v, $matches)) {
$version = $matches[1];
list($k, $v) = each($lines);
preg_match($regex_date, $v, $matches);
$date = $matches[1];
echo str_pad($date, 20) . $version . "\n";
}
}
?>
As of 2009/03/10…
26-February-2009 Version 5.2.9
08-December-2008 Version 5.2.8
04-December-2008 Version 5.2.7
01-May-2008 Version 5.2.6
08-November-2007 Version 5.2.5
30-August-2007 Version 5.2.4
31-May-2007 Version 5.2.3
03-May-2007 Version 5.2.2
08-Feb-2007 Version 5.2.1
02-Nov-2006 Version 5.2.0
24-Aug-2006 Version 5.1.6
17-Aug-2006 Version 5.1.5
04-May-2006 Version 5.1.4
02-May-2006 Version 5.1.3
12-Jan-2006 Version 5.1.2
28-Nov-2005 Version 5.1.1
24-Nov-2005 Version 5.1.0
05-Sep-2005 Version 5.0.5
31-Mar-2005 Version 5.0.4
15-Dec-2004 Version 5.0.3
23-Sep-2004 Version 5.0.2
12-Aug-2004 Version 5.0.1
13-Jul-2004 Version 5.0.0
8-Jun-2004 Version 5.0.0 Release Candidate 3
25-Apr-2004 Version 5.0.0 Release Candidate 2
18-Mar-2004 Version 5.0.0 Release Candidate 1
12-Feb-2004 Version 5.0.0 Beta 4
21-Dec-2003 Version 5.0.0 Beta 3
30-Oct-2003 Version 5.0.0 Beta 2
29-Jun-2003 Version 5.0.0 Beta 1
Splashy is a linux-boot graphical boot screen thinger. It aims to make your booting process into x11 more full of rounded corners and less of 1970’s terminal text streaking by.
Want to get rid of it? Well, make sure to purge it when you remove it, or your system will fail partway through the init scripts on the next boot. You won’t have x11 or networking or dbus. You will have a screen full of errors and a login prompt. So make sure you do:
sudo apt-get --purge remove splashy
However, if you already did just a apt-get remove splashy just like you’d do for any other package, and now your system suddenly won’t boot past 1980, what should you do? Kill the offending file.
sudo rm -ffffffffffffffff /etc/lsb-base-logging.sh
And reboot. Your system should come back up with networking and all. At this point you probably want to re-install splashy then re-remove it using the –purge option to get rid of all its last traces.
This is straight off GoDaddy’s FTP user password requirements for their shared linux hosting plans:
You must create a password for your account. This means that your password:
- Must contain 7 to 14 characters.
- Must contain at least one lowercase letter.
- Must contain at least one uppercase letter.
- Must contain at least one number.
- Must begin with a letter.
- Cannot contain the user name.
- Cannot contain the following characters: question mark, space, caret, single quote, double quote, colon, backslash, dollar sign, ampersand, greater than, less than, tilde, semi-colon, or accent.
The result of these kind of password requirements is that your user has to come up with a new password, or a new variation on one of their existing passwords, just for your site. Now in the perfect world, users would have a unique password for everywhere on the internet they have a login. There are programs out there to help users do that. But guess what. People don’t use them. For some good reasons too – like now a copy of your passwords, one way or another, are being stored somewhere that isn’t your brain. Which is the whole idea – your password is something that only you can produce and you can do so anywhere anytime you need to.
So in reality, your users likely have somewhere between 10 and 100 logins across the internet. If they’re forced to try to remember a special username/password combo for your site – they won’t. They’ll write it down, and stick in their wallet. Or in the drawer next to their desk. Or in a plaintext file on their desktop. Which is about as secure as, well, putting something yummy in the snack room with a sign that says ‘yummy’.
When a hosting provider like GoDaddy does this kind of bad practice, it isn’t that big a deal. It just makes their FTP user base more likely to be compromised. Now when your bank does it (I believe all my banks do it at one level or another) it’s serious. This isn’t helping the security problem – it’s just passing the buck. Even though this makes the average user more vulnerable to attack, that’s no longer your bank’s fault. It was you who didn’t safely guard your 7 different usernames, 3 levels of passwords, and up to 5 variations on those different passwords for your various logins across the internet. That’s what I’m up to: 7, 3 and 5. Now soon to be 6.
As a user, what do you guys use to manage all your usernames/passwords? As a developer, what kind of restrictions do you apply for your users’ passwords and/or usernames? Do you know of any standard set of password restrictions, or any standard algorithm for computing what constitutes a ‘good’ or a ‘weak’ password?
I’m no Rails expert, nor a Ruby expert, and this is only my second installation of Rails in 4 years, and my first on DreamHost. So no promises. But here are the steps I went through to get Rails working on DreamHost with MySQL.
-
Set up a domain and directory. This where your Rails installation will live. DreamHost’s preferred method of running Rails is now officially with Passenger (aka mod_rails) which they have on all their Apache 2 servers. You can use the DreamHost admin panel to set this up: go Domains->Manage Domains->Add New Domain/Sub-Domain and make sure to check off on “Ruby on Rails Passenger (mod_rails)”. If you plan on making ~/path/to/rails/root your root directory for your Rails installation, then you need set the web root directory to ~/path/to/rails/root/public when you add this domain using the DreamHost admin panel.
-
Set up a database. You can do this through DreamHost’s admin panel as well. Goodies->Manage MySQL->Create a new MySQL database.
-
Set up Rails. Go to the directory you’re going to run your Rails installation out of (~/path/to/rails/root from step 1) and run:
rails . -d mysql
(Note the dot for ‘current directory’.) This will create all the Rails directory structure and default starter files.
-
Set the permissions. I’m not sure what the exact minimum possible permissions are to run Rails on DreamHost, but this created an acceptable situation for me for now: (note that I ran step 3 with a umask of 0027)
find ./ -type d -exec chmod o+x {} \;
find ./ -type f -exec chmod o+r {} \;
chmod o-r config/database.yml
You would absolutely want to lock these permissions down further if your application involved any sensitive data or services whatsoever. Leaving all your scripts world-readable allows any other DreamHost user to potentially scan your code and look for vulnerabilities.
-
Do an intermediate test. At this point you should be able to navigate to your domain and see the Rails welcome page. Note that the “About your application’s environment” link will not work in ‘production’ mode, DreamHost’s default. If things aren’t working, your friends are the logs in ~/logs/your.rails.domain.com/http and ~/path/to/rails/root/log.
-
Set up the database connection. This involves editing the file config/database.yml. DreamHost has its Virtual Hosts set up to default your Rails installation to run as ‘production’, but you can change this by setting ENV['RAILS_ENV'] in config/environment.rb. Here’s a good way to do this automagically once you have development/staging/production sites all set up. After editing any of your Rails config files, you need to do:
touch tmp/restart.txt
to make sure Apache reloads the Rails config files on the next HTTP request.
-
Test it. My test was to get the ’skeleton’ version of this project up and running by copying a few files into the Rails directory structure in the appropriate places.
Probability I find something wrong with these instructions in the next week or so? ~80%. I’ll update this post when I do.
Update:
Fyi, if you run the Webrick server in script/server, a DreamHost bot will auto email you telling you to please stop it:
From: DreamHost Policy Bot <support@dreamhost.com>
To: Michael Fogel <******@gmail.com>
Our automated system has come across the following activity under your account that is in violation of our Terms of Service.
We request that you take any necessary action to cease the activity as quickly as possible or we will be forced to take further action. If you were not aware of any such activity, please feel free to contact support and we can look into the issue further.
User **** running “ruby ./script/server”. This process is against our policies.
Please run ruby via cgi, not the built-in Webrick web server
They should add to this email a thinger about mod_rails being their preferred way to run Rails.
Update 2:
Ug, you can’t use HTTP Basic Auth with mod_rails (as of version 2.0.6). Note this is what DreamHost will set up for you if you use their web panel to set up authentication. Here’s a relatively simple if not elegant solution to the problem while we wait for mod_rails 2.1 to be released.
I got to say, the Internet, as a singular invention, just keeps climbing up that list of the ‘most important’ inventions of all time. I expect in about 15 years time it’ll pass up electricity, the internal combustion engine and the printing press to take the number one spot. Right about when some 90% of the earth’s population has high-speed wireless access (via your ‘phone’ more so than your laptop, though it’ll be a semi-hybrid of the two anyway) to the internet.
What will change when we hit that point? Well, consider that:
- The invention of writing effectively allowed humankind to ‘remember’ knowledge reliably for timescales longer than a generation. That changed a lot.
- The invention of the printing press effectively allowed groups of people to ‘discuss’ (mainly a one-to-many transmission) knowledge on the timescale of days to years, depending. That arguably changed more.
- The internet stands poised to allow 6+ billion minds to all digest and contribute to our collective body of thought – on the timescale of seconds.
Methinks that while I don’t know what change that last one will bring, I’m confident it’ll be solidly redonkulous.
This all makes a key assumption: that we’ll get to 90% global penetration of the Internet, in a form that’s still a relatively free, simple, and open communication, many-to-many style. So are we really moving that way? Well, this photo was taken last week in Siwa, an oasis some 300km out a not-entirely paved two lane dead-end road into the Egyptian Sahara desert by Libya.

It’s a little hard to see in between all the crumbling rubble – but the sign on that building in the lower left says (in arabic and english but not siwi) “Cafe” and “Net”. Yup, free wifi with your foul. We are definetely pushing those edges, we are pushing the Internet out to the edges of our civilization harder and faster than clean water or basic shelter. And while that might not make a ton of sense – it sure is damn exciting.
This last month, blog.fogel.ca turned one. Oh, how far we’ve came since we became self-aware in that basement internet cafe in La Paz, Mexico with an annoying international keyboard, a credit card, and a copy of putty. We’ve now upgraded all the way to a regular cafe up in Menlo Park, 2nd biggest train-hating community in CA. Oh boy!
So, I’d like to pay a quick salute to a year of full of travel and tech, cycling and cars, mexico and europe, rights and riots, stanford and cal, rants and rail, politics, oil, gay marriage, howto’s and whatever else was on the mind when the keyboard was dangerously near. I hope it’s been as fun reading my electronic spewage as it has been expelling it.
And for better or for worse, a good stylesheet and some solid blogging software seems to give you a little assumed legitimacy in the internets these days. blog.fogel.ca has seen approx. 30x growth over the past year. Weekday traffic these days surpasses that of the first few months. Now if we can keep those trends up for just two more years….

A few musings about the past year and blog.fogel.ca:
- Even though I don’t know jack about either, posts about cars and Mexico are the most popular.
- Way, way too much traffic comes from searches for Mexican prostitutes and party favors.
- And although it may be a big deal to me, apparently the internet just doesn’t care about the unprecedented success bike-to-work day was this year. Only one lonely reader has ever (probably mistakenly) found themselves reading about commute hour bike traffic counts at the corner of Van Ness and Market.
Happy b-day blog!