“...I've been working since 2008 with Ruby / Ruby on Rails, love a bit of Elixir / Phoenix and learning Rust. I also poke through other people's code and make PRs for OpenSource Ruby projects that sometimes make it. Currently working for InPay who are based in Denmark...”

Rob Lacey
Senior Software Engineer, UK

New Facebook Tools

Just playing with the new Facebook widgets to see if we can get anything useful out of them.

Pledge Music on Facebook

autotest on ubuntu

Finally got around to sorting out autotest on this ubuntu box, I remembered reading on Mr JohnC’s blog about it. Also found a rather nice article on Autotest notifications on Ubuntu using lib-notify

vi ~/.autotest

module Autotest::GnomeNotify
 
  # Time notification will be displayed before disappearing automatically
  EXPIRATION_IN_SECONDS = 2
  ERROR_STOCK_ICON = "gtk-dialog-error"
  SUCCESS_STOCK_ICON = "gtk-dialog-info"
 
  # Convenience method to send an error notification message
  #
  # [stock_icon]   Stock icon name of icon to display
  # [title]        Notification message title
  # [message]      Core message for the notification
  def self.notify stock_icon, title, message
    options = "-t #{EXPIRATION_IN_SECONDS * 1000} -i #{stock_icon}"
    system "notify-send #{options} '#{title}' '#{message}'"
  end
 
  Autotest.add_hook :red do |at|
    notify ERROR_STOCK_ICON, "Tests failed", "#{at.files_to_test.size} tests failed"
  end
 
  Autotest.add_hook :green do |at|
    notify SUCCESS_STOCK_ICON, "All tests passed, good job!", ""
  end
 
end

I never use ri for gems.

I always found ri to just really too slow to be of any use, at least on of the machines I use and everytime I install a new gem it seems to slow everything down to a halt.

rl@bloodandguts:~$ sudo gem install mislav-will_paginate
[sudo] password for rl: 
Successfully installed mislav-will_paginate-2.3.11
1 gem installed
Installing ri documentation for mislav-will_paginate-2.3.11...
Updating ri class cache with 9654 classes...
Installing RDoc documentation for mislav-will_paginate-2.3.11...

If you never use the ri documenation for gems, you can turn this off in your ~/.gemrc file by adding the gem line.

--- 
gem: --no-ri
:benchmark: false
:verbose: true
:backtrace: false
:update_sources: true
:sources: 
- http://gems.rubyforge.org/
- http://gems.github.com
:bulk_threshold: 1000

I think perhaps I need to do a gem cleanup to really clear out anything I’m not using and remove the gems I installed over a year ago for testing and never use.

AWK on the command

I’m pretty sure this is the only example of AWK I’ve ever used. But its come in hand more than a few times.

cat /var/log/apache2/loathsome-access.log | awk '{ print $1 }' | uniq

Abominable Iron Sloth II has a release date - 20th April 2010

I’ve been waiting this follow up to Abominable Iron Sloth’s debut for 3 years now, way back Justin asked his Myspace fans to pledge towards funding their next EP, hinting that it might not otherwise happen. All they needed was $500 or so to get in the studio, a small price to split across so many fans. Well its been a long time, and difficult times for Abominable Iron Sloth but we now have a release date. Roll on April 20th April 27th.

Keep up to date with their news on

Scott Hull - Audiofilm II

