Shinji Kuwayama

Archive for the ‘Rails’ Category

10 Mar, 2010

Perl one-liner to extract email addresses from a text file

Posted by: Shinji Kuwayama In: Rails| Tech Tips

I occasionally have to search log files for email addresses. Here’s the command I use to extract them all out quickly into another file.
perl -wne’while(/[\w\.\-]+@[\w\.\-]+\w+/g){print “$&\n”}’ original.txt | sort -u > extracted_emails.txt
There’s probably room for improvement here—any ideas, please comment!

06 Nov, 2009

New Relic: “Mongrel count” vs “Instance count”

Posted by: Shinji Kuwayama In: Rails| Tech Tips

New Relic is the best way to track a Rails app’s performance, no question, but it still confounds me at times. Here’s something I learned today.

New Relic reports the number of instances per host; until today, I was reading this as the size of our mongrel pool.

It’s not, actually—it’s more like the ideal size of [...]


About

View Shinji Kuwayama's profile on LinkedIn Shinji Kuwayama is a Rails developer in Chicago, Illinois.

Twitter

Posting tweet...