nodereality

node c0re

Archive for September 2009

munin plugin for djbdns' DNS cache

written by Ghirai, on Sep 17, 2009 10:47:00 AM.

If you run a DNS cache with djbdns, you might want to see pretty graphs of the number of requests your cache received (queries/second).

Here's a very simple munin plugin that does just that:

#!/usr/local/bin/python
import sys

logfile = '/etc/dnscache/log/main/current'

if len(sys.argv) == 2 and sys.argv[1] == "autoconf":

  print "yes"

elif len(sys.argv) == 2 and sys.argv[1] == "config":

  print 'graph_title djbdns dnscache queries'
  print 'graph_vlabel Queries/s'
  print 'graph_category DNS'
  print 'queries.label Queries/s'
  print 'queries.type COUNTER'
  print 'graph_args --base 1000 -l 0'

else:

  f = open(logfile)

  for line in f:

    txt = line.split(' ')
    try:
      if txt[1] == 'query':
        query_count = txt[2]
    except IndexError: continue

  f.close()

  print 'queries.value %s' % query_count

Adjust the "logfile" on line 4 to fit your installation.

Python 3.x users will probably need to make slight adjustments to the code.

Install it like any other munin plugin, then restart munin_node. It doesn't require any additional configuration.

EDIT: Here's how it looks: queries/s graph

What's a browser?

written by Ghirai, on Sep 3, 2009 9:27:00 AM.

The answer is, obviously, it depends - on your operating system, on what features you need/expect from a browser, religion, and so forth.

Ruling out the people who use IE (because they have no choice, or don't know any better), you're left with a couple of options.

Do you care if it's 'free' and 'opensource'? Do you need a rich plugin ecosystem? Does it have to integrate seamlessly with your operating system/window manager/etc?

As far as i'm concerned, bloat starts to creep in when your browser can do more than browse the web (properly), has some sort of adblock and some sort of download manager (by that i mean a way of doing simultaneous downloads, and showing progress). If you feel you need something more, maybe you should start looking at a dedicated application. Or perhaps the web page/web app you're using is missing something.

Because most people spend quite a lot of time using the browser, it needs to be fast and hassle-free. Every time the browser takes its time, it steals time from you; this gets multiplied in the long run, and it adds up.

Personally, i never liked Firefox much. It always felt heavy somehow. Like trying to juggle watermelons. You might succeed, but it's exhausting.

Sure, some of the plugins are nice, some are even pretty useful (although i suspect the bulk of them are not).

Opera is a bit better, if they'd ditch the bittorrent and email stuff. And provide a more decent GUI experience on non-windows platforms.

Next we have Konqeror, which is quite fast, despite the bloat. Too bad i always found it crashing a bit too often. And it doesn't work on Windows. Otherwise it's perfect.

Safari is ok (if you ignore the bloat), and if Apple would patch the security holes more often.

Chrome is nice and all, but there's no decent *nix version yet. Oh, and you might want to think about the major privacy issues.

If you agree with this, then you might want to give Arora a shot.

It's free (a compelling argument these days), webkit-based, and platform independent. And it does one thing only. Fast.

Actually, try it even if you think this post is total bullshit.