adamblog

my half-arsed attempt at blogging

Follow me on TwitterRSS Feeds

  • Home
  • About

Mailman and Googlemail -> Gmail: A three step approach…

Jun 2nd

Posted by adam in Uncategorized

No comments

I thought other listadmins might be having fun with gmail now being available in the UK (rather than “googlemail”, as it has been for a while (despite ‘gmail’ originally being available, back in the days of invitation only)), and thought I’d share my hackish way around this, so listfolks can post from their gmail.com addresses.

It’s not pretty, but works for me — pre-requisite, Mark’s very useful “non-members” script: http://www.msapiro.net/scripts/non_members

  1. find who you need to work with:

    mkdir ~/tmp/gmail && list_lists -b | while read L; do list_members ${L} | grep googlemail > ~/tmp/gmail/${L}; done
  2. Zap annoucement lists from the files, remove empty files, too.
  3. Let them post!

    /var/lib/mailman/bin$ ls -1 ~/tmp/gmail | while read L; do sed 's/@googlemail.com/@gmail.com/' ~/tmp/gmail/${L} | while read X; do ./non_members --list=${L} --filter=accept --add ${X} --verbose; done; done

(nb: the path (/var/lib/mailman/bin) is from a Debian machine — Mailman installed via packages — and in my case /var/lib/mailman/bin being in
my ${PATH} — so replace those as appropriate in your cases.)

Which seems to have done the trick.

bash, geek, lazy, mailman, scripts, sysadmin

arpinfo

May 20th

Posted by adam in openrights

No comments

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…

Apple, arp, geek, IEEE, linux, MAC, OEM, OUI, script, sysadmin

Firefox Extensions

Jan 10th

Posted by adam in bash

No comments

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:

  • Adblock Plus
  • AutoPager
  • BetterFlickr
  • Better YouTube
  • Delicious Bookmarks
  • DownloadHelper
  • Echofon
  • Extended Statusbar
  • Fast Video Downloader (with SearchMenu)
  • Firebug
  • Firefox (default)
  • Firefox (en-GB)
  • Flagfox
  • Flashblock
  • Gmail Manager
  • Greasefire
  • Greasemonkey
  • Image Download
  • Image Zoom
  • Inline Code Finder for Firebug
  • is.gd Creator
  • JavaScript Options
  • keyconfig
  • Magic’s Video Downloader
  • oldbar
  • Password Exporter
  • Save Image in Folder [sic]
  • ShowIP
  • SkipScreen
  • TinyUrl Creator
  • Ubuntu Firefox Modificiations
  • URL Fixer
  • VMware Remote Console Plug-In
  • Xulrunner (en-GB)
  • YesScript

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

bash, geek, install, new machine, scripts, set-up, tech

Conditional Prompt colo(u)rs

Dec 23rd

Posted by adam in ENV

No comments

I often work on several different machines, for different projects and things. It’s bloody annoying when I get the wrong machine!

I thought. I know what, I’ll make all of these machines use a colored prompt, and make that lot of machines use a different one.

(At this point, I should say that my dotfiles, and a variety of other things are kept in a subversion repo. Most of those bits are my-eyes-only (particularly a lot of the very badly/hastily thrown together scripts), but a few bits I’m gradually releasing.)

After mentioning this on twitter, a couple of people have been interested in how I did it.

The solution is quite easy, work out the hostname, and from that determine the ‘class’ of machine, and then apply some colors. The archwiki was useful in getting out the colors to use; along with underlining, and emboldening (I never use underlining, except in manuscript: ghastly thing that obscures text).

Whilst not perfect (the color parts could be set as a variable, and then passed to the PS1 line; I could have used “else” clauses…), it works. For me, so, erm, here’s my .bashrc — you want from the # work out machine name/domain: line.

A simple switch wotsits in screen(1), and

$ cd ~/pseudohome && svn up

followed with a

$ . .bashrc

is how I deploy (some people have an ’svn up’ in their start-up scripts, I don’t).

Comments here, if you want to.

bash, color, colour, conditional, dotfiles, ENV, hostname, prompt, PS1
«12345»...Last »
  • Feedburner

    • Subscribe: via Email
    •  Subscribe: via RSS

  • Pages

    • About
  • Recent Posts

    • cURL and Google Spreadsheets
    • apt-listbugs and suite-wide scripted upgrades
    • Privacy, Principles, So long for now, London Decompression
  • Twitters

    Loading tweets...
    Follow me on Twitter!
  • Tags

    4od anime bash cartoon chill crap cron dell diff drm drupal drupal for ngos freebsd funfunfun geek helo install lazy load balance MAC making windows usable making windows useful meeting notes microsoft new machine ngos OEM ordering package systems portupgrade rant rants script scripts set-up software updates sysadmin tech vmware websites welcome wget why can't things be *easy* windows xkcd
  • Archives

    • December 2011
    • November 2010
    • September 2010
    • June 2010
    • May 2010
    • January 2010
    • December 2009
    • October 2009
    • February 2009
    • January 2009
    • November 2008
    • October 2008
    • September 2008
    • August 2008
    • July 2008
    • June 2008
    • March 2008
  • ORG-GRO

  • ORG

    • ORG founding1000
  • Travel

  • Blogroll

    • Ben Laurie's Blog
    • Dooooooom!
    • Emma Mulqueeny
    • Ideal Government
    • Light Blue Touchpaper
    • mySociety
    • netsplit
    • no2id newsblog
    • Open Rights Group
  • Meta

    • Log in
    • Entries RSS
    • Comments RSS
    • WordPress.org
Mystique theme by digitalnature | Powered by WordPress
RSS Feeds XHTML 1.1 Top