tMany changes, but yet nothing interresting - scripts - various script and utils
(HTM) git clone git://z3bra.org/scripts
(DIR) Log
(DIR) Files
(DIR) Refs
---
(DIR) commit df55668cf1e01a503897f84b9544fbb861206050
(DIR) parent d2bab9ab415800907c73b356ae858041b7c3cc42
(HTM) Author: z3bra <willyatmailoodotorg>
Date: Mon, 1 Feb 2016 19:11:17 +0100
Many changes, but yet nothing interresting
Diffstat:
M autoup | 2 +-
M img | 2 --
M log | 1 +
M mailbar | 3 ++-
M maillist | 13 ++++++-------
M menu | 2 +-
M prtmk | 4 ++--
M prtup | 2 +-
M uplay | 12 +++++++++++-
M ushot | 6 ++----
10 files changed, 27 insertions(+), 20 deletions(-)
---
(DIR) diff --git a/autoup b/autoup
t@@ -3,7 +3,7 @@
SSHUSER=egull
SSHKEY=$HOME/.ssh/phobos
SERVER=raw.z3bra.org
-WEBROOT=/var/http/raw.z3bra.org
+WEBROOT=/var/www/raw.z3bra.org
WEBDIR=dev/random
test -z "$1" && exit 1 || FILENAME=$(basename $1)
(DIR) diff --git a/img b/img
t@@ -1,4 +1,2 @@
#!/bin/sh
-
-IMAGE=/tmp/`basename $1`
curl -s "$1" | 2ff | lel -a -w 640 -h 480
(DIR) diff --git a/log b/log
t@@ -3,5 +3,6 @@
NOTE=${1:-random}
LOGDIR=$HOME/data/notes
+test $# -lt 1 && ls -1 $LOGDIR && exit 0
test -d $LOGDIR || mkdir -p $LOGDIR
ts >> $LOGDIR/$NOTE
\ No newline at end of file
(DIR) diff --git a/mailbar b/mailbar
t@@ -3,7 +3,7 @@
. $HOME/.theme
MAILDIR=$HOME/data/mail
-MAILBOX='inbox crux lobsters'
+MAILBOX='inbox crux lobsters pcc'
COL1="%{F$HL}"
COL2="%{F$FG}"
t@@ -14,6 +14,7 @@ mailcount() {
crux) CHAR=''; DIR=$MAILDIR/lists/$1/new ;;
inbox) CHAR=''; DIR=$MAILDIR/$1/new ;;
lobsters) CHAR=''; DIR=$MAILDIR/lists/$1/new ;;
+ pcc) CHAR='©'; DIR=$MAILDIR/lists/$1/new ;;
*) return ;;
esac
(DIR) diff --git a/maillist b/maillist
t@@ -2,16 +2,15 @@
INBOX=$HOME/data/mail/inbox
MBASE=$HOME/data/mail
-LISTS='crux lobsters'
+LISTS='crux lobsters pcc'
crawl() {
+ # uses the X-BeenThere header set by maillist to check from
+ # which list a mail comes from
case $1 in
- crux)
- REGEX='^(to|cc):.*crux@lists.crux.nu'
- ;;
- lobsters)
- REGEX='^to:.*lobsters-[a-zA-Z0-9]*@lobste.rs'
- ;;
+ crux) REGEX='^X-BeenThere:.*crux@lists.crux.nu' ;;
+ lobsters) REGEX='^X-BeenThere:.*lobsters-[a-zA-Z0-9]*@lobste.rs' ;;
+ pcc) REGEX='^X-BeenThere:.*pcc@lists.ludd.ltu.se' ;;
esac
find $INBOX -type f -exec grep -liP "$REGEX" {} +
(DIR) diff --git a/menu b/menu
t@@ -1,7 +1,7 @@
#!/bin/bash
thingmenu -g 140x225 \
"chat on irc" "st -e sh -c 'dm irc ssh wizards'" \
- "run around" "defrag" \
+ "run around" "quake3e +set fs_game defrag" \
"frag people" "quake3e" \
"play a game" "steam" \
"pop a term" "st" \
(DIR) diff --git a/prtmk b/prtmk
t@@ -3,8 +3,8 @@
# z3bra - (c) wtfpl 2014
# Create a Pkgfile from simple templates and user input
-PKGFILE=$HOME/crux/templates/Pkgfile
-PORTDIR=$HOME/crux/ports
+PKGFILE=$HOME/ports/templates/Pkgfile
+PORTDIR=$HOME/ports/crux
EDITOR=${EDITOR:-vim}
daddy="z3bra <willy at mailoo dot org>"
(DIR) diff --git a/prtup b/prtup
t@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
#
# z3bra - (c) wtfpl 2014
# Update git hashes in a Pkgfile
(DIR) diff --git a/uplay b/uplay
t@@ -1,4 +1,13 @@
#!/bin/sh
+#
+# and google keeps changing its API to fuck us up...
#curl "$(youtube-dl -g $*)" | mplayer -cache 1024 -
-mplayer -really-quiet -cache 1024 "$(youtube-dl -g $*)"
+#mplayer -really-quiet -cache 1024 "$(youtube-dl -g $* | head -n1)"
+
+# audio only, video only, both
+case $1 in
+ -a) shift 1; mplayer -quiet -cache 1024 "$(youtube-dl -g $* | sed -n '$p')" ;;
+ -v) shift 1; mplayer -really-quiet -cache 1024 "$(youtube-dl -g $* | sed -n '1p')" ;;
+ *) youtube-dl "$*" -o - | mplayer -really-quiet -cache 1024 - ;;
+esac
+\ No newline at end of file
(DIR) diff --git a/ushot b/ushot
t@@ -2,7 +2,5 @@
FILE=${1:-/dev/null}
-xscreenshot | iffpng | tee $FILE | imgurup
-
-sed 1q ~/.imgurlog | xsel -pi
-test -n "$1" && meh $1
+xscreenshot | ff2png | tee $FILE | imgurup | tr -d'\n' | xsel -i
+img $(xsel -o)