Jon-Michael Deldin

BMX, bike trials, & software from the Pacific Northwest

Recent Posts

Counting the number of XML elements with REXML and XPATH

Sometimes you need a quick-and-dirty way of counting some elements, but not as dirty as calling out to shell and using grep and wc on it (e.g., grep '<resident>' my.xml | wc -l). Imagine you have the only have the Ruby standard library available and wish to count the number of <resident> elements:

Read more…

* * *

Mounting an encrypted drive in Ubuntu

My laptop recently died (System76 Galago Ultra), but thankfully, it wasn’t a drive failure. However, recovering the data proved harder than I thought due to the full-disk encryption. What follows is annotated output from my script session.

Read more…