Archive for the ‘Tech’ Category

Dell laptop BIOS update using FreeDOS and ISO Master

Saturday, April 17th, 2010

I recently needed to update the BIOS on a Dell Inspiron 630m laptop. The file, available from Dell support, is a DOS executable named MX51_A04.EXE.

I had two problems with this file: (1) Windows would not boot, so I couldn’t run the file using Windows. (2) The laptop had no floppy drive, so I couldn’t easily boot into DOS.

Now, one can solve this problem by booting from a FreeDOS LiveCD to run the file. But then you have to figure out how to get and run the MX51_A04.EXE file from within the FreeDOS environment. Various websites suggested methods using USB flash drives, but I couldn’t get this to work.

Instead, I was able to add the file to the LiveCD ISO image before I burnt the CD. Here’s how it worked:

  1. Download the FreeDOS LiveCD called fdfullcd.iso (153MB).
  2. Under Linux or Windows, install and run ISO Master.
  3. Load the fdfullcd.iso in ISO Master and then add the MX51_A04.EXE file to it.
  4. Save the modified ISO under a new name.
  5. Burn the modified ISO to a CD and boot from that.
  6. When you boot the laptop using this modified FreeDOS LiveCD, be sure to choose the LiveCD mode and not the install option.
  7. Once you have a DOS prompt, the command X: will switch you to the X: drive, where you’ll find the contents of the CD and the BIOS update file.
  8. Run it, cross your fingers, and reboot.

A Better Online Dictionary

Thursday, April 8th, 2010
[die.net]

I like using the online dictionary at die.net because it’s fast and clean.

It’s easy to query, also. Just append your word to the end of the URL. For example:

It describes itself as offering “free cross-referenced definitions, spelling correction, and word searches from WordNet, Webster’s, FOLDOC, and a variety of specialized sources.”

In the “spam” entry above, some of the sources include the Free On-Line Dictionary of Computing, the Virtual Entity of Relevant Acronyms, and the Jargon File.

Which editor should I learn?

Tuesday, March 23rd, 2010

On serverfault.com, Rory McCann asked, “What’s the best terminal editor to suggest to a Unix newbie? i.e. not vi or Emacs.”

This answer, which purposefully ignores the original poster’s restriction, says it best:

My take is still Emacs or vi. Even for a beginner.

Why?

Because time invested in learning an editor is productive only as long as you keep using that editor. All those less expressive options are poor choices for the long run, and will be abandoned eventually. At which point the time spent learning them is wasted, and the user still has to learn Emacs or vi.

In other words, the best (most expressive) tool for the job is one of Emacs or vi, and so you’ll eventually switch to one of them. It ultimately doesn’t matter which one you choose, but you would be smart to invest yourself into learning one of them.

For the record, I’m a vim user, and I love using it.

How to Disable Autosave in WordPress

Monday, March 30th, 2009

The autosave feature in recent versions of WordPress (versions 2.5–2.7) is actually a misfeature:

… A misfeature is not a bug. Nor is it a simple unforeseen side effect; the term implies that the feature in question was carefully planned, but its long-term consequences were not accurately or adequately predicted (which is quite different from not having thought ahead at all).

The improper functioning of the WordPress autosave has bitten me several times. It’s supposed to prevent you from losing work by periodically saving your blog edits in the background, when in fact it has caused me to lose work by its very operation.

[WordPress Logo Inverted]

Basically, the most recent edits made to a blog entry often get dropped when you go to “Preview” or “Publish” the entry. In other words, during either of these two operations, it reverts you to what it had autosaved in the past and the new edits are lost. The frustrating thing is that most users would expect the “Preview” operation if not the “Publish” operation to properly save what’s in the edit box. So often, you might end up publishing an incomplete or incorrect version of your blog entry without even knowing it.

This is madness. Let’s stop it.

Find the following four files in the wp-admin/ directory of your WordPress installation:

  1. page-new.php
  2. page.php
  3. post-new.php
  4. post.php

and comment out the following line:

wp_enqueue_script('autosave')

by changing it to:

//wp_enqueue_script('autosave')

This will disable the autosave feature in the WordPress user interface.

A secondary part of the solution, too, is to always hit “Save Draft” before hitting “Preview”. I’m not sure if this is strictly necessary, but now I’m paranoid.

Thanks to Allen Day and William Lone for showing me how to do this.

New Theme

