db46 Checksum Error During MacPorts Upgrade

Problem

When upgrading my MacPorts installation, using sudo port upgrade outdated, I ran into the following error:

--->  Verifying checksum(s) for db46
Error: Checksum (md5) mismatch for patch.4.6.21.1
Error: Checksum (md5) mismatch for patch.4.6.21.2
Error: Checksum (md5) mismatch for patch.4.6.21.3
Error: Checksum (md5) mismatch for patch.4.6.21.4
***
The non-matching file appears to be HTML. See this page for possible reasons
for the checksum mismatch:

***
Error: Target org.macports.checksum returned: Unable to verify file checksums
Log for db46 is at: /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_ports_databases_db46/main.log
Error: Problem while installing db46

Solution

sudo port clean --all db46

Subsequently, running sudo port upgrade outdated worked as expected.

Posted in OS X, Technology | 1 Comment

Mounting a TrueCrypt Partition on Mac OS

When an entire volume has been encrypted by TrueCrypt, it looks like an uninitialized drive to Mac OS. A dialog box will pop up, asking if you want to initialize (format) the drive. Click ignore.

Next, run TrueCrypt. If TrueCrypt is already running, open its main window. Click ‘select device’.

TrueCrypt will prompt you for your administrator password. This is your regular login password. Note that if you don’t have administrative rights, you can’t mount an encrypted volume.

Next, select the encrypted disk from the list of drives. In this example, it’s a 60 gigabyte external harddrive, so I select the drive reported as 55.9 GB.

You are now returned to TrueCrypt’s main window. Click ‘Mount’ in the bottom, left corner.

TrueCrypt will now prompt for the volume password. This is the password used to encrypt the disk.

The volume is now mounted. You may close the TrueCrypt main window and continue to access the encrypted disk.

Posted in Cryptography, OS X, Security, Technology | 1 Comment

Better GMail Causes 100% CPU Usage in Firefox

For the last several weeks, I’ve noticed excessive CPU usage whenever GMail (GAYD-hosted email, specifically) is open in Firefox. By turning off add-ons one at a time, I found that this is caused solely by Better GMail 2.

Firebug, FireGPG, Greasemonkey (on which Better GMail relies), and AdBlock Plus all had no effect on CPU usage.

Posted in OS X, Technology | Leave a comment

Making OS X Command Line Behave More Like Linux (GNU)

The command-line oddities of Mac OS X’s BSD heritage drive me insane. I much prefer the behavior of the GNU toolchain, as provided by Ubuntu Linux.

To begin, first install MacPorts.

MacPorts Installation Variant +with_default_names

With several MacPorts packages, the +with_default_names variant may be specified. This causes package contents to be installed without the default “g” prefix. For example, without +with_default_names, find would be installed as gfind.

Autocompletion

1) Use MacPorts to install the bash-completion package:

sudo /opt/local/bin/port install bash-completion

2) Edit ~/.bash_profile to load the correct autocompletion script:

if [ -f /opt/local/etc/bash_completion ]; then
   /opt/local/etc/bash_completion
fi

Open a new terminal window, and commands should auto-complete according to the GNU specification.

Find

The GNU version of find helpfully assumes that, if no arguments were given, you wish to search the current directory. The OS X (BSD) version has no idea what to do without a directory specification.

sudo /opt/local/bin/port install findutils +with_default_names

This package includes find, gfind, glocate, goldfind, gupdatedb, gxargs, locate, oldfind, updatedb, and xargs.

Core Utilities

This vaguely-named package provides a large number of standard GNU tools.

sudo /opt/local/bin/port install coreutils +with_default_names

Update Path

In order to call the MacPorts-installed tools by default, your path will have to be updated to include /opt/local/libexec/gnubin/. I added the following to ~/.bash_profile:

export PATH="/opt/local/libexec/gnubin/:$PATH"
Posted in OS X, Technology | Tagged , , , , , | Leave a comment