A piggy bank of commands, fixes, succinct reviews, some mini articles and technical opinions from a (mostly) Perl developer.

Jump to

Quick reference

Comparison of private image hosting

  • Facebook - Private albums, but I never quite trust them with my privacy. Interface is tedious and buggy to use. Not geared towards organising lots of images. Upload limit not advertised.
  • Photobucket - Private or password protected albums. Interface is not great as it squashes your thumbnails, has adverts and only shows a few images each page (mobile). 10Gb free, $30/year for 20Gb, more storage available.
  • Flickr - 1Tb free. Pictures can be private, or shared with family. For pictures, this is very good. Uploaded video quality can be poor. Interface is great for uploading and organising many thousands of photos and video.
  • SmugMug - $40/year for unlimited uploads. Advanced privacy/sharing system. They've put a lot of effort into it.
I recommend Flickr.

Fix home and end keys in remote shell

$ od -c

<home key pressed>   ^[[7~
<end key pressed>    ^[[8~

Then put in /etc/inputrc or ~/.inputrc:

"\e[7~": beginning-of-line
"\e[8~": end-of-line

An actual example:

"\e[1~": beginning-of-line
"\e[4~": end-of-line
"\e[3~": delete-char

(source)

Android: Don't refresh page when no signal

chrome://flags/#enable-offline-mode

and

chrome://flags/#enable-offline-load-stale-cache

Unfortunately this doesn't work anymore - those flags were experimental.
In fact I've switched to Firefox (which is also much faster on Android) because Chrome tabs kept annoyingly reloading when the phone had no signal.

Perl: Disable control-C and control-Z

$SIG{'INT'} = 'IGNORE'; # Ctrl-C
$SIG{'TSTP'} = 'IGNORE'; # Ctrl-Z

Bash script must run as root

# This script must be run as root

if [ "$(id -u)" != "0" ]; then
    echo "This script must be run as root" 1>&2
    exit 1
fi