Inotify is a Linux subsystem which monitors the filesystem for changes, and provides a way to trigger actions when it does.

This is handy, since it means that your program/demon can avoid polling for changes constantly, making it more efficient and reliable. As an aside, this is how the Linux Dropbox tool works.

I was reminded of its existence by a recent hacker news article, so I decided to have a little play over lunch. Here is a little toy I hacked together which monitors a directory for text files containing URLs. When it detects a new one the script retrieves it via WGET and deposited in a nominated downloads directory.

This is a trivial use of the technology, although it is still quite useful, letting me trigger large downloads via my phone or ipad which then get automatically fetched by my NAS without the need to fire up my desktop machine.

» Visit the project on Github…

Image by Oxygen Team, used under the GPL2 licence.

Following on from my post yesterday, I would like to introduce something I quickly hacked together to show how the kind of thing I was talking about might work.

As discussed in yesterday’s article, I already use twitter to provide a data feed for selective traffic alerts.

Street Level URLs provides a simple wrapper around this search, providing you with a nice summary page and the option to access the data in a number of different formats.

It uses twitter for the actual data and uses mod_rewrite rules to wrap the actual search up into an addressable URL.

Have fun!

» Street Level URLs