This commit is contained in:
Johannes Findeisen 2018-01-15 20:25:41 +01:00
commit a5fa2c5b07
67 changed files with 7142 additions and 14 deletions

3
bin/_old/old/____hasync2 Executable file
View file

@ -0,0 +1,3 @@
#!/bin/bash
rsync -r -v -z hanez.org:/var/www/hanez.org/www/htdocs/ /home/www/hanez.org/htdocs/ --exclude=wp-config.php --exclude=*~ --exclude=.svn --exclude=tmp.txt --exclude=cache/* --perms --group --times

3
bin/_old/old/backup.sh Executable file
View file

@ -0,0 +1,3 @@
#!/bin/bash
rsync -v -r --delete --progress --exclude=/dev --exclude=/tmp -e ssh root@217.160.187.113:/ /data/server/

5
bin/_old/old/ctail Executable file
View file

@ -0,0 +1,5 @@
#!/bin/sh
tail -f $1 | perl -pe $reg "s/$2/\e[1;31;43m$&\e[0m/g"

35
bin/_old/old/cvspasswd.c Executable file
View file

@ -0,0 +1,35 @@
/* Trivial password generator for cvs. Compile with 'cc -o cvspasswd cvspasswd.c -lcrypt' */
#include <unistd.h>
#include <stdio.h>
#include <sys/times.h>
/* Generate a single character of salt given a random integer. See 'man crypt'. */
int base64(int x)
{
const char b64[64] = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz./";
return b64[x % 64];
}
int main(int argc, char **argv)
{
char ibuf[256];
char passwd[256];
char saltstr[3];
struct tms t;
if (argc != 2) {
fprintf(stderr, "Usage: cvspasswd username\n");
exit(1);
}
fprintf(stderr, "Password for %s: ", argv[1]);
ibuf[0] = 0;
fgets(ibuf, sizeof(ibuf), stdin);
sscanf(ibuf, "%s", passwd);
saltstr[0] = base64(times(&t));
saltstr[1] = base64(time(0));
saltstr[2] = 0;
printf("%s:%s:cvsuser\n", argv[1], crypt(passwd, saltstr));
exit(0);
}

9
bin/_old/old/cvspasswd.sh Executable file
View file

@ -0,0 +1,9 @@
#!/usr/bin/perl
srand (time());
my $randletter = "(int (rand (26)) + (int (rand (1) + .5) % 2 ? 65 : 97))";
my $salt = sprintf ("%c%c", eval $randletter, eval $randletter);
my $plaintext = shift;
my $crypttext = crypt ($plaintext, $salt);
print "${crypttext}\n";

41
bin/_old/old/dnsnotify Executable file
View file

@ -0,0 +1,41 @@
#!/usr/bin/perl -w
# usage: dnsnotify zone slave [...]
# example: dnsnotify example.org 1.2.3.4 1.2.3.5
use Net::DNS;
$zone = shift;
@master_ns = @ARGV;
$res = new Net::DNS::Resolver;
foreach $ns (@master_ns) {
$packet = new Net::DNS::Packet($zone, "SOA", "IN");
die unless defined $packet;
($packet->header)->opcode("NS_NOTIFY_OP");
($packet->header)->rd(0);
($packet->header)->aa(1);
$res->nameservers($ns);
# Prints outgoing packet - the NOTIFY
# $packet->print;
$reply = $res->send($packet);
if (defined $reply) {
print "Received NOTIFY answer from " . $reply->answerfrom . "\n";
# Print received packet - the answer
# $reply->print;
} else {
warn "\$res->send indicates NOTIFY error for $ns\n";
}
}
exit 0;

33
bin/_old/old/dynhdparm Executable file
View file

