From f6ee83b18b0dea5a6390cc60fcee5406868af71f Mon Sep 17 00:00:00 2001 From: tv Date: Tue, 27 Sep 2011 14:40:34 +0200 Subject: //bridge/README: add paste examples --- bridge/share/doc/bridge/README.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/bridge/share/doc/bridge/README.md b/bridge/share/doc/bridge/README.md index 07f5eb6d..5adda89c 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,11 @@ similar) for maximum profit. # mark that stuff # press return + # paste some strink into the session + bridge paste my_fancy_interpreter '1 + 2 + 4 ' + # or + echo 2^20 | bridge paste my_fancy_interpreter + # you can use tab-completion everywhere (if installed) -- cgit v1.2.3 From 4c5a56ef5a49f6e045b1718b4e05c4f92f1247c4 Mon Sep 17 00:00:00 2001 From: tv Date: Tue, 27 Sep 2011 14:45:29 +0200 Subject: //bridge/README: fix typo and rm binary for GitHub-.- --- bridge/share/doc/bridge/README.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/bridge/share/doc/bridge/README.md b/bridge/share/doc/bridge/README.md index 5adda89c..faed3eb7 100644 --- a/bridge/share/doc/bridge/README.md +++ b/bridge/share/doc/bridge/README.md @@ -18,9 +18,11 @@ similar) for maximum profit. # mark that stuff # press return - # paste some strink into the session - bridge paste my_fancy_interpreter '1 + 2 + 4 ' - # or + # 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) -- cgit v1.2.3 From f305a70357d95f7e069fe852df30859e0557ac56 Mon Sep 17 00:00:00 2001 From: tv Date: Tue, 27 Sep 2011 15:04:13 +0200 Subject: //bridge bin/*: add synopses and shi- --- bridge/bin/bridge | 11 +++++++++-- bridge/lib/bridge/bin/attach | 7 +++++++ bridge/lib/bridge/bin/create | 9 +++++++++ bridge/lib/bridge/bin/destroy | 9 +++++++++ bridge/lib/bridge/bin/list | 7 +++++++ bridge/lib/bridge/bin/paste | 23 ++++++++++++++++++----- 6 files changed, 59 insertions(+), 7 deletions(-) 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. -- cgit v1.2.3 From 8e0bf62fc5f373598b21fd3dd64f33f627042058 Mon Sep 17 00:00:00 2001 From: tv Date: Tue, 27 Sep 2011 15:35:57 +0200 Subject: //bridge README: tar -x += --keep-newer-files --- bridge/share/doc/bridge/README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bridge/share/doc/bridge/README.md b/bridge/share/doc/bridge/README.md index faed3eb7..9b250eea 100644 --- a/bridge/share/doc/bridge/README.md +++ b/bridge/share/doc/bridge/README.md @@ -54,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 -- cgit v1.2.3 From e5675a017b92e1d22757111b5ca622543c726995 Mon Sep 17 00:00:00 2001 From: tv Date: Tue, 27 Sep 2011 15:43:40 +0200 Subject: //bridge README: fix mkd stylo --- bridge/share/doc/bridge/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bridge/share/doc/bridge/README.md b/bridge/share/doc/bridge/README.md index 9b250eea..77c62374 100644 --- a/bridge/share/doc/bridge/README.md +++ b/bridge/share/doc/bridge/README.md @@ -54,6 +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 --keep-newer-files -x + tar -C //bridge -c . | + tar --exclude=./README.md -C ~/opt -v --keep-newer-files -x -- cgit v1.2.3 From 9977810168d6dc782cdb485b7999ae9325da0e15 Mon Sep 17 00:00:00 2001 From: tv Date: Tue, 27 Sep 2011 15:59:39 +0200 Subject: Twizzerspam --- twitter-spam | 1 + 1 file changed, 1 insertion(+) create mode 100644 twitter-spam diff --git a/twitter-spam b/twitter-spam new file mode 100644 index 00000000..45b983be --- /dev/null +++ b/twitter-spam @@ -0,0 +1 @@ +hi -- cgit v1.2.3 From 9ae7df3ac1bead5d322e56c3e2562dc850a8455c Mon Sep 17 00:00:00 2001 From: tv Date: Tue, 27 Sep 2011 16:00:06 +0200 Subject: and again..^_^-->some broke it?-.- --- twitter-spam | 1 - 1 file changed, 1 deletion(-) delete mode 100644 twitter-spam diff --git a/twitter-spam b/twitter-spam deleted file mode 100644 index 45b983be..00000000 --- a/twitter-spam +++ /dev/null @@ -1 +0,0 @@ -hi -- cgit v1.2.3 From ad22d3ad5a3dda12a417acd1a48aaeb0160e14ff Mon Sep 17 00:00:00 2001 From: momo Date: Tue, 27 Sep 2011 16:40:19 +0200 Subject: //Reaktor/index: rm logger --- Reaktor/index | 7 ------- 1 file changed, 7 deletions(-) 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 -- cgit v1.2.3 From 5d003d31251807fef9fd7e10d68555a919bed42d Mon Sep 17 00:00:00 2001 From: makefu Date: Wed, 28 Sep 2011 18:17:55 +0200 Subject: ukrepl: add space variations --- crypto/bin/ukrepl | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/crypto/bin/ukrepl b/crypto/bin/ukrepl index 2dfaabc4..febe2d96 100755 --- a/crypto/bin/ukrepl +++ b/crypto/bin/ukrepl @@ -53,6 +53,11 @@ punctuation_dict = { '(' : u'⟨', ')' : u'⟩', ':' : u'ː', + ' ' : u' ', + # all different spaces, made for perfect trolling + #' ' : u' ', + #' ' : u' ', + #' ' : u'⁠', #'-' : u'‒', #'-' : u'—', #'-' : u'―', -- cgit v1.2.3 From 12567464be1c4ef6722da354592daf1db9662c2b Mon Sep 17 00:00:00 2001 From: makefu Date: Fri, 7 Oct 2011 13:18:42 +0200 Subject: streams/stream.db: add lounge-radio.com --- streams/stream.db | 1 + 1 file changed, 1 insertion(+) diff --git a/streams/stream.db b/streams/stream.db index 29949980..1d7bb15e 100644 --- a/streams/stream.db +++ b/streams/stream.db @@ -8,3 +8,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 -- cgit v1.2.3 From 530ae97550d6ac60f562d8b585a9c39cb6b7d954 Mon Sep 17 00:00:00 2001 From: tv Date: Sun, 9 Oct 2011 02:12:28 +0200 Subject: //retiolum hosts ach: initial commit --- retiolum/hosts/ach | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 retiolum/hosts/ach 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----- -- cgit v1.2.3 From 90eb09e15b2af8f8aecc817d130fd2308ce03876 Mon Sep 17 00:00:00 2001 From: tv Date: Mon, 10 Oct 2011 17:54:14 +0200 Subject: =?UTF-8?q?//K=C3=BCbelwagen/playmobil:=20initial=20commit?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit usage: playmobil CODE [t] where t defaults to 0 --- "K\303\274belwagen/playmobil" | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100755 "K\303\274belwagen/playmobil" diff --git "a/K\303\274belwagen/playmobil" "b/K\303\274belwagen/playmobil" new file mode 100755 index 00000000..51ed70d6 --- /dev/null +++ "b/K\303\274belwagen/playmobil" @@ -0,0 +1,12 @@ +#! /bin/sh +file=`mktemp` +trap "rm -f $file" EXIT INT TERM + +gcc -xc -lm -o $file - < +main(t) { + for (t=${2-0};;++t) putchar($1); +} +EOF + +$file | aplay -- cgit v1.2.3 From 1c1d0d95b3c64d045146a61f12d59183f4cf1cba Mon Sep 17 00:00:00 2001 From: makefu Date: Tue, 11 Oct 2011 15:15:00 +0200 Subject: punani: fix multi-match for packages like python using the full path now in retiolum using fallback for different ose --- punani/bin/punani | 12 +++++++----- retiolum/Makefile | 2 +- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/punani/bin/punani b/punani/bin/punani index 954eca43..2f4ce42c 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,7 +81,7 @@ 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 + if pacman -S --needed $(pkgfile -s -b -r $1); then echo "++ finished" exit 0 else @@ -127,14 +129,14 @@ 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 + if apt-get install `apt-file search -l -x $1\$`;then echo "++ finished" else if [ "${hard-}" ] ; then diff --git a/retiolum/Makefile b/retiolum/Makefile index c80a6faa..dd6d8409 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 -- cgit v1.2.3 From ec7f80e6954cc00b6fc87c1d35be269b40868e46 Mon Sep 17 00:00:00 2001 From: makefu Date: Tue, 11 Oct 2011 15:55:51 +0200 Subject: fix bug in install script, change channel --- retiolum/scripts/tinc_setup/install.sh | 1 + retiolum/scripts/tinc_setup/write_channel.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/retiolum/scripts/tinc_setup/install.sh b/retiolum/scripts/tinc_setup/install.sh index 547cf366..16b0f33d 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 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 -- cgit v1.2.3 From 4f4c63c8c778984d68eaa54f6e3fdbb72f96e82a Mon Sep 17 00:00:00 2001 From: makefu Date: Tue, 11 Oct 2011 15:58:26 +0200 Subject: ukrepl: fix utf-8 exception function unicode(unicode-character) throws an exception, return only the ascii character --- crypto/bin/ukrepl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/crypto/bin/ukrepl b/crypto/bin/ukrepl index febe2d96..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'’', @@ -71,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:" -- cgit v1.2.3 From 936188129490ef41612343015c24af28be78c76d Mon Sep 17 00:00:00 2001 From: makefu Date: Tue, 11 Oct 2011 16:00:17 +0200 Subject: add kremu the krebs emulation node --- retiolum/hosts/kremu | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 retiolum/hosts/kremu 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----- -- cgit v1.2.3 From bb5d1bd1f1c0fe22d3b93a5bf17033265ee42776 Mon Sep 17 00:00:00 2001 From: EUcancER Date: Tue, 11 Oct 2011 16:03:56 +0200 Subject: retiolum:add tincd reload after update --- retiolum/Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/retiolum/Makefile b/retiolum/Makefile index dd6d8409..bd3ca776 100644 --- a/retiolum/Makefile +++ b/retiolum/Makefile @@ -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 arch-install: update install arch-autostart autohosts -- cgit v1.2.3 From 489c78b4c92c17e06ad4f78e96742e8d8eccfc91 Mon Sep 17 00:00:00 2001 From: makefu Date: Tue, 11 Oct 2011 17:43:30 +0200 Subject: punani: add manual package selection idea is to avoid installing software matching too often (e.g. installing the 'unzip' package which is in >9k packages) it might be a good idea to just use the first package if only one is found --- punani/bin/punani | 31 ++++++++++++++++++++++++------- 1 file changed, 24 insertions(+), 7 deletions(-) diff --git a/punani/bin/punani b/punani/bin/punani index 2f4ce42c..058331f1 100755 --- a/punani/bin/punani +++ b/punani/bin/punani @@ -81,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 --needed $(pkgfile -s -b -r $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 @@ -118,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() { @@ -136,8 +144,17 @@ handle_system () { } 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" -- cgit v1.2.3 From 2d6bd675297ae0952af4905a19abdf2e4b22f91c Mon Sep 17 00:00:00 2001 From: EUcancER Date: Wed, 12 Oct 2011 09:52:34 +0200 Subject: //retiolum/Makefile: fix race condition bug when reloading tincd it might be possible the tincd is not running and therefore pkill returns =! 0 in this case --- retiolum/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/retiolum/Makefile b/retiolum/Makefile index bd3ca776..83c4ac12 100644 --- a/retiolum/Makefile +++ b/retiolum/Makefile @@ -22,7 +22,7 @@ update: hosts @echo adding hosts bin/update_tinc_hosts restart @echo reloading tincd - pkill -HUP tincd + pkill -HUP tincd || true arch-install: update install arch-autostart autohosts -- cgit v1.2.3 From b98df3f1e4dabc2d42066be097518f200b5af322 Mon Sep 17 00:00:00 2001 From: root Date: Wed, 12 Oct 2011 10:47:27 +0200 Subject: //retiolum hosts oxberg: initial commit --- retiolum/hosts/oxberg | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 retiolum/hosts/oxberg 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----- -- cgit v1.2.3 From e8923cc1ce69716b192e317cb4d5b9e8f0de4e68 Mon Sep 17 00:00:00 2001 From: tv Date: Wed, 12 Oct 2011 10:53:15 +0200 Subject: //retiolum install: add oxberg in `sort`ed order --- retiolum/scripts/tinc_setup/install.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/retiolum/scripts/tinc_setup/install.sh b/retiolum/scripts/tinc_setup/install.sh index 16b0f33d..a550a068 100755 --- a/retiolum/scripts/tinc_setup/install.sh +++ b/retiolum/scripts/tinc_setup/install.sh @@ -54,10 +54,11 @@ cp $CURR/tinc-up /etc/tinc/$netname/ cat>tinc.conf< Date: Wed, 12 Oct 2011 12:56:10 +0200 Subject: //retiolum supernode-update-hosts-and-hup: init --- retiolum/bin/supernode-update-hosts-and-hup | 33 +++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100755 retiolum/bin/supernode-update-hosts-and-hup diff --git a/retiolum/bin/supernode-update-hosts-and-hup b/retiolum/bin/supernode-update-hosts-and-hup new file mode 100755 index 00000000..deff9f2f --- /dev/null +++ b/retiolum/bin/supernode-update-hosts-and-hup @@ -0,0 +1,33 @@ +#! /bin/sh +set -euf + +cd /etc/tinc/retiolum/hosts + +painload="$(dirname "$(readlink -f "$0")")/../.." + +temp1="`mktemp`" +temp2="`mktemp`" +trap "rm -f $temp1 $temp2" EXIT INT TERM + +old_commit="`cat .commit 2>/dev/null || :`" + +curl -fsS "https://github.com/krebscode/painload/tree/master/retiolum/hosts" | + "$painload/util/bin/hrefs" | + grep '^/krebscode/painload/blob/' | + grep -v "/blob/$old_commit/" >$temp1 + +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 -- cgit v1.2.3 From 9c2721f58f6ec9c271dd16f2bf0ddc054f24f403 Mon Sep 17 00:00:00 2001 From: tv Date: Wed, 12 Oct 2011 12:58:20 +0200 Subject: //retiolum supernode-...: do the HUP! --- retiolum/bin/supernode-update-hosts-and-hup | 2 ++ 1 file changed, 2 insertions(+) diff --git a/retiolum/bin/supernode-update-hosts-and-hup b/retiolum/bin/supernode-update-hosts-and-hup index deff9f2f..b1ce3489 100755 --- a/retiolum/bin/supernode-update-hosts-and-hup +++ b/retiolum/bin/supernode-update-hosts-and-hup @@ -31,3 +31,5 @@ sed " wget -qi- < $temp1 echo $new_commit > .commit + +pkill -HUP tincd -- cgit v1.2.3 From 8b1827f42d3d8a967b9a385bbb048835e1792872 Mon Sep 17 00:00:00 2001 From: tv Date: Wed, 12 Oct 2011 13:00:44 +0200 Subject: //retiolum super-...: inline hrefs --- retiolum/bin/supernode-update-hosts-and-hup | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/retiolum/bin/supernode-update-hosts-and-hup b/retiolum/bin/supernode-update-hosts-and-hup index b1ce3489..221a7538 100755 --- a/retiolum/bin/supernode-update-hosts-and-hup +++ b/retiolum/bin/supernode-update-hosts-and-hup @@ -3,16 +3,18 @@ set -euf cd /etc/tinc/retiolum/hosts -painload="$(dirname "$(readlink -f "$0")")/../.." - 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'; } + curl -fsS "https://github.com/krebscode/painload/tree/master/retiolum/hosts" | - "$painload/util/bin/hrefs" | + _hrefs | grep '^/krebscode/painload/blob/' | grep -v "/blob/$old_commit/" >$temp1 -- cgit v1.2.3 From 979a90b5e238d3bdfea16599d93128cfd1475bc4 Mon Sep 17 00:00:00 2001 From: tv Date: Wed, 12 Oct 2011 13:05:07 +0200 Subject: //retiolum supernode-...: add little doc --- retiolum/bin/supernode-update-hosts-and-hup | 30 +++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/retiolum/bin/supernode-update-hosts-and-hup b/retiolum/bin/supernode-update-hosts-and-hup index 221a7538..bfba6409 100755 --- a/retiolum/bin/supernode-update-hosts-and-hup +++ b/retiolum/bin/supernode-update-hosts-and-hup @@ -1,4 +1,8 @@ #! /bin/sh +# +# @oxberg we do put this into crontab: +# * * * * * /supernode-update-hosts-and-hup +# set -euf cd /etc/tinc/retiolum/hosts @@ -13,25 +17,27 @@ _hrefs() { sed -n 's/href="\([^"]\+\)"/\n&\n/gp' | sed -n 's/^href="\([^"]\+\)"$/\1/p'; } -curl -fsS "https://github.com/krebscode/painload/tree/master/retiolum/hosts" | +if curl -fsS \ + "https://github.com/krebscode/painload/tree/master/retiolum/hosts" | _hrefs | grep '^/krebscode/painload/blob/' | grep -v "/blob/$old_commit/" >$temp1 -new_commit=`sed 's|^/krebscode/painload/blob/\([^/]*\)/.*|\1|;q' $temp1` + new_commit=`sed 's|^/krebscode/painload/blob/\([^/]*\)/.*|\1|;q' $temp1` -sed ' - s|^/krebscode/painload/blob/[^/]*/retiolum/hosts/\([^/]*\)$|\1| -' $temp1 > $temp2 + sed ' + s|^/krebscode/painload/blob/[^/]*/retiolum/hosts/\([^/]*\)$|\1| + ' $temp1 > $temp2 -xargs rm -v -f <$temp2 + xargs rm -v -f <$temp2 -sed " - s|^.*$|https://raw.github.com/krebscode/painload/$new_commit/retiolum/hosts/&| -" $temp2 > $temp1 + sed " + s|^.*$|https://raw.github.com/krebscode/painload/$new_commit/retiolum/hosts/&| + " $temp2 > $temp1 -wget -qi- < $temp1 + wget -qi- < $temp1 -echo $new_commit > .commit + echo $new_commit > .commit -pkill -HUP tincd + pkill -HUP tincd +fi -- cgit v1.2.3 From 1cff2a9d548336ddcd8a2d732ed2cd348c8e6b79 Mon Sep 17 00:00:00 2001 From: tv Date: Wed, 12 Oct 2011 13:08:29 +0200 Subject: //retiolum supernode-...: fix typo --- retiolum/bin/supernode-update-hosts-and-hup | 1 + 1 file changed, 1 insertion(+) diff --git a/retiolum/bin/supernode-update-hosts-and-hup b/retiolum/bin/supernode-update-hosts-and-hup index bfba6409..b6b03c69 100755 --- a/retiolum/bin/supernode-update-hosts-and-hup +++ b/retiolum/bin/supernode-update-hosts-and-hup @@ -22,6 +22,7 @@ if curl -fsS \ _hrefs | grep '^/krebscode/painload/blob/' | grep -v "/blob/$old_commit/" >$temp1 +then new_commit=`sed 's|^/krebscode/painload/blob/\([^/]*\)/.*|\1|;q' $temp1` -- cgit v1.2.3