Permalink
Browse files

Remove missing files from grml-www -> grml.org migration

  • Loading branch information...
1 parent b281efd commit 897ba1ee0baa438969238211b815f7ba437875ef Christian Hofstaedtler committed Nov 7, 2011
View
@@ -0,0 +1,63 @@
+#!/bin/sh
+# Filename: get_tw_cli
+# Purpose: get 3ware RAID controller command line interface tool (tw_cli)
+# Authors: grml-team (grml.org), (c) Michael Prokop <mika@grml.org>, Wolfram Schlich <wschlich@gentoo.org>
+# Bug-Reports: see http://grml.org/bugs/
+# License: This file is licensed under the GPL v2.
+# Latest change: Thu Feb 09 12:20:30 CET 2006 [mika]
+################################################################################
+# Notice: this file is based on:
+# Copyright 1999-2006 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/www/www.gentoo.org/raw_cvs/gentoo-x86/sys-block/tw_cli/tw_cli-9.3.0.2.ebuild,v 1.1 2006/01/12 23:36:17 wschlich Exp $
+################################################################################
+
+if [ -r /etc/grml/lsb-functions ] ; then
+ . /etc/grml/lsb-functions
+else
+ alias einfo="echo"
+fi
+
+PN="tw_cli"
+PV="9.3.0.2"
+MY_P="${PN}-linux-x86-${PV}"
+SRC_URI_BASE="http://www.3ware.com/download/Escalade9000Series/${PV}"
+SRC_URI="${SRC_URI_BASE}/${PN}-linux-x86-${PV}.tgz"
+DOWNLOAD_URL="http://www.3ware.com/support/windows_agree.asp?path=/download/Escalade9000Series/${PV}/${MY_P}.tgz"
+
+info() {
+ einfo "get_tw_cli - get 3ware RAID controller command line interface tool (tw_cli)"
+ einfo "==========================================================================="
+ einfo ""
+}
+
+supportedcards() {
+ einfo "This binary supports all current cards, including, but not limited to:"
+ einfo ""
+ einfo "PATA: 7210, 7410, 7450, 7810, 7850, 7000-2, 7500-4, 7500-8,"
+ einfo " 7500-12, 7006-2, 7506-4, 7506-4LP, 7506-8, 7506-12"
+ einfo ""
+ einfo "SATA: 8500-4, 8500-8, 8500-12, 8006-2, 8506-4, 8506-12,"
+ einfo " 8506-8MI, 8506-12MI, 9500S-4LP, 9500S-8, 9500S-12,"
+ einfo " 9500S-8MI, 9500S-12MI"
+ einfo " 9500S-8MI, 9500S-12MI"
+ einfo ""
+}
+
+pkg_nofetch() {
+ einfo "Please agree to the license at URL"
+ einfo ""
+ einfo "\t${DOWNLOAD_URL}"
+ einfo ""
+ einfo "And then use the following URL to download the correct tarball:"
+ einfo ""
+ einfo "\t${SRC_URI}"
+ einfo ""
+}
+
+info
+pkg_nofetch
+supportedcards
+# unp ${MY_P}.tgz
+
+## END OF FILE #################################################################
@@ -0,0 +1,145 @@
+#!/usr/bin/env python2.5
+"""
+Filename: google_correct.py
+Purpose: correct a keyword using google search
+Authors: (c) Michael Prokop <mika@grml.org>
+Bug-Reports: see http://grml.org/bugs/
+License: This file is licensed under the GPL v2 or any later version.
+Latest change: Sun Mar 09 19:19:04 CET 2008 [mika]
+
+Notice:
+
+* requires xsel binary
+* requires python >= 2.4 (for urllib2), version 2.5 suggested :)
+* if python-notify is installed it's used as notification system
+
+History:
+
+* 2008-03-09: improve cmdline parsing logic [gregor herrmann]
+ include support for libnotify [mika]
+ usage information for -h/--help [mika]
+ provide output on stdout even when using xsel [mika]
+* 2008-02-11: initial version [mika]
+
+Whishlist:
+
+* support multiple keywords in one single invocation
+* use python-xlib instead of xsel,
+ like in http://kalvdans.no-ip.org/svn/saturnapps/selection.py ?
+* support something like a search gateway for anonymous search requests
+* support different backends (like fuzzy search in local dictionaries)
+* provide small selection menu for X, vim,...
+"""
+
+import os
+import re
+import urllib
+import urllib2
+import subprocess
+import sys
+
+_correction_re = re.compile(r'<font[^>]*>Did you mean: </font><a[^>]*>'
+ r'<b><i>(.*?)</i></b></a>(?i)')
+
+def usage():
+ print """
+google_correct.py: correct a keyword using google's 'Did you mean' feature
+
+Usage:
+
+ Either run:
+
+ google_correct.py <keyword>
+
+ or select keyword in X and execute the script to set new X selection:
+
+ google_correct.py
+
+Send bug reports, feature requests and patches to Michael Prokop <mika@grml.org>
+"""
+
+def which(filename):
+ """Check whether a given program can be executed"""
+ for path in (os.environ.get('PATH') or os.defpath).split(os.pathsep):
+ myfile = os.path.join(path, filename)
+ if os.access(myfile, os.X_OK):
+ return myfile
+
+def correct_keyword(keyword):
+ """Correct spelling of a keyword using google's 'Did you mean' feature"""
+ req = urllib2.Request('http://www.google.com/search?%s' % urllib.urlencode({
+ 'q': keyword.encode('utf-8'),
+ 'spell': '1'
+ }))
+ req.add_header('User-Agent', 'Mikas-Keyword-Corrector/1.0 :-)')
+ resp = urllib2.urlopen(req)
+ match = _correction_re.search(resp.read())
+ return match and match.group(1) or keyword
+
+# would be nice to support multiple keywords at once,
+# needs work in _correction_re though:
+#def cmdline():
+# for argument in sys.argv[1:]:
+# return ' '.join(arg for arg in sys.argv[1:])
+#keyword = cmdline()
+
+def get_x_selection():
+ """Get X selection"""
+ proc = subprocess.Popen(['xsel', ], stdout=subprocess.PIPE)
+ x_selection = proc.stdout.read()
+ proc.stdout.close()
+ proc.wait()
+ return x_selection
+
+def set_x_selection(keyword):
+ """Set X selection to the given keyword"""
+ proc = subprocess.Popen(['xsel', '-i'], stdin=subprocess.PIPE)
+ proc.stdin.write(keyword)
+ proc.stdin.close()
+ proc.wait()
+
+def default_cb(n, action):
+ assert action == "default"
+ print "You clicked the default action"
+ n.close()
+ gtk.main_quit()
+
+def notify(new_keyword, old_keyword):
+ try:
+ import pynotify
+ if pynotify.init("google_correct"):
+ if new_keyword is not old_keyword:
+ n = pynotify.Notification("New keyword for \"%s\":" % old_keyword, new_keyword)
+ else:
+ n = pynotify.Notification("google_correct result:", "No new keyword for \"%s\" found" % old_keyword)
+
+ n.set_timeout(2000)
+ n.show()
+ except:
+ return 0 # don't print anything because someone might use the output :)
+
+if __name__ == '__main__':
+ if '--help' in sys.argv or '-h' in sys.argv:
+ usage()
+ sys.exit(1);
+
+ if sys.argv[1:]:
+ # print it to stdout:
+ old_keyword = sys.argv[1]
+ new_keyword = correct_keyword(old_keyword)
+ print new_keyword
+ notify(new_keyword, old_keyword)
+ # or if you prefer to put it directly to X selection:
+ #set_x_selection(correct_keyword(sys.argv[1]))
+ else:
+ if which('xsel'):
+ old_keyword = get_x_selection()
+ new_keyword = correct_keyword(old_keyword)
+ print new_keyword
+ set_x_selection(new_keyword)
+ notify(new_keyword, old_keyword)
+ else:
+ sys.exit("Sorry, xsel not found. Exiting.")
+
+## END OF FILE #################################################################
+# vim: ft=python tw=100 ai et
@@ -0,0 +1,8 @@
+#!/bin/sh
+# IMPORTANT: please note that you might override existing
+# configuration files in the current working directory! =>
+wget -O .screenrc http://git.grml.org/f/grml-etc-core/etc/grml/screenrc_generic
+wget -O .vimrc http://git.grml.org/f/grml-etc-core/etc/vim/vimrc
+wget -O .zshrc http://git.grml.org/f/grml-etc-core/etc/zsh/zshrc
+# optional:
+# wget -O .zshrc.local http://git.grml.org/f/grml-etc-core/etc/skel/.zshrc
@@ -0,0 +1,118 @@
+#!/bin/sh
+# Filename: grml-vpnc-tugraz
+# Purpose: connect via vpnc in VC-Graz/TU Graz (www.vc-graz.ac.at / www.tugraz.at)
+# Authors: grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
+# Bug-Reports: see http://grml.org/bugs/
+# License: This file is licensed under the GPL v2.
+# Latest change: Tue Mar 28 10:02:46 CEST 2006 [mika]
+################################################################################
+
+# Documentation:
+# http://www.zid.tugraz.at/ki/netz/extern/vpn/
+
+LANG=C
+LC_ALL=C
+
+if [ "$UID" != 0 ]; then
+ sudo $0
+ exit
+fi
+
+function typeofservice() {
+NETWORK=$(dialog --stdout --clear --title "foobar" --menu \
+"This script is a submenu of grml-network to set up an internet connection
+
+Notice if you want to connect to WLAN at TU Graz:
+Make sure you have a connection to the access point and an ip-address.
+Run 'iwconfig \$DEVICE essid tug ; dhclient \$DEVICE'." 0 0 0 \
+"WLAN" "Connect via WLAN to TU Graz network" \
+"VCGraz" "Connect to VC-Graz (not yet tested - use grml-pptp-vcgraz!)" \
+"External" "External connection (not yet tested!)" \
+"Exit" "Exit this program")
+
+retval=$?
+
+case $retval in
+ 0)
+ if [ $NETWORK == WLAN ]; then
+ GATEWAY=129.27.200.1
+ # GATEWAY=172.27.12.2
+ ACCOUNT='Account information - your TUGOnline username'
+ fi
+
+ if [ $NETWORK == VCGraz ]; then
+ GATEWAY=10.0.0.1
+ ACCOUNT='Account information - your account number'
+ fi
+
+ if [ $NETWORK == External ]; then
+ GATEWAY=129.27.200.1
+ ACCOUNT='Account information - account number'
+ fi
+ ;;
+ 1)
+ echo "Cancel pressed." ; exit
+ ;;
+ 255)
+ echo "ESC pressed." ; exit
+ ;;
+esac
+}
+
+runit(){
+echo "# vpnc at $NETWORK" > /etc/vpnc/vpnctugraz.conf
+echo "
+Debug 0
+IKE DH Group dh2
+Perfect Forward Secrecy dh2
+IPSec gateway $GATEWAY
+IPSec ID default
+IPSec secret default
+Xauth username $ACCOUNTNAME
+Xauth password $PASSWORD
+
+" >> /etc/vpnc/vpnctugraz.conf
+
+echo -e "#!/bin/sh\nLANG=C\n" > /etc/init.d/vpnctug
+cat >> /etc/init.d/vpnctug << "EOF"
+case "$1" in
+ start)
+ echo "Starting vpnc"
+# route del default
+# vpnc /etc/vpnc/vpnctugraz.conf
+ vpnc-connect /etc/vpnc/vpnctugraz.conf
+# route add default dev tun0
+ ;;
+
+ stop)
+ echo "Stopping vpnc"
+ /usr/sbin/vpnc-disconnect
+ killall -HUP vpnc
+ ;;
+
+ *)
+ echo "Usage: /etc/init.d/vpnctug {start|stop}" >&2
+ ;;
+
+esac
+
+exit 0
+EOF
+
+chmod 600 /etc/vpnc/vpnctugraz.conf
+chmod +x /etc/init.d/vpnctug
+/etc/init.d/vpnctug start
+}
+
+typeofservice
+if [ -z "$ACCOUNTNAME" ] || [ -z "$PASSWORD" ] ; then
+ ACCOUNTNAME=$(dialog --stdout --title "vpnc in $NETWORK" --inputbox "${ACCOUNT}:" 0 0) || exit 0
+ PASSWORD=$(dialog --stdout --title "vpnc in $NETWORK" --passwordbox "Account password (hidden typing)" 0 40) || exit 0
+ [ -z "$ACCOUNTNAME" ] && exit 1
+ [ -z "$PASSWORD" ] && exit 1
+ runit
+else
+ runit
+fi
+
+## END OF FILE #################################################################
View
@@ -0,0 +1,10 @@
+<html>
+ <head>
+ <title>scripts @ grml.org</title>
+ </head>
+
+ <body>
+ <p>Please visit <a href="http://git.grml.org/?p=grml-scripts.git">http://git.grml.org/?p=grml-scripts.git</a></p>
+ </body>
+
+</html>
Oops, something went wrong. Retry.

0 comments on commit 897ba1e

Please sign in to comment.