terminal

Quickly generate secure, random passwords (Mac)

If you use Mac OS X, add the following line to your .bash_profile:

alias passme='openssl rand 48 -base64 | pbcopy'

Whenever you need a password (like when you're registering a new account or resetting your password because yet another online service you used was hacked), just fire up the Terminal and type in passme. Then paste the password that's copied to your clipboard into the password fields, and into your password manager (I use 1Password).

This alias simply uses openssl to generate a random base64-encoded string with 48 characters (you can change that value to whatever you want). If the online service you use doesn't allow 48 characters in the password field, you should file a support request with that online service, telling them they're being silly only allowing X characters in a password.

Problems copying a huge Aperture library from one drive to another

I've often had trouble copying files with Mac OS X's Finder. From back in the Mac OS X Beta days (when it was based on NeXT's UI), hard drive to hard drive copies, network copies, and backups have often had strange quirks, and one of the strangest I've yet found happened yesterday when I tried copying a ~170GB Aperture library from one external USB drive to another.

I tried copying the library three times, and each time the copy would get to about 24GB, the hard drive (from which the library was being copied) would make a loud CLICK, and then it would unmount and remount, stopping the library file copy. This particular drive has never had troubles in the past, and the fact that it kept doing the CLICK-die thing at 24GB meant that there may have been a file problem or a Finder bug causing the problem.

I verified the drive using Disk Utility (could've gone deeper and used other utilities too), but only found one or two small errors (a file count one file off, or a few improper permissions). After repairing the disk, the drive still clicked off at 24GB.

My CVS Workflow for Updating a Theme on drupal.org

Drupal CVS <ugh> Druplicon FrownFrom time to time, I've had to update my airyblue project in CVS (Airy Blue is a light, airy, Zen subtheme listed on Drupal.org's Themes section). It's always a bother, and I always end up spending about 20 minutes figuring out how to check out the module to my local computer (I use three of them, so even if I have it set up on one, I need to get it going on another sometimes), then another 20 figuring out how to commit my changes, tag a release, etc.

So, this post might be titled "How to Maintain a Theme on Drupal.org if You're Confounded by the CVS Guide for Theme Maintainers, and you are on a computer on which you haven't checked out your module yet."

Logging in, Setting up CVSROOT

SSH in a Locked-Down Network

Recently, during one job for a client, I needed to work for a length of time in a location that had quite severe network restrictions—in addition to a proxy server, the location blocked every port besides 80, 25, 443, and 8080. In order to use secure shell (SSH) to login to my work web server, I needed to use one of those ports (I used nmap to find open ports on my end).

Luckily, I gained access to another network for a short time, and used that connection to update my work web server to allow SSH over port 8080 (in addition to the standard, port 22). I edited the /etc/ssh/sshd_config file so it reads:

Port 22
Port 8080

(the Port 22 line was commented out, originally).

Then I simply used the -p (port) directive when logging in via SSH:

$ ssh -p8080 [email protected]