Feed on
Posts
Comments

Wireshark is a network protocol analyser, or packet sniffer, available for Ubuntu 10.04 via a simple sudo apt-get install wireshark. However to use it correctly, we need to change some permissions to ensure we’re not running the whole application as root.

The following commands will let the adm group run Wireshark without elevated privileges – the adm group is the group that allows you to read log files, etc., I always add myself to it anyway.

1
2
3
4
5
6
7
8
$ sudo chgrp adm /usr/bin/dumpcap
$ sudo chmod 750 /usr/bin/dumpcap
$ ls -alF /usr/bin/dumpcap
-rwxr-x--- 1 root adm 63520 2010-04-13 01:17 /usr/bin/dumpcap*
$ sudo setcap cap_net_raw,cap_net_admin=eip /usr/bin/dumpcap
$ getcap /usr/bin/dumpcap
/usr/bin/dumpcap = cap_net_admin,cap_net_raw+eip
$

That’s all pretty self explanatory – the setcap command allows that binary to use special capabilities, namely to control NICs (to set promiscuous mode for Wireshark) and capture raw traffic from NICs.

ABC’s The Drum is the ABC’s analysis and opinion site. It has a diverse range of contributors and I’ve found the RSS feed a little too active for my liking.

That said, I love the latest presenter of Media Watch, Jonathan Holmes, and I wanted to read just his articles posted on The Drum. I asked if it was possible to get an RSS feed for specific authors but I didn’t get far so I decided to fire up the ever-useful Yahoo! Pipes to do the job:

You can filter by any Author’s name from The Drum (just copy and paste the name from the by-line) and then select Run Pipe then Get as RSS to add it to your feed reader of choice. If you find this useful or have other suggestions for how this could be used, please don’t hesitate to leave a comment below.

If you’re like me and love your nipple, you might prefer to disable the touchpad on your ThinkPad.

In openSUSE this is a trivial affair of opening up the Gnome mouse preferences and unchecking the Enable Touchpad option. When I went searching for this option in Ubuntu 10.04 I couldn’t find it, so I searched the Ubuntu Software Centre for “touchpad” and installed GSynaptics, which looked very similar to openSUSE’s tool.

GSynaptics disabled the touchpad just fine – until the machine transitioned power state, such as suspend/resume or a reboot. I’ve found that the reliable way of disabling the touchpad in Gnome is to fire up gconf-editor and locate a setting similar to the following and disable it:

Here’s a little bash script to display the name of all lists in your mailman site and the number of subscribers for each list, just run it in the same directory as your mailman binaries (/usr/lib/mailman/bin on Debian):

1
2
3
4
5
6
#!/bin/bash
LISTS=$((`./list_lists | wc -l` - 1))
LISTS=`./list_lists | tail -n$LISTS | awk '{ print $1 }'`
for i in $LISTS; do
    echo $i `./list_members $i | wc -l`
done

Protip: you can also just copy and paste the lines into your terminal so you don’t have to save it as a script.

In the PlanningAlerts project, we recently added a default page title for those pages we forget to add specific titles to. I added the initial code and Matthew did it properly cleaned it up, here’s the diff:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
diff --git a/app/views/layouts/application.haml b/app/views/layouts/application.haml
index 27d81d9..6b42b26 100644
--- a/app/views/layouts/application.haml
+++ b/app/views/layouts/application.haml
@@ -2,10 +2,7 @@
 %html(xml:lang="en" lang="en" xmlns="http://www.w3.org/1999/xhtml")
   %head
     %meta(content="text/html; charset=utf-8" http-equiv="Content-Type")
-    - if @page_title
-      %title PlanningAlerts | #{@page_title}
-    - else
-      %title PlanningAlerts | Email alerts of planning applications near you
+    %title PlanningAlerts | #{@page_title || "Email alerts of planning applications near you"}
     - if @rss
       %link(rel="alternate" type="application/rss+xml" title="RSS" href=@rss)
     = stylesheet_link_tag "memespring", "main", :media => "all"

I thought other people might find this little hack useful for adding default page titles to their HAML templated Ruby on Rails projects.

« Newer Posts - Older Posts »