my half-arsed attempt at blogging
Posts tagged scripts
Mailman and Googlemail -> Gmail: A three step approach…
Jun 2nd
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
- 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
- Zap annoucement lists from the files, remove empty files, too.
- 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
Jan 10th
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
Dell Order Checking: via cron
Jul 31st
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)
