software category

I primarily run Mac OS X and RHEL-based Linux distributions. I also have experience with the BSDs, and think if a problem can’t be solved with Perl then it’s insurmountable.


Keeping downloaded Xcode components

Perhaps its a remnant of my dial-up days, but I'm one of those old fashioned people that keeps local copies of all the stuff I download. Saves me having to download them again if I need to reinstall.

In the case of Xcode 4.x, components are downloaded and installed from the Preferences screen, but you can still keep the downloaded disk images by navigating to:

~/Library/Caches/com.apple.dt.Xcode/Downloads/

Ironically enough, I only remembered this again when I was going through my home folder backups, and realised my Caches folder was way larger than it should be.


Using TextExpander with Perl? Hell yes!

After hearing about it on my beloved 5by5 Back to Work, I finally started using TextExpander. Today, I realised it can be used with my lifehacking language of choice.

Way of the future

TextExpander lets you assign blocks of text (or even images) to a shortcut you assign. For example, when I type ;nc it expands out to all my ncurses boilerplate. ;sig expands to my name, address, email, EARLs and phone numbers. You could leave it at that, and be crazy productive.

But you don't have to stop there. If you create a new shortcut and choose choose "Context: Shell Script" from the top of the editing box, you can write shell scripts to process stuff. I ignored it initially, largely for the same reason I eschew (gesundheit) most Western fast food. I can eat it, but I prefer other things.

Earning some Siracusa cred

On a hunch this morning, I decided to test the limits of this "Context: Shell Script" box and enter some Perl (which of course I inserted with its own TextExpander shortcut!):

#!/usr/local/bin/perl [...]
print("Hello, world");

When I typed my ;test shortcut, Hello was inserted in it's place.

Oh. My. SCIENCE.

That's right, TextExpander took the output from this Perl script, and used it in the substitution. Think of the possibilities. No, seriously, think of them.

I've used Perl scripts, a Dock shortcut and the Mac pasteboard to automate and send results to where I want since 2004. Now I'm going to go through them all and see how I can make TextExpander shortcuts for all of them.


RVM: It's the little things

The Ruby Programming Language

If you make a habit of deploying Ruby code (^_^), I've found the RVM to be the easiest way to install the specific versions of Ruby and rubygems you need.

A lot of this is technical, but also because of this after installing. It's the little things.

Ruben Schade,

Thank you for using RVM!

I sincerely hope that RVM helps to make your life easier and more enjoyable!!!

~Wayne


Non-destructive Perl regex substitutions

I've been a Perl Monk in training for years, but I only just realised this.

Say you want to print an original string, and a modified version with a case-insensitive substitution. This below will output "shimapan shima-melonpan", just because I can.

my $first = "shimapan"
my $second = $first;
$second =~ s/pan/-melonpan/i;
print("$first $second\n");

You can use "r" instead to non-destructively substitute, with the same result.

my $first = "shimapan"
my $second = $first =~ s/pan/melonpan/ir;
print("$first $second\n");

I generally avoid Perl Golf-isms for the same reasosn Dagolden does, but in this case I find it does remove a little redundancy, and is just as readable.

Thanks to @damncabbage for getting me to finally post this!


Use FTP to download Firefox betas

Firefox-tan

So I wanted to to download the Firefox beta. I tried half a dozen times, and was either given a "connection reset by peer" error, or a stub file that's clearly too small to be a web browser. Well, links aside.

Fortunately, the public Mozilla FTP server works just fine, and seemed faster anyway.

For what it's worth, the Mozilla FTP server is fun just to browse in. There's a treasure trove of classic software there, including the original Phoenix browser us early adopters eagerly downloaded back in the day :).

Update: Typos pointed out by Clara.


CentOS onigiri, by @hanezawakirika

And now for something, completely different.


kernel_thread_helper+0x7/0x10

If you're seeing the above error, chances are you haven't got enough memory!

While attempting to install from CentOS-6.3-i386-minimal.iso, both VirtualBox and Parallels Desktop independently produced this error, regardless of the type of installation chosen. I suspect given this mailing list thread, this is due to a bug in the Anaconda installer not being able to use swap space.

Increasing the allocated virtual memory from 128MiB (which I'd chosen to match a VPS) to 192MiB replaced the above errors with an insufficient RAM error message, which was far more useful.

512MiB solved the problem. Boom!


Happy 25th birthday, Perl!

I use half a dozen languages for work and fun, but when I need to quickly get stuff done, Perl still does the job. I couldn't imagine my life without it.

#!/usr/bin/env perl -w
use strict;

&birthday("25th");

sub birthday {
    print("Happy $_[0] birthday!\n");
}

A huge thank you to Peter Whiting who showed me Perl when I was 19, and to Larry Wall, Tom Christiansen and Jon Orwant for the language and the Camel Book :).


NoScript Christmas hat!

Via NoScript.net. I am in approvance! Is that a word?


FreeBSD pkg bootstrap is being restored

Icon from the Crystal Clear Project

Good news, we have news from the pkgbeta.FreeBSD.org server:

pkg bootstrap is being restored. Stay tuned.
Updated: 2012-11-28 10:20 UTC.

The site went down shortly after I wrote my pkgng FreeBSD Handbook post, ironically enough. I was going to post in the newsgroups asking what was up, but now we have news.

UPDATE: We now have a new message.

Currently this site only contains pkg bootstrap files!
Updated: 2012-11-28 11:30 UTC.