Updating a ThinkPad z60t

I recently refurbished an old IBM ThinkPad z60t to make it usable and suitable for donation. This involved two areas of work:

  • Installing Linux
  • Upgrading the firmware

Upgrading the firmware

The ThinkPad has two different firmware upgrades:

  • BIOS
  • Embedded Controller

ThinkWiki’s list is pretty comprehensive, and pointed me to BIOS 1.24 and EC 1.18.

Because this machine is so old, it does not offer .iso files (to put on CD or USB drive) or Linux-compatible firmware. There are diskette versions (for putting on floppy disks) and non-diskette versions (run running manually).

The non-diskette .exe file cannot be extracted using The Unarchiver, unzip, or innoextract. It won’t run on Windows 10, and won’t run under DOS mode. (I tried installing FreeDOS on to a USB stick, too.)

Using Virtualbox and a Windows 10 VM, I installed AOMEI Partition Assistant and tried to create a Windows 7 to Go installation on a USB thumb drive. That got all the way to the end before erroring out.

At this point, I decided to pull the hard drive, install Windows on a new drive, and use Windows to update the firmware.

The BIOS updater runs on Windows 7 (despite not listing that as a compatible option), but the EC updater does not, and gives this error:

DeviceIoControl() returns 24 Please restart your operating system and execute the BIOS or Embedded Controller update utility again.

At this point, I had to find a sketchy Windows XP ISO, burn it to CD and install Windows again.

Once I had XP installed, the EC updater ran as expected and the update completed successfully.

Readers: if you know how to install the diskette version version onto a bootable USB drive, please share how in the comments.

Installing Linux

The z60t uses a Pentium M, which is a 32-bit processor. Most current versions of Linux (such as Ubuntu 20.10) only support 64-bit hardware. I chose Linux Mint 19.3 “Tricia” with Xfce, as it was the least resource-intensive.

After using Etcher put the installer on a USB thumb drive, I was able to easily install Linux Mint on the laptop.

After installation and rebooting, most things worked — except for Wifi. I spent an hour or so googling around and reading about rfkill and trying different commands:

  • sending enable to /proc/acpi/ibm/wan and /proc/acpi/ibm/bluetooth
  • adding blacklist ideapad_laptop to /etc/modprobe.d/blacklist.conf
  • adding option thinkpad_aacpi dbg_bluetoothemul=1 bluetooth state=1 to /etc/modprobe.d/thinkpad-acpi.conf
  • Turning bluetooth/WiFi off and on in the BIOS.

In the end, the solution was much simpler. There’s a hardware slider on the front of the machine, by the headphone ports. Sliding it enables the radios.

Cosmo’s power pancakes, metric edition

I’m a huge fan of Carla Lalli’s Music’s pancakes (aka Bin It to Win It Pancakes aka Cosmo’s Power Pancakes). We make them a bunch, and have fed them to appreciative family and friends.

Carla initially shared the recipe in a Bon Appetit video from April 2017. The recipe was approcumented by a sketchy recipe blogger and a revised version was printed in Where Cooking Begins.

There’s only one problem with this recipe: it calls for 1.5 cups of buttermilk, and buttermilk comes in quarts. Rather than have the buttermilk go to waste, we, of course … make more pancakes.

Unfortunately, the combination of legacy heirloom units and odd fractions leads to some weird quantities, like ⅓ x 2 ⅔ = ⁸⁄₉ = 0.88578 cups of coconut oil.

Being both Canadian and someone who is used to weight-based baking recipes, I knew there was a better way.

With the help of the King Arthur Ingredient weight chart and my handy scale, I converted the recipe to metric and multiplied by 2.66.

I present you with an easy way to use your scale and a whole quart of buttermilk to make a lot of pancakes. (They freeze well.)

