Missing Person: Leo Lipp-Neighbours

February 6th, 2010

Leo Lipp-Neighbours

An old school friend of mine, Leo Lipp-Neighbours has been missing since 4am Sunday 24th January.

He was last seen on Watson Street, Washington Valley, Nelson City; wearing Blue Jeans, a Yellow T-shirt with white printed writing and dark brown leather shoes.
He was driving an Orange 1987 Toyota Corolla Station Wagon, registration NQ7258. We are extremely concerned about his safety.

If you have seen anything you might think will assist us in finding him please call the Nelson Police on (03) 546 3840.

Please share the link to the website http://leolippneighbours.co.nz/ on your blogs etc to help get the word out.

Geminids Success!

December 14th, 2009

I’m really supremely pleased that I have so many friends (such as Jasón James Auger, Storm Geldenhuis, André Geldenhuis, Cass Jones, Frank Ansell, Erin Morgan, Mathew Falloon, Acacia Voorkamp, Giles Reid, Daniel Neville, Roisin Ward, Hamish Winn, Vincent E. Konrad, Nicholas Lloyd, Raphael Nolden, Phil Anderson, Hannah and others!) willing to drive to the wops on a Sunday night just to watch sand ablate in the atmosphere. You guys rock so hard it’s not funny.

Thanks mostly to Jasón for getting the ball rolling. Hope to see some or all of you again at future amateur astronomy occasions (which we may just have to hold.)

Handy Linux Tip #4: Resolving Iceweasel / Firefox Flash Player plugin crashes in Debian Lenny on x86_64

November 11th, 2009

Recently Adobe released a long-anticipated x86_64 build of their ubiquitous Flash Player. After several months many distro-makers began to bundle this as standard, including, Debian in the Lenny release.

Unfortunately for some this plugin makes use of the “LAHF” instruction, an instruction that is not always present on otherwise capable x86_64 CPUs. What this means is that on these CPUs (including early AMD64s, Pentium 4s and others) the Flash Player plugin will cause Firefox or Iceweasel to exit suddenly with an “Illegal instruction” message (or no message at all, depending on how it was launched).

If you are the owner of one of the affected CPUs though, all is not lost. This issue was raised on the Gentoo bug tracker and a clever solution was developed by Maks Verver. The solution comes in the form of a wrapper plugin. This wrapper is compiled from a short section of C code which intercepts the SIGILL signal and emulates the behaviour of the missing LAHF instruction.

Here is the code in its entirety:

/* Simple work-around for running the 64-bit Adobe Flash plug-in version 10
on Athlon64 processors without support for the lahf instruction.


Compile with:
cc -fPIC -shared -nostdlib -lc -oflashplugin-lahf-fix.so flashplugin-lahf-fix.c
Then place the .so file in the plug-in directory (e.g. $HOME/.mozilla/plugins)
or use LD_PRELOAD to force Firefox to load the library.

- Maks Verver <maksverver@geocities.com> July 2009 */

#define _GNU_SOURCE
#include <stdlib.h>
#include <signal.h>
#include <ucontext.h>

static void sig_handler(int signal, siginfo_t *info, void *context) {
if (signal != SIGILL) return;
if (*(char*)info->si_addr != (char)0x9f) abort();
greg_t *regs = ((ucontext_t*)context)->uc_mcontext.gregs;
((char*)&regs[REG_RAX])[1] = ((char*)&regs[REG_EFL])[0];
regs[REG_RIP]++;
}

static struct sigaction old_sa, new_sa = {
.sa_flags = SA_SIGINFO,
.sa_sigaction = &sig_handler };

int _init() { sigaction(SIGILL, &new_sa, &old_sa); return 0; }
int _fini() { sigaction(SIGILL, &old_sa, &new_sa); return 0; }

In order to make use of this on Debian Lenny, copy and paste the code to a text file called flashplugin-lahf-fix.c and compile from the same directory like so:


cc -fPIC -shared -nostdlib -lc -oflashplugin-lahf-fix.so flashplugin-lahf-fix.c

If you find this doesn’t work, first install the package build-essential with aptitude. See the Debian documentation for more on how to do this.

Once the wrapper has been built you can either copy it to the system-wide plugins directory by executing this command as root:


cp flashplugin-lahf-fix.so /usr/lib/mozilla/plugins/

Or drop the file in to ~/.mozilla/plugins (creating the directory as necessary). Then restart Firefox / Iceweasel and ensure that Flash is running by visiting a site like YouTube and playing a video.

24 Hour Movie Marathon

November 2nd, 2009

Incredibly Strange
Alright, so this weekend I attended the 10th annual Incredibly Strange Vendetta Films 24 Hour Movie Marathon at the gritty Hollywood Cinema in Avondale. To give you perhaps some brief understanding of how it all went down, here is a chronlogical list of all the films that played, linked to the relevant IMDB page:

  1. The Secret Four
  2. Zombieland
  3. Road House
  4. Forbidden World
  5. Vice Squad
  6. Paranormal Activity
  7. Maidens of Fetish Street
  8. Mill of the Stone Women
  9. Night Train to Terror
  10. The Visitor
  11. The Informant
  12. Creature From Black Lake
  13. Howling II
  14. Commando

