del.icio.us
Me
Archives
Meta
Tag Archives: tips
assignment alignment in vim
I’ve just been reading some articles about programming vim from Damian Conway. * Scripting the Vim editor, Part 1: Variables, values, and expressions * Scripting the Vim editor, Part 2: User-defined functions The latter has a very useful example. function … Continue reading
find(1) abuse
A colleague wanted to find all the files that end up *.disp or *.frag. Easy enough, right? In the shell you can say *.{disp,frag}. $ ls *.{disp,frag} foo.disp foo.frag Except that this doesn’t work with find: $ find . -name … Continue reading
Removing Byte Order Marks
I keep getting sent files, which are encoded in UTF-8, but include a BOM. Which is completely unnecessary. Thankfully, it’s pretty easy to remove with vim. Just load up the file and type in :set nobomb (docs for the bomb … Continue reading
vim completion
I’ve just found something rather useful in vim: :set wildmode. Normally in vim, you can use TAB to complete filenames. So you enter :e some/ve<TAB> and vim pads it out to :e some/very_long_filename.html. Lovely. But in a directory full of … Continue reading
Curl Tip
Sometimes when running curl, you need to disable the Pragma: no-cache header it sends by default. It turns out that this is quite easy to do: % curl -v -H Pragma: http://example.com/
My Sysadmin Toolbox
After seeing lots of these at Linux.com recently, I thought I’d try to come up with my own list. I used to be a sysadmin (I’m now a programmer), and I’ve long felt that you really a good set of … Continue reading
MultiTail
I used to use tail -f a lot to follow the end of a logfile, as it was written to. Nowadays I tend to use less +F instead, as it can highlight search terms for you as well. But I’ve … Continue reading
Reboots for Users
Jamis Buck has a good article on how to run TextDrive and Lighttpd together. It involves switching the Rails FastCGI processes to be managed independently from the web server. Essentially, the Rails FastCGI runners become independent daemons. But what’s really … Continue reading