Author Archives: Nick Hoffman
MongoDB version number in the Mongo console
To print MongoDB’s version number when in the Mongo console, just run For slightly more information, run This is pretty obvious, but for some reason, I seem to forget this all the time.
Rails 3 console and “no such file to load”
If you happen to load gems in your ~/.irbrc , make sure to add a gem dependency on them in your Rails apps’ Gemfile. For example, I just started using Awesome Print in IRB. However, when I ran rails console … Continue reading
PostgreSQL grants on all tables
As much as I love PostgreSQL, its system of managing user privileges is a pain in the ass. PostgreSQL has no equivalent to MySQL’s method of granting a privilege on all of the tables in a database, including tables that … Continue reading
Deploy a specific revision with Capistrano
Just about every website that I release, be it at work or at home, is stored in a Git repository, and deployed using Capistrano. I’ve been debugging this PHP application at work that was written by a 3rd-party. After cleaning … Continue reading
Answers are for losers
What do you want: questions, or answers? Most people want answers. There’s a problem you need to solve, and the answer’ll let you continue working. That’s fine. That’s valid. But is it interesting? I was talking with @ghuber about a … Continue reading
If Plasma dies, here’s what to do
Every now and then, the Plasma desktop in KDE 4 crashes on me. Usually, it restarts itself. Sometimes, it doesn’t. If you’re cursed with the latter scenario, there’s an easy solution. Note: As avocadohead kindly mentioned in the comments, KDE … Continue reading
Matching Printable Characters
Who doesn’t love regular expressions? They’re fucking awesome. I use’em at least 10 times per day. Sometimes, there’re restrictions on what patterns you can use. I wanted to change a regex for validating passwords. Originally, it allowed letters, numbers, and … Continue reading
Displaying Your ViM Colour Scheme
I posted this mostly because I’m always forgetting it, and also because it’s a pain in the ass to search for on Google. I usually try “:echo g:colorscheme”, which fails miserably. If you’re playing around with colour schemes in ViM … Continue reading
When Gnome and Firefox Are Dead Slow
I’ve had Ubuntu Karmic Koala installed on my MacBook Pro Core2Duo for 2-3 weeks now. Almost everything’s been working perfectly. However, whenever I’d start a second Gnome session and run Firefox, the machine would slow to a crawl, and X’s … Continue reading
Copying Between GNU Screen buffers
GNU Screen is one of those tools that makes you think “How the %&@# did I live without this for so long?!” If you work on command lines regularly, GNU Screen is a must. In my desktop environment, I run … Continue reading