summaryrefslogtreecommitdiff
path: root/packages/cern-scripts/resources/bin
diff options
context:
space:
mode:
authorYves Fischer <yvesf-git@xapek.org>2016-02-27 15:58:12 +0100
committerYves Fischer <yvesf-git@xapek.org>2016-02-27 15:58:12 +0100
commita307e0474e78c51590aeac95dbc5587a87ef6501 (patch)
treec5c7ca86b0b86704a4c1adc588e7ce249826e98f /packages/cern-scripts/resources/bin
parent77955935e9549a847ae7e0d78819f090d429fdb6 (diff)
downloaddebian-packages-a307e0474e78c51590aeac95dbc5587a87ef6501.tar.gz
debian-packages-a307e0474e78c51590aeac95dbc5587a87ef6501.zip
refactor scripts packages
Diffstat (limited to 'packages/cern-scripts/resources/bin')
-rwxr-xr-xpackages/cern-scripts/resources/bin/database-tunnels.sh48
-rwxr-xr-xpackages/cern-scripts/resources/bin/dmenu-pass.sh40
-rwxr-xr-xpackages/cern-scripts/resources/bin/dmenu-software.sh13
-rwxr-xr-xpackages/cern-scripts/resources/bin/gnome-commands.sh19
-rwxr-xr-xpackages/cern-scripts/resources/bin/restart-gwt.sh16
-rwxr-xr-xpackages/cern-scripts/resources/bin/smtp-server.py20
-rwxr-xr-xpackages/cern-scripts/resources/bin/telepath-setpresence.sh6
7 files changed, 0 insertions, 162 deletions
diff --git a/packages/cern-scripts/resources/bin/database-tunnels.sh b/packages/cern-scripts/resources/bin/database-tunnels.sh
deleted file mode 100755
index 1f74c84..0000000
--- a/packages/cern-scripts/resources/bin/database-tunnels.sh
+++ /dev/null
@@ -1,48 +0,0 @@
-#!/bin/bash
-REMOTE_UNC_PATH="//cerndfs.cern.ch/dfs/Applications/Oracle"
-AISADM_IP=aisadm.cern.ch
-AISADM_FINGERPRINT="`dirname \"$0\"`/../lib/aisadm-fingerprint"
-SSH_USER=$USER
-TNSNAMES="$HOME/.cache/tnsnames"
-LOCAL=false
-TEMP=`getopt -o phl: --long help,local,user: \
- -n '$0' -- "$@"`
-if [ $? != 0 ] ; then echo "Failed to parse arguments..." >&2 ; exit 1 ; fi
-
-# Note the quotes around `$TEMP': they are essential!
-eval set -- "$TEMP"
-
-function print() { echo -e "\e]0;$1\a"; echo "$1"; }
-
-while true ; do
- case "$1" in
- -p|--local) LOCAL=true ; shift ;;
- -l|--user) shift; SSH_USER=$1; shift ;;
- -h|--help) echo "$0 [--help|--local] [-l <name>|--user <name>]"; exit 0;;
- --) shift ; break ;;
- *) echo "Internal error! ($*)" ; exit 1 ;;
- esac
-done
-
-if ! $LOCAL; then
- print "Mirror tnsnames.ore files to $TNSNAMES" &&
- mkdir -p "$TNSNAMES/admin" "$TNSNAMES/admin_localhost" &&
- smbclient -k "$REMOTE_UNC_PATH" -D ADMIN_localhost -TXc - 'ADMIN_localhost/OLD' | tar --strip-components=2 -x -C "$TNSNAMES/admin_localhost" &&
- smbclient -k "$REMOTE_UNC_PATH" -D ADMIN -TXc - 'ADMIN/OLD'| tar --strip-components=2 -x -C "$TNSNAMES/admin" ||
- echo "failed to mirror tnsnames to $TNSNAMES" >&2
-fi
-
-if $LOCAL; then
- SSH_EXTRAOPTS="-oProxyCommand=ssh -l \"$SSH_USER\" lxplus.cern.ch nc $AISADM_IP 22"
-else
- true
-fi
-
-print "Database Tunnel" &&
- ssh -l "$SSH_USER" \
- -L 10301:cman1.cern.ch:10300 -L 10302:cman2.cern.ch:10300 \
- -o UserKnownHostsFile=$AISADM_FINGERPRINT \
- ${SSH_EXTRAOPTS:+"$SSH_EXTRAOPTS"} \
- $AISADM_IP \
- "date; echo tunnel is running; cat"
-
diff --git a/packages/cern-scripts/resources/bin/dmenu-pass.sh b/packages/cern-scripts/resources/bin/dmenu-pass.sh
deleted file mode 100755
index bb3be7a..0000000
--- a/packages/cern-scripts/resources/bin/dmenu-pass.sh
+++ /dev/null
@@ -1,40 +0,0 @@
-#!/usr/bin/env bash
-
-shopt -s nullglob globstar
-
-prefix=${PASSWORD_STORE_DIR-~/.password-store}
-password_files=( "$prefix"/**/*.gpg )
-password_files=( "${password_files[@]#"$prefix"/}" )
-password_files=( "${password_files[@]%.gpg}" )
-
-password=$(printf '%s\n' "${password_files[@]}" | dmenu "$@")
-
-[[ -n $password ]] || exit
-
-while true; do
- pass show "$password" 2>&1 \
- | sed -e 's/^pass:.*/pass: XXXX/' \
- | xmessage -file - \
- -buttons "Done:1,Copy 'login':2,Copy 'pass':3,Copy all:4" \
- -default "Done" \
- -nearmouse -timeout 10
- case "$?" in
- 2)
- pass show "$password" 2>&1 \
- | sed -ne 's/^login: \(.*\)/\1/p' \
- | xclip -i -verbose -l 1 2>/dev/null
- ;;
- 3)
- pass show "$password" 2>&1 \
- | sed -ne 's/^pass: \(.*\)/\1/p' \
- | xclip -i -verbose -l 1 2>/dev/null
- ;;
- 4)
- pass show "$password" 2>&1 \
- | xclip -i -verbose -l 1 2>/dev/null
- ;;
- *)
- break
- ;;
- esac
-done
diff --git a/packages/cern-scripts/resources/bin/dmenu-software.sh b/packages/cern-scripts/resources/bin/dmenu-software.sh
deleted file mode 100755
index bca5b54..0000000
--- a/packages/cern-scripts/resources/bin/dmenu-software.sh
+++ /dev/null
@@ -1,13 +0,0 @@
-#!/bin/bash -l
-
-sysenv='System native environment'
-
-env=`(echo "$sysenv"; plain_list_envs) | dmenu`
-
-test -f "$HOME/.cache/dmenu_run" && rm -f "$HOME/.cache/dmenu_run"
-
-if [ "$env" == "$sysenv" ]; then
- dmenu_run
-else
- bash -l -c "activate $env; dmenu_run"
-fi
diff --git a/packages/cern-scripts/resources/bin/gnome-commands.sh b/packages/cern-scripts/resources/bin/gnome-commands.sh
deleted file mode 100755
index ab9de7d..0000000
--- a/packages/cern-scripts/resources/bin/gnome-commands.sh
+++ /dev/null
@@ -1,19 +0,0 @@
-#!/bin/sh
-here=`dirname "$0"`
-here=`realpath "$here"`
-set -x
-dconf write /org/mate/marco/keybinding-commands/command-1 "'$here/telepath-setpresence.sh available'"
-dconf write /org/mate/marco/global-keybindings/run-command-1 "'<Super>n'"
-
-dconf write /org/mate/marco/keybinding-commands/command-2 "'$here/telepath-setpresence.sh busy'"
-dconf write /org/mate/marco/global-keybindings/run-command-2 "'<Super>b'"
-
-dconf write /org/mate/marco/keybinding-commands/command-3 "'mate-terminal'"
-dconf write /org/mate/marco/global-keybindings/run-command-3 "'<Super>Return'"
-
-dconf write /org/mate/marco/keybinding-commands/command-4 "'$here/dmenu-software.sh'"
-dconf write /org/mate/marco/global-keybindings/run-command-4 "'<Super>c'"
-
-dconf write /org/mate/marco/keybinding-commands/command-5 "'$here/dmenu-pass.sh'"
-dconf write /org/mate/marco/global-keybindings/run-command-5 "'<Super>p'"
-
diff --git a/packages/cern-scripts/resources/bin/restart-gwt.sh b/packages/cern-scripts/resources/bin/restart-gwt.sh
deleted file mode 100755
index 3870874..0000000
--- a/packages/cern-scripts/resources/bin/restart-gwt.sh
+++ /dev/null
@@ -1,16 +0,0 @@
-#!/bin/sh
-set -x
-pid=`jps | grep DevMode | cut -f 1 -d ' '`
-if [ -z "$pid" ]; then
- echo "no running gwt-client found" >&2
- exit 1
-fi
-
-cwd=`readlink "/proc/${pid}/cwd"`
-cmd=`cat "/proc/${pid}/cmdline" | tr '\0' ' '`
-cd "$cwd"
-kill -9 "$pid"
-
-sleep 1
-$cmd >/dev/null 2>&1 &
-disown -ar
diff --git a/packages/cern-scripts/resources/bin/smtp-server.py b/packages/cern-scripts/resources/bin/smtp-server.py
deleted file mode 100755
index 1cfef81..0000000
--- a/packages/cern-scripts/resources/bin/smtp-server.py
+++ /dev/null
@@ -1,20 +0,0 @@
-#!/usr/bin/env python
-import sys, os, mailbox, email, smtpd, asyncore
-
-class MaildirServer(smtpd.PureProxy):
- def __init__(self, localaddr, remoteaddr):
- smtpd.SMTPServer.__init__(self, localaddr, remoteaddr)
- self.maildir = mailbox.Maildir("./Maildir", create=True)
- def _deliver(self, mailfrom, rcpttos, data):
- mail = email.message_from_string(data)
- maildirMail = Message(mail)
- self.maildir.add(maildirMail)
-
-if __name__ == '__main__':
- muttrc = os.path.join(os.path.dirname(__file__), "muttrc")
- print("Use `mutt -F {}' to read mails".format(muttrc))
- smtpd.DEBUGSTREAM = sys.stderr
- server = MaildirServer(("0.0.0.0", 8025), (None, None))
- asyncore.loop()
-
-# vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4
diff --git a/packages/cern-scripts/resources/bin/telepath-setpresence.sh b/packages/cern-scripts/resources/bin/telepath-setpresence.sh
deleted file mode 100755
index 5187bb6..0000000
--- a/packages/cern-scripts/resources/bin/telepath-setpresence.sh
+++ /dev/null
@@ -1,6 +0,0 @@
-#!/bin/sh
-# $1 can be 'available' or 'busy' or ?
-qdbus org.freedesktop.Telepathy.Connection.haze.sipe.yves_2efischer_40cern_2ech_2cyfischer \
- /org/freedesktop/Telepathy/Connection/haze/sipe/yves_2efischer_40cern_2ech_2cyfischer \
- org.freedesktop.Telepathy.Connection.Interface.SimplePresence.SetPresence \
- "$1" ""