I’ll be writing a bit more about how awesome this was later.

Handy Linux Tip #3: Summing a column of numbers with awk

September 24th, 2009

Supposing we look at the output of ls -l:

michael@armstrong ~ $ ls -l
total 861648
-rw-r–r– 1 michael michael 145605 2008-10-15 23:14 1224064858283.gif
-rw-r–r– 1 michael michael 104323 2008-12-15 20:36 1229312381830.png

This is a synthetic example, supposing we now want to know the sum of the filesizes in the output of ls -l? You might think that bc is a good fit here, but I found it to be needlessly verbose for the purpose (needs a longish script to sum a column of numbers on stdin).

So? awk to the rescue! And it’s a recipe that you can probably remember despite not needing it too often:

michael@armstrong ~ $ ls -l | awk ‘{ sum+= $5 } END { print sum }’
881289090

Easy as that, substituting $5 to select which space-separated field to sum.

Handy Linux Tip #2: Xnest

September 3rd, 2009

Xnest is a handy X server with a slightly unusual design characteristic: It draws its output in to the window of an existing X server.

The practical upshot of this is that you can launch a new X session inside a window of your existing one. This is useful for, among other things:

  • Testing applications on different display resolutions
  • Running X applications as a different user
  • Testing new desktop environments, window managers, etc

For those of you running Debian, you may have spotted the “Applications -> System Tools -> New Login in a Window” menu option. It would appear that while this is intended to launch a new Xnest instance with GDM, Xnest isn’t actually included in the GNOME desktop task installed by tasksel.

On a stock Debian install selecting this option is more likely to display the following amusing error:
lol

The solution to this is pretty simple though, aptitude install xnest and you should be up and running. Here’s a screenshot of running Xnest on my machine, running a GNOME session for root (note that you probably shouldn’t do this):
GNOME screenshot

Handy Linux Tip #1: Calling ioctl to reload the partition table

August 11th, 2009

If you do low-level manipulation of a block device with a partition table such that the partition table should be reloaded by the kernel (for instance, dd’ing an image file to a USB mass storage device) you need to make a call to ioctl to tell the kernel to reload the partition table from the device (and re-populate /proc/partitions, etc).

Various partition tools do this for you when you manipulate the table (e.g, fdisk from util-linux-ng) but sometimes you just want to hex edit / dd / cat changes to your partition table.

In this instance, I discovered a handy bit of code that just makes the ioctl call. It’s called “partprobe” and it’s included in the GNU parted package for Debian.

aptitude install parted or check out the package http://packages.debian.org/lenny/parted.

If anyone knows a smaller package with the same functionality, drop me a line.

Update: jbg has correctly pointed out that the util-linux package (that you almost certainly already have) contains a tool to do this as well:

blockdev –rereadpt /dev/foo

Easy as that :)

Pioneer Anomaly

July 28th, 2009

Here’s a thing I just read about. It’s cool because it combines several fields of interest to me (Pioneer space probes, unexplained phenomena).

Internet Filtering in Australia

July 27th, 2009

Prime Minister Kevin Rudd has announced that the Australian government will build a new $43 billion national broadband network, connecting 90% of homes to 100-megabit fibre internet. “We believe that fast broadband is absolutely essential for our nation’s future,” he said.

“Telstra has raised issues with the amount of bandwidth usage this will produce, given we’re still hooked to America by tin cans and string, but our Great Firewall of Australia [today.com] Internet filtering project should keep usage down to reasonable levels at near-dialup speeds. We promise you won’t go over your download cap.”

The Great Firewall will reliably block all illegal material, child pornography, terrorism and unAustralian thoughts.

“Not only are the contents of the list illegal,” said Senator Stephen Conroy, “but revealing the list is also illegal, and so is linking to someone linking to someone claiming to reveal the list. So we’re blocking Google Search. Having to use Anzwers should keep usage right down.”

Calling it the “single largest infrastructure decision in Australia’s history,” Mr Rudd said the project would employ up to 37,000 people a year monitoring citizens’ net access, reading their email and correcting spelling errors in their football forum posts.

A consultative process will determine the regulatory framework for the network. “We’re considering getting Senator Fielding to do it personally,” said Senator Conroy, “since he’s the dickhead who demanded the censorship in return for his votes. Hopefully it’ll melt his brain. Bloody balance of power. At least Xenophon’s bloody sane.”

via David Gerard.

Things in the Sky

July 26th, 2009

At Nancy’s excellent suggestion I took my little laptop down to Middleton Park and played with Stellarium.

Here are the things I think I could identify (in no particular order):

  • Scorpius (constellation)
  • Vega (barely, trees in the way)
  • Jupiter (I think the brightest thing I could see aside from the Moon)
  • Formalhaut
  • Grus (constellation)
  • Gamma Capricorni and Beta Capricorni

Highly recommended way to spend an evening.