An emacs mini-hack
There's been a whole host of changes in my life since my last blog post. I left "Ping":http://www.pingidentity.com back in August and am now working at "The Hive":http://thehive.com. My wife and I also welcomed our first child into the world a few weeks ago.
At any rate, I'm now using emacs on a regular basis for editing C/C++ code and got tired of switching buffers manually between header (.h/.hpp) and implementation (.c/.cpp) files. So I hacked a little lisp for my .emacs to make life better. Maybe someone else will find this useful too..
;; Association list of extension -> inverse extension
(setq exts '(("cpp" . ("hpp" "h"))
("hpp" . ("cpp" "c"))
("h" . ("cpp" "c"))))
;; Process the association list of extensions and find the last file
;; that exists
(defun find-other-file (fname fext)
(dolist (value (cdr (assoc fext exts)) result)
(if (file-exists-p (concat fname "." value))
(setq result (concat fname "." value)))))
;; Toggle function that uses the current buffer name to open/find the
;; other file
(defun toggle-header-buffer()
(interactive)
(let ((ext (file-name-extension buffer-file-name))
(fname (file-name-sans-extension buffer-file-name)))
(find-file (find-other-file fname ext))))
;; Bind the toggle function to a global key
(global-set-key "\M-t" 'toggle-header-buffer)
SSH Assistant for OS X
Over the past few weeks, I've been working on rewriting (for the most part) [SSH Assistant](http://sshassistant.org). The last version, 0.8.1 has a variety of issues with the installer and functionality. I really hate it when one has to run an installer with root access to install something that really doesn't _need_ root access. So, I've gone back and redesigned the app to be more amenable to a "normal" user install. I've yet to upload a build, but you can grab the source from my [personal repo](http://dizzyd.com/mercurial/sshassistant). I'm hoping to cut a 1.0.x release sometime in the next week or so.
When you build the new SSH Assistant, the output is a single pref pane bundle. Install that bundle by double-clicking on it. Then go into the pref pane and click the "enable" checkbox. You may have to logout so that it can setup your environment.plist properly, but that's the extent of the install process.
Notes on creating an OpenBSD DVD
I recently rebuilt my gateway box using [OpenBSD 4.1](http://www.openbsd.org). It's pretty easy to construct a DVD that ensures you have all the stuff you need for an install. The tricky thing is getting the DVD setup to boot. Herein are my notes so that the next time I need to do this I can remember how.
There are two tricks to get this to work. First, use the mkhybrid from [MacPorts](http://www.macports.org). Secondly, make sure that the location of the boot image is inside the hierarchy of files being burned to disk. I'm not sure why mkhybrid requires this, but it means the difference between working or not. Ultimately the command line should look something like:
> mkhybrid -joliet-long -iso-level 4 -r -b 4.1/i386/cdrom41.fs -c boot.catalog -o obsd.iso OpenBSD
School’s (almost) out!
I have hardly blogged since January — school and work has just been too much. I wrapped up one class this weekend and the remaining one is mostly done. My days have been one long series of homework assignments, or so it seems. It will take some time to acclimate back to a more sane schedule that allows me to pursue other interests.
One thing I have been doing is continuing to work on my Erlang skills. The tricks you can pull with that platform is outright amazing.