2012 is here

Tags

In 2011,

  1. Made no resolutions and achieved none – pending resolutions from 2010 are still pending!
  2. Quit one job.
  3. Loved every moment of India’s World Cup win and mourned the England tour.
  4. Became a Ruby on Rails committer. Hell yeah.
  5. Spent too much time on Hacker News, Twitter and GitHub.
  6. Wrote all of four posts to make 2011 the most dormant year for the blog. Yet, this is its most popular year. Crazy, I know.

Happy New Year everyone!

A Quarter of a Century

Tags

Another year gone, taking the count to a well rounded 25. And here’s wishing for a few more of them quarters!

GitHub Feed Filter

Tags

, , , , , , ,

There was a time when all was well with my GitHub News Feed. Then came this commit in Rails. For the next few days, the feed was absolutely useless. And it’s time to clean it up! :-)

GitHub Feed Filter, available as a Google Chrome Extension and as a Greasemonkey User Script, reads through the visible feeds in the News Feed section and lists them in the page just like Your Repos or Watched Repos. Clicking on a repository will filter out your News Feed to only include feeds from that repository. This filtering can be further extended to show only the feeds for commits, comments or issues made in that repository.

Install and have fun!

Converting DBF to CSV

Tags

, , , , ,

I was searching for a tool to convert dbf files to csv files today. This post pretty much solved the problem. However, there was a small confusion!

There is dbfdump available from the shapelib package on Ubuntu. And then there is dbf_dump which is available when you install the libdbd-xbase-perl package (Credit: A commenter on the article linked above).

The dbfdump command is pretty simple as seen from the available options and then there is no option to make csv files which makes it useless for most cases. The perl based dbf_dump though is powerful; it allows us to specify the fields that we want to dump from the dbf files, the field separator etc.

2011 is here

Tags

,

Except the last one, I could not manage to keep up with any of the resolutions in 2010. So, nothing this time around. Betting on something this year and hope to pull it off successfully. Have a Happy New Year everyone! :)

God’s 50

Tags

, ,

That’s fifty thousand words in there!

Rails 3 and Apache X-Sendfile

Tags

, , , ,

The Rails 2 way of using x_sendfile: When using send_file, pass an options hash with options[:x_sendfile] = true. This will take care of streaming the file via Apache freeing up Rails.

Changes in Rails 3:

The x_sendfile option to send_file is now deprecated.

There is a new application configuration “config.action_dispatch.x_sendfile_header” set to “X-Sendfile” defined  in config/production.rb. This means that send_file automatically gets the X-Sendfile headers in the production environment. For other environments, we need to copy this setting manually.

The main backend change done in Rails 3 for send_file is to use the Rack::Sendfile middleware. As documented in the link, a request header need to be set before starting to process the request – “RequestHeader Set X-Sendfile-Type X-Sendfile”.

The log no longer prints “Sent X-Sendfile header..” when send_file is used with X-Sendfile option like it used to be in Rails 2. The message is changed to simply log “Sent file..”.

Note: mod_xsendfile needs to be properly enabled in Apache as a prerequisite. Nginx also has its setting defined in production.rb, but this post dealt only with Apache.

Follow

Get every new post delivered to your Inbox.