scripts

misc scripts and tools
git clone git://git.2f30.org/scripts.git
Log | Files | Refs

commit ba5fac9cf1ca63b112973fabbdda405f26c013e9
parent 6e5516496ce07ab96faf6c023ca3cb6825fe0483
Author: lostd <lostd@2f30.org>
Date:   Fri Aug 23 15:31:12 +0300

mostly style fixes, header comments and dependencies

Diffstat:
burndisc | 3+++
mycosmos | 3+++
phonedump | 8+++++---
playvid | 9++++++++-
sprunge | 2++
topdf | 3+++
unpk | 11+++++++----
7 files changed, 31 insertions(+), 8 deletions(-)
diff --git a/burndisc b/burndisc @@ -1,5 +1,8 @@ #!/bin/sh +# fairly portable on the fly data burning script +# depends: mkisofs cdrecord + # try common names for cdrom devs for D in $CDROM /dev/cdrom /dev/cd0c /dev/sr0; do if test -b $D; then DEV=$D && break; fi diff --git a/mycosmos b/mycosmos @@ -1,5 +1,8 @@ #!/bin/sh +# send sms messages using the mail.mycosmos.gr service +# depends: curl + if test -z "$4" then echo usage: $0 user pass target message diff --git a/phonedump b/phonedump @@ -1,6 +1,8 @@ #!/bin/sh # dump contacts from mobile phone using infrared +# depends: birda gnokii + # XXX: infrared does not work after suspend # gnokiirc: # [global] @@ -8,11 +10,11 @@ # connection = serial # model = AT -TMP=$(mktemp /tmp/phone.XXXXXXXXXX) +TMP=$(mktemp) sudo ircomm -d /dev/cua01 -y /dev/ptypv -v2 2>&1 | tee $TMP & sleep 7 -if [ -n "$(grep discover $TMP)" ] -then gnokii --getphonebook ME 1 end --raw | tee phonebook$(date "+%Y%m%d").csv +if test -n "$(grep discover $TMP)" +then gnokii --getphonebook SM 1 end --raw | tee phonebook.csv fi sudo pkill ircomm rm $TMP diff --git a/playvid b/playvid @@ -1,5 +1,12 @@ #!/bin/sh +# play online streaming videos +# depends: get_flash_videos mplayer + +if test -z "$1"; then + echo usage: $(basename $0) url && exit 1 +fi + C="^Content-Location: " -V=$(get_flash_videos -r high -i "$1" | grep "$C" | sed "s/$C//") +V=$(get_flash_videos -r medium -i "$1" | grep "$C" | sed "s/$C//") mplayer -really-quiet "$V" diff --git a/sprunge b/sprunge @@ -1,5 +1,7 @@ #!/bin/sh +# upload text to sprunge.us + SPRUNGE() { curl -F 'sprunge=<-' http://sprunge.us } diff --git a/topdf b/topdf @@ -1,5 +1,8 @@ #!/bin/sh +# convert documents to pdf using the doc2pdf.net service +# depends: curl + if test -z "$1"; then echo usage: $(basename $0) document && exit 1 fi diff --git a/unpk b/unpk @@ -1,10 +1,13 @@ #!/bin/sh -if [ -z "$1" ]; then - echo "Usage: $(basename $0) archive ..."; exit 1 +# extract archives +# depends: unzip unace unrar 7z + +if test -z "$1"; then + echo "usage: $(basename $0) archive ..." && exit 1 fi -while [ -n "$1" ]; do +while test -n "$1"; do case "$1" in *.tar.gz | *.tgz) tar xzf "$1" @@ -51,7 +54,7 @@ while [ -n "$1" ]; do shift ;; *) - echo "File format not supported: $1" + echo "file format not supported: $1" shift ;; esac