summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkrebs <krebs@fuerkrebs>2011-10-13 13:20:02 -0400
committerkrebs <krebs@fuerkrebs>2011-10-13 13:20:02 -0400
commit6caf0d1c502ba9eb6d41aa9a80cb8a350164846d (patch)
tree28237066c93656fe75b2fcc7fb1eec0a2b800888
parentfa7213811c2c77b9f2097c11c8a072265d8a3ac2 (diff)
parent1cff2a9d548336ddcd8a2d732ed2cd348c8e6b79 (diff)
Merge branch 'master' of github.com:krebscode/painload
-rwxr-xr-xKübelwagen/playmobil12
-rwxr-xr-xReaktor/index7
-rwxr-xr-xbridge/bin/bridge11
-rwxr-xr-xbridge/lib/bridge/bin/attach7
-rwxr-xr-xbridge/lib/bridge/bin/create9
-rwxr-xr-xbridge/lib/bridge/bin/destroy9
-rwxr-xr-xbridge/lib/bridge/bin/list7
-rwxr-xr-xbridge/lib/bridge/bin/paste23
-rw-r--r--bridge/share/doc/bridge/README.md12
-rwxr-xr-xcrypto/bin/ukrepl11
-rwxr-xr-xpunani/bin/punani39
-rw-r--r--retiolum/Makefile4
-rwxr-xr-xretiolum/bin/supernode-update-hosts-and-hup44
-rw-r--r--retiolum/hosts/ach11
-rw-r--r--retiolum/hosts/kremu10
-rw-r--r--retiolum/hosts/oxberg11
-rwxr-xr-xretiolum/scripts/tinc_setup/install.sh6
-rw-r--r--retiolum/scripts/tinc_setup/write_channel.py2
-rw-r--r--streams/stream.db1
19 files changed, 202 insertions, 34 deletions
diff --git a/Kübelwagen/playmobil b/Kübelwagen/playmobil
new file mode 100755
index 00000000..51ed70d6
--- /dev/null
+++ b/Kübelwagen/playmobil
@@ -0,0 +1,12 @@
+#! /bin/sh
+file=`mktemp`
+trap "rm -f $file" EXIT INT TERM
+
+gcc -xc -lm -o $file - <<EOF
+#include<math.h>
+main(t) {
+ for (t=${2-0};;++t) putchar($1);
+}
+EOF
+
+$file | aplay
diff --git a/Reaktor/index b/Reaktor/index
index 05827373..ac647ca3 100755
--- a/Reaktor/index
+++ b/Reaktor/index
@@ -4,11 +4,4 @@ set -euf
# cd //Reaktor
cd $(dirname $(readlink -f $0))
-# redirect stdout [and stderr] to syslog
-stdout=`mktemp -u`
-mkfifo $stdout
-trap "rm -vf $stdout" EXIT INT
-exec 1<>$stdout 2>&1
-logger -t Reaktor -f $stdout &
-
exec IRC/index
diff --git a/bridge/bin/bridge b/bridge/bin/bridge
index 6ae4ab11..33cf4577 100755
--- a/bridge/bin/bridge
+++ b/bridge/bin/bridge
@@ -1,5 +1,12 @@
#! /bin/sh
+#
+# Interface to the bridge commands.
+#
+# See commands below $bindir
+#
set -euf
-command="$1"; shift
+
bindir="$(dirname $(readlink -f "$0"))/../lib/bridge/bin"
-exec "$bindir/$command" "$@"
+cmd="$bindir/$1"; shift
+
+exec "$cmd" "$@"
diff --git a/bridge/lib/bridge/bin/attach b/bridge/lib/bridge/bin/attach
index 2edefbe3..f456f8a6 100755
--- a/bridge/lib/bridge/bin/attach
+++ b/bridge/lib/bridge/bin/attach
@@ -1,3 +1,10 @@
#! /bin/sh
+#
+# Attach current tty to a session.
+#
+## SYNOPSIS
+#
+# bridge attach SESSION
+#
set -euf
exec tmux -L bridge attach-session -t "$1"
diff --git a/bridge/lib/bridge/bin/create b/bridge/lib/bridge/bin/create
index 31b2f3d8..2df8b214 100755
--- a/bridge/lib/bridge/bin/create
+++ b/bridge/lib/bridge/bin/create
@@ -1,4 +1,13 @@
#! /bin/sh
+#
+# Create a new session.
+#
+## SYNOPSIS
+#
+# bridge create SESSION [COMMAND [ARGS ...]]
+#
+# COMMAND defaults to $SHELL (by implication / tmux)
+#
set -euf
target="$1"; shift
tmux -L bridge new-session -d -s "$target" "$@"
diff --git a/bridge/lib/bridge/bin/destroy b/bridge/lib/bridge/bin/destroy
index f625d138..dffdbd8a 100755
--- a/bridge/lib/bridge/bin/destroy
+++ b/bridge/lib/bridge/bin/destroy
@@ -1,3 +1,12 @@
#! /bin/sh
+#
+# Destroy a session.
+#
+## SYNOPSIS
+#
+# bridge destroy SESSION
+#
+# Note that this may destroy similar named sessions (by implication / tmux)
+#
set -euf
tmux -L bridge kill-session -t "$1"
diff --git a/bridge/lib/bridge/bin/list b/bridge/lib/bridge/bin/list
index 8b164516..0b767a9b 100755
--- a/bridge/lib/bridge/bin/list
+++ b/bridge/lib/bridge/bin/list
@@ -1,3 +1,10 @@
#! /bin/sh
+#
+# Write a list of all session names to stdout.
+#
+## SYNOPSIS
+#
+# bridge list
+#
set -euf
exec tmux -L bridge list-sessions | cut -d: -f1
diff --git a/bridge/lib/bridge/bin/paste b/bridge/lib/bridge/bin/paste
index d5a768ad..d3ed1fc5 100755
--- a/bridge/lib/bridge/bin/paste
+++ b/bridge/lib/bridge/bin/paste
@@ -1,17 +1,30 @@
#! /bin/sh
+#
+# Paste some data to a session.
+#
+## SYNOPSIS
+#
+# bridge paste SESSION DATA...
+# bridge paste SESSION < DATA
+#
set -euf
+
target="$1"; shift
+
+# paste args or stdin
if test $# -gt 0; then
tmux -L bridge set-buffer -b 0 "$*"
else
+ # use aux file instead of direct stdin for Vim and when used from $SHELL
if test -n "${VIMRUNTIME-}" || tty >/dev/null; then
- temp=`mktemp`
- trap "rm -f $temp" EXIT INT TERM
- cat>$temp
+ path=`mktemp`
+ trap "rm -f $path" EXIT INT TERM
+ cat>$path
else
- temp=-
+ path=-
fi
- tmux -L bridge load-buffer -b 0 $temp
+ tmux -L bridge load-buffer -b 0 $path
fi
+
tmux -L bridge paste-buffer -b 0 -t "$target"
tmux -L bridge set-buffer -b 0 READY.
diff --git a/bridge/share/doc/bridge/README.md b/bridge/share/doc/bridge/README.md
index 07f5eb6d..77c62374 100644
--- a/bridge/share/doc/bridge/README.md
+++ b/bridge/share/doc/bridge/README.md
@@ -1,5 +1,3 @@
-# //bridge
-
Bridge is a tool to connect your favourite editor and interpreter (or
similar) for maximum profit.
@@ -20,6 +18,13 @@ similar) for maximum profit.
# mark that stuff
# press return
+ # paste some stuff into the session
+ bridge paste my_fancy_interpreter '1 + 2 + 4^M'
+ # (note that ^M is carriage return obtained by pressing ^V^M AKA C-V C-M)
+
+ # or use bridge as a sink in your pipeline
+ echo 2^20 | bridge paste my_fancy_interpreter
+
# you can use tab-completion everywhere (if installed)
@@ -49,5 +54,6 @@ Hint #3: you could also use ~/.profile or similar
## install bridge into some usr-like hierarchy [advanced]
- tar -C //bridge -c . | tar --exclude=./README.md -C ~/opt -v -x
+ tar -C //bridge -c . |
+ tar --exclude=./README.md -C ~/opt -v --keep-newer-files -x
diff --git a/crypto/bin/ukrepl b/crypto/bin/ukrepl
index 2dfaabc4..9b084027 100755
--- a/crypto/bin/ukrepl
+++ b/crypto/bin/ukrepl
@@ -32,7 +32,7 @@ cyrillic_dict = {
}
def cyrillic_replace(char): #c
- return cyrillic_dict.get(char,unicode(char))
+ return cyrillic_dict.get(char,char)
historic_latin_dict = {
'B' : u'Ɓ',
'b' : u'ƅ',
@@ -45,7 +45,7 @@ historic_latin_dict = {
'5' : 'Ƽ'
}
def historic_latin(char): #H
- return historic_latin_dict.get(char,unicode(char))
+ return historic_latin_dict.get(char,char)
punctuation_dict = {
'!' : u'ǃ',
'\'': u'’',
@@ -53,6 +53,11 @@ punctuation_dict = {
'(' : u'⟨',
')' : u'⟩',
':' : u'ː',
+ ' ' : u' ',
+ # all different spaces, made for perfect trolling
+ #' ' : u' ',
+ #' ' : u' ',
+ #' ' : u'⁠',
#'-' : u'‒',
#'-' : u'—',
#'-' : u'―',
@@ -66,7 +71,7 @@ punctuation_dict = {
}
def punctuation(char): #p
- return punctuation_dict.get(char,unicode(char))
+ return punctuation_dict.get(char,char)
def helpme():
print "usage %s [modes]" % sys.argv[0]
print "modes:"
diff --git a/punani/bin/punani b/punani/bin/punani
index 954eca43..058331f1 100755
--- a/punani/bin/punani
+++ b/punani/bin/punani
@@ -29,6 +29,7 @@ guess_system()
fi
}
+
arch_aur_helper()
{
# pacman is the last fallback helper
@@ -43,6 +44,7 @@ arch_aur_helper()
echo "!! no helper found, this should never happen(tm)."
return 1
}
+
handle_system () {
case "$system" in
(*arch-like*)
@@ -57,7 +59,7 @@ handle_system () {
# get dependencies :
# we need pkgfile
if ! [ `which pkgfile` ] ; then
- pacman -S --noconfirm pkgtools
+ pacman -S --needed --noconfirm pkgtools
pkgfile -u
fi
punani_Scientist_update() {
@@ -65,7 +67,7 @@ handle_system () {
pkgtool -u
}
punani_Scientist_search() {
- pkgfile $1
+ pkgfile -s -b $1
if [ "${hard-}" ] ; then
mgr=`arch_aur_helper`
$mgr -Ss $1
@@ -79,9 +81,17 @@ handle_system () {
#
# when trying harder it tries to load the package with the given name directly via yaourt
echo "** trying to find package with given file"
- if pacman -S `pkgfile $1` ; then
- echo "++ finished"
- exit 0
+ pkgs=$(pkgfile -s -b -r $1 | tr "\n" "|" )
+ if [ "$pkgs" ];then
+ echo "** found one or more packages matching, skip the ones you do not need!"
+ OLDIFS=$IFS
+ IFS='|'
+ for to_install in $pkgs;do
+ if pacman -S --needed "$to_install"; then
+ echo "++ finished"
+ fi
+ done
+ IFS=$OLDIFS
else
echo "!! nothing found in base repos"
if [ "${hard-}" ] ; then
@@ -116,9 +126,9 @@ handle_system () {
# apt-get () { echo $@; }
#fi
if ! which apt-file; then
- echo "installing dependencies: apt-file"
+ echo "** installing dependencies: apt-file"
apt-get install --yes apt-file
- echo "update the apt-file tool"
+ echo "** update the apt-file tool"
apt-file update
fi
punani_Scientist_update() {
@@ -127,15 +137,24 @@ handle_system () {
}
punani_Scientist_search() {
- apt-file search -l -x /$1\$ && exit 0
+ apt-file search -l -x $1\$ && exit 0
if [ "${hard-}" ] ; then
apt-cache search $1
fi
}
punani_Engineer_insert() {
echo "trying to install $1"
- if apt-get install `apt-file search -l -x /$1\$`;then
- echo "++ finished"
+ pkgs=$(apt-file search -l -x $1\$ | tr "\n" "|" )
+ if [ "$pkgs" ];then
+ echo "** found one or more packages matching, skip the ones you do not need!"
+ OLDIFS=$IFS
+ IFS='|'
+ for to_install in $pkgs;do
+ if apt-get install $to_install;then
+ echo "++ finished"
+ fi
+ done
+ IFS=$OLDIFS
else
if [ "${hard-}" ] ; then
echo "** trying harder"
diff --git a/retiolum/Makefile b/retiolum/Makefile
index c80a6faa..83c4ac12 100644
--- a/retiolum/Makefile
+++ b/retiolum/Makefile
@@ -11,7 +11,7 @@ hosts:
bin/update-retiolum-hosts || true
install: update
- @#punani -Ei tinc python
+ punani -Eih tinc /usr/bin/python /usr/bin/python2
@# will not run automatically
scripts/tinc_setup/install.sh
scripts/autostart/create-startup.sh
@@ -21,6 +21,8 @@ update: hosts
bin/update_tinc_hosts "create magic" || true
@echo adding hosts
bin/update_tinc_hosts restart
+ @echo reloading tincd
+ pkill -HUP tincd || true
arch-install: update install arch-autostart autohosts
diff --git a/retiolum/bin/supernode-update-hosts-and-hup b/retiolum/bin/supernode-update-hosts-and-hup
new file mode 100755
index 00000000..b6b03c69
--- /dev/null
+++ b/retiolum/bin/supernode-update-hosts-and-hup
@@ -0,0 +1,44 @@
+#! /bin/sh
+#
+# @oxberg we do put this into crontab:
+# * * * * * /supernode-update-hosts-and-hup
+#
+set -euf
+
+cd /etc/tinc/retiolum/hosts
+
+temp1="`mktemp`"
+temp2="`mktemp`"
+trap "rm -f $temp1 $temp2" EXIT INT TERM
+
+old_commit="`cat .commit 2>/dev/null || :`"
+
+_hrefs() {
+ sed -n 's/href="\([^"]\+\)"/\n&\n/gp' |
+ sed -n 's/^href="\([^"]\+\)"$/\1/p'; }
+
+if curl -fsS \
+ "https://github.com/krebscode/painload/tree/master/retiolum/hosts" |
+ _hrefs |
+ grep '^/krebscode/painload/blob/' |
+ grep -v "/blob/$old_commit/" >$temp1
+then
+
+ new_commit=`sed 's|^/krebscode/painload/blob/\([^/]*\)/.*|\1|;q' $temp1`
+
+ sed '
+ s|^/krebscode/painload/blob/[^/]*/retiolum/hosts/\([^/]*\)$|\1|
+ ' $temp1 > $temp2
+
+ xargs rm -v -f <$temp2
+
+ sed "
+ s|^.*$|https://raw.github.com/krebscode/painload/$new_commit/retiolum/hosts/&|
+ " $temp2 > $temp1
+
+ wget -qi- < $temp1
+
+ echo $new_commit > .commit
+
+ pkill -HUP tincd
+fi
diff --git a/retiolum/hosts/ach b/retiolum/hosts/ach
new file mode 100644
index 00000000..58e43a0a
--- /dev/null
+++ b/retiolum/hosts/ach
@@ -0,0 +1,11 @@
+Subnet = 10.7.7.67
+Subnet = 42:c50f:d371:cf01:8cf0:0b77:bb01:5013/128
+
+-----BEGIN RSA PUBLIC KEY-----
+MIIBCgKCAQEA2d5RaWiFmkuw0UhPsQCrFBNNgBwzHQMDO69rU6XlH8VSGI8HTPuI
+v5Jjyhrf2p/ktLAnafBUHO32bNRu/9lbM0rjPZna5t1MjJpUaja6yF5TzdAQ4YMD
+KTkGqjI9QEuGBPixFNRq+P9QK5FLx1/wtF0ZE1CYS+A6iwQ9S+IPCIYYswUmhYQF
+ik2IaixG6EkZj2NSJqvDF4HDJz8lnwQIQfFqZ8WdP2MtMUng09PdjQHss0jqRbPO
+4J7UpDkrXSABjDnEYk4CKH0YhLGPB3VDYeD4rQjKuDTYOWXQ8OYIyPVucKe2RABc
+dJF6MQ+z+2m1vMqEYPBOH69Ggncq9GQ4xwIDAQAB
+-----END RSA PUBLIC KEY-----
diff --git a/retiolum/hosts/kremu b/retiolum/hosts/kremu
new file mode 100644
index 00000000..06df489f
--- /dev/null
+++ b/retiolum/hosts/kremu
@@ -0,0 +1,10 @@
+Subnet = 42:88ec:8968:cc6b:978a:68b7:1004:fc8a/128
+Subnet = 10.7.7.192
+-----BEGIN RSA PUBLIC KEY-----
+MIIBCgKCAQEAsdjqCyLvGfkIsawGji1CIIxGaKKdFhKJcfFK8FWiyQdgeNK/9UAh
+XsJYkSHVcXqHAorP1QAvk5fIiSEEoSwoChyecqpNOREOnN8+N8RVrs0QIwL0mwa0
+9H4HDcpt8O8J0mpM8z8pb7vhDk261oMchG52TVYX4cuEgpEiyJtij27UIfOeVY8g
+8kuJQG+9X7WNGMOt2Y8A7pXFf/+8qdwpOq5C0SIRPR5WplBeeF3BepzmUeq24XOE
+cdF/ggYeU8hSYzr3DFX7g9u/gOjBQrhApopx6LR9TkpkrFfVcgLw3NaOzI2vQzqa
+7m8v62D+/3vun3ZB/1OfQpIMfm77DC8AEQIDAQAB
+-----END RSA PUBLIC KEY-----
diff --git a/retiolum/hosts/oxberg b/retiolum/hosts/oxberg
new file mode 100644
index 00000000..91f0151a
--- /dev/null
+++ b/retiolum/hosts/oxberg
@@ -0,0 +1,11 @@
+Address = 84.23.80.172
+Subnet = 10.7.7.172
+Subnet = 42:c154:3219:a91c:77eb:91bb:2f18:ff75/128
+-----BEGIN RSA PUBLIC KEY-----
+MIIBCgKCAQEA57j66efrYrB7jlBVu6XD6433n/j1QL86KI/l7BCVTE11mJrElElc
+YSAOB44arnFurSlU8RZIZAC4gnScmDnjJqCqudxps4wO0JTPqUCvUXkaZQ1fUf7W
+H00K05Jkrr6xFHyDwZNrU4uitBfMuAXlUE2A0sFLJiBmFLMSS0abaUg0ALRwFsMI
+5ftLHZPMV/TwUollCHQTfwMiMGo28WBm+nYvY+nUZRu3sx8HPLskYWmvt9giu7eo
+iQCDee/bHym5Ax9vETpCrkZITq2MJtQdJX46iwvlgKxsV7VkCXAtmU3lMLyTSeRX
+582RdmjFP2DdTPEulbL2YyfXVuLs0QIiRQIDAQAB
+-----END RSA PUBLIC KEY-----
diff --git a/retiolum/scripts/tinc_setup/install.sh b/retiolum/scripts/tinc_setup/install.sh
index 547cf366..a550a068 100755
--- a/retiolum/scripts/tinc_setup/install.sh
+++ b/retiolum/scripts/tinc_setup/install.sh
@@ -40,6 +40,7 @@ then
if ! $MYBIN/check-free-retiolum-v4 $v4num;then
exit 1
fi
+ myipv4="10.7.7.$v4num"
fi
echo "Subnet = $myipv4" > hosts/$myname
@@ -53,10 +54,11 @@ cp $CURR/tinc-up /etc/tinc/$netname/
cat>tinc.conf<<EOF
Name = $myname
-ConnectTo = supernode
+ConnectTo = EUcancER
ConnectTo = kaah
+ConnectTo = oxberg
ConnectTo = pa_sharepoint
-ConnectTo = EUcancER
+ConnectTo = supernode
Device = /dev/net/tun
EOF
diff --git a/retiolum/scripts/tinc_setup/write_channel.py b/retiolum/scripts/tinc_setup/write_channel.py
index ee28674f..53a155d9 100644
--- a/retiolum/scripts/tinc_setup/write_channel.py
+++ b/retiolum/scripts/tinc_setup/write_channel.py
@@ -6,7 +6,7 @@ except:
print "you are made of stupid"
exit (23)
-CHANNEL = '#tincspasm'
+CHANNEL = '#krebsco'
HOST='irc.freenode.net'
FILE="/etc/tinc/retiolum/hosts/"+myname
PORT=6667
diff --git a/streams/stream.db b/streams/stream.db
index fb393667..263e95b4 100644
--- a/streams/stream.db
+++ b/streams/stream.db
@@ -9,3 +9,4 @@ http://stream2.jungletrain.net:8000 jungletrain
http://playlist.tormentedradio.com/tormentedradio.pls tormented
http://filebitch.shack:8000 mpd
http://radio.krautchan.net:8000/radio.mp3 radiofreieskrautchan
+http://nl1.streamhosting.ch/listen.pls lounge