Stick your file to a specific path with stickfile

Update (2011-04-22): Zach let me know in the meantime that there's a much easier way to implement stickfile in BASH:

Moral of the story: I should have searched for inotify command line which would lead me to inotify-tools which contains inotifywait.

And now to the original post:

My employer uses SonicWALL NetExtender for his VPN needs. Saying that I'm not a fan of IPsec would be definitely an understatement, but my major problem is that NetExtender overwrites my resolv.conf upon every connection which screws the hostname resolution on my LAN from my laptop. chmoding or chowning resolv.conf doesn't help because it gets re-chowned and re-chmoded by NetExtender.

I was thinking about overwriting resolv.conf on a regular basis from a script but it seemed rather inelegant. But how should I do it otherwise? With inotify, of course.

Here's the script I've written which you should save as "stickfile" to a directory that is featured in your $PATH.

After I created a valid resolv.conf and saved it as /etc/resolv.conf.orig I only had to execute the following as root before starting up NetExtender:

stickfile /etc/resolv.conf.orig /etc/resolv.conf

Overclock.net Mechanical Keyboard Guide Atom Feed

I use RSS / atom feeds pretty much all the time to minimize information overload but the Mechanical Keyboard Guide of Overclock.net doesn't make my job any easier because they don't provide any feeds and the thread moves very fast.

I couldn't tolerate this anymore so I've created a webscraper that provides atom feeds for this thread. Parsing HTML into a DOM and executing XPath queries on the DOM is something that I have a vast amount experience with and this project didn't take a long time either. I've been testing it for more than a month and it's rock solid. The only glitch is that sometimes posts are randomized between very short time intervals which is a minor inconvenience.

The script below (also available on GitHub) is executed on a hourly basis by cron and its content is saved to http://monda.hu/overclock-net-mech-keyboard.xml

Goodbye Feedy, Greetings Google Reader!

I've recently trashed my feed reader, Feedy. I started it about a half year ago, but it took too much time to maintain it. I knew about Google Reader for a long time, but I didn't like it's interface. Now that I use it for two weeks I have no doubts about its superior usability. I'm very satisfied with it.

Although I doubt anyone would use Feedy, I put it out, because I think it has a nice UI and a good database layout that prevents feed duplication pretty effectively so it may be a good base for developing a more robust feed reader.

feedy.tar.bz2 is not a release. A release is a carefully put together end product that is easy to install. Feedy is not easy to install, but check out the README file for some information.

Lastly but not leastly here are some screenshots:

feedy-1

feedy-2

How to Automate HTTP Requests Using Greasemonkey

There are some sites that I use daily. The sad thing is, many of them don't provide me any mechanisms to log in automatically, so I have to always do it manually. I also had to fill the same form in on these sites and carry on the same operation over and over again. This was very frustrating for me so I decided to come up with a solution. Greasemonkey seemed to have the potential to solve my burning need.

I want to share the core function I've written that can help you in such scenarios. It's a simple, but very useful one.

Requests are typically triggered based on the content of window.location.href or document.referrer.

Greasemonkey has some ugly annoyances, but fortunately most of them can be worked around. The LiveHTTPHeaders add-on can also help you tremendously constructing the fields of the forms.

Planet Archiver 0.2 Released

Planet Archiver was getting naughty so I made a small bugfix release, version 0.2.

planet-gnome-archives

Changes:

  • searchbar.php: Change the signature of monthdays() to be able to correctly compute the previous day.
  • searchbar.php: Force decimal conversion in leadingzero(number) to properly convert "08" and "09" to their decimal equevivalent instead of applying octal conversion.

Planet GNOME Archives Is Down, Planet Archiver Is Available

Four days after I set up Planet GNOME Archives, Jeff Waugh, editor of Planet GNOME mailed me:

Hi László,

I found your blog entry about Planet GNOME Archives as a referer to the
Planet website.

Planet, as it was designed for Planet GNOME, specifically did not include an
archival feature, because we felt it was inappropriate for a third-party
site to archive blog entries. The original author may edit the entry, remove
it from his/her blog, or change the readership policy in the future and this
really is up to them, *not* a third-party archival site that they are unable
to control.

At some stage, Planet itself may include an archival feature, for aggregator
admins that wish to do this. But many admins will approach it the same way I
have for Planet GNOME: no archival whatsover, leave that in the hands of the
authors themselves.

So, this is a long-winded, history-filled way of suggesting that you should
not make your archive of Planet GNOME publically accessible.

Thanks,

- Jeff

For these very reasons, you should be careful about putting your archive out to the public. You should negotiate this with the admins of the Planet you wish to archive. I've made Planet GNOME Archives private and published its source as the project Planet Archiver 0.1. Jeff found it a cool hack that useful for many on-line resources and so do I.

Planet GNOME Archives Is Alive

Update (2006-06-07): Planet GNOME Archives is no longer available publicly. See my post: "Planet GNOME Archives Is Down, Planet Archiver is Available" for the explanation.

I'm addicted to Planet GNOME. It's the richest resource I read on a regular basis. Lots of talented people writing here about mostly GNOME related and generally Free Software related stuff and one can learn a lot by reading their posts.

I had only one problem with it, though: PlanetPlanet is not able to generate feed archives, so it is not possible to go back in history and read the earlier posts that the GNOME folks made. If I forget to visit or can't visit Planet GNOME for 3 days or more, I drop behind and there are phases in my life when I don't have so much time and it's a pain in my ass. I could use a web based feed reader with cron, but unfortunately none of the readers are good enough for my choosey taste, so I had to choose a different approach to solve this issue.

Ladies and Gentlemen, I'd like to introduce Planet GNOME Archives [link removed]! (I like the name, came out with it myself.) It must be pretty damn intuitive to use, because of the extra JavaScript love I gave to this babe. Motto: "No readers get left behind!"

I haven't used JavaScript for a long time, but despite of this fact, it was really a pleasure. Enjoy!