IngredientUnofficialVideoMetricMultiplied outWhere Cooking BeginsMetricMultiplied out
Coconut oil0.33 cup0.25 cup79ml210 ml2 tbsp butter28g113g
Oats0.33 cup?30g80g0.33 cup30g80g
Buttermilk1.5 cups?354 ml945 ml 1.5 cups354 ml945 ml
AP Flour1 cup1 cup120g320g0.75 cup90g240g
WW Flour0.5 cups0.5 cups57g150g0.75 cup85g225g
Baking powder1.5 tsp1.5 tsp6g16g1 tsp4g11g
Baking soda0.5 tsp0.5 tsp3g8g1 tsp6g16g
Salt0.5 tsp?1g4g0.5 tsp1g4g
Sugar1 tbspLittle bit12g33g1 tbsp12g33g
Flax0.25 cup?35g93g2 tbsp17g47g
Chia0.25 cup?61g162g0.33 cup81g216g
Eggs2?525

Directions

Tools needed

  • Medium and large bowls
  • Scale
  • Whisk, spatula, scoop
  • Skillet or griddle
  • Microwave- or oven-safe measure to melt coconut oil

Prepare

  • Measure and melt the 210ml coconut oil
  • Heat a skillet on medium heat and grease with additional coconut oil

In a medium bowl

  • Soak the oats in buttermilk

In a large bowl

  • Combine the dry ingredients: mix all-purpose flour, whole wheat flour, baking powder, baking soda, salt, sugar, flax and chia

In the medium bowl

  • Add eggs and melted coconut oil (to buttermilk and oats)
  • Whisk together

Combine everything

  • Pour the wet ingredients in to the large bowl
  • Stir with spatula to combine

Cook

  • Cooking time is approximately 90 seconds per side, depending on the size of the pancake. Adjust your cooktop temperature if they’re cooking too slow or too fast.

Notes

  • Salt is based on Diamond Crystal kosher salt. If you’re using Morton’s kosher salt, double the amount of salt provided.
  • For additional background, see Carla’s recipe notes and the buttermilk pancake recipe she used as a starting point.

HOWTO fix ActiveRecord migration NoMethodError in Rails 5.2

Ruby on Rails 5.2 changed the method signature for ActiveRecord::Migrator.migrate().

The old signature was this:

def migrate(migrations_paths, target_version = nil, &block)

The new signature is this:

def migrate(target_version = nil, &block)

Suppose you had some Rails 5.1 code like so:

ActiveRecord::Migrator.migrate(
  ActiveRecord::Tasks::DatabaseTasks.migrations_paths,
  version,
)

If you ran it in Rails 5.2, you would get this error:

