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.
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:
- If you install more than one package with the same dependency, that dependency will be installed more than once. This will cause problems with stow. Hopefully common dependencies are already installed on your system.
- It only installs one level of dependencies, so the dependencies might be missing dependencies, causing things not to work.
- There is probably some terrible bug I don't know about. Let me know if you find one!
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.
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}
04 January 2009
Volsched Release
A few people have expressed their interest in the VolSched source, so here it is! I haven't actually tried deploying it from this tarball, so let me know if it doesn't work. Hopefully I've remembered to include everything I need to include.
This is released under the MIT License, a copy of which is included in the tarball. This basically means, use it as you will.
RSS Feed