Mihai Anca

RSS

Processing logs in real-time

I thought about how to process logs faster than using a cron job to poll for updates and I found mkfifo which you can use to get what’s written in real time. It makes a FIFO pipe which acts like a regular unix file except it has to be opened for reading (using fopen) before writing to it. I tested it on Snow Leopard, it is the same in linux as well.

After getting the updates in real time you can pushing them to a queue server like RabbitMQ for processing. Here’s how I done it using Ruby, Eventmachine and amqp gem:

mihai$ mkfifo log
mihai$ ruby1.9 publisher.rb log &
mihai$ echo "Test" > log

Homebrew

After a clean install of Snow Leopard I decided not to use MacPorts but to go with homebrew. Its main advantages are no duplication (macports installed its own version of ruby, python and other libs) and the path layout: packages are installed into their own prefix (eg. /usr/local/Cellar/wget) and then symlinked into the Homebrew prefix (eg. /usr/local).

And because all of the formulas are in git, to add one you just fork the project on GitHub, push your formula and make a pull request. Because of that it’s one of the most forked project on GitHub.

That’s what I did and now you can install Tokyo Cabinet and Tokyo Tyrant from my fork (I hope it will be merged into master soon) from main repo:

brew install tokyo-tyrant

(yep, no sudo needed).

Manchester

University of Manchester

It’s been one month since I arrived in Manchester and I really like it. The University is great, I only have 5 courses and 20h per week (and lunch breaks).

But the thing that I like the most in Manchester are the user groups. I’ve been to North West Ruby User Group, GeekUp and want to go at the next Manchester Free Software talk and to Python North West. I will probably talk at the next NWRUG meeting so I strongly recommend you come (and maybe make a short talk as well).

Sep 1

Since July I have joined the awesome team at uberVU. I really like challenges and their goal to track the whole social media sounded very exciting. During this time I learned a lot of new things (like Python) and discovered how to cope with the amount of new information being generated on the internet.

This video shows what we have accomplished so far.

ubervu:

It’s easy. Search for a keyword and we can tell you where are the people discussing that keyword, how many of them there are and what are the conversations you should get engaged in.

As opposed to buzz tracking technologies that track mentions of your name or brand, our service is oriented around which people are interacting with your content or content about you and whether you are engaging those people or not. This approach turns the tables on buzz tracking by focusing on measuring and growing your community - building relationships and loyalty with people - rather than maximizing mention count without regard to people or relationships.

mr. penumbra’s twenty-four-hour book store

Google Wave Hackathon at Mountain View

I wish I was at I/O to get the opportunity to play with Google Wave. I love the idea, and I think it’s limited only by what robots/gadgets makers think of doing with it.

jaggeree:

At I/O there were some really interesting Office Hours sessions where you could go and talk to the engineering teams about questions and issues. I wanted to find out a bit more about Wave and so went along to their APIs one. At the end of a really interesting chat an understandably tired Douwe gave me a mysterious looking card and invited me to come up to Mountain View the following day to hack on the Wave APIs… amazing, thank you Douwe.

I liked the ARGy nature of the mysterious tr.im URL on a card with nothing else on it, which lead you to a webpage where you could sign up.

And a set of e-mails telling you where to go and how to get into the Waves sandbox. I had a few meetings in the morning in San Francisco I couldn’t miss and was worried it was getting too late to really build stuff when I got to the Hackathon so I spent most of the journey on the Caltrain up there looking through the docs, pulling together some simple ideas I could do in the 2 hours I’d have to code and also writing some very simple guestimate code based on the docs.

The ARGy nature of the day carried on with fantastic lo-fi handwritten signs telling you where to go which I wished I’d photographed. When I got into the hacking room there were about 50 of us including the Wave team and it was a real honour and pleasure to meet Lars and many of the others who’d made this exciting new thing.

Within about an hour or so (glad I already know AppEngine, all Robots are currently implemented in AppEngine) I had the Robot responding to the text properly and then in a little while longer I had the latest 10 stories from The Guardian Content API being pushed into the right Blip within the Wave. We’ll be covering my code over on the Open Platform blog and we’ll put a screencast of it in action there and here soon. I called it Grauniady, partly because of The Guardian’s pet name in the UK of The Grauniad, partly because a naming convention seems to have come out of the Wave team of robots ending in “y” and partly because Lar’s demo of the spell checking was just so amazing, it all seemed appropriate.

It was a really amazing day, some fantastic demos from all the developers which ranged from a collaborative drum machine and a piano embedded in a Wave, to a robot from Twilio which looked for phone numbers and enabled a call between people, and recorded that call and embedded it in the wave (awesome demo). There were a couple of Robots which behaved like bots and responded to text.

Apart from the usual laptop/projector hookup mayhem Grauniady performed admirably and worked fine. Thanks to a Tory MP trying to claim for a “duck island” and Anna Pickard’s use of the word “cockweasel” in The Apprentice live blog I had some good funny examples to show (always good to hear laughter at something other than sketchy code). Obviously I was following Simon Willison’s convention of API demo’s involving animal names.

thanks to Pamela Fox for image above and for taking notes of the hacks in a wave.

Thanks to Kevin Marks for the perfectly timed lift back to Mountain View station (5 minutes later and I’d have been sitting on the platform for an hour). Love the double decker CalTrains, couldn’t stop grinning about them and the day on the way back. Totally memorable. Feel very lucky. Thank you.

Quick jump to folder

Another script I stole from evilchelu is j.sh. It enables you to quickly jump to a folder that you often access by writing a small part of its name. I use it to quickly cd to my projects or other repositories with "j <a few letters>"

To install it save it somewhere (I use a bin/ folder in my home) and add "source <path to j.sh>" to your .bashrc or .bash_profile.

I'm a ninja

As I said on twitter, I now switched to Vim (MacVim specifically). I am using evilchelu’s vimrc which has FuzzyFinder (my favourite TextMate feature). It wasn’t that hard to get productive at acceptable level.

Any tips and/or recommendation ?

Mar 8

Videos and podcasts

I wanted to share with you a list of videos and podcast that I listen to when I have some time.

About videos I posted earlier with recommended talks. Here’s some courses that I have seen (I got them from iTunes U):

I listen mostly to Ruby podcasts, to find out the latest news and opinions:

What do you subscribe to ? Have any informative video that you’d like to share ?

Acts_as_conference videos

Just saw Innovation in Rails by Gregg Pollack and Jason Seifer (RailsEnvy guys) where they talked about the new things in the past year in the Ruby and Rails world. Confreaks posted high resolution 720p videos of the conference on their site.

Gregg showed how to use a reverse proxy cache to speed up your application. You can find links about the discussed topics on the RailsEnvy blog. Earlier Gregg Pollack also released a series of screencasts about scaling Rails debunking the myth that Rails can’t scale.