@ -0,0 +1,33 @@
#!/bin/sh
# dynhdparm is a script to deactivate harddiscs with "hdparm -y" if
# they are not used. I had this running as cron job on a fileserver.
#
# Author: Johannes Findeisen <you@hanez.org>
#
# Usage: dynhdparm /dev/hda
# Or: dynhdparm /dev/hda /dev/hdb
#
# Note: This script will not work to disable devices where the root
# partition resides on.
if [ $# -lt 1 ]; then
echo "You need at least to set one device as paramater"
echo "Example: dynhdparm /dev/hdd /dev/sda"
echo ""
exit
fi
DEVICES=$@
LSOFDATA=""
for DEVICE in $DEVICES; do
PARTITIONS=`cat /etc/mtab | grep $DEVICE | cut -d " " -f 2`
for PARTITION in $PARTITIONS; do
LSOFDATA=$LSOFDATA`lsof | grep $PARTITION`
done
if [ ${#LSOFDATA} -lt 1 ]; then
HDPARMOUT=`hdparm -y $DEVICE`
fi
done

6
bin/_old/old/foo Executable file
View file

@ -0,0 +1,6 @@
#!/bin/bash
foo=`dirname $0`
echo $foo;

9
bin/_old/old/glasync Executable file
View file

@ -0,0 +1,9 @@
#!/bin/bash
rsync --delete -r -v -z /mnt/shared/www/wordpress/ \
-e ssh \
glashoffs.de:/var/www/glashoffs.de/www/htdocs/ \
--exclude='*~' \
--exclude='wp-config.php' \
--delete-excluded --perms --group

3
bin/_old/old/hddstandby.sh Executable file
View file

@ -0,0 +1,3 @@
#!/bin/bash
sudo /sbin/hdparm -y /dev/hdc

4
bin/_old/old/homeback Executable file
View file

@ -0,0 +1,4 @@
#!/bin/sh
rsync -av --delete /home/ /media/DATA_400GB-2/homebackup/

21
bin/_old/old/hprint Executable file
View file

@ -0,0 +1,21 @@
#!/bin/bash
echo "TODO...!"
#cd /home/hanez/Desktop/neu/
#for i in ./*; do
# echo $i
# pdf2ps $i
# mv *.ps ../ps/
#done
#cd /home/hanez/Desktop/ps/
#for h in ./*; do
# cat $h > /dev/usb/lp0
# echo $h
# sleep 5
#done

4
bin/_old/old/hxterm Executable file
View file

@ -0,0 +1,4 @@
#!/bin/sh
xterm -bg black -fg grey -sb -leftbar -si -bc -cr orange

View file

@ -0,0 +1,18 @@
#!/bin/sh
#
# install daemontools on fedora/redhat linux
#
# Mike Jackson <mj@sci.fi> 5 NOV 2005
#
#
mkdir /package
chmod 1755 /package
cd /package
wget http://cr.yp.to/daemontools/daemontools-0.76.tar.gz
tar xzvf daemontools-0.76.tar.gz
rm -f daemontools-0.76.tar.gz
cd admin/daemontools-0.76/src
wget http://www.qmailrocks.org/downloads/patches/daemontools-0.76.errno.patch
patch < daemontools-0.76.errno.patch
cd ..
package/install

14
bin/_old/old/intenso Executable file
View file

@ -0,0 +1,14 @@
#!/bin/sh
mencoder $1 \
-o $2 \
-ffourcc XVID \
-ofps 18 \
-vf-add scale=220:176, \
-vf-add expand=220:176:-1:-1:1,rotate=2,flip \
-srate 44100 \
-ovc xvid \
-xvidencopts bitrate=800:max_bframes=0:quant_type=h263:me_quality=0 \
-oac lavc \
-lavcopts acodec=mp2:abitrate=64

70
bin/_old/old/jd.sh Executable file
View file

@ -0,0 +1,70 @@
#!/bin/bash
#JD Installer/Starter Version 0.2
#by Jiaz(JD-Team), jiaz@jdownloader.org
#You need at least:
#1.) bash (its a bash script ;) )
#2.) wget
#3.) Java Version >= 1.5 (OpenJDK works also in latest Version)
#How to use this?
#1.) chmod +x jd.sh
#2.) Place it anywhere you want
#3.) Running jd.sh for the first time will install and setup JD into JDDIR folder
#4.) Running jd.sh after the first time will start JDownloader directly
#Parameters
# update (will perform an update)
#JD Installation folder (adjust to your needs)
JDDIR=~/.jd
#default path to our install/update tool (DO NOT Change this)
JDINSTALLER=http://update0.jdownloader.org/jdupdate.jar
if [ -e $JDDIR ]
then
if [ "$1" = "update" ]
then
if [ -e $JDDIR/jdupdate.jar ]
then
cd $JDDIR
echo "Start JD-Updater"
java -Xmx512m -jar jdupdate.jar
exit
else
echo "Cannot start JD-Updater: Download/Start JD-Installer"
cd $JDDIR
wget $JDINSTALLER
java -Xmx512m -jar jdupdate.jar
exit
fi
fi
if [ -e $JDDIR/JDownloader.jar ]
then
echo "JD Installation found: Starting JD now"
cd $JDDIR
#java -Xmx512m -jar JDownloader.jar --add-links $1 $2 $3 $4 $5 $6 $7 $8 $9
java -Xmx512m -jar JDownloader.jar
exit
else
echo "JD Installation found: No valid JDownloader.jar exist!"
fi
if [ -e $JDDIR/jdupdate.jar ]
then
cd $JDDIR
echo "Start JD-Updater"
java -Xmx512m -jar jdupdate.jar
else
echo "Cannot start JD-Updater: Download/Start JD-Installer"
cd $JDDIR
wget $JDINSTALLER
java -Xmx512m -jar jdupdate.jar
exit
fi
else
echo "Download/Start JD-Installer"
mkdir $JDDIR
cd $JDDIR
wget $JDINSTALLER
java -Xmx512m -jar jdupdate.jar
exit
fi

80
bin/_old/old/mkmp3list Normal file
View file

@ -0,0 +1,80 @@
#!/usr/bin/php
<?php
function returnSearchArray($command){
ob_start();
passthru($command);
$output = ob_get_contents();
ob_end_clean();
$slist = explode("\n", $output);
return $slist;
}
$max_slash = NULL;
$min_slash = 1000;
$list = returnSearchArray("find /data/mp3 -print");
for($i=0;$i<sizeof($list);$i++) {
if (file_exists($list[$i])) {
$slashcount = substr_count($list[$i], '/');
$xlist[$slashcount][$i]['source'] = $list[$i];
$xlist[$slashcount][$i]['slashcount'] = $slashcount;
if ($max_slash < $slashcount)
$max_slash = $slashcount;
if ($min_slash > $slashcount)
$min_slash = $slashcount;
$tfile = strrchr($list[$i], "/");
$xfile = substr($tfile, 1, strlen($tfile));
if (is_dir($list[$i])) {
$xlist[$slashcount][$i]['fileextension'] = "";
$xlist[$slashcount][$i]['file'] = $xfile;
$tpath = $list[$i];
}
else {
$xlist[$slashcount][$i]['fileextension'] = substr($list[$i], strlen($list[$i])-4 , 4);
$xlist[$slashcount][$i]['file'] = substr($xfile, 0, strlen($tfile)-5);
$tpath = substr($list[$i], 0, strlen($list[$i])-4);
}
$xpath = substr($tpath, 0, (strlen($tpath)-strlen($xlist[$slashcount][$i]['file'])));
$xlist[$slashcount][$i]['path'] = $xpath;
$dfile = str_replace(". ", "_", $xlist[$slashcount][$i]['file']);
$dfile = str_replace("--", "_", $dfile);
$dfile = str_replace(" ", "_", $dfile);
$dfile = str_replace(" .", "_", $dfile);
$dfile = str_replace("( ", "(", $dfile);
$dfile = str_replace(" )", ")", $dfile);
$dfile = str_replace("'", "", $dfile);
$dfile = str_replace(" ", "_", $dfile);
$dfile = str_replace(".", "_", $dfile);
$dfile = str_replace("__", "_", $dfile);
$xlist[$slashcount][$i]['destination'] = $xlist[$slashcount][$i]['path'] . $dfile . $xlist[$slashcount][$i]['fileextension'];
}
}
for ($i=$max_slash;$i>=$min_slash;$i--) {
foreach ($xlist[$i] as $value) {
if ($value['source'] != $value['destination']) {
$com = "mv -f --verbose \"".$value['source']."' '".$value['destination']."\"";
echo $com;
#passthru($com);
}
}
}
?>

465
bin/_old/old/simple-glade-codegen Executable file
View file

@ -0,0 +1,465 @@
#!/usr/bin/env python
# simple-glade-codegen.py
# A code generator that uses pygtk, glade and SimpleGladeApp.py
# Copyright (C) 2004 Sandino Flores Moreno
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
# USA
import sys
import os
import re
import codecs
import tokenize
import shutil
import time
import xml.sax
from xml.sax._exceptions import SAXParseException
header_format = """\
#!/usr/bin/env python
# -*- coding: UTF8 -*-
# Python module %(module)s.py
# Autogenerated from %(glade)s
# Generated on %(date)s
# Warning: Do not delete or modify comments related to context
# They are required to keep user's code
import os
import gtk
from SimpleGladeApp import SimpleGladeApp
glade_dir = ""
# Put your modules and data here
# From here through main() codegen inserts/updates a class for
# every top-level widget in the .glade file.
"""
class_format = """\
class %(class)s(SimpleGladeApp):
%(t)sdef __init__(self, path="%(glade)s", root="%(root)s", domain=None, **kwargs):
%(t)s%(t)spath = os.path.join(glade_dir, path)
%(t)s%(t)sSimpleGladeApp.__init__(self, path, root, domain, **kwargs)
%(t)sdef new(self):
%(t)s%(t)s#context %(class)s.new {
%(t)s%(t)sprint "A new %(class)s has been created"
%(t)s%(t)s#context %(class)s.new }
%(t)s#context %(class)s custom methods {
%(t)s#--- Write your own methods here ---#
%(t)s#context %(class)s custom methods }
"""
callback_format = """\
%(t)sdef %(handler)s(self, widget, *args):
%(t)s%(t)s#context %(class)s.%(handler)s {
%(t)s%(t)sprint "%(handler)s called with self.%%s" %% widget.get_name()
%(t)s%(t)s#context %(class)s.%(handler)s }
"""
creation_format = """\
%(t)sdef %(handler)s(self, str1, str2, int1, int2):
%(t)s%(t)s#context %(class)s.%(handler)s {
%(t)s%(t)swidget = gtk.Label("%(handler)s")
%(t)s%(t)swidget.show_all()
%(t)s%(t)sreturn widget
%(t)s%(t)s#context %(class)s.%(handler)s }
"""
main_format = """\
def main():
"""
instance_format = """\
%(t)s%(root)s = %(class)s()
"""
run_format = """\
%(t)s%(root)s.run()
if __name__ == "__main__":
%(t)smain()
"""
class NotGladeDocumentException(SAXParseException):
def __init__(self, glade_writer):
strerror = "Not a glade-2 document"
SAXParseException.__init__(self, strerror, None, glade_writer.sax_parser)
class SimpleGladeCodeWriter(xml.sax.handler.ContentHandler):
def __init__(self, glade_file):
self.indent = "\t"
self.code = ""
self.roots_list = []
self.widgets_stack = []
self.creation_functions = []
self.callbacks = []
self.parent_is_creation_function = False
self.parent_is_object = False
self.glade_file = glade_file
self.data = {}
self.input_dir, self.input_file = os.path.split(glade_file)
base = os.path.splitext(self.input_file)[0]
module = self.normalize_symbol(base)
self.output_file = os.path.join(self.input_dir, module) + ".py"
self.sax_parser = xml.sax.make_parser()
self.sax_parser.setFeature(xml.sax.handler.feature_external_ges, False)
self.sax_parser.setContentHandler(self)
self.data["glade"] = self.input_file
self.data["module"] = module
self.data["date"] = time.asctime()
def normalize_symbol(self, base):
return "_".join( re.findall(tokenize.Name, base) )
def capitalize_symbol(self, base):
ClassName = "[a-zA-Z0-9]+"
base = self.normalize_symbol(base)
capitalize_map = lambda s : s[0].upper() + s[1:]
return "".join( map(capitalize_map, re.findall(ClassName, base)) )
def uncapitalize_symbol(self, base):
InstanceName = "([a-z])([A-Z])"
action = lambda m: "%s_%s" % ( m.groups()[0], m.groups()[1].lower() )
base = self.normalize_symbol(base)
base = base[0].lower() + base[1:]
return re.sub(InstanceName, action, base)
def startElement(self, name, attrs):
if self.parent_is_object:
return
elif name == "object":
self.parent_is_object = True
elif name == "widget":
widget_id = attrs.get("id")
widget_class = attrs.get("class")
if not widget_id or not widget_class:
raise NotGladeDocumentException(self)
if not self.widgets_stack:
self.creation_functions = []
self.callbacks = []
class_name = self.capitalize_symbol(widget_id)
self.data["class"] = class_name
self.data["root"] = widget_id
self.roots_list.append(widget_id)
self.code += class_format % self.data
self.widgets_stack.append(widget_id)
elif name == "signal":
if not self.widgets_stack:
raise NotGladeDocumentException(self)
widget = self.widgets_stack[-1]
signal_object = attrs.get("object")
if signal_object:
return
handler = attrs.get("handler")
if not handler:
raise NotGladeDocumentException(self)
if handler.startswith("gtk_"):
return
signal = attrs.get("name")
if not signal:
raise NotGladeDocumentException(self)
self.data["widget"] = widget
self.data["signal"] = signal
self.data["handler"]= handler
if handler not in self.callbacks:
self.code += callback_format % self.data
self.callbacks.append(handler)
elif name == "property":
if not self.widgets_stack:
raise NotGladeDocumentException(self)
widget = self.widgets_stack[-1]
prop_name = attrs.get("name")
if not prop_name:
raise NotGladeDocumentException(self)
if prop_name == "creation_function":
self.parent_is_creation_function = True
def characters(self, content):
if self.parent_is_object:
return
if self.parent_is_creation_function:
if not self.widgets_stack:
raise NotGladeDocumentException(self)
handler = content.strip()
if handler not in self.creation_functions:
self.data["handler"] = handler
self.code += creation_format % self.data
self.creation_functions.append(handler)
def endElement(self, name):
if name == "object":
self.parent_is_object = False
elif name == "property":
self.parent_is_creation_function = False
elif name == "widget":
if not self.widgets_stack:
raise NotGladeDocumentException(self)
self.widgets_stack.pop()
def write(self):
self.data["t"] = self.indent
self.code += header_format % self.data
try:
glade = open(self.glade_file, "r")
self.sax_parser.parse(glade)
except xml.sax._exceptions.SAXParseException, e:
sys.stderr.write("Error parsing document\n")
return None
except IOError, e:
sys.stderr.write("%s\n" % e.strerror)
return None
self.code += main_format % self.data
for root in self.roots_list:
self.data["class"] = self.capitalize_symbol(root)
self.data["root"] = self.uncapitalize_symbol(root)
self.code += instance_format % self.data
self.data["root"] = self.uncapitalize_symbol(self.roots_list[0])
self.code += run_format % self.data
try:
self.output = codecs.open(self.output_file, "w", "utf-8")
self.output.write(self.code)
self.output.close()
except IOError, e:
sys.stderr.write("%s\n" % e.strerror)
return None
return self.output_file
def usage():
program = sys.argv[0]
print """\
Write a simple python file from a glade file.
Usage: %s <file.glade>
""" % program
def which(program):
if sys.platform.startswith("win"):
exe_ext = ".exe"
else:
exe_ext = ""
path_list = os.environ["PATH"].split(os.pathsep)
for path in path_list:
program_path = os.path.join(path, program) + exe_ext
if os.path.isfile(program_path):
return program_path
return None
def check_for_programs():
packages = {"diff" : "diffutils", "patch" : "patch"}
for package in packages.keys():
if not which(package):
sys.stderr.write("Required program %s could not be found\n" % package)
sys.stderr.write("Is the package %s installed?\n" % packages[package])
if sys.platform.startswith("win"):
sys.stderr.write("Download it from http://gnuwin32.sourceforge.net/packages.html\n")
sys.stderr.write("Also, be sure it is in the PATH\n")
return False
return True
def main():
if not check_for_programs():
return -1
if len(sys.argv) == 2:
code_writer = SimpleGladeCodeWriter( sys.argv[1] )
glade_file = code_writer.glade_file
output_file = code_writer.output_file
output_file_orig = output_file + ".orig"
output_file_bak = output_file + ".bak"
short_f = os.path.split(output_file)[1]
short_f_orig = short_f + ".orig"
short_f_bak = short_f + ".bak"
helper_module = os.path.join(code_writer.input_dir,SimpleGladeApp_py)
custom_diff = "custom.diff"
exists_output_file = os.path.exists(output_file)
exists_output_file_orig = os.path.exists(output_file_orig)
if not exists_output_file_orig and exists_output_file:
sys.stderr.write('File "%s" exists\n' % short_f)
sys.stderr.write('but "%s" does not.\n' % short_f_orig)
sys.stderr.write("That means your custom code would be overwritten.\n")
sys.stderr.write('Please manually remove "%s"\n' % short_f)
sys.stderr.write("from this directory.\n")
sys.stderr.write("Anyway, I\'ll create a backup for you in\n")
sys.stderr.write('"%s"\n' % short_f_bak)
shutil.copy(output_file, output_file_bak)
return -1
if exists_output_file_orig and exists_output_file:
os.system("diff -U1 %s %s > %s" % (output_file_orig, output_file, custom_diff) )
shutil.copy(output_file, output_file_bak)
if not code_writer.write():
os.remove(custom_diff)
return -1
shutil.copy(output_file, output_file_orig)
if os.system("patch -fp0 < %s" % custom_diff):
os.remove(custom_diff)
return -1
os.remove(custom_diff)
else:
if not code_writer.write():
return -1
shutil.copy(output_file, output_file_orig)
os.chmod(output_file, 0755)
if not os.path.isfile(helper_module):
open(helper_module, "w").write(SimpleGladeApp_content)
print "Wrote", output_file
return 0
else:
usage()
return -1
SimpleGladeApp_py = "SimpleGladeApp.py"
SimpleGladeApp_content = '''\
# SimpleGladeApp.py
# Module that provides an object oriented abstraction to pygtk and libglade.
# Copyright (C) 2004 Sandino Flores Moreno
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
# USA
try:
import os
import sys
import gtk
import gtk.glade
import weakref
except ImportError:
print "Error importing pygtk2 and pygtk2-libglade"
sys.exit(1)
class SimpleGladeApp(dict):
def __init__(self, glade_filename, main_widget_name=None, domain=None, **kwargs):
if os.path.isfile(glade_filename):
self.glade_path = glade_filename
else:
glade_dir = os.path.split( sys.argv[0] )[0]
self.glade_path = os.path.join(glade_dir, glade_filename)
for key, value in kwargs.items():
try:
setattr(self, key, weakref.proxy(value) )
except TypeError:
setattr(self, key, value)
self.glade = None
gtk.glade.set_custom_handler(self.custom_handler)
self.glade = gtk.glade.XML(self.glade_path, main_widget_name, domain)
if main_widget_name:
self.main_widget = self.glade.get_widget(main_widget_name)
else:
self.main_widget = None
self.signal_autoconnect()
self.new()
def signal_autoconnect(self):
signals = {}
for attr_name in dir(self):
attr = getattr(self, attr_name)
if callable(attr):
signals[attr_name] = attr
self.glade.signal_autoconnect(signals)
def custom_handler(self,
glade, function_name, widget_name,
str1, str2, int1, int2):
if hasattr(self, function_name):
handler = getattr(self, function_name)
return handler(str1, str2, int1, int2)
def __getattr__(self, name):
if name in self:
data = self[name]
return data
else:
widget = self.glade.get_widget(name)
if widget != None:
self[name] = widget
return widget
else:
raise AttributeError, name
def __setattr__(self, name, value):
self[name] = value
def new(self):
pass
def on_keyboard_interrupt(self):
pass
def gtk_widget_show(self, widget, *args):
widget.show()
def gtk_widget_hide(self, widget, *args):
widget.hide()
def gtk_widget_grab_focus(self, widget, *args):
widget.grab_focus()
def gtk_widget_destroy(self, widget, *args):
widget.destroy()
def gtk_window_activate_default(self, widget, *args):
widget.activate_default()
def gtk_true(self, *args):
return gtk.TRUE
def gtk_false(self, *args):
return gtk.FALSE
def gtk_main_quit(self, *args):
gtk.main_quit()
def main(self):
gtk.main()
def quit(self):
gtk.main_quit()
def run(self):
try:
self.main()
except KeyboardInterrupt:
self.on_keyboard_interrupt()
'''
if __name__ == "__main__":
exit_code = main()
sys.exit(exit_code)

33
bin/_old/old/snscan Executable file
View file

@ -0,0 +1,33 @@
#!/usr/bin/ruby
f = 1..255
#f.each do |line|
# puts line
# system("ping -c 1 192.168.0.#{line}")
#pig = IO.popen("ping -c 1 192.168.0.#{line}")
#puts pig.gets
#end
count = 0
arr = []
f.each do |i|
arr[i] = Thread.new {
#sleep(rand(0)/10.0)
system("ping -c 1 192.168.0.#{i}")
#Thread.current["mycount"] = IO.popen("ping -c 1 192.168.0.#{i}")
#Thread.current["mycount"] = count
count += 1
}
end
#arr.each {|t| t.join; print t["mycount"], ", " }
#puts "count = #{count}"

8
bin/_old/old/test.sh Executable file
View file

@ -0,0 +1,8 @@
#!/bin/bash
foo=aaabbbccc; bar=zzz; lop=`echo $foo | sed -e s/aaa/$bar/`; echo $lop
foo=aaabbbccc; bar=zzz; lop=`echo $foo | sed -e s/aaa/$bar/`; echo $lop
foo=/home/hanez/fooo; bar=/home/hanez; lop=`echo $foo | sed -e "s|\${bar}|AAAA|"`; echo $lop
echo $bar

1
bin/_old/old/um_gentoo Normal file
View file

@ -0,0 +1 @@
/home/hanez/linux//vmlinux ubda=/home/hanez/projects/linux/Gentoo-2006.1-x86-root_fs mem=128M eth0=tuntap,,,192.168.0.254

3
bin/_old/old/upsync Executable file
View file

@ -0,0 +1,3 @@
#!/bin/bash
rsync --delete -r -v -z /home/www/unixpeople.org/ hanez.org:/var/www/unixpeople.org/www/ --exclude=*~ --exclude=.svn --exclude=config.xml --perms --group --times

3
bin/_old/old/upsync2 Executable file
View file

@ -0,0 +1,3 @@
#!/bin/bash
rsync --delete -r -v -z /data/hanez/unixpeople.org/ hanez.org:/var/www/unixpeople.org/www/ --exclude=*~ --exclude=.svn --delete-excluded --perms --group --times

3296
bin/_old/old/winetricks Executable file

File diff suppressed because it is too large Load diff

97
bin/_old/old/xw3 Executable file
View file

@ -0,0 +1,97 @@
#!/bin/bash
# The XW3 website generator.
#
# This scipts generates a complete website in plain HTML from a source-
# directory containing all content.
#
# You don't need Apache when using this Software.
#
# Licensed under the GNU Public License (GPL)
#
# Copyright: Johannes Findeisen <you@hanez.org>
parseFile()
{
#$1
echo $1
echo $2
if [ $1 = php ]; then
echo $PARSER[$1]
#$2 >> $3
fi
}
if [ ! $1 ]; then
echo "Usage: xw3 /path/to/projectroot"
exit
fi
PROJECTPATH=$1
if [ ! -e $PROJECTPATH ] || [ ! -e $PROJECTPATH/xw3.conf ]; then
echo "[xw3 error]: Projectpath: $PROJECTPATH does not exist or you have no xw3.conf in there. It seems not to be a xw3 project!"
exit
fi
. $PROJECTPATH/xw3.conf
rm -Rf $OUTPUTDIR/*
if [ ! -e $OUTPUTDIR ]; then
mkdir $OUTPUTDIR
fi
for i in 1 2 3 4 5; do
echo $i
#sleep 1
done
for file in `find $PROJECTPATH/input/ -type f -print`
do
filename=`basename $file`
dirname=`dirname $file`
dirextension=`echo $dirname | sed -e "s|\${PROJECTPATH}\/input||"`
#if [ -z $dirextension ]; then
# dirextension="."
#fi
ext=${filename##*.}
filenamewoext=${filename%.*}
newname=$filenamewoext.$OUTPUTEXTENSION
if [ -d $PROJECTPATH/input$dirextension ]; then
mkdir -p $OUTPUTDIR$dirextension
fi
if [ $ext = php ]; then
cat $PROJECTPATH/head.html > $OUTPUTDIR$dirextension/$newname
parseFile php $file $OUTPUTDIR$dirextension/$newname
cat $PROJECTPATH/foot.html >> $OUTPUTDIR$dirextension/$newname
# cat $PROJECTPATH/head.html > $OUTPUTDIR$dirextension/$newname
# echo `$PHPBIN $file` >> $OUTPUTDIR$dirextension/$newname
# cat $PROJECTPATH/foot.html >> $OUTPUTDIR$dirextension/$newname
elif [ $ext = html ] || [ $ext = htm ]; then
cat $PROJECTPATH/head.html > $OUTPUTDIR$dirextension/$newname
cat $PROJECTPATH/input$dirextension/$filename >> $OUTPUTDIR$dirextension/$newname
cat $PROJECTPATH/foot.html >> $OUTPUTDIR$dirextension/$newname
elif [ $ext = jpeg ] || [ $ext = jpg ] || [ $ext = png ] || [ $ext = gif ]; then
cp $PROJECTPATH/input$dirextension/$filename $OUTPUTDIR$dirextension/$filename
elif [ $ext = "" ]; then
cat $PROJECTPATH/head.html > $OUTPUTDIR$dirextension/$newname
echo `sh -c $PROJECTPATH/input$dirextension/$filename` >> $OUTPUTDIR$dirextension/$newname
cat $PROJECTPATH/foot.html >> $OUTPUTDIR$dirextension/$newname
fi
# if --verbose
echo $dirextension/$newname"... Finished!"
done
cp -r $PROJECTPATH/content/* $OUTPUTDIR/
echo "Finished... ;)"

79
bin/_old/old/xw32 Executable file
View file

@ -0,0 +1,79 @@
#!/bin/bash
# The XW3 website generator.
#
# This scipts generates a complete website in plain HTML from a source-
# directory containing all content.
#
# You don't need Apache when using this Software.
#
# Licensed under the GNU Public License (GPL)
#
# Copyright: Johannes Findeisen <you@hanez.org>
# Commandline parameter / .xw3 settings
#PROJECTDIR - use this if .xw3 exists
PROJECTPATH=/home/hanez/wg
OUTPUTEXTENSION=html
#UPLOAD=ssh,scp,ftp
#HOST=hanez.org
#USERNAME=Foo
#PASSWORD=Bar
# LANGUAGE FORMAT
# 0 = /path/to/file/filename.LN.html (default)
# 1 = /LN/path/to/file/filename.html
# LN = the language code you use e.g. en, de etc.
LANGUAGE_FORMAT=0
# Static configuration variables
OUTPUTDIR=$PROJECTPATH/output
PHPBIN=/usr/bin/php
PERLBIN=/usr/bin/perl
PYTHONBIN=/usr/bin/python
# Execute
rm -Rf $OUTPUTDIR/*
if [ ! -e $dirname ]; then
mkdir $OUTPUTDIR
fi
for file in `find $PROJECTPATH/input/ -type f -print`
do
filename=`basename $file`
dirname=`dirname $file`
dirextension=`echo $dirname | sed -e "s|\${PROJECTPATH}\/input||"`
#if [ -z $dirextension ]; then
# dirextension="."
#fi
ext=${filename##*.}
filenamewoext=${filename%.*}
newname=$filenamewoext.$OUTPUTEXTENSION
if [ -d $PROJECTPATH/input$dirextension ]; then
mkdir -p $OUTPUTDIR$dirextension
fi
if [ $ext = php ]; then
cat $PROJECTPATH/head.html > $OUTPUTDIR$dirextension/$newname
echo `$PHPBIN $file` >> $OUTPUTDIR$dirextension/$newname
cat $PROJECTPATH/foot.html >> $OUTPUTDIR$dirextension/$newname
elif [ $ext = html ] || [ $ext = htm ]; then
cat $PROJECTPATH/head.html > $OUTPUTDIR$dirextension/$newname
cat $PROJECTPATH/input$dirextension/$filename >> $OUTPUTDIR$dirextension/$newname
cat $PROJECTPATH/foot.html >> $OUTPUTDIR$dirextension/$newname
elif [ $ext = jpeg ] || [ $ext = jpg ] || [ $ext = png ] || [ $ext = gif ]; then
cp $PROJECTPATH/input$dirextension/$filename $OUTPUTDIR$dirextension/$filename
elif [ $ext = "" ]; then
cat $PROJECTPATH/head.html > $OUTPUTDIR$dirextension/$newname
echo `sh -c $PROJECTPATH/input$dirextension/$filename` >> $OUTPUTDIR$dirextension/$newname
cat $PROJECTPATH/foot.html >> $OUTPUTDIR$dirextension/$newname
fi
# if --verbose
echo $dirextension/$newname"... Finished!"
done
cp -r $PROJECTPATH/content/* $OUTPUTDIR/
echo "Finished... ;)"

11
bin/_old/old/you@hanez.org.sh Executable file
View file

@ -0,0 +1,11 @@
#!/bin/bash
echo "Johannes Findeisen | Lokstedter Weg 100 | 20251 Hamburg | Germany"
echo ""
echo "Let's rock the web!!!"
echo "(Lassen Sie uns das Netz schaukeln!!!) translated by google.com"
echo ""
echo "Key Lookup:"
echo " http://pgp.mit.edu:11371/pks/lookup?op=vindex&search=0xF58D4435"
gpg --fingerprint you@hanez.org
#echo "Take a look @:"
#echo "http://www.againsttcpa.com/ | http://petition.eurolinux.org/ | http://www.opensource.org/ | http://www.gentoo.org/ | http://kde.org/"

2
bin/_old/old/zynkx Executable file
View file

@ -0,0 +1,2 @@
#!/bin/sh
exec /usr/bin/mono /home/hanez/projects/zynk/Zynk.exe "$@"

3
bin/_old/old/zysync Executable file
View file

@ -0,0 +1,3 @@
#!/bin/bash
rsync --delete -r -v -z /home/www/zynk.org/ zynk.org:/var/www/zynk.org/www/ --exclude=*~ --exclude=.svn --exclude=tmp.txt --exclude=cache/* --exclude=comments/* --perms --group --times