Posts tagged scripts

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

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.

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.

Dell Order Checking: via cron

Ok. So let’s start off with a fairly obvious statement. I’m indolent. And I can write scripts. This is a dangerous, nay, perilous pairing…

So, with this existing laptop really getting on my nerves, and the lack of email coming from Dell regarding the new ‘un I ordered, I thought I’d tidy up some diff-scripts used $ELSEWHERE, and re-appropriate for quick-and-dirty order-tracking.

Fairly simple: fetch a web-page, in this case the order page (which is accesssible with the order number & email address used for the order), compare it with an existing copy (should it exist), and mail specified addresses when/if there are changes. Do this whenever (@hourly works fine for me), and forget about website visiting.

Bingo.

So, erm, just in case anyone else wants it (yes, the licensing blurb is probably about the same length as the code itself, i dunno why I bother, but maybe someone’s got some hints/tips/comments…), ‘dell-order-status‘ (it’s a tidied up version of the one I’m actually using, so i may need a nudge to update the web-version if I change the one in use)

  • Pages

  • Twitters

    Follow me on Twitter!
  • ORG-GRO

  • ORG

  • Travel