Permalink
Browse files

Added ~/bin scripts

Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
  • Loading branch information...
1 parent 587c12b commit 99062309bc45e453c9ad9a3c2704b7dcdbe812e8 @trofi committed Oct 15, 2011
Showing with 170 additions and 0 deletions.
  1. BIN bin/done.wav
  2. +4 −0 bin/git-cvsci.sh
  3. +5 −0 bin/gitify
  4. +4 −0 bin/mk_iso
  5. +4 −0 bin/mk_udf
  6. +13 −0 bin/pb
  7. +98 −0 bin/player-status-entry.py
  8. +7 −0 bin/player-status.sh
  9. +3 −0 bin/rdp.sh
  10. +3 −0 bin/s2ram.sh
  11. +6 −0 bin/screenshot.sh
  12. +8 −0 bin/up_world
  13. +15 −0 bin/vg
View
Binary file not shown.
View
@@ -0,0 +1,4 @@
+#!/bin/sh -e
+
+git add .
+git commit -a -s -m "Synced with CVS tree ($(date +%F))"
View
@@ -0,0 +1,5 @@
+#!/bin/sh -e
+
+git init
+git add .
+git commit -a -s -m "initial $(pwd)"
View
@@ -0,0 +1,4 @@
+#!/bin/sh
+
+FILE="image-$(date "+%F-%H-%M-%S").iso"
+genisoimage -multi -r -J -o "$FILE" $@
View
@@ -0,0 +1,4 @@
+#!/bin/sh
+
+FILE="image-$(date "+%F-%H-%M-%S").udf"
+genisoimage -r -udf -o "$FILE" "$@"
View
13 bin/pb
@@ -0,0 +1,13 @@
+#!/usr/bin/perl
+
+my $i = 0;
+while (read STDIN, my $ch, 1)
+{
+ printf "%02X ", ord($ch);
+ if (++$i == 16)
+ {
+ $i = 0;
+ printf "\n";
+ }
+}
+printf "\n";
View
@@ -0,0 +1,98 @@
+#!/usr/bin/python
+
+import sys
+
+if sys.argv[1] in ['irc', 'xmobar', 'none', 'tty']:
+ pass
+else:
+ print "ERROR: please choose available flavour"
+ exit(1)
+
+flavour = sys.argv[1]
+
+def paint(color, text):
+ if flavour == 'xmobar':
+ return "<fc=%s>%s</fc>" % (color, text)
+ elif flavour == 'irc':
+ colors = { 'green' : 3
+ , 'brightred' : 4
+ , 'red' : 5
+ , 'yellow' : 7
+ , 'brightyellow' : 8
+ , 'cyan' : 10
+ , 'brightcyan' : 11
+ , 'gray' : 14
+ , 'white' : 15
+ }
+ return "\x03%02d%s" % (colors.get(color, 15), text)
+ elif flavour == 'tty':
+ colors = { 'green' : 32
+ , 'brightred' : 31
+ , 'red' : 31
+ , 'yellow' : 33
+ , 'brightyellow' : 33
+ , 'cyan' : 36
+ , 'brightcyan' : 36
+ , 'gray' : 30
+ , 'white' : 29
+ }
+ return "\033[01;%02dm%s\033[00m" % (colors.get(color, 15), text)
+ elif flavour == 'none':
+ return text
+ else:
+ print "ERROR: bad flavour: %s" % flavour
+ exit(1)
+
+import locale
+
+locale.setlocale(locale.LC_ALL, '')
+locale_enc = locale.nl_langinfo(locale.CODESET)
+
+def show(s):
+ print(s.encode(locale_enc
+ , errors='backslashreplace'
+ #, errors='replace'
+ #, errors='xmlcharrefreplace'
+ )
+ )
+
+import xmmsclient
+
+xc = xmmsclient.XMMSSync('xmobar-tray')
+xc.connect()
+
+mid = xc.playback_current_id()
+mdata = xc.medialib_get_info(mid)
+
+# set segmet more prioritized
+mdata.sources = [ 'client/xmobar-tray'
+ , 'plugin/segment'
+ # , 'plugin/mad' # over id3v2
+ , 'plugin/id3v2' # over id3v1
+ , 'server'
+ , 'plugin/*'
+ , 'client/*'
+ , '*']
+
+def pp_duration(milliseconds):
+ result = ""
+ seconds = milliseconds / 1000
+ minutes = seconds / 60
+ hours = minutes / 60
+ days = hours / 24
+ started_output = False
+ if days > 0 or started_output: result += ("%dd " % days); started_output = True
+ if hours > 0 or started_output: result += ("%dh " % (hours % 24)); started_output = True
+ if minutes > 0 or started_output: result += ("%dm " % (minutes % 60)); started_output = True
+ if seconds > 0 or started_output: result += ("%ds" % (seconds % 60)); started_output = True
+ return result
+
+show(' '.join(map( lambda(c,t): paint(c,t)
+ , [ ('cyan', "<%s>" % mdata.get('artist', '?'))
+ #, ('green', "%s" % '-')
+ , ('yellow', "[%s]" % mdata.get('album', '?'))
+ #, ('green', "%s" % '-')
+ , ('red', "%s" % mdata.get('title', '?'))
+ , ('cyan', "[%dkbps]" % (mdata.get('bitrate', 0) / 1000))
+ , ('green', "%s" % pp_duration(mdata.get('duration', 0)))
+ ])))
View
@@ -0,0 +1,7 @@
+#!/bin/sh
+
+while :
+do
+ $HOME/bin/player-status-entry.py xmobar 2>&1 || echo "<fc=red>[error]</fc>"
+ sleep 4
+done
View
@@ -0,0 +1,3 @@
+#!/bin/sh -e
+
+/usr/bin/rdesktop -k en-gb -g1280x1024 -K "$@"
View
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+sudo sh -c "echo mem > /sys/power/state"
View
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+DIR=~/archive/shots
+FILE="$(date "+%F-%H-%M-%S").png"
+import -window root "$DIR/$FILE"
+aplay ~/bin/done.wav
View
@@ -0,0 +1,8 @@
+#!/bin/sh -e
+
+sudo cave resolve \
+ --execute \
+ --complete \
+ --continue-on-failure if-satisfied \
+ world \
+ "$@"
View
15 bin/vg
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+G_SLICE=always-malloc \
+G_DEBUG=gc-friendly \
+\
+GLIBCXX_FORCE_NEW=1 \
+valgrind \
+ --track-origins=yes \
+ --num-callers=50 \
+ --track-fds=yes \
+ --leak-check=full \
+ --show-reachable=yes \
+ --malloc-fill=0xa1 \
+ --free-fill=0xa1 \
+ "$@"

0 comments on commit 9906230

Please sign in to comment.