Automatic paging with ack and rak (git style)
After reading Git-Style Automatic Paging in Ruby, I wanted to try it out on my new favorite command line toy: ack.
Getting ack to work is as simple as adding the following to your ~/.ackrc.
# Always color, even if piping to a filter
--color
# Use "less -r" as my pager
--pager=LESS=FSRX less -r
rak is very similar to ack, only written in Ruby. To see some examples of using rak, check out Getting to Know a Gem: Rak.
rak doesn't support paging by default, so I'd have to do a really quick hack to get things to work. Luckily, rak is hosted on git at git://git.donttreadonme.co.uk/rak, so I forked it over at GitHub and copied the run_pager method from the cheat project.
The results can be seen over at http://github.com/PotatoSalad/rak. I wanted to try out github's new gem building feature, so I included a gemspec file in my changes. If you've got rubygems installed, just run...
gem sources -a http://gems.github.com/ (you only need to run this once)
sudo gem install PotatoSalad-rak
(see gems.github.com for more information)
Finally, if you'd like to see my changes/make your own, grab a copy of my repository with git clone git://github.com/PotatoSalad/rak.git
After I noticed the tauntingly large number of messages sitting comfortably in my Spam folder the other day, I went about the routine of performing the "Delete all spam messages now" that many Gmail users are accustomed to. I then checked my inbox to find that 26 of my 32 unread e-mails were phishing attempts. Not bad, Gmail's spam filtering system managed to keep around 98% of the Spam out of my inbox, but the 2% of messages that continue to seep through all have one thing in common: YOUR EMAIL HAS WON!!! UK LOTTERY WINNER!!!
This is a very, very quick and dirty update to allow for secondary fan control. If your laptop only has one fan, there really is no reason to upgrade.