Git commits in the blog sidebar

April 25, 2008 on 3:47 pm | von Alexander Lang | 1 Kommentar

As the careful reader might have noticed, we have added another RSS feed to the blog sidebar. Under the keiala product blog you can now see our commits to all our open source repositories on github. To make this possible I have used yahoo pipes for the first time. The pipe consumes the RSS feeds of all our open source projects on github, merges these into one, prefixes the titles with the project names and also truncates them, before wordpress consumes that pipe’s output and displays it in a sidebar widget. That’s what I call a real mashup. :D If anyone is interested, here’s the pipe.

post to del.icio.us Diese Seite zu Mister Wong hinzufügen

New Rails Plugin: social feed

April 25, 2008 on 3:40 pm | von Alexander Lang | 1 Kommentar
socialfeed.png

This is our latest and also largest plugin for ruby on rails so far. After the installation it adds a social feed as seen in the picture to your rails application. The sources have been extracted from autoki which has had a social feed for a couple of months now, so rest assured we have put some thoughts into it over time. :)

Features so far: As a user I can decide what kinds of events I want to see on my social feed and also wether I want to be sent an email when an event occurs. I can also decide wether others will receive a notification on their social feed concerning my own actions.

The plugin includes model extensions for the user, a controller and views for viewing the feed and editing settings as well as a generator to easily create new event types so, getting started only takes a couple of minutes. For more info check out the README or get the sources from github.

post to del.icio.us Diese Seite zu Mister Wong hinzufügen

Hiding attachment_fu from your controllers

April 21, 2008 on 11:21 am | von Alexander Lang | keine Kommentare

Yesterday I was using attachment_fu to attach photos to a couple of models. Since attachment_fu requires you to create an extra model for the photo, you usually have a one to one relationship between the model and the photo.

But now that you have two models you also have to deal with these in your controller and views, something along the lines of this:

Sort of ugly if all you want is to add a photo to the Project model. But fear not, after adding the following piece of code to your model, you can transparently assign the photo to your project model in the view:

The tweaked model:

Now you can use a standard view:

And a standard controller:

(credits to this railscast for the idea of using a virtual attribute, I only added a bit of sugar for attachment_fu)

post to del.icio.us Diese Seite zu Mister Wong hinzufügen

Rails reporting: dead simple reports now supports excel directly

April 12, 2008 on 9:44 pm | von Alexander Lang | keine Kommentare

dead simple reports is a Ruby on Rails plugin that allows you to create reports from your application data within minutes. As of now it can not only generate HTML tables and CSV files but also M$ Excel spreadsheets. This is possible through the use of the spreadsheet-excel gem. You can grab a copy from the git repository or just download it from there.

post to del.icio.us Diese Seite zu Mister Wong hinzufügen

Moving to GitHub

April 11, 2008 on 4:07 pm | von Alexander Lang | 4 Kommentare
octacat.png

GitHub is out of beta so now we have moved our open source projects there. Actually they already have been there for a while but we have now split them into their own repositories. The upstream subversion will still be online for a while but new commits will only go to git. Apart from being hyped alot these days git can do some pretty cool things like committing only parts of a file or changing previous commits - well worth checking it out I’d say.

post to del.icio.us Diese Seite zu Mister Wong hinzufügen

Monitoring the internals of your Rails application with Nagios

April 10, 2008 on 10:03 am | von Alexander Lang | 2 Kommentare

autoki has recently grown into a more and more complex application. Besides two clusters of mongrels and the mysql database we have a memcached server, ferret and starling plus clients for asynchronous processing. WIth so many services running (and sometimes not running) the need to monitor all these grew. We decided to set up nagios on one of the servers - it’s ugly but it lets you monitor all sorts of stuff pretty easily via remote agents that run on each monitored server.

With nagios we have access to quite a number of monitoring plugins, e.g. for monitoring TCP ports (e.g. for checking memcached is still alive), HTTP, server load, free disk space etc. Yesterday I came to a point where I wanted to monitor something nagios couldn’t: When a user uploads a bunch of photos, the task of creating copies of the photos in different sizes is put in a starling queue for asycnhronous processing. If something with that processing goes wrong and the queue gets too big I want nagios to pick this up and notify me. Time for my own nagios plugin.