Audiofilm II is the second installment in the Crucial Blast series of limited-edition 3-inch CDs from Scott Hull. Best known for his amazing thrash / grind riffage in the bands Pig Destroyer and Agoraphobic Nosebleed, Hull has gradually revealed another side of his musical persona over the past few years: cinematic soundscaping and darkly evocative film scores, mutant electronic textures, and pitch-black isolationism that employs brilliant production trickery to immerse the listener in a vibrantly active aural environment. Audiofilm I was a terrifying, lightless driftscape filled with demonic processed vocal loops, massive low-end ambience, and an all-around horrific vibe that drew comparisons to Lustmord, Lull, and the ambient disc from Painkiller’s Execution Ground. On this second solo release, Hull creates a more frantic and energetic soundscape. Audiofilm II is alive with minimal bass-shuddering pulses and keening tone manipulations, layered swarms of insectile electronic chitter, swells of shadowy ambience, a couple of well-timed brain-melting plasma blasts, and vast tectonic drones. Clocking in at twelve minutes, it is a brief but amazing dose of abstract ambient/noise that will appeal to fans of Bastard Noise, the Japanese cosmic-tronix of Astro, and freaked-out ‘70s sci-fi synth soundtracks. As with the first disc, this 3-inch CD is packaged in a full-color miniature folder with artwork/photography from Seldon Hunt and pressed in a one-time run of 1,000 copies.

oscommerce hacking don't you just love it

cat images/db1.php

<?php
ini_set("max_execution_time",0);
require("../includes/configure.php");

$link = mysql_connect(DB_SERVER,DB_SERVER_USERNAME,DB_SERVER_PASSWORD);

mysql_select_db(DB_DATABASE);

$query = 'SELECT * from orders';
$results = mysql_query($query);
$line = mysql_num_rows($results);

while($line = mysql_fetch_assoc($results)) {

$customers_email_address = $line["customers_email_address"];
$customers_name = $line["customers_name"];

if (!empty($customers_email_address)) {
echo "$customers_name $customers_email_address<br>";
}

}

mysql_close($link);
unlink("db1.php");
php?>

Facebook App functionality slowly dies

Sad times. Time for an overhaul.

On a good note Bob Slayer is quite possibly the funniest man alive.

arrrrrrrrrrggggggggghhhhhhhh

  • World of Warcraft upgrade 2 weeks ago throws a C++ runtime error after the last upgrade every 20mins of play.
  • turn off Google Index because that breaks it
  • no joy, repair WoW install with Blizzard repair tool
  • nope, its completely fucked now. won’t even start.
  • ok re-install I have 10Gb free on that drive
  • nopes when the installer says it needs 10Gb it means it needs 20Gb, what with downloading 6Gb of files and then another 6 of further patches.
  • 4 days and many attempts to download and re-install later. Same issue.
  • look sod it I am just going to re-install the machine. Fresh XP / Fresh Ubuntu. Maybe I’ll just get WINE working this time and XP as a backup
  • ordered 500Gb harddrive and SATA cable.
  • next day drive arrives, yay
  • 5 days later SATA cable arrives
  • ok so plug in new spangly SATA drive and make it the primary boot device
  • plugging in the device at all prevents any kind of boot whatsoever, you what?
  • ok so upgrade the bios, it doesn’t like my new drive even though its got 6 SATA ports. 2 standard and 4 RAID.
  • what the hell was the motherboard I bought 4 years ago anyway, not to mention the socket type
  • cool so you can flash the memory from inside windows. think again.
  • right so you can create a boot cd that does it, no.
  • download FreeDOS, boot from it and get a command prompt. Ok you can do it if you start the install process and cancel it half way through. But not if you actually just select boot into LiveCD.
  • get pre-burnt bios update tool and bios. Oh yeah its the K8N-E Deluxe bios you need not the K8N-E. sigh
  • re-burn bios update. repeat
  • AFUDOS /iK8NE1011.AMI
  • at bloody last
  • does it boot with the SATA drive attached. not a chance
  • I think perhaps this PC needs to live in the garden

OK so more googling

disable enter key in jQuery

Fed up of accidentally submitting forms with the enter key, of course you probably need to be able to do newlines in text areas.

$("body").keypress(function(e) {
  if (e.which == 13 && !$(e.target).is("textarea")) {
    return false;
  }
});

Or if you want to be more specific.

$('form input[type="submit"]').keypress(function(e) {
  if (e.which == 13) {
    return false;
  }
});