Software
Here I'm making some of the software I've written over the years available.
Here I'm making some of the software I've written over the years available.
I wrote this little script to monitor traffic on various machines at work. We use Shorewall to set up all the netfilter rules, traffic shaping, etc. It also makes it easy to set up rules to monitor traffic for different types of traffic. We use Munin to track all sorts of things over time. The script below is a Munin plugin that will create a graph with one data series for each of the chains defined in your shorewall accounting file. Put this script into /etc/munin/plugins and call it something like shorewall_accounting, and then add this in /etc/munin/plugin-conf.d/munin-node:
[shorewall_accounting] user rootThe name in between the square brackets should match the name of the file you saved the script in. The script needs to run as root in order to get access to iptables. Edit Jan 20, 2006: Some minor bugfixes to the script have now been included. The shorewall accounting chains are now output in alphabetical order, and the regexp has been fixed to catch very large numbers.
#!/usr/bin/python
# shorewall_accounting
# A munin plugin for tracking traffic as recorded by shorewall accounting rules
# Written by Chris AtLee
# Released under the GPL v2
import sys, commands, re
accountingLineExp = re.compile(r"^\s*\d+\s+(\d+)\s+(\w+).*$")
def getBytesByChain():
status, output = commands.getstatusoutput("shorewall -x show accounting")
if status != 0:
raise OSError("Error running command (%s)[%i]: %s" % (trafficCmd, status, output))
chains = {}
for line in output.split("\n"):
m = accountingLineExp.match(line)
if m is not None:
target = m.group(2)
bytes = int(m.group(1))
if target in chains:
chains[target] += bytes
else:
chains[target] = bytes
retval = []
chainNames = chains.keys()
chainNames.sort()
for name in chainNames:
retval.append((name, chains[name]))
return retval
if len(sys.argv) > 1:
if sys.argv[1] == "autoconf":
print "yes"
sys.exit(0)
elif sys.argv[1] == "config":
print "graph_title Shorewall accounting"
print "graph_category network"
print "graph_vlabel bits per ${graph_period}"
for chain,bytes in getBytesByChain():
print "%s.min 0" % chain
print "%s.type DERIVE" % chain
print "%s.label %s" % (chain, chain)
print "%s.cdef %s,8,*" % (chain, chain)
sys.exit(0)
for chain, bytes in getBytesByChain():
print "%s.value %i" % (chain, bytes)
The trailer for The Wild is now available for viewing online. I'm pretty excited about this movie because Houdini was used extensibly to make this movie. Look for it in theatres on April 14th!
Steve Pavlina's latest post shows the power of Google's AdSense. In the past 12 months his revenues from AdSense has gone from pretty much nil to almost $5,000 a month! I've been listening to a few of his personal development podcasts, and it isn't hard to see why his site is so successful. He has a very good speaking and writing style - very clear, concise and down to earth. The articles available from his website are very helpful as well as inspirational. A few things I've picked up from his website and podcasts:
If you're in the mood for a great blond joke, I suggest checking out Darryl's blog. p.s. I like the name of your blog Darryl. p.p.s. I'm sorry
apt-get install debian-archive-keyringwill also work :) This package was added just a few hours ago.
I got sick of Thunderbird opening up links in Mozilla instead of Firefox. A friend mentioned that the preference responsible for opening up links was 'network.protocol-handler.app.http'. I searched around in the Thunderbird pref files for what it was currently using. On my machine it was set to launch 'x-www-browser'. This is actually a symlink into Debian's alternatives directory, so a simple
update-alternatives --set x-www-browser /usr/bin/firefox
did the trick.
Melissa and I watched The Station Agent a few weeks ago on the recommendation of a coworker of hers. I had never heard of it before, but it really is a fantasic movie. I think it has some of most unique characters I've seen in a while, and it has tons of rolling-on-the-floor-hilarious lines as well as dealing with some tough emotional issues. Rotten Tomatoes rates it at 95% right now. If you haven't seen it and you're looking for something a little different, I'd very much recommend it.
As root (this should be all one line):
wget -q -O - http://ftp-master.debian.org/ziyi_key_2005.asc http://ftp-master.debian.org/ziyi_key_2006.asc | apt-key add -The debian-keyring package should probably have these keys included, but it doesn't seem to.