Nagios plugins are actually very simple. All you have to provide is something that can be executed in a shell and that returns either 0, 1 or 2 for an OK, Warning or Critical state of the monitored service. So here’s the source code for monitoring the number of photo uploads in the queue (RAILS_ROOT/lib/check_photo_uploads.rb):

At autoki the server that runs the asynchronous processes is called jobs1 and this is also where the queue should be checked, so I added this to the /etc/nagios/nrpe.cfg file (the config file for the remote nagios agent):

Then I had to add the service to the nagios configuration on the monitoring server:

Well, that was it, and this is how it looks - ugly but it works :)

nagios_photo_uploads.png

(I recently signup with scout - looks much prettier and the setup is much easier than nagios, plugins are written as ruby classes and it comes as a ruby gem - sweet concept so far, could have been my idea, more on that later)

post to del.icio.us Diese Seite zu Mister Wong hinzufügen

4-Tage-Woche und Kreditkarten für alle

March 10, 2008 on 11:19 am | von Alexander Lang | keine Kommentare

Das klingt so gut, das machen wir auch: 37signals haben beschlossen, im Sommer nur 4 Tage die Woche zu arbeiten - nach 3 Tagen Wochenende ist man einfach entspannter, glücklicher ergo produktiver. Kreditkarten für alle und finanzielle Beteiligung an den Hobbys der Mitarbeiter - klingt auch nicht schlecht, aber so richtige Mitarbeiter haben wir ja gar nicht, da müssen wir uns was anderes überlegen.

post to del.icio.us Diese Seite zu Mister Wong hinzufügen

upstream auf github

March 4, 2008 on 8:06 pm | von Alexander Lang | keine Kommentare

Nach kurzer Wartezeit habe ich heute meine Einladung zum Betatest von GitHub bekommen und das erst gestern eröffnete public upstream subversion ins public upstream git repository kopiert. Man kann unser großartiges dead simple reports plugin jetzt also auch über git ziehen.

Der Einstieg in github war schonmal sehr angenehm. Um das erste Repository anzulegen bekam ich erstmal die benötigten Kommandos angezeigt und konnte die gleich in mein Terminal kopieren. Von den diversen git tutorials und screencasts ist bei mir leider nicht viel hängen geblieben, sodass ich git wohl erst im Laufe des Praxiseinsatzes richtig kapieren werden. Ein sehr spannender Ansatz bei github ist auf jeden Fall die Möglichkeit, bestehende Repositories zu forken und dann darin zu entwickeln. Statt also irgendwelche Patches an Open Source-Projekte zu senden, forkt man einfach nur noch deren Repository, werkelt darauf herum und kann dann ggf. die Änderungen in das Main-Repository hochladen.

post to del.icio.us Diese Seite zu Mister Wong hinzufügen

upstream goes open source: dead simple reports

March 3, 2008 on 4:48 pm | von Alexander Lang | keine Kommentare

Na endlich. Nach all den Jahren des nur-Geldverdienens und Open Source-Ausnutzens haben wir es geschafft, ein paar erste Zeilen Code in die Freiheit zu entlassen: dead simple reports, ein Rails-Plugin, das Reports generieren kann. Mehr dazu im neuen Bereich Open Source

post to del.icio.us Diese Seite zu Mister Wong hinzufügen

Delete considered harmful

February 28, 2008 on 12:10 pm | von Alexander Lang | keine Kommentare

We just encountered a bug in one of our rails applications where we had accidentally used some_mode.delete instead of some_model.destroy. I think delete should not be a public method on ActiveRecord. After all it’s just some evil means to circumvent all those rails callbacks and stuff to gain some more performance when deleting objects. It should be a protected method or something so that requires some effort (i.e. model.send(:delete)) to call it so you don’t use it accidentally when you actually want to call destroy.

post to del.icio.us Diese Seite zu Mister Wong hinzufügen

Next Page »
  • RSS keiala

  • RSS open source projects: commits

  • Tags

  • Archives

  • Meta


  • Powered by WordPress with Pool theme design by Borja Fernandez.
    Entries and comments feeds. Valid XHTML and CSS. ^Top^