NoMethodError: undefined method `migrate' for ActiveRecord::Migrator:Class

In Rails 5.2, you would write:

ActiveRecord::MigrationContext.new( ActiveRecord::Tasks::DatabaseTasks.migrations_paths ).migrate( version )

HOWTO move WordPress from MyISAM to InnoDB

When importing an old WordPress database, it may have tables in MyISAM. You can convert them to InndoDB in MySQL like so:

ALTER TABLE wp_commentmeta ENGINE=InnoDB;
ALTER TABLE wp_comments ENGINE=InnoDB;
ALTER TABLE wp_links ENGINE=InnoDB;
ALTER TABLE wp_options ENGINE=InnoDB;
ALTER TABLE wp_postmeta ENGINE=InnoDB;
ALTER TABLE wp_posts ENGINE=InnoDB;
ALTER TABLE wp_term_relationships ENGINE=InnoDB;
ALTER TABLE wp_term_taxonomy ENGINE=InnoDB;
ALTER TABLE wp_termmeta ENGINE=InnoDB;
ALTER TABLE wp_terms ENGINE=InnoDB;
ALTER TABLE wp_usermeta ENGINE=InnoDB;
ALTER TABLE wp_users ENGINE=InnoDB;

If you run into errors like this:

ERROR 1067 (42000): Invalid default value for 'user_registered'

It’s because of the SQL mode. You need to remove NO_ZERO_DATE from the mode. First, see what SQL mode you have set:

select @@sql_mode \G
*************************** 1. row ***************************
@@sql_mode: ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION

Then, set it to everything except NO_ZERO_DATE. In my case, that is:

set SQL_MODE='ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION';

This setting is temporary, and will go away as soon as you exit the MySQL client.

Now, re-run the ALTER TABLE statements above.

Journalism Resources

Education and Training

Publications

News Organizations

Professional Associations and Consortia

Press Freedom

Tools

Miscellaneous

Password rotation is dumb

Many organizations have policies requiring you to change your passwords every 90 days. These policies are dumb, and make security worse.

The following material should help you fight back against this nonsense. You don’t have to believe Paul Schreiber, but you should believe NIST, the FTC and the UK’s NSCS.

NIST

In 2016, the National Institute for Standards and Technology came out with a new set of password guidelines. The formal document is “NIST Special Publication 800-63B Digital Identity Guidelines: Authentication and Lifecycle Management.”

§ 5.1.1.2 states:

“Verifiers SHOULD NOT require memorized secrets to be changed arbitrarily (e.g., periodically).

memorized secrets is NIST-speak for passwords.

Chester Wisniewski provides an excellent plain-English summary of all of NIST’s recommendations (not just password rotation).

NCSC

The UK’s Nation Cyber Security Center writes:

CESG now recommend organisations do not force regular password expiry. We believe this reduces the vulnerabilities associated with regularly expiring passwords (described above) while doing little to increase the risk of long-term password exploitation. Attackers can often work out the new password, if they have the old one. And users, forced to change another password, will often choose a ‘weaker’ one that they won’t forget.

FTC

Lorrie Cranor, the US Federal Trade Commission’s Chief Technologist writes:

I go on to explain that there is a lot of evidence to suggest that users who are required to change their passwords frequently select weaker passwords to begin with, and then change them in predictable ways that attackers can guess easily. Unless there is reason to believe a password has been compromised or shared, requiring regular password changes may actually do more harm than good in some cases. (And even if a password has been compromised, changing the password may be ineffective, especially if other steps aren’t taken to correct security problems.)

She has a formal academic paper on the topic, “Measuring Password Guessability for an Entire University.

How to register a Kindle DX in 2018

I recently repaired a Kindle DX for a friend. As part of that, I reset it to factory defaults. When I went to register it so it would connect to his Amazon Account, I received the following error:

Your Kindle is unable to connect at this time. Please try again later. If the problem persists, please restart your Kindle from the menu in Settings and try again.

I confirmed the Kindle was running the latest software. Some chatter on the Internet suggested Amazon had disabled (re)registration for older Kindles, but that turned out to be a bug that Amazon had already fixed.

Restarting didn’t fix the problem. Turning wireless on and off didn’t fix the problem. Downloading a free book didn’t fix the problem. Wireless was definitely working — I could browse the Kindle store.

I called Amazon support. They suggested changing the password. That didn’t work. The rep tried deregistering the Kindle and then manually re-adding it to my friend’s account. That didn’t work.

He promised a callback three days later (today). The callback never came.

I called Amazon support again. I explained the situation and asked for an update. The support representatives were anti-helpful. They suggested a factory reset (that’s what got me in to this situation in the first place). I asked for a manager. Twice. Neither supervisor was helpful. One offered me 15% off a new Kindle, which I did not want. The reps would not divulge a case number or ticket number. I eventually was told by “Dorothy” that “Murray” was the person I spoke to on Sunday and he’d call me back.

During the 45-minute call, I did some additional research. It turns out that in addition to updating the Kindle to 2.5.8, you need to install the Kindle Services Update. (See Kindle DX Software Updates.) You can do so via USB from your Mac or PC. (See Transfer & Install Software Updates Manually.)

  1. Download the Kindle Services Update
  2. Copy the update-caupdate-05.bin to the root level of your Kindle
  3. Disconnect your Mac from the Kindle
  4. From Home, press the Menu button, and then select Settings.
  5. Press the Menu button, and then select Update Your Kindle.
  6. Select OK.
  7. Wait for your Kindle to update and restart.

Assuming it’s listed in your Amazon account, your Kindle will automatically reregister itself. If not, register the device manually.

So what is this additional update? A new set of security certificates.

Problems

  • The Kindle gives a generic “unable to connect” error. Nothing about the error message indicates it was problem with certificates. The corrective action it suggested (wait, restart) will fail 100% of the time.
  • Instead of releasing a 2.5.9 update, Amazon released this as a supplemental update. This makes it hard for users to know if the update is installed.
  • Amazon support staff are exceptionally poorly trained and didn’t think to check if I had installed the CA Update.