Chillibear
A place for notes about stuff

*NIX

Ruby xml-mapping: `write’: undefined local variable or method `output’

I’ve been working with the XML-Mapping gem and had the following error when trying to generate XML: /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rexml/element.rb:685:in `write’: undefined local variable or method `output’ for <xml_node> … </>:REXML::Element (NameError) A bit of digging lead me to this bug report, which lead me to look properly at the code and sure enough correcting the code [...]

`gem_original_require’: no such file to load — xml/mapping (LoadError)

Just installed the XML-Mapping Gem (http://xml-mapping.rubyforge.org/) and kept getting a require error every time I tried to use it. /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `gem_original_require’: no such file to load — xml/mapping (LoadError) Everything seemed okay, until eventually I noticed that the Gem files themselves were rather restrictive on permissions – owner read and write only. So I had [...]

Sorting ls output by type

I was recently wondering if there was an easy way to list a directory on *NIX and have all the directories listed first together. A popular search engine to the rescue and the following site was located http://superuser.com/questions/19781/make-ls-sort-by-file-type-then-name. Now since I run the vastly wonderful FreeBSD and we errr, don’t have all those fancy Linux [...]

Extending Varnish with C code

I’ve recently been planning to move over to using Varnish (http://varnish-cache.org/) as my primary reverse proxy on a couple of servers. To that end I’ve been having a bit of a play configuring it and trying to get it to do all the quirky little bits I have the current Apache doing. One of those [...]

Git and CVS like keyword expansion idents

I was pondering putting /etc and /usr/local/etc under version control next time I build a personal server. For those deployed in real production environments we normally keep configuration files and whatnot under version control and then deploy new versions out to the servers. This time I wondered about using Git and just working locally – [...]

OSX FileMerge

Just found the FileMerge tool in with the developer tools (in /Developer/Applications/Utilties if you’ve got the Developer Tools installed – free download from Apple after you’re registered). It’s a rather nice GUI version of the diff command line tool for comparing the differences between two files, but critically it does this rather sweet line scrolling [...]

Tar cheatsheet

Since I often find myself searching for examples using tar I thought I’d compile some examples using the settings I most commonly use. Create a new archive called archive.tar from the files contained in /some/directory. tar -cvf archive.tar /some/directory Create a new archive called archive.tar from all of the ruby (.rb) files in the current [...]

Apache 403 error and .htaccess

One you might not be aware of if you don’t read your log files. If you’ve been editing a .htaccess file and you’re getting 403 Forbidden errors on the site, it’s may not be down to some obscure bit of mod_rewrite code it could just be that Apache can’t read you .htaccess file. This shows [...]

Console network bandwidth monitoring

Just found this rather nifty little network traffic monitoring tool. From the blurb… vnStat is a console-based network traffic monitor for Linux and BSD that keeps a log of network traffic for the selected interface(s). It uses the network interface statistics provided by the kernel as information source. This means that vnStat won’t actually be [...]

Splitting files

Since I was busy explaining how to do this to people at work yesterday I thought I might post it here. The problem encountered involved copying a 5GB file from a Mac to an external drive (to move it elsewhere), the drive in question was formatted with Fat32. They therefore hit the 4GB file size [...]

← Before