From c77015310e7928d8330b2b5a8483f02055bb3376 Mon Sep 17 00:00:00 2001 From: lassulus Date: Tue, 15 Nov 2011 19:22:34 +0100 Subject: deleted routes for testing --- retiolum/hosts/Lassulus | 1 - retiolum/hosts/Styx | 1 - retiolum/hosts/supernode | 1 - 3 files changed, 3 deletions(-) diff --git a/retiolum/hosts/Lassulus b/retiolum/hosts/Lassulus index f794d06c..594d1203 100644 --- a/retiolum/hosts/Lassulus +++ b/retiolum/hosts/Lassulus @@ -1,6 +1,5 @@ Subnet = 42:0:0:0:0:0:0:dea7/128 Subnet = 42.251.103.67/32 -Subnet = 0.0.0.0/0 -----BEGIN RSA PUBLIC KEY----- MIIBCgKCAQEAsj1PCibKOfF68gmFQ+wwyfhUWpqKqpznrJX1dZ+daae7l7nBHvsE H0QwkiMmk3aZy1beq3quM6gX13aT+/wMfWnLyuvT11T5C9JEf/IS91STpM2BRN+R diff --git a/retiolum/hosts/Styx b/retiolum/hosts/Styx index b05eaac5..37083ddc 100644 --- a/retiolum/hosts/Styx +++ b/retiolum/hosts/Styx @@ -1,5 +1,4 @@ Subnet = 42.37.61.123/32 -Subnet = 0.0.0.0/0 -----BEGIN RSA PUBLIC KEY----- MIIBCgKCAQEA4jbOi+HZIGOGNm4aBSwnq4m3Vg3IXHmYUbJx1AzP4a/yvEgswfk6 MP5FXvoY/hZ0NQ0IRzbbJxGbcUdulz0WSjX1C+8uQUZstz+lvYZ4FeCXcdE5cuFM diff --git a/retiolum/hosts/supernode b/retiolum/hosts/supernode index e4698009..b046347e 100644 --- a/retiolum/hosts/supernode +++ b/retiolum/hosts/supernode @@ -1,7 +1,6 @@ Address = miefda.org Subnet = 42:0:0:0:0:0:0:255/128 Subnet = 42.0.0.1/32 -Subnet = 0.0.0.0/0 -----BEGIN RSA PUBLIC KEY----- MIIBCgKCAQEAr3DlBmQxP9UTBCkohK8FCYSk2td4Ov5lQYvC3Adx04lEWHfp+0nP sShYqqN9Aj3iCqj/DHx5jGuSqjyTmmFWIOMM9IwKMo2Oiz/PcBM56N6gzIHuR5wj -- cgit v1.2.3 From fd04c6512e502e7518fce110901a04a909b345ef Mon Sep 17 00:00:00 2001 From: lassulus Date: Wed, 16 Nov 2011 15:44:46 +0100 Subject: removed ALRM --- retiolum/Makefile | 1 - 1 file changed, 1 deletion(-) diff --git a/retiolum/Makefile b/retiolum/Makefile index 8301c926..e0268c35 100644 --- a/retiolum/Makefile +++ b/retiolum/Makefile @@ -24,7 +24,6 @@ update: hosts sudo bin/restart-tincd; \ else \ sudo pkill -HUP tincd || :; \ - sudo pkill -ALRM tincd || :; \ fi arch-install: update install arch-autostart autohosts -- cgit v1.2.3 From c97518523b910ca7412f69de3803739affe2c583 Mon Sep 17 00:00:00 2001 From: EUcancER Date: Wed, 16 Nov 2011 18:35:13 +0100 Subject: //punani: tightnani-web is now able to handle fallback(super-) package manager --- punani/tightnani/tightnani-web.py | 7 ++++++- punani/tightnani/tightnani_db | 3 +++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/punani/tightnani/tightnani-web.py b/punani/tightnani/tightnani-web.py index 52f5004f..4386bbae 100755 --- a/punani/tightnani/tightnani-web.py +++ b/punani/tightnani/tightnani-web.py @@ -18,7 +18,7 @@ pdb= json.load(open(PDB_FILE)) class Index: def GET(self): ret = """Welcome to the Tightnani API
-Retrieve a package name for your distribution with: /ARCH/PKG""" +Retrieve a package name for your distribution with: /PACKER/PKG""" return ret class Reload: @@ -36,13 +36,18 @@ class ArchFinder: if not packer or not package: web.BadRequest() else: packer = pdb['packer-symlinks'].get(packer,packer) #try to resolve similar packers + super_packer = pdb['super-packer'].get(packer,'') ret = pdb.get(package,{}).get(packer,False) + ret = ret if ret else pdb.get(package,{}).get(super_packer,False) + if not ret: web.NotFound() else: return ret if __name__ == "__main__": + import sys + sys.argv.append("9111") app = web.application(urls,globals()) app.internalerror = web.debugerror app.run() diff --git a/punani/tightnani/tightnani_db b/punani/tightnani/tightnani_db index d15a9ad4..4c2d4843 100644 --- a/punani/tightnani/tightnani_db +++ b/punani/tightnani/tightnani_db @@ -4,6 +4,9 @@ "aptitude" : "apt-get", "bauerbill" : "yaourt" }, + "super-packer" : { + "yaourt" : "pacman" + }, "vim" : { "apt-get" : "vim", "pacman" : "vim", -- cgit v1.2.3 From f5c086a61ed2cf493d2e6edb0edf0f32230bb615 Mon Sep 17 00:00:00 2001 From: makefu Date: Wed, 16 Nov 2011 19:29:44 +0100 Subject: //punani/tightnani_client: initial commit the tigtnani client finds your package manager and the required parameters to handle the manager. currently it is able to remove and install : pacman (and derivates), apt (and derivates), yum and brew. Nothing is tested so be aware --- punani/tightnani/tightnani_client | 59 +++++++++++++++++++++++++++++++++++++++ punani/tightnani/tightnani_db | 6 +++- 2 files changed, 64 insertions(+), 1 deletion(-) create mode 100755 punani/tightnani/tightnani_client diff --git a/punani/tightnani/tightnani_client b/punani/tightnani/tightnani_client new file mode 100755 index 00000000..d2a598d3 --- /dev/null +++ b/punani/tightnani/tightnani_client @@ -0,0 +1,59 @@ +#!/bin/bash +set -xeuf + +if [ $# -ne 2 ];then + echo "usage: `basename $0` (install|remove) PACKAGE" + exit 23 +fi + +PACKERS="yum!-y install remove +brew install remove +pacman!--noconfirm -S!--needed -Rcs +bauerbill!--noconfirm -S!--needed -Rcs +yaourt!--noconfirm -S!--needed -Rcs +packer!--noconfirm -S!--needed -Rcs +apt-get!--yes install remove +aptitude!--yes install remove" + +OIFS=$IFS +PACKER= +IFS=' +' + +TIGHTNANI_HOST="http://euer.krebsco.de:9111" +# Find suitable packer +for PACKER_LINE in $PACKERS; do + TRY_PACKER_CMD="$(echo "$PACKER_LINE" | cut -d ' ' -f 1)" + TRY_PACKER="$(echo "$TRY_PACKER_CMD" | cut -d '!' -f 1)" + if which $TRY_PACKER &>/dev/null; then + PACKER=$TRY_PACKER + PACKER_CMD="$(echo "$TRY_PACKER_CMD" | tr "!" " ")" + echo "you got $PACKER" + INSTALL_PARAM="$(echo "$PACKER_LINE" | cut -d ' ' -f 2 | tr "!" " ")" + REMOVE_PARAM="$(echo "$PACKER_LINE" | cut -d ' ' -f 3 | tr "!" " ")" + fi +done +IFS=$OIFS +if [ ! "$PACKER" ];then + echo "Could not find a supported packer for you, bailing out!" + exit 23 +fi + + +# find the package name +PKG="$2" +RESOLVED=`wget -O- $TIGHTNANI_HOST/$PACKER/$PKG` +if [ ! "$RESOLVED" ];then + echo "Could not resolve your requested package, bailing out!" + exit 23 +fi +case "$1" in + install) + exec $PACKER_CMD $INSTALL_PARAM $RESOLVED + ;; + remove) + exec $PACKER_CMD $REMOVE_PARAM $RESOLVED + ;; + *) + echo "usage: `basename $0` (install|remove) PACKAGE" +esac diff --git a/punani/tightnani/tightnani_db b/punani/tightnani/tightnani_db index d15a9ad4..322e28f8 100644 --- a/punani/tightnani/tightnani_db +++ b/punani/tightnani/tightnani_db @@ -21,5 +21,9 @@ "python3" : { "apt-get" : "python3", "pacman" : "python" - } + }, + "tinc" : { + "apt-get" : "tinc", + "yaourt" : "tinc" + } } -- cgit v1.2.3 From 655db45a3ef4ca58f9e9fe42bba015d1fd1eccb6 Mon Sep 17 00:00:00 2001 From: makefu Date: Wed, 16 Nov 2011 19:34:09 +0100 Subject: //punani: tightnani is now less verbose --- punani/tightnani/tightnani_client | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/punani/tightnani/tightnani_client b/punani/tightnani/tightnani_client index d2a598d3..8caf669e 100755 --- a/punani/tightnani/tightnani_client +++ b/punani/tightnani/tightnani_client @@ -1,5 +1,5 @@ #!/bin/bash -set -xeuf +set -euf if [ $# -ne 2 ];then echo "usage: `basename $0` (install|remove) PACKAGE" @@ -42,7 +42,7 @@ fi # find the package name PKG="$2" -RESOLVED=`wget -O- $TIGHTNANI_HOST/$PACKER/$PKG` +RESOLVED=`wget -O- $TIGHTNANI_HOST/$PACKER/$PKG 2>/dev/null` if [ ! "$RESOLVED" ];then echo "Could not resolve your requested package, bailing out!" exit 23 -- cgit v1.2.3 From 8575b9856aca6809bce214fd8a199c990cb6561c Mon Sep 17 00:00:00 2001 From: EUcancER Date: Wed, 16 Nov 2011 22:27:12 +0100 Subject: //punani: tightnani_client -> tinani, add packages --- punani/tightnani/tightnani_client | 59 --------------------------------------- punani/tightnani/tightnani_db | 26 ++++++++++++++++- punani/tightnani/tinani | 59 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 84 insertions(+), 60 deletions(-) delete mode 100755 punani/tightnani/tightnani_client create mode 100755 punani/tightnani/tinani diff --git a/punani/tightnani/tightnani_client b/punani/tightnani/tightnani_client deleted file mode 100755 index 8caf669e..00000000 --- a/punani/tightnani/tightnani_client +++ /dev/null @@ -1,59 +0,0 @@ -#!/bin/bash -set -euf - -if [ $# -ne 2 ];then - echo "usage: `basename $0` (install|remove) PACKAGE" - exit 23 -fi - -PACKERS="yum!-y install remove -brew install remove -pacman!--noconfirm -S!--needed -Rcs -bauerbill!--noconfirm -S!--needed -Rcs -yaourt!--noconfirm -S!--needed -Rcs -packer!--noconfirm -S!--needed -Rcs -apt-get!--yes install remove -aptitude!--yes install remove" - -OIFS=$IFS -PACKER= -IFS=' -' - -TIGHTNANI_HOST="http://euer.krebsco.de:9111" -# Find suitable packer -for PACKER_LINE in $PACKERS; do - TRY_PACKER_CMD="$(echo "$PACKER_LINE" | cut -d ' ' -f 1)" - TRY_PACKER="$(echo "$TRY_PACKER_CMD" | cut -d '!' -f 1)" - if which $TRY_PACKER &>/dev/null; then - PACKER=$TRY_PACKER - PACKER_CMD="$(echo "$TRY_PACKER_CMD" | tr "!" " ")" - echo "you got $PACKER" - INSTALL_PARAM="$(echo "$PACKER_LINE" | cut -d ' ' -f 2 | tr "!" " ")" - REMOVE_PARAM="$(echo "$PACKER_LINE" | cut -d ' ' -f 3 | tr "!" " ")" - fi -done -IFS=$OIFS -if [ ! "$PACKER" ];then - echo "Could not find a supported packer for you, bailing out!" - exit 23 -fi - - -# find the package name -PKG="$2" -RESOLVED=`wget -O- $TIGHTNANI_HOST/$PACKER/$PKG 2>/dev/null` -if [ ! "$RESOLVED" ];then - echo "Could not resolve your requested package, bailing out!" - exit 23 -fi -case "$1" in - install) - exec $PACKER_CMD $INSTALL_PARAM $RESOLVED - ;; - remove) - exec $PACKER_CMD $REMOVE_PARAM $RESOLVED - ;; - *) - echo "usage: `basename $0` (install|remove) PACKAGE" -esac diff --git a/punani/tightnani/tightnani_db b/punani/tightnani/tightnani_db index 6ae8098c..3641350d 100644 --- a/punani/tightnani/tightnani_db +++ b/punani/tightnani/tightnani_db @@ -28,5 +28,29 @@ "tinc" : { "apt-get" : "tinc", "yaourt" : "tinc" - } + }, + "python-notify" : { + "pacman" : "python-notify", + "apt-get" : "python-notify" + }, + "python-dbus" : { + "pacman" : "dbus-python", + "apt-get" : "python-dbus" + }, + "w3m" : { + "pacman" : "w3m", + "apt-get" : "w3m" + }, + "make" : { + "pacman" : "make", + "apt-get" : "make" + }, + "perl-xml-simple" : { + "apt-get" : "libxml-simple-perl", + "pacman" : "perl-xml-simple" + }, + "hostname" : { + "pacman" : "inetutils", + "apt-get" : "hostname" + } } diff --git a/punani/tightnani/tinani b/punani/tightnani/tinani new file mode 100755 index 00000000..8caf669e --- /dev/null +++ b/punani/tightnani/tinani @@ -0,0 +1,59 @@ +#!/bin/bash +set -euf + +if [ $# -ne 2 ];then + echo "usage: `basename $0` (install|remove) PACKAGE" + exit 23 +fi + +PACKERS="yum!-y install remove +brew install remove +pacman!--noconfirm -S!--needed -Rcs +bauerbill!--noconfirm -S!--needed -Rcs +yaourt!--noconfirm -S!--needed -Rcs +packer!--noconfirm -S!--needed -Rcs +apt-get!--yes install remove +aptitude!--yes install remove" + +OIFS=$IFS +PACKER= +IFS=' +' + +TIGHTNANI_HOST="http://euer.krebsco.de:9111" +# Find suitable packer +for PACKER_LINE in $PACKERS; do + TRY_PACKER_CMD="$(echo "$PACKER_LINE" | cut -d ' ' -f 1)" + TRY_PACKER="$(echo "$TRY_PACKER_CMD" | cut -d '!' -f 1)" + if which $TRY_PACKER &>/dev/null; then + PACKER=$TRY_PACKER + PACKER_CMD="$(echo "$TRY_PACKER_CMD" | tr "!" " ")" + echo "you got $PACKER" + INSTALL_PARAM="$(echo "$PACKER_LINE" | cut -d ' ' -f 2 | tr "!" " ")" + REMOVE_PARAM="$(echo "$PACKER_LINE" | cut -d ' ' -f 3 | tr "!" " ")" + fi +done +IFS=$OIFS +if [ ! "$PACKER" ];then + echo "Could not find a supported packer for you, bailing out!" + exit 23 +fi + + +# find the package name +PKG="$2" +RESOLVED=`wget -O- $TIGHTNANI_HOST/$PACKER/$PKG 2>/dev/null` +if [ ! "$RESOLVED" ];then + echo "Could not resolve your requested package, bailing out!" + exit 23 +fi +case "$1" in + install) + exec $PACKER_CMD $INSTALL_PARAM $RESOLVED + ;; + remove) + exec $PACKER_CMD $REMOVE_PARAM $RESOLVED + ;; + *) + echo "usage: `basename $0` (install|remove) PACKAGE" +esac -- cgit v1.2.3 From 1b0c87879d80fd7e70edb10a93b6010a014bbd15 Mon Sep 17 00:00:00 2001 From: EUcancER Date: Wed, 16 Nov 2011 22:54:27 +0100 Subject: //punani: db - add pip package manager --- punani/tightnani/tightnani_db | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/punani/tightnani/tightnani_db b/punani/tightnani/tightnani_db index 3641350d..318f0e27 100644 --- a/punani/tightnani/tightnani_db +++ b/punani/tightnani/tightnani_db @@ -52,5 +52,9 @@ "hostname" : { "pacman" : "inetutils", "apt-get" : "hostname" - } + }, + "pip" : { + "pacman" : "python-pip", + "apt-get" : "python-pip" + } } -- cgit v1.2.3 From 4e8fa61ec02b6f05134e8b95239d1821a46de57c Mon Sep 17 00:00:00 2001 From: EUcancER Date: Wed, 16 Nov 2011 22:56:47 +0100 Subject: //tightnani-web: add error message: --- punani/tightnani/tightnani-web.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/punani/tightnani/tightnani-web.py b/punani/tightnani/tightnani-web.py index 4386bbae..4e6a64a4 100755 --- a/punani/tightnani/tightnani-web.py +++ b/punani/tightnani/tightnani-web.py @@ -12,8 +12,9 @@ urls = ( PDB_FILE="tightnani_db" - -pdb= json.load(open(PDB_FILE)) +f = open(PDB_FILE) +pdb= json.load(f) +f.close() class Index: def GET(self): @@ -23,7 +24,9 @@ Retrieve a package name for your distribution with: /PACKER/PKG""" class Reload: def GET(self): - pdb= json.load(open(PDB_FILE)) + f = open(PDB_FILE) + pdb= json.load(f) + f.close() return "DB reloaded" @@ -40,7 +43,9 @@ class ArchFinder: ret = pdb.get(package,{}).get(packer,False) ret = ret if ret else pdb.get(package,{}).get(super_packer,False) - if not ret: web.NotFound() + if not ret: + web.NotFound() + return "not found. i'm so sorry :(" else: return ret -- cgit v1.2.3 From 3877e5d8221d42811d376ddb560552684d34f5cc Mon Sep 17 00:00:00 2001 From: EUcancER Date: Thu, 17 Nov 2011 11:16:48 +0100 Subject: //punani: rm old punani, tightnani->punani --- punani/bin/punani | 323 +++++++------------------------------- punani/db/punani | 60 +++++++ punani/index.py | 58 +++++++ punani/tightnani/tightnani-web.py | 58 ------- punani/tightnani/tightnani_db | 60 ------- punani/tightnani/tinani | 59 ------- 6 files changed, 171 insertions(+), 447 deletions(-) create mode 100644 punani/db/punani create mode 100755 punani/index.py delete mode 100755 punani/tightnani/tightnani-web.py delete mode 100644 punani/tightnani/tightnani_db delete mode 100755 punani/tightnani/tinani diff --git a/punani/bin/punani b/punani/bin/punani index 058331f1..8caf669e 100755 --- a/punani/bin/punani +++ b/punani/bin/punani @@ -1,276 +1,59 @@ -#! /bin/sh -# -# punani - filesystem scienteer -# -# Engineering Operations -# -E -i spec insert a package to the target filesystem -# -E -r spec remove a package -# +#!/bin/bash set -euf -godmode() { - if test "${nosudo-false}" != true -a `id -u` != 0; then - echo "!! we require god mode..." >&2 - exec sudo "$0" "$@" - exit 23 # go to hell - fi -} -# return the 'system' variable -# currently be: -# arch-like -# debian-like -guess_system() -{ - if [ -f "/etc/arch-release" ] ;then - system="${system+$system, }arch-like" - fi - if [ -f "/etc/lsb-release" -o -f "/etc/debian_version" ] ;then - system="${system+$system, }debian-like" +if [ $# -ne 2 ];then + echo "usage: `basename $0` (install|remove) PACKAGE" + exit 23 +fi + +PACKERS="yum!-y install remove +brew install remove +pacman!--noconfirm -S!--needed -Rcs +bauerbill!--noconfirm -S!--needed -Rcs +yaourt!--noconfirm -S!--needed -Rcs +packer!--noconfirm -S!--needed -Rcs +apt-get!--yes install remove +aptitude!--yes install remove" + +OIFS=$IFS +PACKER= +IFS=' +' + +TIGHTNANI_HOST="http://euer.krebsco.de:9111" +# Find suitable packer +for PACKER_LINE in $PACKERS; do + TRY_PACKER_CMD="$(echo "$PACKER_LINE" | cut -d ' ' -f 1)" + TRY_PACKER="$(echo "$TRY_PACKER_CMD" | cut -d '!' -f 1)" + if which $TRY_PACKER &>/dev/null; then + PACKER=$TRY_PACKER + PACKER_CMD="$(echo "$TRY_PACKER_CMD" | tr "!" " ")" + echo "you got $PACKER" + INSTALL_PARAM="$(echo "$PACKER_LINE" | cut -d ' ' -f 2 | tr "!" " ")" + REMOVE_PARAM="$(echo "$PACKER_LINE" | cut -d ' ' -f 3 | tr "!" " ")" fi - -} - -arch_aur_helper() -{ - # pacman is the last fallback helper - manager="yaourt clyde packer bauerbill tupac pacaur paktahn pbfetch aurget aurora cower powaur pacman" - for i in $manager;do - mgr=`which $i` - if [ "$mgr" ] ;then - echo $mgr - return 0 - fi - done - echo "!! no helper found, this should never happen(tm)." - return 1 -} - -handle_system () { - case "$system" in - (*arch-like*) - # dryrun - # TODO dryrun not dry enough for aur helper - if [ "${dryrun-}" ];then - pacman () { echo "pacman $@" ; } - pkgfile () { echo "pkgfile $@"; } - yaourt () { echo "yaourt $@" ; } - fi - - # get dependencies : - # we need pkgfile - if ! [ `which pkgfile` ] ; then - pacman -S --needed --noconfirm pkgtools - pkgfile -u - fi - punani_Scientist_update() { - pacman -Sy - pkgtool -u - } - punani_Scientist_search() { - pkgfile -s -b $1 - if [ "${hard-}" ] ; then - mgr=`arch_aur_helper` - $mgr -Ss $1 - fi - - } - - punani_Engineer_insert() { - # punani under archlinux first tries to load the packages with the given file name - # it needs pkgfile for that - # - # when trying harder it tries to load the package with the given name directly via yaourt - echo "** trying to find package with given file" - 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 - echo "** trying harder" - echo "** trying yaourt directly with given package" - mgr=`arch_aur_helper` - if $mgr -S $1 ;then - echo "++ finished" - return 0 - else - echo "!! giving up...i am sorry" - return 1 - fi - echo - else - echo "?? When in doubt try $0 -h -Ei $1 " - fi - fi - } - punani_Engineer_remove() { - pacman -Rcs "`pacman -Ql | grep $1$ | awk '{print $1}'`" - if [ "${hard-}" ] ; then - echo "** trying harder" - echo "** directly delete given package name" - pacman -Rcs "$1" - fi - } +done +IFS=$OIFS +if [ ! "$PACKER" ];then + echo "Could not find a supported packer for you, bailing out!" + exit 23 +fi + + +# find the package name +PKG="$2" +RESOLVED=`wget -O- $TIGHTNANI_HOST/$PACKER/$PKG 2>/dev/null` +if [ ! "$RESOLVED" ];then + echo "Could not resolve your requested package, bailing out!" + exit 23 +fi +case "$1" in + install) + exec $PACKER_CMD $INSTALL_PARAM $RESOLVED ;; - (*debian-like*) - #if [ "${dryrun-}" ]; then - # apt-file () { echo $@; } - # apt-get () { echo $@; } - #fi - if ! which apt-file; then - echo "** installing dependencies: apt-file" - apt-get install --yes apt-file - echo "** update the apt-file tool" - apt-file update - fi - punani_Scientist_update() { - apt-get update - apt-file update - } - - punani_Scientist_search() { - apt-file search -l -x $1\$ && exit 0 - if [ "${hard-}" ] ; then - apt-cache search $1 - fi - } - punani_Engineer_insert() { - echo "trying to install $1" - 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" - apt-get install $1 - fi - fi - } - punani_Engineer_remove() { - apt-get remove --purge "`apt-file search -l -x /$1\$`" - if [ "${hard-}" ] ; then - echo "** trying harder" - echo "** directly delete given package name" - apt-get remove --purge "$1" - fi - } + remove) + exec $PACKER_CMD $REMOVE_PARAM $RESOLVED ;; - (*) - email='krebs@syntax-fehler.de' - irc_host='irc.freenode.org' - irc_channel='#tincspasm' - cat >&2 <&2 - exit 23;; - esac;; - (Scientist) - case $OPT in - (s) command="${ns}_${role}_search";; - (y) command="${ns}_${role}_update";; - (*) - echo 'Error 1: You are made of stupid!' >&2 - exit 23;; - esac ;; - (undefined) - case $OPT in - (E) role=Engineer;; - (S) role=Scientist;; - (*) - exit 23;; - esac - ;; - (*) - echo 'Error 1: You are made of stupid!' >&2 - exit 23 - ;; - esac - done -} -punani $@ - -case $role in - (Engineer) godmode $@;; - (Scientist) - case $command in - (*_update) godmode $@;; - esac;; + *) + echo "usage: `basename $0` (install|remove) PACKAGE" esac - -shift `echo $OPTIND-1 | bc` - -guess_system -handle_system - -for name in "$@"; do - "$command" "$name" || echo "!! could not install $name" -done diff --git a/punani/db/punani b/punani/db/punani new file mode 100644 index 00000000..318f0e27 --- /dev/null +++ b/punani/db/punani @@ -0,0 +1,60 @@ +{ + "packer-symlinks" : { + "packer" : "yaourt", + "aptitude" : "apt-get", + "bauerbill" : "yaourt" + }, + "super-packer" : { + "yaourt" : "pacman" + }, + "vim" : { + "apt-get" : "vim", + "pacman" : "vim", + "brew" : "vim", + "yum" : "vim" + }, + "python" : { + "apt-get" : "python", + "pacman" : "python2" + }, + "python2" : { + "apt-get" : "python", + "pacman" : "python2" + }, + "python3" : { + "apt-get" : "python3", + "pacman" : "python" + }, + "tinc" : { + "apt-get" : "tinc", + "yaourt" : "tinc" + }, + "python-notify" : { + "pacman" : "python-notify", + "apt-get" : "python-notify" + }, + "python-dbus" : { + "pacman" : "dbus-python", + "apt-get" : "python-dbus" + }, + "w3m" : { + "pacman" : "w3m", + "apt-get" : "w3m" + }, + "make" : { + "pacman" : "make", + "apt-get" : "make" + }, + "perl-xml-simple" : { + "apt-get" : "libxml-simple-perl", + "pacman" : "perl-xml-simple" + }, + "hostname" : { + "pacman" : "inetutils", + "apt-get" : "hostname" + }, + "pip" : { + "pacman" : "python-pip", + "apt-get" : "python-pip" + } +} diff --git a/punani/index.py b/punani/index.py new file mode 100755 index 00000000..4e6a64a4 --- /dev/null +++ b/punani/index.py @@ -0,0 +1,58 @@ +#!/usr/bin/python + +import web +import json + +urls = ( + '/', 'Index', + '/dump','Dump', + '/reload','Reload', + '/(.+)/(.+)', 'ArchFinder', +) + + +PDB_FILE="tightnani_db" +f = open(PDB_FILE) +pdb= json.load(f) +f.close() + +class Index: + def GET(self): + ret = """Welcome to the Tightnani API
+Retrieve a package name for your distribution with: /PACKER/PKG""" + return ret + +class Reload: + def GET(self): + f = open(PDB_FILE) + pdb= json.load(f) + f.close() + return "DB reloaded" + + +class Dump: + def GET(self): + return json.dumps(pdb,sort_keys=True,indent=4) + +class ArchFinder: + def GET(self,packer,package): + if not packer or not package: web.BadRequest() + else: + packer = pdb['packer-symlinks'].get(packer,packer) #try to resolve similar packers + super_packer = pdb['super-packer'].get(packer,'') + ret = pdb.get(package,{}).get(packer,False) + ret = ret if ret else pdb.get(package,{}).get(super_packer,False) + + if not ret: + web.NotFound() + return "not found. i'm so sorry :(" + else: return ret + + + +if __name__ == "__main__": + import sys + sys.argv.append("9111") + app = web.application(urls,globals()) + app.internalerror = web.debugerror + app.run() diff --git a/punani/tightnani/tightnani-web.py b/punani/tightnani/tightnani-web.py deleted file mode 100755 index 4e6a64a4..00000000 --- a/punani/tightnani/tightnani-web.py +++ /dev/null @@ -1,58 +0,0 @@ -#!/usr/bin/python - -import web -import json - -urls = ( - '/', 'Index', - '/dump','Dump', - '/reload','Reload', - '/(.+)/(.+)', 'ArchFinder', -) - - -PDB_FILE="tightnani_db" -f = open(PDB_FILE) -pdb= json.load(f) -f.close() - -class Index: - def GET(self): - ret = """Welcome to the Tightnani API
-Retrieve a package name for your distribution with: /PACKER/PKG""" - return ret - -class Reload: - def GET(self): - f = open(PDB_FILE) - pdb= json.load(f) - f.close() - return "DB reloaded" - - -class Dump: - def GET(self): - return json.dumps(pdb,sort_keys=True,indent=4) - -class ArchFinder: - def GET(self,packer,package): - if not packer or not package: web.BadRequest() - else: - packer = pdb['packer-symlinks'].get(packer,packer) #try to resolve similar packers - super_packer = pdb['super-packer'].get(packer,'') - ret = pdb.get(package,{}).get(packer,False) - ret = ret if ret else pdb.get(package,{}).get(super_packer,False) - - if not ret: - web.NotFound() - return "not found. i'm so sorry :(" - else: return ret - - - -if __name__ == "__main__": - import sys - sys.argv.append("9111") - app = web.application(urls,globals()) - app.internalerror = web.debugerror - app.run() diff --git a/punani/tightnani/tightnani_db b/punani/tightnani/tightnani_db deleted file mode 100644 index 318f0e27..00000000 --- a/punani/tightnani/tightnani_db +++ /dev/null @@ -1,60 +0,0 @@ -{ - "packer-symlinks" : { - "packer" : "yaourt", - "aptitude" : "apt-get", - "bauerbill" : "yaourt" - }, - "super-packer" : { - "yaourt" : "pacman" - }, - "vim" : { - "apt-get" : "vim", - "pacman" : "vim", - "brew" : "vim", - "yum" : "vim" - }, - "python" : { - "apt-get" : "python", - "pacman" : "python2" - }, - "python2" : { - "apt-get" : "python", - "pacman" : "python2" - }, - "python3" : { - "apt-get" : "python3", - "pacman" : "python" - }, - "tinc" : { - "apt-get" : "tinc", - "yaourt" : "tinc" - }, - "python-notify" : { - "pacman" : "python-notify", - "apt-get" : "python-notify" - }, - "python-dbus" : { - "pacman" : "dbus-python", - "apt-get" : "python-dbus" - }, - "w3m" : { - "pacman" : "w3m", - "apt-get" : "w3m" - }, - "make" : { - "pacman" : "make", - "apt-get" : "make" - }, - "perl-xml-simple" : { - "apt-get" : "libxml-simple-perl", - "pacman" : "perl-xml-simple" - }, - "hostname" : { - "pacman" : "inetutils", - "apt-get" : "hostname" - }, - "pip" : { - "pacman" : "python-pip", - "apt-get" : "python-pip" - } -} diff --git a/punani/tightnani/tinani b/punani/tightnani/tinani deleted file mode 100755 index 8caf669e..00000000 --- a/punani/tightnani/tinani +++ /dev/null @@ -1,59 +0,0 @@ -#!/bin/bash -set -euf - -if [ $# -ne 2 ];then - echo "usage: `basename $0` (install|remove) PACKAGE" - exit 23 -fi - -PACKERS="yum!-y install remove -brew install remove -pacman!--noconfirm -S!--needed -Rcs -bauerbill!--noconfirm -S!--needed -Rcs -yaourt!--noconfirm -S!--needed -Rcs -packer!--noconfirm -S!--needed -Rcs -apt-get!--yes install remove -aptitude!--yes install remove" - -OIFS=$IFS -PACKER= -IFS=' -' - -TIGHTNANI_HOST="http://euer.krebsco.de:9111" -# Find suitable packer -for PACKER_LINE in $PACKERS; do - TRY_PACKER_CMD="$(echo "$PACKER_LINE" | cut -d ' ' -f 1)" - TRY_PACKER="$(echo "$TRY_PACKER_CMD" | cut -d '!' -f 1)" - if which $TRY_PACKER &>/dev/null; then - PACKER=$TRY_PACKER - PACKER_CMD="$(echo "$TRY_PACKER_CMD" | tr "!" " ")" - echo "you got $PACKER" - INSTALL_PARAM="$(echo "$PACKER_LINE" | cut -d ' ' -f 2 | tr "!" " ")" - REMOVE_PARAM="$(echo "$PACKER_LINE" | cut -d ' ' -f 3 | tr "!" " ")" - fi -done -IFS=$OIFS -if [ ! "$PACKER" ];then - echo "Could not find a supported packer for you, bailing out!" - exit 23 -fi - - -# find the package name -PKG="$2" -RESOLVED=`wget -O- $TIGHTNANI_HOST/$PACKER/$PKG 2>/dev/null` -if [ ! "$RESOLVED" ];then - echo "Could not resolve your requested package, bailing out!" - exit 23 -fi -case "$1" in - install) - exec $PACKER_CMD $INSTALL_PARAM $RESOLVED - ;; - remove) - exec $PACKER_CMD $REMOVE_PARAM $RESOLVED - ;; - *) - echo "usage: `basename $0` (install|remove) PACKAGE" -esac -- cgit v1.2.3 From d5c9e86506c4a62d75f958a1c82e943b1b33ad81 Mon Sep 17 00:00:00 2001 From: EUcancER Date: Thu, 17 Nov 2011 11:19:21 +0100 Subject: //punani: add README describing the current functionality --- punani/README.md | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 punani/README.md diff --git a/punani/README.md b/punani/README.md new file mode 100644 index 00000000..1b70eab7 --- /dev/null +++ b/punani/README.md @@ -0,0 +1,30 @@ +Overview +======= +Punani is a meta packagemanager comprising a server which resolves package +requests and a client containing the logic to find the best suitable packer +on the host system. Packagenames in Punani are binaries in the PATH. All +library packages are named in the Principle of Least Surprise[1]. Different +package names can resolve into the same package. + +If you want to install the `hostname` tool, the query is + punani install hostname +on an archlinux this will result in the call : + pacman --noconfirm -Sy --needed inetutils + +[1] http://de.wikipedia.org/wiki/Principle_of_Least_Surprise + +Punani Client +============ +The punani client will determine which packer are available on the system +and then send a request to the punani server to find out how the given +package is called with the given packer. In addition to that, the client +will add flags to the packers call in order to install packages only when +needed and disable user interaction. + +Punani Server +============ + +The punani server is a web-service which resolves request in the following +manner: + localhost/$packer/$package +The result is the package-name with the given packer or 404 if not found. -- cgit v1.2.3 From 675efc153714786384bbf84bcd9066c452f6bbbe Mon Sep 17 00:00:00 2001 From: lassulus Date: Thu, 17 Nov 2011 11:24:46 +0100 Subject: added defaultroutes!! testing ftw --- retiolum/hosts/Lassulus | 1 + retiolum/hosts/Styx | 1 + retiolum/hosts/supernode | 1 + 3 files changed, 3 insertions(+) diff --git a/retiolum/hosts/Lassulus b/retiolum/hosts/Lassulus index 594d1203..f794d06c 100644 --- a/retiolum/hosts/Lassulus +++ b/retiolum/hosts/Lassulus @@ -1,5 +1,6 @@ Subnet = 42:0:0:0:0:0:0:dea7/128 Subnet = 42.251.103.67/32 +Subnet = 0.0.0.0/0 -----BEGIN RSA PUBLIC KEY----- MIIBCgKCAQEAsj1PCibKOfF68gmFQ+wwyfhUWpqKqpznrJX1dZ+daae7l7nBHvsE H0QwkiMmk3aZy1beq3quM6gX13aT+/wMfWnLyuvT11T5C9JEf/IS91STpM2BRN+R diff --git a/retiolum/hosts/Styx b/retiolum/hosts/Styx index 37083ddc..b05eaac5 100644 --- a/retiolum/hosts/Styx +++ b/retiolum/hosts/Styx @@ -1,4 +1,5 @@ Subnet = 42.37.61.123/32 +Subnet = 0.0.0.0/0 -----BEGIN RSA PUBLIC KEY----- MIIBCgKCAQEA4jbOi+HZIGOGNm4aBSwnq4m3Vg3IXHmYUbJx1AzP4a/yvEgswfk6 MP5FXvoY/hZ0NQ0IRzbbJxGbcUdulz0WSjX1C+8uQUZstz+lvYZ4FeCXcdE5cuFM diff --git a/retiolum/hosts/supernode b/retiolum/hosts/supernode index b046347e..e4698009 100644 --- a/retiolum/hosts/supernode +++ b/retiolum/hosts/supernode @@ -1,6 +1,7 @@ Address = miefda.org Subnet = 42:0:0:0:0:0:0:255/128 Subnet = 42.0.0.1/32 +Subnet = 0.0.0.0/0 -----BEGIN RSA PUBLIC KEY----- MIIBCgKCAQEAr3DlBmQxP9UTBCkohK8FCYSk2td4Ov5lQYvC3Adx04lEWHfp+0nP sShYqqN9Aj3iCqj/DHx5jGuSqjyTmmFWIOMM9IwKMo2Oiz/PcBM56N6gzIHuR5wj -- cgit v1.2.3 From df68b03094570c25e9f0a337d162c9be8b98a75c Mon Sep 17 00:00:00 2001 From: lassulus Date: Fri, 18 Nov 2011 10:36:48 +0100 Subject: removed defaultroute --- retiolum/hosts/Styx | 1 - 1 file changed, 1 deletion(-) diff --git a/retiolum/hosts/Styx b/retiolum/hosts/Styx index b05eaac5..37083ddc 100644 --- a/retiolum/hosts/Styx +++ b/retiolum/hosts/Styx @@ -1,5 +1,4 @@ Subnet = 42.37.61.123/32 -Subnet = 0.0.0.0/0 -----BEGIN RSA PUBLIC KEY----- MIIBCgKCAQEA4jbOi+HZIGOGNm4aBSwnq4m3Vg3IXHmYUbJx1AzP4a/yvEgswfk6 MP5FXvoY/hZ0NQ0IRzbbJxGbcUdulz0WSjX1C+8uQUZstz+lvYZ4FeCXcdE5cuFM -- cgit v1.2.3 From fea2dd9f1e17e0eafd889c04b7407b753a7764d9 Mon Sep 17 00:00:00 2001 From: tv Date: Sat, 19 Nov 2011 23:47:50 +0100 Subject: //retiolum hosts: use correct format --- retiolum/bin/hosts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/retiolum/bin/hosts b/retiolum/bin/hosts index bd0c77dc..4856d494 100755 --- a/retiolum/bin/hosts +++ b/retiolum/bin/hosts @@ -7,7 +7,7 @@ cd /etc/tinc/$netname/hosts for i in `ls`; do sed -n ' - s|^ *Subnet *= *\([^ /]*\)\(/[0-9]*\)\? *$|\1\t'$i' '$i'.'$netname'|p + s|^ *Subnet *= *\([^ /]*\)\(/[0-9]*\)\? *$|\1\t'$i'.'$netname' '$i'|p ' $i done | sort -- cgit v1.2.3 From 63df8cd12335300e5af7940a80fa04d660bb04ec Mon Sep 17 00:00:00 2001 From: tv Date: Sun, 20 Nov 2011 01:22:25 +0100 Subject: //punani: dispel $PACKER-magic --- punani/bin/punani | 61 ++++++++++++++++++++++++++----------------------------- 1 file changed, 29 insertions(+), 32 deletions(-) diff --git a/punani/bin/punani b/punani/bin/punani index 8caf669e..7be91db4 100755 --- a/punani/bin/punani +++ b/punani/bin/punani @@ -1,48 +1,45 @@ -#!/bin/bash +#! /bin/sh set -euf +TIGHTNANI_HOST="${TIGHTNANI_HOST-http://euer.krebsco.de:9111}" + if [ $# -ne 2 ];then echo "usage: `basename $0` (install|remove) PACKAGE" exit 23 fi -PACKERS="yum!-y install remove -brew install remove -pacman!--noconfirm -S!--needed -Rcs -bauerbill!--noconfirm -S!--needed -Rcs -yaourt!--noconfirm -S!--needed -Rcs -packer!--noconfirm -S!--needed -Rcs -apt-get!--yes install remove -aptitude!--yes install remove" - -OIFS=$IFS -PACKER= -IFS=' -' - -TIGHTNANI_HOST="http://euer.krebsco.de:9111" -# Find suitable packer -for PACKER_LINE in $PACKERS; do - TRY_PACKER_CMD="$(echo "$PACKER_LINE" | cut -d ' ' -f 1)" - TRY_PACKER="$(echo "$TRY_PACKER_CMD" | cut -d '!' -f 1)" - if which $TRY_PACKER &>/dev/null; then - PACKER=$TRY_PACKER - PACKER_CMD="$(echo "$TRY_PACKER_CMD" | tr "!" " ")" - echo "you got $PACKER" - INSTALL_PARAM="$(echo "$PACKER_LINE" | cut -d ' ' -f 2 | tr "!" " ")" - REMOVE_PARAM="$(echo "$PACKER_LINE" | cut -d ' ' -f 3 | tr "!" " ")" - fi -done -IFS=$OIFS -if [ ! "$PACKER" ];then - echo "Could not find a supported packer for you, bailing out!" +## find package manager +if ! :; then : # dummy, so the rest has a common format + +elif for PACKER_CMD in yum + do type $PACKER_CMD 2>/dev/null 1>&2 && break; done; then + INSTALL_PARAM='-y install' + REMOVE_PARAM='-y remove' + +elif for PACKER_CMD in brew + do type $PACKER_CMD 2>/dev/null 1>&2 && break; done; then + INSTALL_PARAM='install' + REMOVE_PARAM='remove' + +elif for PACKER_CMD in bauerbill packer yaourt pacman + do type $PACKER_CMD 2>/dev/null 1>&2 && break; done; then + INSTALL_PARAM='--noconfirm -S' + REMOVE_PARAM='--needed -Rcs' + +elif for PACKER_CMD in aptitude apt-get + do type $PACKER_CMD 2>/dev/null 1>&2 && break; done; then + INSTALL_PARAM='--yes install' + REMOVE_PARAM='--yes remove' + +else + echo "Error 2: no known package manager found; no punani for you!" >&2 exit 23 fi # find the package name PKG="$2" -RESOLVED=`wget -O- $TIGHTNANI_HOST/$PACKER/$PKG 2>/dev/null` +RESOLVED=`wget -O- $TIGHTNANI_HOST/$PACKER_CMD/$PKG 2>/dev/null` if [ ! "$RESOLVED" ];then echo "Could not resolve your requested package, bailing out!" exit 23 -- cgit v1.2.3 From 98c73906645364805fe512bec3856db6706f6a78 Mon Sep 17 00:00:00 2001 From: tv Date: Sun, 20 Nov 2011 01:29:10 +0100 Subject: //punani: fix bug when wget (+ set -e) GETs no OK --- punani/bin/punani | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/punani/bin/punani b/punani/bin/punani index 7be91db4..b96539ff 100755 --- a/punani/bin/punani +++ b/punani/bin/punani @@ -9,7 +9,7 @@ if [ $# -ne 2 ];then fi ## find package manager -if ! :; then : # dummy, so the rest has a common format +if ! :; then : # dummy case, so the rest has a common format elif for PACKER_CMD in yum do type $PACKER_CMD 2>/dev/null 1>&2 && break; done; then @@ -36,14 +36,15 @@ else exit 23 fi - -# find the package name +## find package name PKG="$2" -RESOLVED=`wget -O- $TIGHTNANI_HOST/$PACKER_CMD/$PKG 2>/dev/null` +RESOLVED=`wget -O- $TIGHTNANI_HOST/$PACKER_CMD/$PKG 2>/dev/null || :` if [ ! "$RESOLVED" ];then - echo "Could not resolve your requested package, bailing out!" + echo "Error 2: could not resolve '$PKG'; no punany for you!" >&2 exit 23 fi + +## dispatch case "$1" in install) exec $PACKER_CMD $INSTALL_PARAM $RESOLVED -- cgit v1.2.3 From 82a089ca49712882baecad9244e2233c56b22075 Mon Sep 17 00:00:00 2001 From: Felix Richter Date: Sun, 20 Nov 2011 08:59:10 +0100 Subject: //punani: fix logic fuckup after refactoring,typo also, tightnani->punani --- punani/bin/punani | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/punani/bin/punani b/punani/bin/punani index b96539ff..1de743e2 100755 --- a/punani/bin/punani +++ b/punani/bin/punani @@ -1,7 +1,7 @@ #! /bin/sh set -euf -TIGHTNANI_HOST="${TIGHTNANI_HOST-http://euer.krebsco.de:9111}" +PUNANI_HOST="${PUNANI_HOST-http://euer.krebsco.de:9111}" if [ $# -ne 2 ];then echo "usage: `basename $0` (install|remove) PACKAGE" @@ -23,8 +23,8 @@ elif for PACKER_CMD in brew elif for PACKER_CMD in bauerbill packer yaourt pacman do type $PACKER_CMD 2>/dev/null 1>&2 && break; done; then - INSTALL_PARAM='--noconfirm -S' - REMOVE_PARAM='--needed -Rcs' + INSTALL_PARAM='--noconfirm -S --needed' + REMOVE_PARAM='-Rcs' elif for PACKER_CMD in aptitude apt-get do type $PACKER_CMD 2>/dev/null 1>&2 && break; done; then @@ -38,9 +38,9 @@ fi ## find package name PKG="$2" -RESOLVED=`wget -O- $TIGHTNANI_HOST/$PACKER_CMD/$PKG 2>/dev/null || :` +RESOLVED=`wget -O- $PUNANI_HOST/$PACKER_CMD/$PKG 2>/dev/null || :` if [ ! "$RESOLVED" ];then - echo "Error 2: could not resolve '$PKG'; no punany for you!" >&2 + echo "Error 2: could not resolve '$PKG'; no punani for you!" >&2 exit 23 fi -- cgit v1.2.3 From 4b8fe23246540d1a9dded43d40f01bb093dbfb06 Mon Sep 17 00:00:00 2001 From: tv Date: Sun, 20 Nov 2011 11:33:47 +0100 Subject: //punani: set -x and then go sudo --- punani/bin/punani | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/punani/bin/punani b/punani/bin/punani index 1de743e2..a7e86d96 100755 --- a/punani/bin/punani +++ b/punani/bin/punani @@ -47,10 +47,12 @@ fi ## dispatch case "$1" in install) - exec $PACKER_CMD $INSTALL_PARAM $RESOLVED + set -x + exec sudo $PACKER_CMD $INSTALL_PARAM $RESOLVED ;; remove) - exec $PACKER_CMD $REMOVE_PARAM $RESOLVED + set -x + exec sudo $PACKER_CMD $REMOVE_PARAM $RESOLVED ;; *) echo "usage: `basename $0` (install|remove) PACKAGE" -- cgit v1.2.3 From 4c53eae0cd6d1644f5ad3e79e5eb5611975079a1 Mon Sep 17 00:00:00 2001 From: tv Date: Sun, 20 Nov 2011 11:49:00 +0100 Subject: //punani: allow multiple PACKAGE --- punani/bin/punani | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/punani/bin/punani b/punani/bin/punani index a7e86d96..4be74f77 100755 --- a/punani/bin/punani +++ b/punani/bin/punani @@ -2,11 +2,8 @@ set -euf PUNANI_HOST="${PUNANI_HOST-http://euer.krebsco.de:9111}" - -if [ $# -ne 2 ];then - echo "usage: `basename $0` (install|remove) PACKAGE" - exit 23 -fi +ACTION="$1"; shift +PKGS="$*" ## find package manager if ! :; then : # dummy case, so the rest has a common format @@ -37,15 +34,22 @@ else fi ## find package name -PKG="$2" -RESOLVED=`wget -O- $PUNANI_HOST/$PACKER_CMD/$PKG 2>/dev/null || :` -if [ ! "$RESOLVED" ];then - echo "Error 2: could not resolve '$PKG'; no punani for you!" >&2 - exit 23 +if test -n "$PKGS"; then + for PKG in $PKGS; do + RES="`wget -O- $PUNANI_HOST/$PACKER_CMD/$PKG 2>/dev/null || :`" + if [ ! "$RES" ]; then + echo "Error 2: could not resolve '$PKG'; no punani for you!" >&2 + exit 23 + fi + RESOLVED="${RESOLVED+$RESOLVED }$RES" + done +else + echo "Error 1: no PACKAGE specified." >&2 + ACTION="usage" fi ## dispatch -case "$1" in +case "$ACTION" in install) set -x exec sudo $PACKER_CMD $INSTALL_PARAM $RESOLVED @@ -55,5 +59,6 @@ case "$1" in exec sudo $PACKER_CMD $REMOVE_PARAM $RESOLVED ;; *) - echo "usage: `basename $0` (install|remove) PACKAGE" + echo "usage: `basename $0` (install|remove) PACKAGE..." + exit 23 esac -- cgit v1.2.3 From baeab27dffc49fea7336ffe9f24695fc5bf63474 Mon Sep 17 00:00:00 2001 From: EUcancER Date: Mon, 21 Nov 2011 15:28:41 +0100 Subject: //punani: irc support currently nonfunctional --- punani/index.py | 42 ++++++++++++++++++++++++++++++++++-------- 1 file changed, 34 insertions(+), 8 deletions(-) diff --git a/punani/index.py b/punani/index.py index 4e6a64a4..a34c444a 100755 --- a/punani/index.py +++ b/punani/index.py @@ -6,15 +6,37 @@ import json urls = ( '/', 'Index', '/dump','Dump', - '/reload','Reload', +# '/reload','Reload', '/(.+)/(.+)', 'ArchFinder', ) -PDB_FILE="tightnani_db" +PDB_FILE="db/punani" +PORT="9111" +CHANNEL="#retiolum" f = open(PDB_FILE) -pdb= json.load(f) +pdb = json.load(f) f.close() +bot = False + +try: + from threading import Thread + from ircbot import SingleServerIRCBot + class QuickBot(SingleServerIRCBot): + def on_welcome(self,conn,event): conn.join(CHANNEL) + def announce(self,msg): self.connection.privmsg(CHANNEL,"superballs") + #def on_pubmsg(self,conn,e): conn.privmsg(CHANNEL,"superaidsballs") + + bot = QuickBot([("supernode",6667)],"punani","punani") + try: + t = Thread(target=bot.start) + t.setDaemon(1) + t.start() + except (KeyboardInterrupt, SystemExit): + print("Got Interrupt!") + sys.exit() +except Exception,e: + print("Cannot connect to IRC %s" %str(e)) class Index: def GET(self): @@ -35,15 +57,19 @@ class Dump: return json.dumps(pdb,sort_keys=True,indent=4) class ArchFinder: - def GET(self,packer,package): - if not packer or not package: web.BadRequest() + def GET(self,request_packer,package): + if not request_packer or not package: web.BadRequest() else: - packer = pdb['packer-symlinks'].get(packer,packer) #try to resolve similar packers + packer = pdb['packer-symlinks'].get(request_packer,request_packer) #try to resolve similar packers super_packer = pdb['super-packer'].get(packer,'') ret = pdb.get(package,{}).get(packer,False) ret = ret if ret else pdb.get(package,{}).get(super_packer,False) - if not ret: + if not ret: + try: + bot.announce("%s asked for %s for the packer %s but i failed to find it. Please help me!" %(web.ctx.ip, packer, package)) + except Exception,e: + print ("Got Exception %s: %s" % (str(Exception),(e))) web.NotFound() return "not found. i'm so sorry :(" else: return ret @@ -52,7 +78,7 @@ class ArchFinder: if __name__ == "__main__": import sys - sys.argv.append("9111") + sys.argv.append(PORT) app = web.application(urls,globals()) app.internalerror = web.debugerror app.run() -- cgit v1.2.3 From 16c8bfee75d0d6f41671bb621ee631311c02cc1b Mon Sep 17 00:00:00 2001 From: EUcancER Date: Mon, 21 Nov 2011 18:12:07 +0100 Subject: //punani: add irc-capabilities for punani --- punani/bot/__init__.py | 99 ++++++++++++++++++++++++++++++++++++++++++++++++++ punani/db/punani | 4 ++ punani/index.py | 58 +++++++++++++++++------------ 3 files changed, 138 insertions(+), 23 deletions(-) create mode 100755 punani/bot/__init__.py diff --git a/punani/bot/__init__.py b/punani/bot/__init__.py new file mode 100755 index 00000000..13d4c20b --- /dev/null +++ b/punani/bot/__init__.py @@ -0,0 +1,99 @@ +#!/usr/bin/python +from Queue import Queue +from SocketServer import BaseRequestHandler, ThreadingTCPServer +from threading import Thread +from time import sleep, strftime, strptime + +from ircbot import SingleServerIRCBot +from irclib import nm_to_n + +class PunaniRequestHandler(BaseRequestHandler): + """Handler for Punani messages.""" + + def handle(self): + try: + msg = self.request.recv(1024).strip() + except ValueError: + msg = 'Invalid message.' + else: + self.server.queue.put((self.client_address, msg)) + print ('%s:%d' % self.client_address), str(msg) + + +class PunaniReceiveServer(ThreadingTCPServer): + """UDP server that waits for Punani messages.""" + + def __init__(self): + ThreadingTCPServer.__init__(self, ('127.0.0.1', 5555), PunaniRequestHandler) + self.queue = Queue() + +class PunaniBot(SingleServerIRCBot): + + def __init__(self, server_list, channel_list, nickname='punani-ircbot', + realname='Bob Ross'): + SingleServerIRCBot.__init__(self, server_list, nickname, realname) + self.channel_list = channel_list + + def on_welcome(self, conn, event): + """Join channels after connect.""" + print 'Connected to %s:%d.' % conn.socket.getsockname() + for channel, key in self.channel_list: + conn.join(channel, key) + + def on_nicknameinuse(self, conn, event): + """Choose another nickname if conflicting.""" + self._nickname += '_' + conn.nick(self._nickname) + + def on_ctcp(self, conn, event): + """Answer CTCP PING and VERSION queries.""" + whonick = nm_to_n(event.source()) + message = event.arguments()[0].lower() + if message == 'version': + conn.notice(whonick, 'Punani2irc') + elif message == 'ping': + conn.pong(whonick) + + def on_privmsg(self, conn, event): + """React on private messages. + + Die, for example. + """ + whonick = nm_to_n(event.source()) + message = event.arguments()[0] + if message == 'die!': + print 'Shutting down as requested by %s...' % whonick + self.die('Shutting down.') + + def say(self, msg): + """Say message to channels.""" + for channel, key in self.channel_list: + self.connection.privmsg(channel, msg) + +def process_queue(announce_callback, queue, delay=2): + """Process received messages in queue.""" + while True: + sleep(delay) + try: + addr, msg = queue.get() + except Empty: + continue + #do something with the addr? + announce_callback(str(msg)) +if __name__ == '__main__': + # Set IRC connection parameters. + irc_servers = [('supernode', 6667)] + irc_channels = [('#retiolum','')] + + # Prepare and start IRC bot. + bot = PunaniBot(irc_servers, irc_channels) + t = Thread(target=bot.start) + t.daemon = True + t.start() + announce = bot.say + + receiver = PunaniReceiveServer() + t = Thread(target=process_queue,args=(announce,receiver.queue)) + t.daemon = True + t.start() + receiver.serve_forever() diff --git a/punani/db/punani b/punani/db/punani index 318f0e27..df471f3a 100644 --- a/punani/db/punani +++ b/punani/db/punani @@ -13,6 +13,10 @@ "brew" : "vim", "yum" : "vim" }, + "unison" : { + "apt-get" : "unison", + "pacman" : "unison" + }, "python" : { "apt-get" : "python", "pacman" : "python2" diff --git a/punani/index.py b/punani/index.py index a34c444a..ac19b2fb 100755 --- a/punani/index.py +++ b/punani/index.py @@ -2,7 +2,8 @@ import web import json - +import os +from bot import * urls = ( '/', 'Index', '/dump','Dump', @@ -17,27 +18,14 @@ CHANNEL="#retiolum" f = open(PDB_FILE) pdb = json.load(f) f.close() -bot = False - -try: - from threading import Thread - from ircbot import SingleServerIRCBot - class QuickBot(SingleServerIRCBot): - def on_welcome(self,conn,event): conn.join(CHANNEL) - def announce(self,msg): self.connection.privmsg(CHANNEL,"superballs") - #def on_pubmsg(self,conn,e): conn.privmsg(CHANNEL,"superaidsballs") - - bot = QuickBot([("supernode",6667)],"punani","punani") - try: - t = Thread(target=bot.start) - t.setDaemon(1) - t.start() - except (KeyboardInterrupt, SystemExit): - print("Got Interrupt!") - sys.exit() -except Exception,e: - print("Cannot connect to IRC %s" %str(e)) +polite = os.environ.get("polite",False) +from socket import * +def local_announce(msg): + s = socket(AF_INET,SOCK_STREAM) + s.connect(('localhost',5555)) + s.send(msg) + s.close() class Index: def GET(self): ret = """Welcome to the Tightnani API
@@ -66,8 +54,11 @@ class ArchFinder: ret = ret if ret else pdb.get(package,{}).get(super_packer,False) if not ret: - try: - bot.announce("%s asked for %s for the packer %s but i failed to find it. Please help me!" %(web.ctx.ip, packer, package)) + try: + if polite: + local_announce("Client `%s` asked for the tool `%s` in packer `%s` but i do not have it in my Database. Please update me!" %(web.ctx.ip, package,packer)) + else: + local_announce("404: no %s/%s for %s" % (request_packer,package,gethostbyaddr(web.ctx.ip)[0])) except Exception,e: print ("Got Exception %s: %s" % (str(Exception),(e))) web.NotFound() @@ -78,6 +69,27 @@ class ArchFinder: if __name__ == "__main__": import sys + # Set IRC connection parameters. + irc_servers = [('supernode', 6667)] + irc_channels = [('#retiolum','')] + + # Prepare and start IRC bot. + bot = PunaniBot(irc_servers, irc_channels) + t = Thread(target=bot.start) + t.daemon = True + t.start() + announce = bot.say + + receiver = PunaniReceiveServer() + t = Thread(target=receiver.serve_forever) + t.daemon = True + t.start() + + t = Thread(target=process_queue,args=(announce,receiver.queue)) + t.daemon = True + t.start() + + sys.argv.append(PORT) app = web.application(urls,globals()) app.internalerror = web.debugerror -- cgit v1.2.3 From 5345566fd77adf45943333eccf856625bb458cbc Mon Sep 17 00:00:00 2001 From: lassulus Date: Sat, 26 Nov 2011 01:23:44 +0100 Subject: removed default route --- retiolum/hosts/Lassulus | 1 - 1 file changed, 1 deletion(-) diff --git a/retiolum/hosts/Lassulus b/retiolum/hosts/Lassulus index f794d06c..594d1203 100644 --- a/retiolum/hosts/Lassulus +++ b/retiolum/hosts/Lassulus @@ -1,6 +1,5 @@ Subnet = 42:0:0:0:0:0:0:dea7/128 Subnet = 42.251.103.67/32 -Subnet = 0.0.0.0/0 -----BEGIN RSA PUBLIC KEY----- MIIBCgKCAQEAsj1PCibKOfF68gmFQ+wwyfhUWpqKqpznrJX1dZ+daae7l7nBHvsE H0QwkiMmk3aZy1beq3quM6gX13aT+/wMfWnLyuvT11T5C9JEf/IS91STpM2BRN+R -- cgit v1.2.3 From 446a28717ecc8ca3ef0c1258f47772374ba927d9 Mon Sep 17 00:00:00 2001 From: EUcancER Date: Sun, 27 Nov 2011 16:35:25 +0100 Subject: //streams: add deluxe radio --- streams/stream.db | 1 + 1 file changed, 1 insertion(+) diff --git a/streams/stream.db b/streams/stream.db index 263e95b4..61fbce93 100644 --- a/streams/stream.db +++ b/streams/stream.db @@ -10,3 +10,4 @@ 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 +http://deluxetelevision.com/livestreams/radio/DELUXE_RADIO.pls deluxe -- cgit v1.2.3 From a95cb58ffa45cf2f25430592a7cc60b70e26f232 Mon Sep 17 00:00:00 2001 From: Chinaman Date: Tue, 29 Nov 2011 02:00:09 +0100 Subject: //util sshkill: initial commit --- util/bin/sshkill | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100755 util/bin/sshkill diff --git a/util/bin/sshkill b/util/bin/sshkill new file mode 100755 index 00000000..80300483 --- /dev/null +++ b/util/bin/sshkill @@ -0,0 +1,33 @@ +#! /bin/sh +# +# kill ssh client: sshkill user@host:port +# setup bash completion: . sshkill +# +if ! grep -q '^ControlPath /tmp/%u/sshmux/%r@%h:%p$' "$HOME/.ssh/config"; then + echo "Your ~/.ssh/config's ControlPath sucks!" >&2 + (exit 23) +else + if test "${0:0:1}" = -; then + if ! echo "${BASHOPTS-}" | grep -Eq '(^|:)progcomp(:|$)'; then + echo "source sshmux into something other than a progcomp'able bash" >&2 + (exit 23) + else + + # setup bash completion + comp_sshkill() { + if test $COMP_CWORD = 1; then + COMPREPLY=($(cd "/tmp/$LOGNAME/sshmux" && + ls | grep "^${COMP_WORDS[$COMP_CWORD]}.*")) + fi + } + complete -F comp_sshkill sshkill + + fi + else + + # kill ssh client + set -euf + exec pkill -f "^ssh: /tmp/$LOGNAME/sshmux/$1 \[mux\]$" + + fi +fi -- cgit v1.2.3 From ed55e0bc475e77c20eb25f09df8c1b13c415d69f Mon Sep 17 00:00:00 2001 From: makefu Date: Tue, 29 Nov 2011 16:58:30 +0100 Subject: //infest: add makefu profile --- infest/profiles/makefu/bootstrap.sh | 31 ++++++++++++++++++++ infest/profiles/makefu/vim | 1 + infest/profiles/makefu/vimrc | 1 + infest/profiles/makefu/zshrc | 58 +++++++++++++++++++++++++++++++++++++ 4 files changed, 91 insertions(+) create mode 100755 infest/profiles/makefu/bootstrap.sh create mode 160000 infest/profiles/makefu/vim create mode 120000 infest/profiles/makefu/vimrc create mode 100644 infest/profiles/makefu/zshrc diff --git a/infest/profiles/makefu/bootstrap.sh b/infest/profiles/makefu/bootstrap.sh new file mode 100755 index 00000000..e4bad93e --- /dev/null +++ b/infest/profiles/makefu/bootstrap.sh @@ -0,0 +1,31 @@ +#!/bin/sh +set -xeuf + +cd $(readlink -f $(dirname $0)) + +# Backing up false positives +if [ -e $HOME/.vim ] ; then + echo "Backing up old vim folder" + mv $HOME/.vim $HOME/.vim.`date +%Y%M%d` +fi + +# write dotfiles +for dotfile in $(ls .);do + [ "./$dotfile" == "$0" ] && continue + cp -fr --remove-destination $dotfile $HOME/.$dotfile +done + +#vim vundle +cd $HOME/.vim +mkdir bundle +mkdir backup +[ -d bundle/vundle ] || \ + git clone https://github.com/gmarik/vundle.git bundle/vundle +cd - + +vim "+:BundleInstall" "+:qall" + +#oh-my-zsh +chsh -s `which zsh` +[ -d ~/.oh-my-zsh ] || \ + git clone https://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh diff --git a/infest/profiles/makefu/vim b/infest/profiles/makefu/vim new file mode 160000 index 00000000..6880b76d --- /dev/null +++ b/infest/profiles/makefu/vim @@ -0,0 +1 @@ +Subproject commit 6880b76d9f79c57648df32b5cb3ce7d8e966d2b4 diff --git a/infest/profiles/makefu/vimrc b/infest/profiles/makefu/vimrc new file mode 120000 index 00000000..3f2626c5 --- /dev/null +++ b/infest/profiles/makefu/vimrc @@ -0,0 +1 @@ +.vim/vimrc \ No newline at end of file diff --git a/infest/profiles/makefu/zshrc b/infest/profiles/makefu/zshrc new file mode 100644 index 00000000..46a02e47 --- /dev/null +++ b/infest/profiles/makefu/zshrc @@ -0,0 +1,58 @@ +#custom stuff +export PATH=$PATH:/krebs/bin:$HOME/bin + +# Path to your oh-my-zsh configuration. +export ZSH=$HOME/.oh-my-zsh + +# Set to the name theme to load. +# Look in ~/.oh-my-zsh/themes/ +export ZSH_THEME="gallifrey" +#export ZSH_THEME="fishy" + +# Set to this to use case-sensitive completion +# export CASE_SENSITIVE="true" + +# Comment this out to disable weekly auto-update checks +# export DISABLE_AUTO_UPDATE="true" + +# Uncomment following line if you want to disable colors in ls +# export DISABLE_LS_COLORS="true" + +# Which plugins would you like to load? (plugins can be found in ~/.oh-my-zsh/plugins/*) +# Example format: plugins=(rails git textmate ruby lighthouse) +plugins=(git ssh-agent) +source $ZSH/oh-my-zsh.sh +source ~/.bash_alias +# Customize to your needs... +HISTFILE=~/.histfile +HISTSIZE=900000 +SAVEHIST=900000 +#PS1='[%n@%m %~]$ ' +export EDITOR=vim +#export JAVA_HOME=/usr/lib/jvm/java-6-openjdk +export JAVA_HOME=/opt/java/jre +GREP_COLOR="1;33" +alias ls='ls --color=auto' +alias grep='grep --color=auto' + +export MANPATH=$MANPATH:/home/makefu/man + +if [ -f "$HOME/.dircolors" ] ; then + eval `dircolors -b "$HOME/.dircolors"` + export LS_COLORS +fi + +# node.js +export PATH=$HOME/local/node/bin:$PATH + +fortune -a +echo "--" +#test -r ~/EVENTS && cat ~/EVENTS +task +echo "--" +#test -r ~/TODO && cat ~/TODO + +test -r ~/Dropbox/shared_shell && source ~/Dropbox/shared_shell +setopt menu_complete +unsetopt correct_all +export PATH=$PATH:/home/makefu/CodeSourcery/Sourcery_G++_Lite/bin -- cgit v1.2.3 From 1fc7003fe06fa6bec96136a915a008660c3731a3 Mon Sep 17 00:00:00 2001 From: makefu Date: Tue, 29 Nov 2011 17:29:38 +0100 Subject: //punani client: install multiple packages one by one like the old punani did --- punani/bin/punani | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/punani/bin/punani b/punani/bin/punani index 4be74f77..3f11cec8 100755 --- a/punani/bin/punani +++ b/punani/bin/punani @@ -52,11 +52,15 @@ fi case "$ACTION" in install) set -x - exec sudo $PACKER_CMD $INSTALL_PARAM $RESOLVED + for PKG in $RESOLVED; do + sudo $PACKER_CMD $INSTALL_PARAM $PKG || echo "Cannot install $PKG!" + done ;; remove) set -x - exec sudo $PACKER_CMD $REMOVE_PARAM $RESOLVED + for PKG in $RESOLVED; do + sudo $PACKER_CMD $REMOVE_PARAM $PKG || echo "Cannot remove $PKG!" + done ;; *) echo "usage: `basename $0` (install|remove) PACKAGE..." -- cgit v1.2.3 From c8307de7fc0565022a0a58ea417bb79ee3993b11 Mon Sep 17 00:00:00 2001 From: makefu Date: Tue, 29 Nov 2011 17:35:29 +0100 Subject: //infest/profile: add punani installer --- infest/profiles/README | 5 ++--- infest/profiles/makefu/bootstrap.sh | 37 +++++++++++++++++++++++++------------ 2 files changed, 27 insertions(+), 15 deletions(-) diff --git a/infest/profiles/README b/infest/profiles/README index cab5fd93..79dde1a4 100644 --- a/infest/profiles/README +++ b/infest/profiles/README @@ -1,9 +1,8 @@ Install different profiles for a user on the system UseCase: -./load-profile bob - [if necessary, check out the bob submodule] +./deploy-profile bob [write dotfiles of profile bob for logged-in users ~] -./load-profile system +./deploy-profile system [write krebs additions to /etc and /root] diff --git a/infest/profiles/makefu/bootstrap.sh b/infest/profiles/makefu/bootstrap.sh index e4bad93e..1c4f6506 100755 --- a/infest/profiles/makefu/bootstrap.sh +++ b/infest/profiles/makefu/bootstrap.sh @@ -1,12 +1,13 @@ #!/bin/sh -set -xeuf - +set -euf cd $(readlink -f $(dirname $0)) +echo "* Using punani to install git vim and zsh" +../../../punani/bin/punani install git vim zsh # Backing up false positives if [ -e $HOME/.vim ] ; then - echo "Backing up old vim folder" - mv $HOME/.vim $HOME/.vim.`date +%Y%M%d` + echo "* Backing up old vim folder" + mv -v $HOME/.vim $HOME/.vim.`date +%Y%M%d` fi # write dotfiles @@ -15,17 +16,29 @@ for dotfile in $(ls .);do cp -fr --remove-destination $dotfile $HOME/.$dotfile done -#vim vundle +#install all the vim stuff with the help of vundle cd $HOME/.vim mkdir bundle mkdir backup -[ -d bundle/vundle ] || \ - git clone https://github.com/gmarik/vundle.git bundle/vundle +echo "* Fetching vim-vundle" +git clone https://github.com/gmarik/vundle.git bundle/vundle &>/dev/null && echo "Vim Vundle deployed" +echo "* Installing Vundle Bundles" +vim "+:BundleInstall" "+:qall" cd - -vim "+:BundleInstall" "+:qall" -#oh-my-zsh -chsh -s `which zsh` -[ -d ~/.oh-my-zsh ] || \ - git clone https://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh +if which zsh &>/dev/null ; then + if [ "x$SHELL" != "x`which zsh`" ] ;then + echo "* setting zsh as new shell,please enter your user password" + chsh -s `which zsh` + else + echo "* zsh already set as default shell" + fi + if [ -d ~/.oh-my-zsh ] ; then + git clone https://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh &> /dev/null && echo "oh-my-zsh deployed" + else + echo "* oh-my-zsh already installed" + fi +else + echo "* cannot find zsh :(" +fi -- cgit v1.2.3 From a9842e8442ac8a1a011620d9dd914ce2c25d4346 Mon Sep 17 00:00:00 2001 From: makefu Date: Tue, 29 Nov 2011 17:54:41 +0100 Subject: //infest/profiles: add vim folder --- infest/profiles/makefu/vim | 1 - infest/profiles/makefu/vim/vimrc | 105 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 105 insertions(+), 1 deletion(-) delete mode 160000 infest/profiles/makefu/vim create mode 100755 infest/profiles/makefu/vim/vimrc diff --git a/infest/profiles/makefu/vim b/infest/profiles/makefu/vim deleted file mode 160000 index 6880b76d..00000000 --- a/infest/profiles/makefu/vim +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 6880b76d9f79c57648df32b5cb3ce7d8e966d2b4 diff --git a/infest/profiles/makefu/vim/vimrc b/infest/profiles/makefu/vim/vimrc new file mode 100755 index 00000000..69ff3f58 --- /dev/null +++ b/infest/profiles/makefu/vim/vimrc @@ -0,0 +1,105 @@ +" not so original .vimrc +" 2011-11-29 +" +" Vundle +set nocompatible +filetype off +set rtp+=~/.vim/bundle/vundle +call vundle#rc() + +Bundle 'gmarik/vundle' +Bundle 'SudoEdit.vim' +Bundle 'snipMate' +Bundle 'tpope/vim-fugitive' +Bundle 'pyflakes' + +filetype plugin indent on + +" +set vb +let g:snips_author = 'Bob Ross ' +let g:makefu_author = 'makefu' + +""" just for tex + +let g:compiler_gcc_ignore_unmatched_lines=1 " ignore for gcc and SCONS +" compiler gcc +set foldenable +set foldmethod=syntax +" shows matching braches etc +set showmatch +set matchtime=3 +" highlight search +set hlsearch + +let g:load_doxygen_syntax=1 + +" we do not want any filename~ files +" set noswapfile +" set nobackup +set backupdir=~/.vim/backup +set directory=~/.vim/backup + +" turn off F1 +" +inoremap +nnoremap +vnoremap + +" save on focus lost +au FocusLost * :wa + +"let TlistAddFilesRecursive = /home/makefu/repos/P2P_MDS " *.cpp *.hpp +let Tlist_Exit_OnlyWindow =1 " exit if other window is closed +nnoremap :TlistToggle +set spelllang=en +" use set spell to enable spelling + +" press ttt to rot16 the whole file +nmap ttt ggg?G + +colorscheme darkblue +set background=dark + +set number +set mouse= +set textwidth=9001 +set ignorecase +set incsearch +set