Monday, January 19th, 2009
[Milk Carton by http://openclipart.org/media/files/jonata/3950]

In the spirit of minimalization, I’ve decided to greatly simplify the look of my blog. So I’ve adopted and slightly modified the White as Milk theme (v1.8) designed by Azeem Azeez.

Some of the modifications I made include:

  • Set page width to 95%.
  • Set posts as justified text.
  • Set the <blockquote> text colour to #777 (grey) like the original WordPress Kubrick theme.
  • Disabled the underlining of hyperlinks.

I like the cleanness of the design, and it looks good in text-based browsers (and on mobile devices). Importantly, it puts the blog’s navigational elements after the main text on each page. I’m not sure about the right-aligned sidebar on the left, though. For one thing, it doesn’t show the hierarchy of my categories at all well.

There is some colour to this theme, but only if I post some code:

/*Background Color of the page*/
    body {background-color:white;}

/*Body text color*/
    body {color:#333;}

/*Text color of the blog title in the header*/
    #header h1 a {color:#3b6ea5;}

/*Text color of the blog description in the header*/
    .description {color:#333;}

/*Links color*/
    a {color:#0066CC}

/*Links hover color*/
    a:hover {color:#333}

/*Headings color*/
    .post h2 a, #sidebar h2 {color:#333;}

/*Headings hover color*/
    .post h2 a:hover {color:#0066CC;}

/*Width of the entire page*/
    #page {width:95%;}

Also, in this same spirit, the sidebar now only shows the Search box, About text, a greatly reduced set of Pages, an Archives dropdown, Categories, and two bits of syndicated content that I produce elsewhere (the RSS feeds). The WordPress (v2.7) Widgets functionality made it super easy to set up and arrange these elements on the sidebar without requiring me to edit the sidebar.php code as in the past. It is very slick.

Dialog Box

Wednesday, December 31st, 2008

Does the following dialog box make sense to you? That is, are you able to answer the question it asks?

[Nonsensical dialog box]

Think about it for a bit, then see the comments for this post for the answer.

School

Saturday, December 27th, 2008

[xkcd's 11th Grade]

Interestingly, Python was first released when I was in Grade 11. Via xkcd.

Jason’s Alternator Story

Monday, October 8th, 2007

My friend Jason Rule was in Edmonton for the Father’s Day weekend and had a funny trip back from Edmonton to Calgary. In his own words, here is what happened.

[Alternator photo by goodharbor. Used with permission.]

While driving in Edmonton, I noticed at one point my alternator light go on… It just happened for a second and I did not really think anything of it. Later as I was leaving the city, the light was about 50% on, so basically it’s putting out some power—the exact amount the car needs. By the Edmonton International Airport, the light was on and I was running on battery power (the battery power was making the spark for the engine).

I went into conservation mode and turned off all electrical systems but the radio.

Around Red Deer, the engine started skipping a beat and the radio died. There was not enough power to spark the plugs… I pulled over (leaving the engine running) and quickly wired up my second battery to the engine by the wires I had pre-installed years before. The car’s back to life!!! I turn off the radio and keep driving.

It starts raining… I try using the windshield wipers, but there is so little power, they take about 10 seconds to cycle. So, with no fan (defog) and no wipers… I continue.

I need to stop in Didsbury where Brooke’s dad lives. I needed to pick something up and get as much power as possible. About 10 km from Didsbury, the dash fails, no speedo, nothing… About 3 km from Didsbury, the car is skipping again. I am approaching a stop sign and go to apply the brake. The power going to the brake lights makes the engine quit. As I was still travelling fast, I pop the clutch and get the engine running again. I then stop the car with engine breaking and the ebrake. I just get to the house and park in front of her dad’s truck.

Without explaining what I was doing, I start his truck and start transferring as much power as possible via booster cables into the car battery. I also start charging the second battery via a charger…. How long to wait… it’s 8 p.m. and the sun is going down. By 9:45 p.m., it will be dark and I will need headlights and I will be screwed… But, I need as much power as possible.

I pull out almost all of the circuit breakers from the fuse box. At 8:15 p.m., I start driving, extra battery not connected, car battery driving the engine. There are no electrical systems at all…

I make it to just north of Airdrie. Engine, with no warning, fails… Poor steering and brakes (that was a surprise). I pull over and remove the primary battery and install the secondary battery. I tried to start the engine, but there is not enough power to turn the starter…. I get out of the car, push it backwards, down the little hill I was on… Pop the clutch and the engine is running… I’m off.

I make it to Deerfoot and McKnight. Engine again quits… I pull over and call Brooke. The Deerfoot Trail is nuts as cars are going by at nuts speeds. She comes quickly and now it’s about 9:30 p.m. I pull the extra battery from her truck and throw it into the car. The car starts and we start driving—Brooke following me and being my lights.

About five blocks from home, car again fails… We load the gear into the truck and leave the car there for the night… We come back the next morning with a charged battery and drive home.

Two points to this story:

  1. All that crap I carry in my car sometimes comes in very handy.
  2. MacGyver himself would have been proud!

– Jason

My First Bug Report

Tuesday, May 15th, 2007

I recently submitted my first bug report to the Debian Project, regarding mod_dav and apache2. It was accepted by the maintainers of the relevant packages, and they’re taking the necessary steps to fix it.

So I’m proud of my little contribution. :) Yay for me! Yay for Debian!

An awesome blog about Python, Linux, and System Administration

Friday, March 9th, 2007

I recently discovered an awesome blog about Python, Linux, and System Administration. Chris Siebenmann is a sysadmin for the University of Toronto Unix Systems Group. I could spend hours reading his archives. Smart guy. Articles are short and informative to the max. Hope you enjoy it: