scripts

various script and utils
git clone git://z3bra.org/scripts
Log | Files | Refs

commit 53ce3809dc8bc525d85a7e726f4733ac19bf6ae1
parent 3ee0bcf3c6a2aeafdfcff348210a805cda968990
Author: z3bra <contactatz3bradotorg>
Date:   Fri Jul 28 23:17:27 +0200

commit this and that

Diffstat:
autoup | 13-------------
bars | 25-------------------------
diffcolor | 10+++++-----
nsroot | 7+++++++
pack | 10++++++----
passmenu | 3+++
prtmk | 2+-
radio | 4++--
randcolor | 2+-
sbar | 5++++-
sct | 0
square | 3+--
sshmenu | 2+-
13 files changed, 31 insertions(+), 55 deletions(-)
diff --git a/autoup b/autoup @@ -1,13 +0,0 @@ -#!/bin/sh - -SSHUSER=egull -SSHKEY=$HOME/.ssh/phobos -SERVER=raw.z3bra.org -WEBROOT=/var/www/raw.z3bra.org -WEBDIR=dev/random - -test -z "$1" && exit 1 || FILENAME=$(basename $1) -scp -i "$SSHKEY" "$1" "${SSHUSER}@${SERVER}:${WEBROOT}/${WEBDIR}/$FILENAME" -echo "http://$SERVER/$WEBDIR/$FILENAME" | xsel -i -$HOME/bin/popup "$FILENAME uploaded!" -rm $1 diff --git a/bars b/bars @@ -1,25 +0,0 @@ -#!/bin/sh - -. $HOME/.wmrc -COL2="%{B#66000000}" -COL1="%{B#ff000000}" - -START=$COL1 -SEP=$COL2 -END=%{B-} -CHAR1=" " -CHAR2=" " -SIZE=20 -export SIZE CHAR1 CHAR2 START END SEP - -mailbar & - -while :; do - mkb $(volume) - sleep 1 -done | lemonbar -d -g 114x7+1306+40 & - -while :; do - mkb $(mpc | sed '2s/.*(\([0-9]\+\)%.*/\1/p;d') - sleep 1 -done | lemonbar -d -g 114x7+1306+60 & diff --git a/diffcolor b/diffcolor @@ -1,7 +1,7 @@ -#!/bin/sed -f -# -# diffcolor: colorize unified diff output +#!/usr/bin/sed -f -s/^+.*$/&/ +s/^[-+]\{3\}.*$/&/ +s/^diff .*$/&/ +s/^@@.*$/&/ s/^-.*$/&/ -s/^@.*$/&/ +s/^+.*$/&/ diff --git a/nsroot b/nsroot @@ -0,0 +1,7 @@ +NSROOT=${1:-/ns/static} + +mountpoint -q $NSROOT/dev || sup mount -t devtmpfs none $NSROOT/dev +mountpoint -q $NSROOT/proc || sup mount -t proc none $NSROOT/proc +mountpoint -q $NSROOT/sys || sup mount -t sysfs none $NSROOT/sys + +sup env -i HOME=/root chroot $NSROOT /bin/mksh -l diff --git a/pack b/pack @@ -3,9 +3,9 @@ SICKKEY=$HOME/.sick.d/$USER.key DIR=$(basename `pwd`) TAG=$(git tag | sed -n '$p' | tr -d a-z) -REPO=/var/www/htdocs/dl.z3bra.org/pack +REPO=$HOME/data/repository -prefix=/usr/local +#prefix=/usr/local CONFIGURE_OPT=" --prefix=${prefix} @@ -24,15 +24,17 @@ case $MK in *) MAKEFLAGS="" ;; esac +mkdir /tmp/rootfs test -f configure && ./configure $CONFIGURE_OPT $MK $MAKEFLAGS PREFIX="$prefix" $MK $MAKEFLAGS DESTDIR=/tmp/rootfs PREFIX="$prefix" MANDIR=/share/man install ( cd /tmp/rootfs mkdir -p $REPO - tar cvj * | sick -s -f ${SICKKEY} > $REPO/${PKG}#${VER}.tar.bz2 + tar cvj * | sick -asf ${SICKKEY} > $REPO/${PKG}@${VER}.tbz ) rm -rf /tmp/rootfs echo -ls $REPO/${PKG}#${VER}.tar.bz2 +#ls $REPO/${PKG}@${VER}.tbz +repogen $REPO diff --git a/passmenu b/passmenu @@ -0,0 +1,3 @@ +#!/bin/sh +pass=$(find $HOME/.pass -type f | sed "s,$HOME/.pass/,,;s/.gpg//" | dmenu -l 32) +test -n "$pass" && tpm $pass | xsel diff --git a/prtmk b/prtmk @@ -4,7 +4,7 @@ # Create a Pkgfile from simple templates and user input PKGFILE=$HOME/ports/templates/Pkgfile -PORTDIR=$HOME/ports/crux +PORTDIR=$HOME/ports/z3bra EDITOR=${EDITOR:-vim} daddy="z3bra <willy at mailoo dot org>" diff --git a/radio b/radio @@ -1,6 +1,6 @@ #!/bin/sh STREAM=${1:-http://radio.2f30.org:8000/live.mp3} +STREAM=${1:-http://radio.z3bra.org:8000} -#curl -sL $STREAM | play -q -t mp3 - #2>/dev/null -mplayer -nocache ${STREAM} +curl -sL $STREAM | play - diff --git a/randcolor b/randcolor @@ -2,5 +2,5 @@ for i in `seq 0 15`; do c=$(tr -cd "0-9a-f" < /dev/urandom | fold -bw 6 | sed 1q) - printf "*color%d: #%s\n" "$i" "$c" + printf "#%s\n" "$c" done diff --git a/sbar b/sbar @@ -3,7 +3,10 @@ swidth=$(wattr w `lsw -r`) geom="${swidth}x20" -LEMON_FLAVOR="-d -g $geom" +BG=$(sed -n 2p < $HOME/.colors) +FG=$(tac < $HOME/.colors | sed -n 2p) + +LEMON_FLAVOR="-dbg $geom -B${BG} -F${FG}" clock() { printf 'TIME %%{R} %s %%{R}' "$(date +%H:%M)" diff --git a/sct b/sct Binary files differ. diff --git a/square b/square @@ -3,9 +3,8 @@ CHAR=${1:-XXXX} echo -echo #for i in `seq 0 7`; do printf " [0;3${i}m${CHAR}"; done; echo #for i in `seq 0 7`; do printf " [1;3${i}m${CHAR}"; done; echo for i in `seq 0 7`; do - printf " [0;3${i}m${CHAR}[1;3${i}m${CHAR}\n" + printf " [0;3${i}m${CHAR} [1;3${i}m${CHAR}\n" done diff --git a/sshmenu b/sshmenu @@ -6,4 +6,4 @@ gethosts() { TARGET=$(gethosts | pick) -test -n "$TARGET" && ssh $TARGET +test -n "$TARGET" && exec ssh $TARGET