selberg.org Home Home

Archive for January 27th, 2007
1/27/07
7:51 pm
Upgraded to WordPress 2.1

I upgraded to WordPress 2.1. While not a terribly exciting ordeal for most, I want to comment on what I see is the inherent brokenness of the WordPress Upgrade Process.

Here’s the non-detailed fast version, in five easy steps:

  1. Backup files and database. What, you mean you don’t have some script running that automatically backs up everything nightly?
  2. Deactivate all plugins. Gah. If this is a standard thing, how about a Deactivate All switch somewhere, eh Matt?
  3. Overwrite Files. And since this is a 2.0.x -> 2.1 upgrade, delete magic old files. You know which ones, right?
  4. Run the upgrade script
  5. Reactivate plugins one by one. Again, gah.

OK… the sucky part is really Steps 2, 3, and 5, especially 3 — overwrite and delete files. This is lame. Here’s what I did to make it less lame:

  1. Move all the version-specific files into a version directory, e.g. wordpress2.0.3/ or wordpress2.1.
  2. Create a special symlink called wordpress_version that links to the appropriate directory
  3. Create symlinks in the top-level dir to the appropriate file in wordpress_version
  4. Create symlinks in the version directories back up to wp-config.php.

For example, here’s a brief excerpt of my directory structure for this blog:


selberg.org/
		wp.config.php
		index.php@ -> wordpress_version/index.php
		wordpress_version@ -> wordpress2.1
		wordpress2.0.3/
			index.php
			wp-config.php@ -> ../wp-config.php
		wordpress2.1/
			index.php
			wp-config.php@ -> ../wp-config.php 

As far as when WordPress introduces files, you have to create new links. When you need to delete files, they appear easily via ls as a broken link. And even if I forget to delete a link, the file is effectively gone. We’ll see how this works. And maybe I’ll get inspired to try and fix how plugins work in the next upgrade.

Hat tip to Raging Liberal for the scoop on fixing Postie, the plugin I use to post mail to the blog. Turns out e-mail really is the best way to write a blog entry IMHO.

Update: Forgot to link to wp-cron.php, which appears to have caused WordPress to launch a DOS against itself… oops.

1/27/07
7:26 pm
Cracking Masterlocks…

Remember those 2-4 Masterlock combination locks you have in your tool chest / junk drawer that have been there since high school? Well, I needed to get a lock in order to secure a locker in our new building at work. Of course, the paper that had the combinations is long gone. Luckily, those Masterlocks provide all the security you’d expect for the $20 or so they run for. Yup, easily cracked with plenty of references online to do it — for example, the Masterlock Crack page hosted on Angelfire. Gotta love it.

1/27/07
3:50 am
Induction - necessary for diet success?

The 20/20 Lifestyles Program puts people on a diet (and by this I do mean a temporary change in eating) for a couple reasons to help them lose weight. This is also similar to the Atkins / South Beach Diet’s induction period.

The diet, roughly, is the following:

  1. 5 meal-replacement shakes, 12oz cooked lean meat. Shake & slab!
  2. Add Veggies
  3. Add Milk & Yogurt
  4. Add Cheese
  5. Add Fruit
  6. Add Beans
  7. Add (whole wheat) bread
  8. Add high-glycemic fruits (such as bananas)

Note that after adding something, the meal replacement shakes and some of the meat goes away, so calories are kept the same. The meal replacement shakes are supposed to be some specially formulated shake designed for the 20/20 program. They’re effectively just protein shakes as near as I can see.

The idea behind the diet is that there may be certain foods, or certain types of foods, that cause a given person to feel hungry or gain weight. By trimming down the diet to these shakes and bits of meat and then slowly adding food back in, the idea is to isolate and identify those foods to determine where they fit into normal eating. Personally, I suspect it has a number of other effects:

  • By removing all normal meals, it forces the person on the program to recreate the types of meals they eat — ideally in a healthier fashion.
  • By creating a radically different diet, the person on it is much more likely to keep to it versus eating normally.
  • By radically changing the diet, you don’t give the body a chance to adjust to simply eating less of the same stuff.

The third point is probably the most unsubstantiated, but I think the most important, at least for me. Weight loss is a radical change for the body… and thus lots of eating plus lots of dietary change is necessary for the body to change, versus simply adapt.

Unlike Atkins, the 20/20 diet isn’t zero or low carbs. Veggies are highly encouraged — and it turns out it’s hard to eat that many veggies and gain a lot of weight (although adding fatty salad dressings can add up those calories in a hurry!).

OK, there’s the diet. Next up: water!