Rodolfo Ferreira Calmer than you are.

Solving S99 In Clojure

I found myself a question while solving some S99 problems in Clojure.

Apache Tomcat 7 service script

So, here’s my Tomcat service init script. It was adapted from many others throughout the web, which when didn’t gave me syntax errors, didn’t make use of tomcat’s PID file or just didn’t work at all.

Script to delete all objects in a AWS S3 bucket


This is mainly for test cases, when you’re new to AWS S3 and you create a test bucket to start testing things out. Soon you discover there’s a lot of extra objects like FooBar2013-03-29-02-54-37-E56AFCD9348BBA9D776F6C4 (that’s ok, it’s just the logging), but when you try to delete this entire test bucket, you can’t, because S3 buckets need to be empty before they are deleted.

Since I particularly had many many objects like these, I started going through all of them in the AWS S3 web interface deleting, waiting, then selecting again (because the web interface doesn’t have a “select all” feature to date - I think for security/performance reasons).

Real time event notifications for web apps - Part 2


So, in my previous post, I introduced the idea of a solution for realtime event messaging using a Pub/Sub implementation and Chromium’s Desktop Notifications API.

The architectural view presented there only covers the big picture. Now let’s get into details technically.

In summary, the solution presented here will provide a organized way of having a event server available for publishing events to active users. This is a web-based browser-only solution, as it uses WebSockets and the Socket.IO library.

Note: The notification pop-ups are implemented using Desktop Notifications in order to have the notifications appear outside the tab, even when the browser is minimized. This only works in Chrome and Safari right now. If you really need this outside Chrome, you can use an extension for Firefox, but other browsers don’t have a similar solution as of today.

Real time event notifications for web apps - Part 1


I thought I would share an interesting solution I came up with for notifying active users of a web application about system events in real time. I’ll just use the following scenario:

an e-commerce app which needs to notify active back-office administrators in the instant when an order has been placed or when an order’s items have just been successfully delivered to their destination.

Note the emphasis on active - what I mean is: currently logged in and active users, with at least one tab open in any page of the app. An on-screen, desktop notification is appropriate, and with Chromium’s Desktop Notifications API it’s not only possible to notify the user when the tab is active, but even when it’s not (and even when the whole browser itself is minimized).

Of course you could have e-mail alerts, but that could end up cluttering every inbox with unnecessary and outdated alerts, once the order could have already been acted upon long before these alerts would be checked.