Adam Wolfe Gordon (adam.wolfegordon@gmail.com)
Design by Minimalistic Design
Powered By Loathsxome

19 July 2010

Connecting IPv6 Clients to IPv4 Services

I've been playing with IPv6 lately. My home computer, my laptop, and this server all have IPv6 addresses through Hurricane Electric's tunnelbroker.net, I've been using the IPv6 addresses for SSH, and I've made all my webpages available on IPv6 (the IPv6 version of my blog is at blog6.xvx.ca). It's fun to play with, and ultimately we'll all be using it anyway.

Some daemons, though, don't support IPv6 (yet). To remedy this, I've created 6translator, a daemon that shuffles data between IPv6 clients and IPv4 services. You can download it from here and try it out.

link -- [ipv6, software]

06 July 2010

Installing Debian Packages Locally

My department is planning to install Ubuntu on all our lab machines, and probably take away sudo access from everyone who doesn't truly need it (i.e. anyone who isn't a sysadmin). I'm looking forward to having Ubuntu, but it's less useful if I can't install the software I want with apt-get. Thus, I started wondering whether it's possible to install Debian packages in a non-standard location, without being root.

dpkg has a --root option that lets you change the installation prefix, but it still won't let you install anything without being root. apt-get will fetch packages, but, again, only as root. So I figured I'd write a script to do it all.

The script is here. It takes as arguments either the name of a package (like you'd pass to apt-get install) or the filename of a .deb, and the prefix to which you'd like to install it. It fetches dependencies (and the package itself if necessary), then unpacks the debs and installs them. I'm planning to use it in combination with stow to install packages to $HOME/.local.

Caveats:

link -- [linux, dpkg, software]

02 July 2010

New Blog Software

I used to use Blosxom for my blog. It's a nice system in that it stores your posts in text files, and displays them in multiple views automatically. No database and no PHP required.

Recently, I found Loathsxome, which is like Blosxom but with some improvements (and a better name). I'm now using it, plus git for wrangling metadata, for this blog and my new research log. I'm quite happy with this setup.

link -- [loathsxome, meta]

08 November 2009

Sending Keystrokes to Applications in Linux (Programatically)

Lately I've been using the Awesome window manager, a simple dynamic window manager based on dwm. It's great, but it seems to fight with imwheel, which I've long used to map my mouse's thumb buttons to page-up and page-down. I wondered: why is there no reasonable imwheel alternative?

I tried xrebind and xnee, but it wasn't easy to get either to do what I wanted. I realized that Awesome has a built-in mouse binding support, but doesn't have a way to send keystrokes to client applications. So, I ended up figuring out a little C program that sends a keystroke to the focused client, and telling Awesome to run the program with the appropriate argument when the mouse thumb buttons are pressed.

Read more…

link -- [linux, software]

24 September 2009

Typesetting MIPS Assembly Code in LaTeX

I'm TAing an introductory architecture course this term, and for each lab assignment I need to present some material in the lab. Since the course is taught with MIPS (using SPIM), my presentation slides sometimes need to contain MIPS assembly language. I use LaTeX and Beamer for my slides, so naturally I turned to the listings package to typeset my code.

As it turns out, though, listings doesn't include a MIPS assmebly language definition, so while it will happily typeset the code, it won't do any sort of syntax hilighting.

So, I created a language definition for MIPS. This definition treats all the directives and instructions supported by SPIM (including pseudoinstructions) as keywords, so listings will format them as such.

See the listings package documentation for how to use this style file. An example is:

\documentclass{article}

\usepackage{listings}
\usepackage{mips}

\begin{document}
\lstset{language=[mips]Assembler}
\begin{lstlisting}
	.text
main:
	# I'm going to output a string.
	li $v0, 4
	la $a0, mystr
	syscall

	# Bye!
	li $v0, 10
	syscall

	.data
mystr:
	.asciiz "This is my string. All mine!\n"
\end{lstlisting}
\end{document}
link -- [software, school]