vimgrep alias
I’ve been using Solaris recently… since yesterday. First reactions: How can anyone use their command line tools!? Fortunately the system I was on had zsh and vim. Here is a macro I use to avoid Solaris grep: function vimgrep () { tmp="$@" ; vim -c "vimgrep $tmp | copen" ; } (I could not figure out a way to do it w/o the tmp variable) Now you can do things like:
mouse-free
First there was a Navigator, then there was an Explorer. Later it was time for a Konqueror. Now it’s time for an Imperator, the VIMperator :) VIMperator is a mozilla/firefox plugin from Martin Stubenschrott. It completely redefines the firefox interface to mimic the beloved VIM editor. If you love vim, you are likely to love VIMperator. If not… well, your loss.
ATA messages via SCSI layer
I’ve been working on a contract for Symbio Technologies for the last month. They are makers of a few thin client terminals. My work for Symbio involves talking to a SATA hard disk using ATA command set. What makes this a bit more interesting is that /dev/hda is the way of the past. New devices are covered by libata drives which fit into the SCSI subsystem. So, the challenge for me was how to send raw ATA messages using the SCSI layer to the SATA drive. Besides the fact that the interface is sparsely documented, it was pretty easy.
GITDiff vim plugin
Taking a TODO item off my list, I am adding a plugin to vim that splits the current window and presents a diff between the current file and any revision of that file in the current git repository.
git presentation for OCLUG
I am giving a intro to git tutorial for oclug tomorrow. Here are the slides in PDF format. If you are one of the lucky ones and magic point works for you, you can also grab the source tarball.
fixing vim's [[ and ]] for bad code
I just added something to my .vim/c.vim to make [[ and ]] work even if the code does not have { on new lines. function! FindFunctionDefinition(dir) let l:lastpattern = @/ if a:dir==-1 ?^\(\a.*(\_[^\)]*) *\)\{,1\}{ elseif a:dir==1 /^\(\a.*(\_[^\)]*) *\)\{,1\}{ endif let @/ = l:lastpattern endfunction nmap [[ :call FindFunctionDefinition(-1)<CR> nmap ]] :call FindFunctionDefinition(1)<CR> This will make [[ and ]] find the next and previous function even if the first { is not in the first column.
pxeboot and nfsroot with debian
I have two boxes (i386 and amd64) in the lab that I use for testing of drivers I work on. Recently another Maxtor hard disk died on me, and I decided to get network booting working. I already have a file server from which I host my $HOME directories and do all backups from. It sounded like a win. I’ve never done this before, so it took me a few hours to get the first host going, the second took 10 minutes plus the amount of time to build the kernel for it. Below, I describe steps I took to get pxe-enabled hardware to boot a debian image, from a debian DHCP, TFTP and NFS servers.
etc snapshots with git
I got this idea from a blog posting a few months back. I think the guy was using darcs. Unfortunately, I was unable to find the reference to link to him. Anyway, here is how you can track your /etc directory with git, and have apt update it automatically each time a package is installed.
remote power switch
I just got a Web Power Switch, and hooked it up to the lab machines in the basement. I can now reset them with a web page… which is going to get scripted really soon.
klips-less openswan git tree
Recently Martin merged openswan/pfkeyv2.h with linux/pfkeyv2.h. Sparks flew. Michael Richardson and I have tried this before and decided to postpone it. I merged it into my tree, so it seems that we have to do the hard thing and divorce klips from openswan.git. This basically requires that we create an openswan tree that builds against pfkey definitions in another tree. Michael suggested that Martin and I start with the #unstable branch of openswan.git. What I see happening eventually is this include/linux/pfkeyv2.h defining all the pfkey RFC bits, and include/klips/pfkeyv2.h including that and adding it’s extensions. For now we will be happy if we can get pluto talking to the new franken-klips.