software

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.

Can’t upload images to a Wordpress blog?

If, like the guys in the ORG HQ, you find yourself unable to upload images in a Wordpress Blog, and are befuddled by the reams of posts &c on the web, well, here’s another idea that might sort you out:

Remove the crap from old installs, in your ~/.mozilla directory. And by crap, well, I mean:

  • appreg
  • mozver.dat
  • pluginreg.dat
  • plugins/

cd .mozilla
rm -rf plugins/
rm appreg
rm mozver.dat

cd firefox/
rm -rf pluginreg.dat

Astonishingly, by removing a couple of bits of pelt, the uploads worked for the guys.

Seeing as this is my blog, and people expect me to be miserable, here’s my whine: why the fuck don’t people SEARCH THE FUCKING ARCHIVES on forums before posting a new question? I gave up, and went back to old-fashioned testing.

Oh, and I should probably plug a fairly new site I recently discovered: stackoverflow — about all I can whine about with that is that is uses OpenID…

  • Pages

  • Twitters

    Follow me on Twitter!
  • ORG-GRO

  • ORG

  • Travel