my half-arsed attempt at blogging
Posts tagged script
Transmission and Renaming Torrents
Sep 14th
I’ve recently (ish) started using transmission as my torrent client; the change-over comes from my switching-things-off approach; instead of keeping ktorrent running on the laptop (and caneing my bandwidth), I can have something mainly work on the NAS which is always on (bar power-cuts/maint).
One of the things that I noticed was the apparent lack of renaming within Transmission (and the curious way earlier tickets are marked as duplicitous of later ones).
So, erm, I’ve written something that works for me. And hacked out the mailer-script to something a little cleaner— at least in my view.
The premise is that you’re using a POSIXish operating system — my NAS runs on Debian — and that all of your exports are within the /nas directory, and your torrents directory is /nas/torrents.
The changes needed are (with transmission not running, apparently) to include /path/to/post-download as the value for
script-torrent-done-filename in settings.json
You’ll need to echo in "/path/to/store/the/completed-file" to a file named as per the torrent (see your incomplete directory for that), but with “.move” appended; the rest should all happen automagically.
You might find it useful to chown the directories you’ll be moving things to that of the user running the transmission processes; I tend to setgid to my GID too.
The other file, mvtor, is one for doing a manual move, specify the torrent as an arguement; e.g., ./mvtor "ubuntu-10.04.1-alternate-i386.iso"
arpinfo
May 20th
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:
#
# $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…
