Friday, September 11, 2009
Linux kernel hacking: file notification system with kernel tracepoints
An example of how to use kernel tracepoints to create a simple real-time backup / file change notification system. The article (only in italian, sorry) is available at stacktrace.it.
Friday, June 26, 2009
mutt + gmail notifier
I really enjoy the power of mutt, and I've to say that I've not too far from reaching the email Nirvana with it :). OK, it's not the email client for everybody, it's just for the people that prefer the keyboard to the mouse and love the command line interfaces.
There's only one missing feature in mutt: a nice way to notifiy new emails. The problem with mutt is that I need to periodically switch to the mutt shell to check for new emails. And I don't even like the crappy notification balloons that cover the useful part of the desktop (e.g., thunderbird). A small tray icon could be a solution (and I did it this way for a while, patching mutt), but with the icon I don't see immediately the message that I receive.
This led me to notice a large unused area in the gnome panel at the top (recently I moved from Fluxbox to Gnome, yeah! :) now I've a ultra-very-fast SSD I can also use a fancy desktop environment). So, why not to use the top panel to notify the subject of the last email I received in my mailbox? ta-da! the solution: a small python gnome applet that periodically fetches the last unread email from a generic IMAPS folder in gmail and prints the subject to the panel.
Here's the code: gmail-check, very minimalist and designed just for my particular desktop environment, so it may not work in some cases...
There's only one missing feature in mutt: a nice way to notifiy new emails. The problem with mutt is that I need to periodically switch to the mutt shell to check for new emails. And I don't even like the crappy notification balloons that cover the useful part of the desktop (e.g., thunderbird). A small tray icon could be a solution (and I did it this way for a while, patching mutt), but with the icon I don't see immediately the message that I receive.
This led me to notice a large unused area in the gnome panel at the top (recently I moved from Fluxbox to Gnome, yeah! :) now I've a ultra-very-fast SSD I can also use a fancy desktop environment). So, why not to use the top panel to notify the subject of the last email I received in my mailbox? ta-da! the solution: a small python gnome applet that periodically fetches the last unread email from a generic IMAPS folder in gmail and prints the subject to the panel.
Here's the code: gmail-check, very minimalist and designed just for my particular desktop environment, so it may not work in some cases...
Monday, June 8, 2009
New SSD disk
I just got one new SSD disk MTRON MOBI 3000 for my Dell Latitude D430 notebook. It's very small, only 32GB, but it definitely ROCKS!!! I can boot in about 12 seconds, without any deep tuning of the kernel and boot services, but the _responsiveness_ is the most relevant thing, apart the read/write 100MB/s throughput (that is not so important for a desktop system). The impressive part is the ~5500 iops (IO operations per second) obtained using a workload of 4KB random reads/writes!
Thursday, May 14, 2009
Linux kernel hacking: process containers
A basic overview of the Linux cgroups. My article is available at stacktrace.it (in italian).
Saturday, May 2, 2009
battery life in bash prompt
I've just reconfigured my .bashrc to execute this bash script that allows to show the perentage of battery life at the beginning of the command prompt. Geeze, really nice! :) At this point I can turn off the guidance-power-manager applet and enjoy a faster boot.
#!/bin/bash
GRAY="1;30"
CYAN="0;36"
LIGHT_CYAN="1;36"
LIGHT_BLUE="1;34"
YELLOW="1;33"
WHITE="0;1"
NO_COLOR="0"
LIGHT_RED="1;31"
LIGHT_GREEN="1;32"
BROWN="0;33"
function battery_info()
{
BATT_INFO=$(acpi -b | awk -F', ' '{print $2}')
AC_INFO=$(acpi -aB | awk -F': ' '{print $2}')
if [ $AC_INFO = "off-line" ]; then
BATT_PERC=${BATT_INFO:0:${#BATT_INFO}-1}
if [ $BATT_PERC -ge 75 ]; then
COLOR=$LIGHT_GREEN
elif [ $BATT_PERC -le 25 ]; then
COLOR=$LIGHT_RED
else
COLOR=$YELLOW
fi
else
COLOR=$NO_COLOR
fi
}
PROMPT_COMMAND=battery_info
PS1="\[\033[\$(echo -n \$COLOR)m\]\$(echo -n \$BATT_INFO)\
\[\033[${NO_COLOR}m\] \u@\h:\[\033[${WHITE}m\]\w\[\033[${NO_COLOR}m\]\$ "
Tuesday, April 28, 2009
iozone: buffer overflow in ubuntu jaunty
In the latest Ubuntu Jaunty iozone immediately crashes with a nice *** buffer overflow detected *** message, that means it is practically unusable. Fortunately the cause of the bug is very simple: a wrong length used to copy a string by gethostname(). I posted a fix here.
Thursday, April 16, 2009
cgroup: io-throttle controller (v13)
A new version of my IO controller for Linux cgroups.
LWN.net coverage at http://lwn.net/Articles/328484/.
LWN.net coverage at http://lwn.net/Articles/328484/.
Subscribe to:
Posts (Atom)