scripts

arpinfo

Ever wanted to know who the OEM/Supplier/Manufacturer of network devices attached to a machine were?

I did. And couldn’t see anyone else’s script to steal, so here’s a really ugly way to do it ;)


# arpinfo:
# pull hardware info from the arp() table
#
# Copyright (c) 2010 Adam McGreggor. Some rights reserved.
# Email: Web:
#
# $Id:$
#

WEBSOURCE=http://standards.ieee.org/regauth/oui/oui.txt
DOC=/usr/local/doc/oui.txt

curl --silent ${WEBSOURCE} -o "${DOC}"

arp | awk '{print $3}' | awk -F: '{print $1"-"$2"-"$3}' | while read ARP
do
grep $ARP ${DOC}
done
arp

Works for me… although it could do with a tidy-up. As a quick and dirty thing, mind…

Firefox Extensions

Thought this might double up as a note of the firefox extensions I currently have installed — I’ve tried getting this to script, but, the source file isn’t something I’m over-familiar with, and getting fields to match-up ain’t happening, due to my crapness.

Anyhow, I would appear to have these firefox extensions installed:

A few of those don’t have links I can identify from the URI.

Want some code that vaguely does this for you?

#!/bin/sh
#
# ffexts:
# list firefox extensions: names and URIs for download/homepage
#
# Copyright (c) 2010 Adam McGreggor. Some rights reserved.
# Email: <adam@amyl.org.uk> Web: <http://blog.amyl.org.uk>
#
# $Id: ffexts 119 2010-01-10 00:38:04Z adam $
#

set -e

MOZDIR=~/.mozilla/firefox
PROFDIR=`ls -lha ${MOZDIR} | grep default | awk '{print $NF}'`
FILE=extensions.rdf
INFILE=${MOZDIR}/${PROFDIR}/${FILE}
OF=~/tmp/ffexts
OUTFILE=~/pseudohome/nas-docs/firefox-extensions-$(date '+%Y%m%d')

# check for existing outfile, as we'll be
# appending; if so, zap it
if [ -e ${OUTFILE} ]; then
rm ${OUTFILE}
fi

# grab the interesting bits from the RDF file
for K in name homepageURL
do
# nice fix-up, eh?
grep "NS1:${K}" ${INFILE} | sed -e "s/NS1:${K}=//" \
-e 's/"//g' -e 's/>//' \
-e 's/^[ \t]*//' | sort | uniq > ${OF}-${K}
# using wc here is entirely optional ;)
wc -l ${OF}-${K}
# append
cat ${OF}-${K} >> ${OUTFILE}
done

UKGovWeb Barcamp

Hum, so there’s another UKGovWeb Barcamp in the pipe-line. Good-oh, says I.

To work around my hatred of PBWiki’s “notification” system, I’ve just re-appropriated (and made ‘ukgovweb-check‘) my dell-order-checking script to work for the wiki-page; changelog is that the script now uses lynx instead of wget, and that we send the difflog, rather than the whole-bloody-changed file.

If you’re still in the dark-ages like me, and haven’t written one yourself, here you go. If there’s a demand and people are feeling lazy, I suppose I could whip up a list.

Let me know if you do.

There’s some discussion going on on email, I do believe.

Catching up with the 21st Century.

Well, in an half-arsed manner, I’m finally catching up with this century’s gizmo, that most people didn’t believe I didn’t use.

RSS.

I say kinda, ‘cos, despite having finally found something non-intrusive, and with a UI that doesn’t suck, I still don’t check the webpage it makes. Despite it updating.

Of course, I should have thought “I know who would have written something useful” donkey’s years ago. But I never did. Only recently, when hunting for Matilda did I think about it. *sigh*

So, there we have it. Next up is working a fix for it, to handle rss feeds which require basic-auth (trac-tastic!), and getting xkcd to display inline…

Next up: populating it a bit more, and then unsubscribing from some lists… well, maybe filter ‘em out…

  • Pages

  • Twitters

    Follow me on Twitter!
  • ORG-GRO

  • ORG

  • Travel