Google just announced the public availability of the Google Analytics API. This is great news, because you can now write your own (web) applications that use the data from your analytics account. I might integrate this with the CMS we wrote for my company.
The announcement is available here.
Monthly Archives: April 2009
Magic c-style comments
A friend/collegea of mine had a really cool idea about c-style comments. C-style comments are multi-line comments that start with /* and end with */. They can be used in C, C++, C#, PHP, Java and a other languages. When this friend debugged some code, he found himself switching some blocks of code on and off all the time. He came up with a solution to switch between two blocks of code by just removing or adding one character!
See for yourself at: http://blog.mycroes.nl/2009/04/magic-comments.html
Monitor Postfix with Cacti and SNMP
Today I configured Cacti and SNMP after I saw the graphs of a friend. He had graphs for Postfix, which showed statics like sent/received/rejected.
After a little search on the internet, I found a post on the Cacti forum. At first I couldn't get it to work, but after running the script manually (instead of via SNMPd) I found out /var/log/mail.log was not readable by the SNMP user.
Cacti has been polling snmp for the past few hours now and apparently I receive around 25 spam emails that get rejected every 5 minutes. That's 6000 mails per day, more than 2.000.000 every year. I'm glad I configured postfix to reject those mails (have a look at the reject_rbl_client config directive of postfix).
Testing Ubuntu Jaunty with UXA
I've been testing Ubuntu Jaunty for a few weeks now and after using it for a day or two, my memory filled up. Recently I found out that this was caused by Compiz. Apparently if you use UXA with the new Intel drivers, Compiz will start to leak memory. After only 8 hours of usage, Compiz was using more than 1.5GB of memory! The solution? Disable Compiz, because UXA is a big performance improvement for me.
Update: Apparently this bug is fixed (#328232).
Using imapproxy to speedup webmail
Yesterday, I discovered a great way to improve the speed of your webmail client. Two friends of mine were talking about something called imapproxy.
Apparently this is a simply brilliant tool. It was invented because the web is stateless, but imap is not. Your webmail client (for example Roundcube) will reconnect to the imap server everytime you click a link or refresh. This introduces a great deal of lag. The solution to this problem is imapproxy. Your webmail client connects to the proxy and imapproxy opens a connection to the imap server. When the webmail client disconnects, the proxy keeps the connection open for another 5 minutes, so when you refresh or change directory, this can be done very fast!
I installed imapproxy on the webserver of my company. At first I couldn't get it to work, because I wanted it to connect to imap over ssl, but after enabling "plain text" imap for localhost, I let imapproxy connect to it and everything worked. The roundcube installation now reacts almost instantly!
So remember, don't try to let imapproxy use ssl, because the only error you will notice is that imapproxy is not listening on any port. The developers just forgot to add error reporting I guess.