Signed-off-by: Nico Schottelius <nico@manager.schottelius.org>
This commit is contained in:
Nico Schottelius 2017-07-19 17:15:41 +02:00
parent 256dc98754
commit df2daf524d
641 changed files with 140617 additions and 12 deletions

5
aalot Executable file
View file

@ -0,0 +1,5 @@
#!/bin/sh
cd /home/users/nico/p/foreign/alot
export PYTHONPATH=$(pwd -P)
python2 ./bin/alot

3
add-new-package Normal file
View file

@ -0,0 +1,3 @@
/root/scripts/add-links "$1"
/root/scripts/rekursivperms "$1"
chown -R .util "$1"

80
add.wddb-to-fsdb Executable file
View file

@ -0,0 +1,80 @@
BASEDIR=/home/server/www/org/wddb/www/
tmp=/tmp/wddb-$$
function report()
{
# sender
UFLINE
# return path
RPLINE
# we
RECIPIENT
# delivered to..
DTLINE
# set
}
function init()
{
cat > $tmp
}
# continent
continent=`grep "^continent" "$1" | sed 's/.*="\(.*\)"/\1/'`
case "$continent" in
africa|asia|australia|europe|northamerica|southamerica) ;;
*) report "Allowed continents: africa|asia|australia|europe|northamerica|southamerica" ;;
esac
# other vars
essid=`grep "^essid" "$1" | sed 's/.*="\(.*\)"/\1/'`
# remove possible dots
country=`grep "^country" "$1" | sed 's/.*="\(.*\)"/\1/' | sed 's/\.\.//g'`
area=`grep "^area" "$1" | sed 's/.*="\(.*\)"/\1/' | sed 's/\//-/g' | sed 's/ //c'`
mac=`grep "^mac" "$1" | sed 's/.*="\(.*\)"/\1/'`
rate=`grep "^rate" "$1" | sed 's/.*="\(.*\)"/\1/'`
wep=`grep "^wep" "$1" | sed 's/.*="\(.*\)"/\1/'`
hints=`grep "^hints" "$1" | sed 's/.*="\(.*\)"/\1/'`
location=`grep "^location" "$1" | sed 's/.*="\(.*\)"/\1/'`
# check for empty fields
for a in essid country area mac rate wep hints location; do
eval tmp="\$$a"
if [ -z "$tmp" ]; then
report "Empty field: $a"
fi
done
if [ ! -f $BASEDIR/$continent/$country/$area.html ]; then
cat << EOF > "$1"
<html>
<head>
<title>wddb.org - WarDriver's DataBase</title>
</head>
<BODY bgcolor="#000000" color="#ef0000" font-color="#ef0000">
<FONT COLOR="#ef0000">
else
lines=`cat "$BASEDIR/$continent/$country/$area.html" | wc |awk '{ print $1 }'`
use_lines=$[$lines-7]
head -n $use_lines "$BASEDIR/$continent/$country/$area.html" > "$1"
fi
cat << EOF >> "$1"
</TABLE>
<HR>
<A HREF="../index.html"> << One step back</A>
<P><A HREF="/submit-new.html">Submit new network or changes<A>
</FONT>
</BODY>
</HTML>
EOF

3
add_usb_storage Normal file
View file

@ -0,0 +1,3 @@
modprobe usb-storage
modprobe ohci-hcd
modprobe sd_mod

15
archive_mails.sh Executable file
View file

@ -0,0 +1,15 @@
#!/bin/sh
# Nico Schottelius
# clean current mailbox, so imap connections are faster
set -e
maildir="$HOME/Maildir"
curdir="$maildir/cur"
date=$(date +%Y-%m-%d)
archiv="$HOME/mail-archiv"
ddir="${archiv}/${date}/"
mkdir -p "$ddir"
find "$curdir" -type f -exec mv {} "$ddir" \;

View file

@ -0,0 +1,21 @@
#!/bin/sh
if [ "$#" -ne 1 ]; then
echo "$0 package" >&2
exit 1
fi
deps=$(pacman -Qi "$1" | awk -F: '/Depends On/ { print $2 }')
echo $1 -- $deps
alldeps=""
for dep in $deps; do
[ "$dep" = "None" ] && continue
pkg=$(echo $dep | sed 's/>=.*//')
alldeps="$alldeps $("$0" "$pkg")"
done
echo "$alldeps"

153
attach Executable file
View file

@ -0,0 +1,153 @@
#!/usr/bin/perl -wT
#
# TWiki Collaboration Platform, http://TWiki.org/
#
# Copyright (C) 1999-2003 Peter Thoeny, peter@thoeny.com
#
# For licensing info read license.txt file in the TWiki root.
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program 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 General Public License for more details, published at
# http://www.gnu.org/copyleft/gpl.html
# Set library paths in @INC, at compile time
BEGIN { unshift @INC, '.'; require 'setlib.cfg'; }
use CGI::Carp qw( fatalsToBrowser );
use CGI;
use TWiki;
use strict;
#open(STDERR,'>&STDOUT'); # redirect error to browser
$| = 1; # no buffering
&main();
# =========================
sub listVersions
{
my( $web, $topic, $attachment ) = @_;
my $latestRev = TWiki::Store::getRevisionNumber( $web, $topic, $attachment );
$latestRev =~ /\.(.*)/;
my $maxRevNum = $1;
my $found = 0;
my $result = "\n| *Version:* | *Action:* | *Date:* | *Who:* | *Comment:* |\n";
for( my $version = $maxRevNum; $version >= 1; $version-- ) {
my $rev = "1.$version";
my( $date, $userName, $dummy, $comment ) =
TWiki::Store::getRevisionInfo( $web, $topic, $rev, "TWiki date", $attachment );
my $wikiUserName = &TWiki::userToWikiName( $userName );
my $viewAction = "<a href=\"%SCRIPTURLPATH%/viewfile%SCRIPTSUFFIX%/%WEB%/%TOPIC%?rev=$rev&filename=$attachment\">view</a>";
$result .= "| 1.$version | $viewAction | $date | $wikiUserName | $comment |\n";
}
$result = "$result";
return $result;
}
# =========================
sub main
{
my $query = new CGI;
my $thePathInfo = $query->path_info();
my $theRemoteUser = $query->remote_user();
my $theTopic = $query->param( 'topic' );
my $theUrl = $query->url;
my( $topic, $webName, $dummy, $userName ) =
&TWiki::initialize( $thePathInfo, $theRemoteUser, $theTopic, $theUrl, $query );
$dummy = ""; # to suppress warning
my $tmpl = "";
my $text = "";
my $meta = "";
my $atext = "";
my $fileName = "";
my $fileUser = "";
my $wikiUserName = &TWiki::userToWikiName( $userName );
my $isHideChecked = "";
if( ! &TWiki::Store::webExists( $webName ) ) {
my $url = &TWiki::getOopsUrl( $webName, $topic, "oopsnoweb" );
TWiki::redirect( $query, $url );
return;
}
my( $mirrorSiteName, $mirrorViewURL ) = &TWiki::readOnlyMirrorWeb( $webName );
if( $mirrorSiteName ) {
my $url = &TWiki::getOopsUrl( $webName, $topic, "oopsmirror", $mirrorSiteName, $mirrorViewURL );
TWiki::redirect( $query, $url );
return;
}
# check access permission
if( ! &TWiki::Access::checkAccessPermission( "change", $wikiUserName, "", $topic, $webName ) ) {
my $url = &TWiki::getOopsUrl( $webName, $topic, "oopsaccesschange" );
TWiki::redirect( $query, $url );
return;
}
$fileName = $query->param( 'filename' ) || "";
if( &TWiki::Store::topicExists( $webName, $topic ) ) {
( $meta, $text ) = &TWiki::Store::readTopic( $webName, $topic );
}
my %args = $meta->findOne( "FILEATTACHMENT", $fileName );
%args = ( "attr" => "", "path" => "", "comment" => "" ) if( ! % args );
if ( $args{"attr"} =~ /h/o ) {
$isHideChecked = "checked";
}
if ( $fileName ) {
$atext = listVersions( $webName, $topic, $fileName );
}
# why log attach before post is called?
# FIXME: Move down, log only if successful (or with error msg?)
# Attach is a read function, only has potential for a change
if( $TWiki::doLogTopicAttach ) {
# write log entry
&TWiki::Store::writeLog( "attach", "$webName.$topic", $fileName );
}
my $fileWikiUser = "";
my $skin = $query->param( "skin" ) || TWiki::Prefs::getPreferencesValue( "SKIN" );
if( $fileName && %args ) {
$tmpl = TWiki::Store::readTemplate( "attachagain", $skin );
$fileWikiUser = &TWiki::userToWikiName( $args{"user"} );
} else {
$tmpl = TWiki::Store::readTemplate( "attachnew", $skin );
}
$tmpl =~ s/%ATTACHTABLE%/$atext/go;
$tmpl =~ s/%FILEUSER%/$fileWikiUser/go;
$tmpl = &TWiki::handleCommonTags( $tmpl, $topic );
$tmpl = &TWiki::getRenderedVersion( $tmpl );
$tmpl = &TWiki::handleMetaTags( $webName, $topic, $tmpl, $meta );
$tmpl =~ s/%HIDEFILE%/$isHideChecked/go;
$tmpl =~ s/%FILENAME%/$fileName/go;
$tmpl =~ s/%FILEPATH%/$args{"path"}/go;
$tmpl =~ s/%FILECOMMENT%/$args{"comment"}/go;
TWiki::writeHeader( $query );
print $tmpl;
}
# EOF

10
backup.to.eiche Executable file
View file

@ -0,0 +1,10 @@
HOST=eiche
DESTDIR=/mnt/datennirvana/backup/bruehe
EXCLUDE_FILE=/root/.backup-exclude
#time rsync -e ssh -av --exclude-from=/root/.backup-exclude / 192.168.23.33:/mnt/backup/bruehe
time rsync -e ssh -av --exclude-from=$EXCLUDE_FILE / "$HOST":"$DESTDIR"
#echo "Shutting down $HOST..."
#ssh $HOST "shutdown -h now"

18
backup_to_eiche.nfs Normal file
View file

@ -0,0 +1,18 @@
NEWROOT=/mnt/eiche
DATA_DIRS="bin boot etc home lib opt root sbin tmp usr var"
SCRIPTS="/root/scripts/to_eiche"
# display how long we backup
date
for script in $SCRIPTS; do
$script
done
# create empty dirs
mkdir -p $NEWROOT/dev $NEWROOT/proc $NEWROOT/mnt
for a in /mnt/*; do mkdir -p $NEWROOT/$a; done
cd /
tar cf - $DATA_DIRS | ( cd $NEWROOT; tar xf - )
date

4
bootstrap Normal file
View file

@ -0,0 +1,4 @@
#!/bin/sh
mkdir ~/p/
mr checkout

9
change.old.new Executable file
View file

@ -0,0 +1,9 @@
#!/bin/sh
OLD='\[ Nico at Schottelius dot org \]'
NEM='\[ info: use finger @schottelius.org ]'
if [ ! -d "$1" ]; then
cat "$1" | sed "s/$OLD/$NEW/g"
#> $1.tmp
#mv $1.tmp $1
fi

29
clear-link-dirs Normal file
View file

@ -0,0 +1,29 @@
check_file()
{
if [ ! -h "$1" ]; then
echo "$1" is not a link\! Please FIXME\!
if [ ! -e "$1" ]; then
echo "$1" is broken. removing.
#rm "$1"
fi
fi
}
for a in /usr/bin/* ; do
check_file "$a"
done
for a in /usr/lib/* ; do
check_file "$a"
done
for a in /usr/sbin/*; do
check_file "$a"
done
for a in /usr/include/*; do
check_file "$a"
done

4
console_dvd Normal file
View file

@ -0,0 +1,4 @@
~/scripts/enab_fbdev
~/scripts/enab_sound
mplayer -nogui -vo fbdev -dvd 1 /dev/cdroms/cdrom0 "$@"

4
console_vcd Normal file
View file

@ -0,0 +1,4 @@
~/scripts/enab_fbdev
~/scripts/enab_sound
mplayer -nogui -vo fbdev -vcd 1 /dev/cdroms/cdrom0 "$@"

1
create-logdir Executable file
View file

@ -0,0 +1 @@
mkdir logs; chown www-data:www-data logs

10
cron/check_pppd Executable file
View file

@ -0,0 +1,10 @@
#!/bin/sh
PID=""
PROG="pppd call dsl-provider"
PID=`ps ax | grep "$PROG" | grep -v grep | awk '{ print $1 }'`
if [ -z "$PID" ]; then
echo "Starte Internet neu"
pppd call dsl-provider
fi

16
cron/clean-nico-mailbox.sh Executable file
View file

@ -0,0 +1,16 @@
#!/bin/sh
# Nico Schottelius
# clean current mailbox, so imap connections are faster
set -e
maildir="/home/server/mail/schottelius.org/nico/"
curdir="$maildir/cur"
date=$(date +%Y-%m-%d)
archiv="/home/user/nico/mail-archiv"
ddir="${archiv}/${date}/"
mkdir -p "$ddir"
find "$curdir" -type f -exec mv {} "$ddir" \;

59
cron/lighty-rrd-graph.sh Executable file
View file

@ -0,0 +1,59 @@
#!/bin/sh
RRDTOOL=/usr/bin/rrdtool
OUTDIR=/home/server/www/nico/org/schottelius/home/www/stats
INFILE=/home/server/www/rrd/lighttpd.rrd
OUTPRE=lighttpd-traffic
DISP="-v bytes --title TrafficWebserver \
DEF:binraw=$INFILE:InOctets:AVERAGE \
DEF:binmaxraw=$INFILE:InOctets:MAX \
DEF:binminraw=$INFILE:InOctets:MIN \
DEF:bout=$INFILE:OutOctets:AVERAGE \
DEF:boutmax=$INFILE:OutOctets:MAX \
DEF:boutmin=$INFILE:OutOctets:MIN \
CDEF:bin=binraw,-1,* \
CDEF:binmax=binmaxraw,-1,* \
CDEF:binmin=binminraw,-1,* \
CDEF:binminmax=binmax,binmin,- \
CDEF:boutminmax=boutmax,boutmin,- \
AREA:binmin#ffffff: \
STACK:binminmax#f00000: \
LINE1:binmin#a0a0a0: \
LINE1:binmax#a0a0a0: \
LINE2:bin#a0a735:incoming \
GPRINT:bin:MIN:%.2lf \
GPRINT:bin:AVERAGE:%.2lf \
GPRINT:bin:MAX:%.2lf \
AREA:boutmin#ffffff: \
STACK:boutminmax#00f000: \
LINE1:boutmin#a0a0a0: \
LINE1:boutmax#a0a0a0: \
LINE2:bout#a0a735:outgoing \
GPRINT:bout:MIN:%.2lf \
GPRINT:bout:AVERAGE:%.2lf \
GPRINT:bout:MAX:%.2lf \
"
$RRDTOOL graph $OUTDIR/$OUTPRE-hour.png -a PNG --start -14400 $DISP
$RRDTOOL graph $OUTDIR/$OUTPRE-day.png -a PNG --start -86400 $DISP
$RRDTOOL graph $OUTDIR/$OUTPRE-month.png -a PNG --start -2592000 $DISP
OUTPRE=lighttpd-requests
DISP="-v req --title RequestsperSecond -u 1 \
DEF:req=$INFILE:Requests:AVERAGE \
DEF:reqmax=$INFILE:Requests:MAX \
DEF:reqmin=$INFILE:Requests:MIN \
CDEF:reqminmax=reqmax,reqmin,- \
AREA:reqmin#ffffff: \
STACK:reqminmax#0e0e0e: \
LINE1:reqmin#a0a0a0: \
LINE1:reqmax#a0a0a0: \
LINE2:req#00a735:requests"
$RRDTOOL graph $OUTDIR/$OUTPRE-hour.png -a PNG --start -14400 $DISP
$RRDTOOL graph $OUTDIR/$OUTPRE-day.png -a PNG --start -86400 $DISP
$RRDTOOL graph $OUTDIR/$OUTPRE-month.png -a PNG --start -2592000 $DISP

12
cron/ping_pong Executable file
View file

@ -0,0 +1,12 @@
#HOSTS="www.spiegel.de www.lernen.de www.isc.org B.ROOT-SERVERS.NET"
HOSTS="www.heise.de www.netcraft.com "
STATUS=offline
for myh in $HOSTS; do
ping -c1 $myh >/dev/null 2>&1 && STATUS=online
done
if [ "$STATUS" = offline ]; then
echo 'Offline.'`date`
fi

28
cron/webalizer.cron Executable file
View file

@ -0,0 +1,28 @@
#!/bin/sh
# Date: 27. May 1999
# Author: Nico Schottelius ( webmaster@schottelius.org )
# webalizer.cron; do webalizer for every server
# Last Modified: 20. Mai 2003
# Version : 1.02
# Preperations
# unset / set varibales
SERV=""
WEBALIZER="/usr/bin/nice -n 20 webalizer"
ERR_LOG="/var/log/webalizer.err"
STD_LOG="/var/log/webalizer.log"
## Startup
echo Starting at : `date`
# MAIN
for SERV in `find /home/server/www/ -name webalizer.conf`; do
echo "Using $SERV"
LOGDIR=`dirname $SERV`/..
$WEBALIZER -c $SERV $LOGDIR/access.log*
# $WEBALIZER -c $SERV $LOGDIR/access.log.1 $LOGDIR/access.log*
done
## Shutdown
echo Stopping at : `date`

32
cron/webalizer.cron-v0.2 Normal file
View file

@ -0,0 +1,32 @@
#!/bin/sh
# Date: 27. May 1999
# Author: Nico Schottelius ( webmaster@schottelius.org )
# webalizer.cron; do webalizer for every server
# Last Modified: 20. Mai 2003
# Version : 1.02
# Preperations
# unset / set varibales
SERV=""
WEBALIZER="/usr/bin/nice -n 20 webalizer -c"
ERR_LOG="/var/log/webalizer.err"
STD_LOG="/var/log/webalizer.log"
## Startup
echo Starting at : `date`
# MAIN
for SERV in `find /home/server/www/ -name webalizer.conf`; do
echo "Using $SERV"
LOGDIR=`dirname $SERV`/..
for log in $LOGDIR/access.log $LOGDIR/access.log.1; do
echo "$log ..."
$WEBALIZER $SERV $log
cat $log | $WEBALIZER $SERV
done
zcat $LOGDIR/access*.gz | $WEBALIZER $SERV
done
## Shutdown
echo Stopping at : `date`

3
cron/webalizer.unix Executable file
View file

@ -0,0 +1,3 @@
#!/bin/sh
cd /home/server/www/nico/org/schottelius/unix
webalizer -c webalizer/webalizer.conf logs/access.log.1

57
dcl-ip-converter.py Executable file
View file

@ -0,0 +1,57 @@
#!/usr/bin/env python3
import ipaddress
import sys
def hexstr2int(string):
return int(string.replace(':', ''), 16)
FIRST_MAC = hexstr2int('02:00:b3:39:79:4d')
FIRST_V4 = ipaddress.ip_address('185.203.112.2')
FIRST_V6 = "2a0a:e5c0:0:2:400:b3ff:fe39:794d"
V6_NAT64_BASE = ipaddress.ip_address("2a0a:e5c0:0:1:0:1::")
def v4_from_mac(mac):
"""Calculates the IPv4 address from a MAC address.
mac: string (the colon-separated representation)
returns: ipaddress.ip_address object with the v4 address
"""
return FIRST_V4 + (hexstr2int(mac) - FIRST_MAC)
def v4_from_v6(ipv6ip):
"""Calculates the IPv4 address from the IPv4 address
ipv6ip: the ip
returns: ipaddress.ip_address object with the v4 address
"""
return FIRST_V4 + (hexstr2int(ipv6ip) - (hexstr2int(FIRST_V6)))
def v6_from_v4(ipv4):
v4addr = ipaddress.ip_address(ipv4)
return V6_NAT64_BASE + int(v4addr)
if __name__ == "__main__":
addr = sys.argv[1]
out = []
try:
out.append(v4_from_v6(addr))
except:
pass
try:
out.append(v6_from_v4(addr))
except:
pass
print("{}".format(out))
# test.ch
# 2a0a:e5c0:0:1:0:1:504a:8a8c
# 80.74.138.140
# 1347062412
#

28
dhcp-abuse Normal file
View file

@ -0,0 +1,28 @@
# virtull devices
vdev=0
dev=eth0
l6="0"
while [ "$l6" -lt 256 ]; do
l5="0"
while [ "$l5" -lt 256 ]; do
l4="0"
while [ "$l4" -lt 256 ]; do
l3="0"
while [ "$l3" -lt 256 ]; do
l2="0"
while [ "$l2" -lt 256 ]; do
echo ifconfig $dev:$vdev hw ether `printf 00:%x:%x:%x:%x:%x $l2 $l3 $l4 $l5 $l6`
ifconfig $dev:$vdev hw ether `printf 00:%x:%x:%x:%x:%x $l2 $l3 $l4 $l5 $l6`
l2=$[$l2+1]
vdev=$[$vdev+1]
done
l3=$[$l3+1]
done
l4=$[$l4+1]
done
l5=$[$l5+1]
done
l6=$[$l6+1]
done

251
dhw2ps.pl Executable file
View file

@ -0,0 +1,251 @@
#!/usr/bin/env perl
# -------------------------------------------------------------------------
# file: dhw2ps.pl
# task: convert the internal dwh file format of DigiMemo A501 to
# ps or pdf files
# authors: Jan Theofel (theofel@etes.de)
# Harald Koenig
# version: 0.1
# license: free to use, an official license will follow
# -------------------------------------------------------------------------
# TODO:
# - code cleanup
# - code optimisation (the array of chars is very slow)
# - adding a real license
# - add documentation
# -------------------------------------------------------------------------
use strict;
use Getopt::Long qw(:config gnu_getopt);
my $pdfout = ($0 =~ /dhw2pdf/);;
my $debug = 0;
my $verbose = 0;
my $usage = 0;
my $quiet = 0;
my $colorlayers = 0;
sub usage
{
print "usage: $0 [params] [dwh file(s)]\n\n";
print "Where params can be:\n";
print "-c|--colorlayers color layers\n";
print "-d|--debug run in debug mode\n";
print "-h|--help display this usage message\n";
print "-q|--quiet run in quite mode\n";
print "-v|--verbose run in verbose mode\n";
print "--pdf create pdf files (nneds ps2pdf)\n";
print "--ps create ps files\n";
exit $_[0];
}
GetOptions (
'c' => \$colorlayers, 'colorlayers!' => \$colorlayers,
'd' => \$debug, 'debug!' => \$debug,
'h' => \$usage, 'help' => \$usage,
'q' => \$quiet, 'quiet!' => \$quiet,
'v' => \$verbose, 'verbose!' => \$verbose,
'pdf!' => \$pdfout,
'ps!' => sub { $pdfout = 0 },
) or usage(1);
my $inname = shift();
usage(0) if ($usage || !$inname);
if ($pdfout)
{
my $check_ps2pdf = `which ps2pdf`;
if($check_ps2pdf eq "")
{
die "ERROR: ps2pdf is needed in pdf mode.\n";
}
}
while ($inname) { # loop for all input files
my ($buffer, $skip, $data);
my ($fileversion, $paperwidth, $paperheight, $paperformat);
my $file_content;
print "INFO: input file: $inname\n" if (!$quiet);
open(IN, "$inname");
my $count = 32;
read(IN, $data, $count);
if($data ne "ACECAD_DIGIMEMO_HANDWRITING_____") {
die "Invalid INK file $inname\n";
}
# read rest of input file in 64K junks
while(read(IN, $buffer, 64*1024)) {
$data .= $buffer;
}
close(IN);
my @data = split(//, $data);
# decode header data
$fileversion = ord($data[$count++]);
$paperwidth = ord($data[$count+0]) + (ord($data[$count+1]) << 8);
$count += 2;
$paperheight = ord($data[$count+0]) + (ord($data[$count+1]) << 8);
$count += 2;
my $pagetype = ord($data[$count++]);
ord($data[$count++]); # skip header byte
ord($data[$count++]); # skip header byte
my $paper = ("a5", "a4", "??2", "??3", "??4", "??5", "??6", "??7", "b5", "b4")[$pagetype];
my $orientation = ("Portrait", "Landscape")[ $paperheight < $paperwidth ];
my $llx = 0; # 87 for A4 centering on A4
my $lly = 0; # 123 for A4 centering on A4
my $urx = $llx + int($paperwidth / 1000. * 72. + 0.999999);
my $ury = $lly + int($paperheight / 1000. * 72. + 0.999999);
my $now = gmtime;
print "DEBUG: ink file version: $fileversion\n" if ($debug);
print "DEBUG: width / height: $paperwidth / $paperheight\n" if ($debug);
print "DEBUG: pagetype: $pagetype ($paper)\n" if ($debug);
my $outfile;
if ($pdfout) {
$outfile = "|ps2pdf -sPAPERSIZE=$paper - $inname";
$outfile =~ s/\.dhw$//;
$outfile .= ".pdf";
} else {
$outfile = ">$inname";
$outfile =~ s/\.dhw$//;
$outfile .= ".ps";
}
print "DEBUG: output file: $outfile\n" if ($debug);
open(OUT, "$outfile");
print OUT <<PSHEAD;
%!PS-Adobe-2.0
%%Title: $inname
%%Creator: ink2ps $inname
%%CreationDate: $now
%%Orientation: $orientation
%%BoundingBox: $llx $lly $urx $ury
%%DocumentPaperSizes: $paper
%%Pages: 1
%%EndComments
/StartPage {
gsave
$llx $lly translate
72 1000 div dup scale
1 setlinecap
1 setlinejoin
1 LW
} bind def
/EndPage {
grestore
showpage
} bind def
/RGB { setrgbcolor } bind def
/LW { setlinewidth } bind def
/S { newpath moveto } bind def
/L { lineto } bind def
/E { stroke } bind def
%%EndProlog
%%Page: 1 1
StartPage
% set line width
16 LW
% set color
0 0 0 RGB
% strokes
PSHEAD
my $color = 0;
my $lastcolor = 0;
my $layer = 0;
my $strokes = 0;
my $points = 0;
my $pointcmd = "S";
while($count < $#data) {
my $next = ord($data[$count++]);
if (($next & ~0x07) == 0x80) { # pen up/down
if ($next & 0x01) {
$pointcmd = "S";
print "DEBUG pen down POSITION $count\n" if ($debug);
}
else {
$pointcmd = "L\nE\n";
$strokes++;
print "DEBUG pen up POSITION $count\n" if ($debug);
}
$color = (($next >> 1) + ($layer * $colorlayers)) & 0x03;
print "DEBUG pen color $color\n" if ($debug);
if ($color != $lastcolor) {
$lastcolor = $color;
print OUT "%%Color: $color\n";
print OUT ("0 0 0", "1 0 0", "0 1 0", "0 0 1")[$color] . " RGB\n";
}
}
elsif ($next == 0x88) { # time stamp
my $timestamp = ord($data[$count++]);
print "DEBUG TimeStamp $timestamp\n" if ($debug);
print OUT "%%TimeStamp: $timestamp\n" if ($timestamp < 0x7f);
}
elsif ($next == 0x90) { ## end of layer
$layer = ord($data[$count++]);
print "DEBUG End of LAYER $layer\n" if ($debug);
die("Layer # $layer > 127") if ($layer & 0x80);
print OUT "%%EndOfLayer: $layer\n\n";
}
elsif (!($next & ~0x7f)) { ## coordinates
my ($b1, $b2, $b3, $b4) = ($next, ord($data[$count+0]), ord($data[$count+1]), ord($data[$count+2]));
$count += 3;
printf "DEBUG CHECK position $count A %02x %02x %02x %02x\n", $b1, $b2, $b3, $b4 if ($debug);
# die("MSB set in coordinate bytes") if (($b1 | $$b2 | $b3 | $b4) & ~0x7f);
my $x = $b1 + ($b2 << 7);
my $y = $b3 + ($b4 << 7);
print "DEBUG $count: x = $x / y = $y\n" if ($debug);
print OUT "$x $y " . $pointcmd . "\n";
$points++;
$pointcmd = "L";
} else {
die("unknown byte " . sprintf("0x%02x", $next) . " at position $count");
}
}
print OUT <<PSFOOT;
EndPage
%%Trailer
%%EOF
PSFOOT
close(OUT);
print "INFO: $points points, $strokes strokes, $layer layers\n\n" if (! $quiet);
$inname = shift();
}

9
dnstunnel Executable file
View file

@ -0,0 +1,9 @@
#!/bin/sh
ns=$1; shift
sudo iodine -f "$ns" 42.schottelius.org "$@" < ~nico/.iodine-password
#ip route del default
#ip route add default via 172.16.0.1

4
emacs Executable file
View file

@ -0,0 +1,4 @@
#!/bin/sh
# /usr/bin/emacs -nw "$@"
/usr/bin/emacs "$@"

View file

@ -0,0 +1,51 @@
#!/bin/sh
#
# 2008 Nico Schottelius (nico-nsbin at schottelius.org)
#
# This file is part of nsbin.
#
# nsbin is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# nsbin 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 General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with nsbin. If not, see <http://www.gnu.org/licenses/>.
#
# Export an internal puppet module to an own git repo
# Usage: $0 module desc pseudo-owner
#
srcdir=/home/users/nico/ethz/vcs/puppet
dstdir=/home/users/nico/p/puppet/
export module="$1"; shift
export mdir="modules/${module}"
mv "${srcdir}/${module}" "${dstdir}"
( cd "${srcdir} && git rm -r "${mdir}" && git c -m "-- ${mdir}" "${mdir} )
# allow display via gitweb
touch "${GIT_DIR}/git-daemon-export-ok"
# add description
echo "${desc}" > "${GIT_DIR}/description"
# make sure group rights are kept
cat << eof > "${GIT_DIR}/config"
[core]
filemode = true
bare = true
sharedRepository = group
[gitweb]
owner = "${powner:-"sans"}"
eof
chgrp sans -R "${GIT_DIR}"
chmod g+rw -R "${GIT_DIR}"

104
firewall-masq Normal file
View file

@ -0,0 +1,104 @@
################################################################################
# LINUX FIREWALL
# Nico Schottelius <Nico@Schottelius.Org>
# Dec 2001
################################################################################
########## TEST #### #DEV_OUT="eth1"
DEV_OUT="eth0"
DEV_INT="eth1"
NET_INT="192.168.1.0/255.255.255.0"
# Das NAT-Modul laden (dies zieht all die andern mit).
modprobe iptable_nat
# erstmal aufraeumen:
# benutzerdefinierte chains von filter loeschen
iptables -X
# filter aufraeumen. loescht alle chains
iptables -F
# auch in nat
iptables -t nat -F
##################
#
# NAT/Masquarading
#
# In der NAT-Tabelle (-t nat) eine Regel fuer alle an ppp0 (-o ppp0)
# ausgehenden Pakete hinter dem Routing (POSTROUTING), die maskiert
# werden sollen, anhaengen (-A).
iptables -t nat -A POSTROUTING -o $DEV_OUT -j MASQUERADE
# IP-Forwarding aktivieren
echo 1 > /proc/sys/net/ipv4/ip_forward
# auch dynamische Adresse
echo "1" > /proc/sys/net/ipv4/ip_dynaddr
#################
#
# INPUT Pakete an diesen Rechner
#
# von intranet alles erlauben
iptables -A INPUT -s $NET_INT -j ACCEPT
# erlaube SSH von ueberall (auch inet)
iptables -A INPUT -p tcp --dport ssh -j ACCEPT
# civ
iptables -A INPUT -p tcp --dport 5555 -j ACCEPT
# UDP Pakete aus lokalem Netz passieren lassen
# iptables -A INPUT -p udp -s $NET_INT -j ACCEPT
# UDP-Pakete von Name-Servern durchlassen
iptables -A INPUT -p udp --sport 53 -j ACCEPT
# ICMP-Pakete (z.B. Ping) aus lokalem Netz erlauben
iptables -A INPUT -p icmp -s $NET_INT -j ACCEPT
# ICMP-Pakete (z.B. Ping) generell verbieten
#iptables -A INPUT -p icmp -j DROP
# lokale arbeit zulassen (loopback)
iptables -A INPUT -i lo -j ACCEPT
# sonst nur packete aus vorhandenen verbindungen
iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
# Policy (Standardverhalten am Regelende): Paket verwerfen
iptables -P INPUT DROP
###############
#
# FORWARD Geroutete Packete
#
# Policy (Standardverhalten am Regelende): Paket verwerfen
iptables -P FORWARD DROP
# Pakete aus lokalem Netz erlauben und routen
iptables -A FORWARD -s $NET_INT -j ACCEPT
# man koennte es auch nur auf ftp beschraenken:
##iptables -A FORWARD -o $DEV_OUT -p tcp --sport 1024:65535 --dport ftp -m state --state NEW -j ACCEPT
# zu routende Pakete nur durchlassen, wenn von innen oder zu einer
# bestehenden Verbindung gehörig
#
iptables -A FORWARD -m state --state ESTABLISHED,RELATED -j ACCEPT
##################
#
# OUTPUI von uns (lokal)
#
# Policy (Standardverhalten am Regelende): Paket durchlassen
iptables -P OUTPUT ACCEPT

6
fix_broken_2.5er Normal file
View file

@ -0,0 +1,6 @@
#!/bin/sh
cd /lib/modules/"$1"
cp `find -name \*.ko` kernel
~nico/bin/mmv ko o

21
fsdb-web/show-pages.fsdb Executable file
View file

@ -0,0 +1,21 @@
DB=/home/user/nico/DB/wddb/
HTMLDB=/home/user/nico/DB/wddb-html/
DATA_1=`echo $1 | sed 's/\.\.\///g'`
echo $DATA_1
CONTINENT=`echo $DATA_1 | awk -F"/" '{ print $1 }'`
#CONTINENT=`echo $DATA_1 | sed 's/^\(.*\)\/.*/\1/g'`
echo $CONTINENT
DATADIR=`echo $DATA_1 | sed 's/\(.*\)\/\(.*\)/\1/g'`
HTML=`echo $DATA_1 | sed 's/\(.*\)\/\(.*\)/\2/g'`
echo $DATADIR
echo $HTML
if [ ! -d $DB/$CONTINENT ]; then
show_error
fi
grep

224
generate.rb Executable file
View file

@ -0,0 +1,224 @@
#!/usr/bin/env ruby
require 'misen/style-sgml'
require 'misen/util'
require 'getoptlong'
require 'fileutils'
require 'digest/sha1'
@version = '0.2'
@verbose = 0
@force = false
@outpath = "#{Dir.pwd}/generated"
@inpath = "#{Dir.pwd}/source"
@template = "#{Dir.pwd}/templates"
@default = 'default.html'
@datadir = "#{Dir.pwd}/data"
@filehash = Hash.new
def printMsg(prefix, msg, descriptor = $stdout)
descriptor.puts '%-12s %s' % [prefix + ':', msg]
end
def panic(msg)
printMsg('PANIC', msg, $stderr)
Kernel.exit(-1)
end
def error(msg)
printMsg('ERROR', msg, $stderr)
end
def warn(msg)
printMsg('WARNING', msg)
end
def info(msg)
printMsg('INFO', msg)
end
def debug(msg, verbosity = 1)
if(@verbose >= verbosity)
printMsg("DEBUG(#{verbosity})", msg, $stderr)
end
end
def generateMenu(dir, file = nil, level = 0)
debug("call generateMenu('#{dir}', '#{file}', #{level})")
template = '<ul<misen:class />>
<misen:menuentries>
<li><a href="<misen:url />"<misen:class />><misen:desc /></a><misen:menu /></li>
</misen:menuentries>
</ul>'
dir = dir + '/' if(!dir.empty? && dir[-1].chr != '/')
menu = File.new("#{dir}menu.def").readlines
data = Hash.new
menuentries = Array.new
menu.each { |x|
entry = x.split(/\s*\|\s*/, 2)
e = Hash.new
e[:class] = (file && dir + entry[0] == file ? ' class="active"' : '')
if(file && dir + entry[0] == file)
e[:class] = data[:class] = ' class="active"'
end
e[:url] = "/#{dir}#{entry[0]}" # TODO: make relative paths
e[:desc] = entry[1].strip
if(FileTest.directory?("#{dir}#{entry[0]}") && FileTest.exists?("#{dir}#{entry[0]}/menu.def"))
e[:menu] = generateMenu("#{dir}#{entry[0]}", file, level + 1)
end
menuentries << e
}
return '' if(menuentries.empty?)
data[:menuentries] = menuentries
return removeEmptyLine(Misen.expand_text(Misen::STYLE_SGML, template, data))
end
def generateFiles(dir = '')
debug("call generateFiles('#{dir}')")
dir = dir + '/' if(!dir.empty? && dir[-1].chr != '/')
Dir.foreach(dir.empty? ? '.' : dir) { |x|
next if(x =~ /^(\.|\.\.)$/)
if(x =~ /\.html$/)
if(!FileTest.exists?(@outpath + '/' + dir + x) || @filehash[dir + x] != Digest::SHA1.hexdigest(File.new(dir + x).read) || @force)
info("Transforming #{dir}#{x}")
data = {:style => getStylePath(dir) + 'style.css', :content => File.new("#{dir}#{x}").read, :menu => generateMenu('', dir + File.basename(x, '.html'))}
Dir.mkdir("#{@outpath}/#{dir}") if(!FileTest.exists?("#{@outpath}/#{dir}"))
File.open("#{@outpath}/#{dir}#{x}", "w") { |file|
file.print removeEmptyLine(Misen.expand_text(Misen::STYLE_SGML_EX, @source, data))
}
@filehash[dir + x] = Digest::SHA1.hexdigest(File.new(dir + x).read)
else
info("Nothing to do for #{dir}#{x}")
end
elsif(FileTest.directory?(dir + x))
begin
Dir.mkdir("#{@outpath}/#{dir}#{x}") if(!FileTest.exists?("#{@outpath}/#{dir}#{x}"))
rescue
panic("Could not create #{@outpath}/#{dir}#{x}: #{$!}")
end
generateFiles("#{dir}#{x}")
elsif(x !~ /(\.def|\.swp)$/)
if(!FileTest.exists?(@outpath + '/' + dir + x) || @filehash[dir + x] != Digest::SHA1.hexdigest(File.new(dir + x).read) || @force)
info("Copying file #{dir}#{x}")
FileUtils.cp(dir + x, @outpath + '/' + dir + x)
@filehash[dir + x] = Digest::SHA1.hexdigest(File.new(dir + x).read)
else
info("No need to copy #{dir}#{x}. Already latest.")
end
end
}
end
def removeEmptyLine(str)
str.split($/).collect{ |x| x =~ /^\s*$/ ? nil : x}.compact.join($/)
end
def getPath(path)
return path if(path[0].chr == '/')
return "#{Dir.pwd}/#{path}"
end
def getStylePath(dir)
newdir = ''
dir.split('/').each {
newdir += '../'
}
return newdir
end
def usage
info("Usage: #{File.basename(__FILE__)} [options]")
info('')
info('%20s %s' % ['--verbose, -v', 'Verbose output. Add v for more verbose output'])
info('%20s %s' % ['--inpath, -i', 'Specify where to search for input files [./source]'])
info('%20s %s' % ['--outpath, -o', 'Specify where to write the output files [./generated]'])
info('%20s %s' % ['--template, -t', 'Specify where to search for template files [./templates]'])
info('%20s %s' % ['--default, -d', 'The default template name [default.html]'])
info('%20s %s' % ['--force, -f', 'Force the new generating of all files [false]'])
info('%20s %s' % ['--help, -h', 'Print this screen'])
info('%20s %s' % ['--version, -V', 'Print the version and exit'])
end
puts "This is #{File.basename(__FILE__)} v#{@version} 2005 by René Nussbaumer"
puts
opts = GetoptLong.new(
['--verbose', '-v', GetoptLong::OPTIONAL_ARGUMENT],
['--inpath', '-i', GetoptLong::REQUIRED_ARGUMENT],
['--outpath', '-o', GetoptLong::REQUIRED_ARGUMENT],
['--template', '-t', GetoptLong::REQUIRED_ARGUMENT],
['--default', '-d', GetoptLong::REQUIRED_ARGUMENT],
['--force', '-f', GetoptLong::NO_ARGUMENT],
['--help', '-h', GetoptLong::NO_ARGUMENT],
['--version', '-V', GetoptLong::NO_ARGUMENT]
)
opts.each { |arg,value|
case arg
when '--verbose'
@verbose += 1
value.each_byte { |x|
if(x.chr == 'v')
@verbose += 1
end
}
debug("Verbosity set to: #{@verbose}")
when '--inpath'
@inpath = getPath(value)
when '--outpath'
@outpath = getPath(value)
when '--template'
@template = getPath(value)
when '--default'
@default = value
when '--force'
@force = true
when '--help'
usage
Kernel.exit(0)
when '--version'
Kernel.exit(0)
else
warn("Unknown option #{arg}#{value && !value.empty? ? ('with value ' + value) : ''}")
end
}
debug("Current configuration:")
debug('%-10s %s' % ['Inpath:', @inpath])
debug('%-10s %s' % ['Outpath:', @outpath])
debug('%-10s %s' % ['Template:', @template])
debug('%-10s %s' % ['Default:', @default])
begin
Dir.mkdir(@inpath) if(!FileTest.directory?(@inpath))
Dir.mkdir(@outpath) if(!FileTest.directory?(@outpath))
Dir.mkdir(@template) if(!FileTest.directory?(@template))
Dir.mkdir(@datadir) if(!FileTest.directory?(@datadir))
rescue
panic("Could not create directory: #{$!}")
end
panic("#{@template}/#{@default} does not exist! Please create at least the default template.") if(!FileTest.exists?("#{@template}/#{@default}"))
@source = File.new("#{@template}/#{@default}").read
Dir.chdir(@inpath)
panic("Init directory needs a menu.def!") if(!FileTest.exists?('menu.def'))
@filehash = Marshal.load(File.new(@datadir + '/digest').read) if(FileTest.exists?(@datadir + '/digest'))
generateFiles
File.open(@datadir + '/digest', 'w') { |file|
file.print Marshal.dump(@filehash)
}

53
geturl Executable file
View file

@ -0,0 +1,53 @@
#!/usr/bin/perl -w
#
# Simple utility to fetch an HTML page from a server
# (Utility for TWiki Collaboration Platform, http://TWiki.org/)
#
# Copyright (C) 1999 Jon Udell, BYTE
# Copyright (C) 2000-2003 Peter Thoeny, peter@thoeny.com
#
# For licensing info read license.txt file in the TWiki root.
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program 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 General Public License for more details, published at
# http://www.gnu.org/copyleft/gpl.html
use Socket;
if( ! $ARGV[1] ) {
print "Usage: geturl <host> <path> [<port> [<header>]]\n";
print "Example: geturl some.domain /some/dir/file.html 80\n";
print "will get: http://some.domain:80/some/dir/file.html\n";
exit 1;
}
my $host = $ARGV[0];
my $url = $ARGV[1];
my $port = $ARGV[2] || "80";
my $header = $ARGV[3] || "Host: $host";
print getUrl( $host, $port, $url, $header );
# =========================
sub getUrl
{
my ( $theHost, $thePort, $theUrl, $theHeader ) = @_;
my $result = '';
my $req = "GET $theUrl HTTP/1.1\r\n$theHeader\r\n\r\n";
my ( $iaddr, $paddr, $proto );
$iaddr = inet_aton( $theHost );
$paddr = sockaddr_in( $thePort, $iaddr );
$proto = getprotobyname( 'tcp' );
socket( SOCK, PF_INET, SOCK_STREAM, $proto ) or die "socket: $!";
connect( SOCK, $paddr ) or die "connect: $!";
select SOCK; $| = 1;
print SOCK $req;
while( <SOCK> ) { $result .= $_; }
close( SOCK ) or die "close: $!";
select STDOUT;
return $result;
}

15
git-mv.sh Executable file
View file

@ -0,0 +1,15 @@
DIR="$1"
DEST="$2"
hier="/home/server/git/$DIR/"
there="git.schottelius.org:/home/server/git/$DEST"
echo "$hier to $there?"
read bar
rsync -av "$hier" "$there"
echo "ok?"
read foo
echo rm -rf "$hier"

33
gpm Normal file
View file

@ -0,0 +1,33 @@
#! /bin/sh
# Copyright (c) 1995-1998 S.u.S.E. GmbH Fuerth, Germany.
#
# Author:
#
# /sbin/init.d/gpm
#
# and symbolic its link
#
# /sbin/rcgpm
#
### BEGIN INIT INFO
case "$1" in
start)
gpm -m /dev/misc/psaux -t ps2
;;
stop)
killall -TERM gpm
;;
restart|reload)
$0 stop && $0 start
;;
status)
echo -n "Checking for console mouse support (gpm): "
checkproc /usr/sbin/gpm && echo OK || echo No process
;;
*)
echo "Usage: $0 {start|stop|status|restart|reload}"
exit 1
;;
esac
rc_exit

2
gta.sh Executable file
View file

@ -0,0 +1,2 @@
#!/bin/sh
wine ~/.wine/drive_c/Program\ Files\ \(x86\)/Rockstar\ Games/Grand\ Theft\ Auto/WINO/Grand\ Theft\ Auto.exe

View file

@ -0,0 +1,44 @@
#!/bin/sh
#
# 2003-2015 Nico Schottelius (nico-nsbin at schottelius.org)
#
# This file is part of nsbin.
#
# nsbin is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# nsbin 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 General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with nsbin. If not, see <http://www.gnu.org/licenses/>.
#
#
# Copy / to some other place
#
HOST=fs2
NEWROOT=/mnt/data/spezial/edv/backup/nico
DATA_DIRS="bin boot etc home lib opt root sbin tmp usr var"
#SCRIPTS="/root/scripts/to_eiche"
# display how long we backup
#for script in $SCRIPTS; do
# $script
#done
# create empty dirs
#ssh $HOST "mkdir -p $NEWROOT/dev $NEWROOT/proc $NEWROOT/mnt ; for a in /mnt/*; do mkdir -p $NEWROOT/$a; done"
#date
cd /
# wdt-old
#ssh $HOST "mkdir -p $NEWROOT/`date +%d-%b-%Y`"
#tar cf - $DATA_DIRS | ssh $HOST "( cd $NEWROOT/`date +%d-%b-%Y`; tar xf - )"
time tar cf - $DATA_DIRS | ssh $HOST "gzip -c > $NEWROOT/`date +%d-%b-%Y`.tar.gz "

View file

@ -0,0 +1,405 @@
#!/bin/bash
#
# This small shell script is the starter for the
# Netscape Communicator.
#
# SuSE, 1996-2000
#
trap "echo" 31
prog=""
if [ -x /opt/netscape/netscape ] ; then
prog="/opt/netscape/netscape"
else
prog="$prog $(type -p netscape)"
prog="$prog $(type -p Mosaic)"
prog="$prog $(type -p mosaic)"
prog="$prog $(type -p arena)"
prog="$prog $(type -p amaya)"
fi
preloader ()
{
#
# See which binary type we have: libc6 or libc5.
#
lddout="$(ldd $1 2>/dev/null)"
nspipepatch=libnspipepatch.so.0.0
while read line; do
case "$line" in
libc.so.5*) lib=libc5 ;;
libBrokenLocale.so.*)
lib=libc6n ;;
libc.so.6*) lib=libc6o ;;
libXext.so.6*)
set -- $line
case "$(find $3 -printf '%l\n')" in
libXext.so.6.[0-3]) nspipepatch=libnspipepatch.so.0.0 ;;
*) nspipepatch=libnspipepatch.so.0.1 ;;
esac
;;
esac
done < <(exec echo "$lddout")
#
# For libc5 programs this should be preloaded
#
if test -e /usr/i486-linux-libc5/lib/libgnumalloc.so.5 ; then
LIBGNUMALLOC=/usr/i486-linux-libc5/lib/libgnumalloc.so.5
else
LIBGNUMALLOC=/usr/lib/libgnumalloc.so.5
fi
if test $lib = libc5 -a -e $LIBGNUMALLOC ; then
if test -n "$LD_PRELOAD" ; then
LD_PRELOAD="$LIBGNUMALLOC $LD_PRELOAD"
else
LD_PRELOAD="$LIBGNUMALLOC"
fi
export LD_PRELOAD
fi
#
# For libc6 only based systems
#
if test $lib = libc6o -a -e /lib/libBrokenLocale.so.1 ; then
#
# This glibc based netscape isn't linked against libBrokenLocale
#
if test -n "$LD_PRELOAD" ; then
LD_PRELOAD="/lib/libBrokenLocale.so.1 $LD_PRELOAD"
else
LD_PRELOAD="/lib/libBrokenLocale.so.1"
fi
export LD_PRELOAD
fi
if test -e $MOZILLA_HOME/$nspipepatch ; then
NSFIX_LIB=/lib/libc.so.6
test $lib = "libc5" && NSFIX_LIB=/lib/libc.so.5
export NSFIX_LIB
if test -n "$LD_PRELOAD" ; then
LD_PRELOAD="$MOZILLA_HOME/$nspipepatch $LD_PRELOAD"
else
LD_PRELOAD="$MOZILLA_HOME/$nspipepatch"
fi
export LD_PRELOAD
fi
}
#
for p in $prog ; do
case "${p##*/}" in
netscape*)
# Switch from alarm(2) to select(2) in
# netscape's thread handling
# NSPR_NOCLOCK=1; export NSPR_NOCLOCK
#
lang="${LANG%[_@]*}"
if test ${#lang} -gt 2 -a -r /usr/share/locale/locale.alias ;then
while read alias real ; do
case "$alias" in
\#*|"") ;;
*) if test "${lang}" = "${alias%[_@]*}" ; then
LANG=${real}
break
fi ;;
esac
done < <(exec grep -vE '^#|^$' /usr/share/locale/locale.alias)
fi
#
# Multi-Language is buggy in netscape
#
test -z "$LANG" && LANG=POSIX
export LANG
enable -n printf >/dev/null 2>&1
if test "`printf "%1.1f" 1 2>/dev/null`" != "1.0" ; then
LC_NUMERIC=POSIX
export LC_NUMERIC
fi
if test "`printf "%1.1f" 1 2>/dev/null`" != "1.0" ; then
LC_COLLATE=$LANG
LC_CTYPE=$LANG
LC_MONETARY=$LANG
LC_MESSAGES=$LANG
LC_TIME=$LANG
LC_ALL=""
export LC_COLLATE LC_CTYPE LC_MONETARY LC_MESSAGES LC_TIME LC_ALL
fi
#
# Find Mozillas home
#
for d in /opt/netscape /usr/local/netscape \
/usr/lib/netscape /usr/local/lib/netscape \
/usr/netscape
do
if test -d $d ; then
MOZILLA_HOME=$d
d=$d/app-defaults
XFILESEARCHPATH=%D:$d/%L/%N:$d/%l_%t/%N:$d/%l/%N:$d/%N
unset d
break
fi
done
test -n "$MOZILLA_HOME" && export MOZILLA_HOME
test -n "$XFILESEARCHPATH" && export XFILESEARCHPATH
if test -s "$MOZILLA_HOME/registry" ; then
MOZILLA_SHARED_REGISTRY=$MOZILLA_HOME/registry
export MOZILLA_SHARED_REGISTRY
fi
#
# netscape should find it's movemail and nethelp
#
PATH=$MOZILLA_HOME:$PATH
export PATH
#
# Motif-Datenbank der Tastensymbole
#
if [ ! -r /usr/X11R6/lib/X11/XKeysymDB ] ; then
XKEYSYMDB=${MOZILLA_HOME}/XKeysymDB
export XKEYSYMDB
fi
#
# Time zone
#
TZ=:/etc/localtime
export TZ
#
# Disable X Color Management System
#
XCMSDB=/dev/null
export XCMSDB
#
# Workaround for XFree Bug (< XFree86[tm]-4.0) ??
#
MOZILLA_LINUX_INSERT_LINK_FIX=1
export MOZILLA_LINUX_INSERT_LINK_FIX
#
# Who needs this?
#
test -z "$DISPLAY" && DISPLAY=:0
display=$DISPLAY
for o in ${1+"$@"} ; do
if test "$o" = -display; then
display=""
continue
fi
test -z "$display" && display="$o"
done
export DISPLAY display
#
# Acrobat plugin
#
adir=""
for d in /usr/lib/Acrobat[1-9] \
/usr/X11R6/lib/Acrobat[1-9] \
/usr/Acrobat[1-9] \
/usr/local/Acrobat[1-9] \
/opt/Acrobat[1-9]
do
test -d $d && { adir=$d/Browsers/intellinux; break; }
done
if test -n "$adir" -a -d "$adir" ; then
adir=$HOME/.netscape/plugins:$adir:$MOZILLA_HOME/plugins
if test -n "$NPX_PLUGIN_PATH" ; then
NPX_PLUGIN_PATH=$adir:$NPX_PLUGIN_PATH
else
NPX_PLUGIN_PATH=$adir
fi
export NPX_PLUGIN_PATH
fi
#
# Class path
#
for d in $HOME/.netscape/java/classes \
$HOME/.netscape/java/download \
$HOME/.netscape/java \
$HOME/.netscape/plugins \
$HOME/.netscape
do
test -d $d || continue
if test -n "$CLASSPATH" ; then
CLASSPATH=$CLASSPATH:$d
else
CLASSPATH=$d
fi
done
if test -n "$CLASSPATH" ; then
jars=""
rest=""
for j in $MOZILLA_HOME/java/classes/*.jar \
$MOZILLA_HOME/plugins/*.jar
do
case "$j" in
*/java[0-9]*.jar) jars=$j ;;
*/*.jar) rest=$rest:$j ;;
esac
done
CLASSPATH=$MOZILLA_HOME/java/classes:$CLASSPATH
CLASSPATH=$MOZILLA_HOME/plugins:$CLASSPATH
CLASSPATH=$jars$rest:$CLASSPATH
export CLASSPATH
fi
#
# Real Player
#
rdir=""
for d in /opt/{rv,rvplayer,rvplayer?.?} \
/usr/lib/{rv,rvplayer,rvplayer?.?} \
/usr/local/{rv,rvplayer,rvplayer?.?} \
/usr/local/lib/{rv,rvplayer,rvplayer?.?}
do
if test -d $d ; then
rdir=$d
break
fi
done
if test -n "$rdir" ; then
if test -n "$LD_LIBRARY_PATH" ; then
LD_LIBRARY_PATH=$rdir:$LD_LIBRARY_PATH
else
LD_LIBRARY_PATH=$rdir
fi
export LD_LIBRARY_PATH
fi
#
# General expansion of Java, Plugins, and shared libraries
#
OIFS="$IFS"
IFS=': ,'
for d in ${MOZILLA_ADDONS:-""}
do
test -d "$d" || continue
if test -r "$d/mozilla.rc" ; then
# Hopefully they do not chrash this
# script or Netscape its self
. "$d/mozilla.rc"
else
if test -d "$d/plugins/" ; then
if test -n "$NPX_PLUGIN_PATH" ; then
NPX_PLUGIN_PATH=$d/plugins:$NPX_PLUGIN_PATH
else
NPX_PLUGIN_PATH=$d/plugins
fi
export NPX_PLUGIN_PATH
fi
if test -d "$d/classes/" ; then
jars=
for j in $d/classes/*.jar ; do
test -r "$j" || continue
jars=$jars:$j
done
if test -n "$CLASSPATH" ; then
CLASSPATH=${CLASSPATH}$jars
else
CLASSPATH=$MOZILLA_HOME/java/classes$jars
fi
export CLASSPATH
fi
if test -d "$d/lib/" ; then
if test -n "$LD_LIBRARY_PATH" ; then
LD_LIBRARY_PATH=$d/lib:$LD_LIBRARY_PATH
else
LD_LIBRARY_PATH=$d/lib
fi
export LD_LIBRARY_PATH
fi
test -d "$d/bin/" && PATH=$d/bin:$PATH
fi
done
IFS="$OIFS"
#
# Security
#
HN=$HOME/.netscape
if [ ! -d $HN ] ; then
mkdir -m 0700 $HN
mkdir -m 0700 $HN/cache
mkdir -m 0700 $HN/archive
fi
if [ ! -e $HN/preferences.js ] ; then
default='HP="http://www.suse.de/"'
/sbin/pidof httpd > /dev/null 2>&1 && default='HP="http://localhost/"'
umask 077
set -f
cat > $HN/preferences.js <<-EOF
// Netscape User Preferences
// This is a generated file! Do not edit.
user_pref("browser.cache.disk_cache_size", 7680);
user_pref("browser.cache.memory_cache_size", 1024);
user_pref("browser.enable_style_sheets", false);
user_pref("browser.fe_java_xt_app_timeout", 1);
user_pref("browser.startup.homepage", $default);
user_pref("browser.startup.homepage_override", false);
user_pref("editor.dont_lock_spell_files", true);
user_pref("helpers.global_mailcap_file", "/etc/mailcap");
user_pref("helpers.global_mime_types_file", "/etc/mime.types");
user_pref("java.applets.stop_on_iconify", true);
user_pref("javascript.allow.mailnews", false);
user_pref("javascript.enabled", false);
user_pref("ldap_2.servers.pab.locale", "C");
user_pref("li.client.javasecurity", true);
user_pref("mail.default_html_action", 1);
user_pref("mail.html_compose", false);
user_pref("mail.quoted_style", 0);
user_pref("mail.strictly_mime", true);
user_pref("network.dnsAttempt", 30);
user_pref("network.dnsCacheExpiration", 5000);
user_pref("network.dnsTimout", 30);
user_pref("network.max_connections", 8);
user_pref("network.tcpbufsize", 256);
user_pref("network.tcptimeout", 10);
user_pref("network.use_async_dns", false);
user_pref("offline.startup_mode", 1);
user_pref("security.enable_java", false);
EOF
set +f
fi
if [ -n "$SECURE_NETSCAPE" -a "$SECURE_NETSCAPE" = "yes" ]; then
test -L $HN/cookies || rm -rf $HN/cookies
test -e $HN/cookies || ln -sf /dev/null $HN/cookies
else
test -L $HN/cookies && rm -rf $HN/cookies
touch $HN/cookies
fi
chmod -f -R go-rxw $HN &
#
# Avoid crash and freezes
#
test -e $HN/cert7.db -a ! -s $HN/cert7.db && rm -f $HN/cert7.db
test -e $HN/pab.na2 -a ! -s $HN/pab.na2 && rm -f $HN/pab.na2
ln -sf history.dat $HN/history.db
: ${TMPDIR=/tmp/${USER}-netscape}
test -d $TMPDIR || { mkdir -m 0700 $TMPDIR || exit 1; }
export TMPDIR
#
# Try to make malloc safety
#
MALLOC_CHECK_=4; export MALLOC_CHECK_
#
# Start
#
dd if=$p of=/dev/null bs=8k conv=sync > /dev/null 2>&1
preloader $p
arg0=""
test -n "$BASH_VERSINFO" && arg0="-a $p"
exec $arg0 $p ${1+"$@"}
;;
*)
for param in $@ ; do
if test "$param" = "-remote" ; then
echo "Parameter \"-remote\" not supported. Exit." 1>&2
exit 1
fi
done
preloader $p
exec $p ${1+"$@"}
esac
done
echo "$0: No WWW browser found in PATH" 1>&2
exit 1

View file

@ -0,0 +1,5 @@
~/scripts/enab_fbdev
~/scripts/enab_sound
setterm -blank 0
mplayer -vo fbdev /mnt/dvd/* "$@"

View file

@ -0,0 +1,47 @@
#!/bin/sh
#
# Author: Nico Schottelius <nico AT schottelius DOT org>
# Date: 6th of May 2k+1
# Last Changed: 18th of May 2k+1
# Comment: Support for devfs
#
. /etc/sys/combined
. /etc/sys/boot/devfs
test `basename $0` = devfs && START_DEVFS="yes"
test "$START_DEVFS" = yes || exit 0
CHECK_DEVFS=`cat /proc/mounts | grep devfs | awk '{ print $1 }'`
# Check whether devfs is mounted
if [ -z "$CHECK_DEVFS ]; then
$SYS_ECHO $FAIL $NO_DEVFS_THERE
exit 1
fi
case "$1" in
start) $SYS_ECHO "$START $DEVFS_TEXT"
startproc /usr/sbin/named -u $NAMED_USER -g $NAMED_GROUP \
|| ( $SYS_ECHO "$FAIL" ; exit 1)
$SYS_ECHO $DONE
;;
stop) $SYS_ECHO -n "$STOP $NAMED_TEXT "
killproc -TERM /usr/sbin/named || ( $SYS_ECHO "$FAIL" ; exit 1)
$SYS_ECHO $DONE
;;
restart)
$0 stop && $0 start
;;
reload) $SYS_ECHO -n "$RELOAD $NAMED_TEXT "
killproc -HUP /usr/sbin/named || ( $SYS_ECHO "$FAIL" ; exit 1)
$SYS_ECHO $DONE
;;
status) checkproc /usr/sbin/named && $SYS_ECHO $OK || $SYS_ECHO $NOP
;;
*) $SYS_ECHO "$USAGE $0 {start|stop|restart|reload|status}"
exit 1
esac
exit 0

View file

@ -0,0 +1 @@
fbset -fb /dev/fb/0 -xres 1024 -yres 768

View file

@ -0,0 +1,4 @@
modprobe sound
ln -s /dev/sound/dsp /dev/dsp
ln -s /dev/sound/mixer /dev/mixer
ln -s /dev/sound/mixer1 /dev/mixer1

View file

@ -0,0 +1,8 @@
modprobe ppp_generic
modprobe ppp_async
modprobe ppp_deflate
modprobe ppp_synctty
modprobe 8250 #serial 2.5
modprobe serial #serial 2.4
modprobe bsd_comp
pppd user arcor

View file

@ -0,0 +1,4 @@
#!/bin/sh
xinput --set-prop bcm5974 "Trackpad Sensitivity" 0.3

View file

@ -1,7 +1,9 @@
#!/bin/sh
securemail
fetchmail
# Tue Jul 18 15:13:45 CEST 2017
#securemail
#fetchmail
mbsync -a
# Disabled by Mon Jun 20 10:56:19 CEST 2016 -- using mu now
# notmuch new

5
hole_mails2 Executable file
View file

@ -0,0 +1,5 @@
#!/bin/sh
maildircommit
git pull
git push

2
homestart Normal file
View file

@ -0,0 +1,2 @@
~/bin/home/route start
ssh ozean -lroot

7
ikn_init Executable file
View file

@ -0,0 +1,7 @@
#!/bin/sh
# + screen
# + x
xrandr --output LVDS1 --off
# use latest version
/home/users/nico/temp/build/synergy-read-only/bin/synergyc kr
sgterm &

19
install.add.links Normal file
View file

@ -0,0 +1,19 @@
cd /usr/bin
for a in "$1"/bin/*; do
ln -s $a
done
cd /usr/lib
for a in "$1"/lib/*; do
ln -s $a
done
cd /usr/sbin
for a in "$1"/sbin/*; do
ln -s $a
done
cd /usr/include
for a in "$1"/include/*; do
ln -s $a
done

34
install_product.sh Executable file
View file

@ -0,0 +1,34 @@
#!/bin/sh
# Nico Schottelius
# 2007-02-04
# Install a product to listed instances, change permissions
# Nothing spectacular, but useful
instances="/home/server/zope/instance/nico.schottelius.org.1 \
/home/server/zope/instance/nico.schottelius.org.2"
zope_user="zope"
######################## NO CHANGES BELOW HERE NEEDED ##########################
if [ $# -ne 1 ]; then
echo "$0: product (tar, gzipped)"
exit 23
fi
product="$1"
echo "Installing $product ..."
echo ""
# do NOT continue on failure!
set -e
for instance in $instances; do
proddir="${instance}/Products"
echo "Extracting product to $instance ..."
tar xfz "$product" -C "$proddir"
echo "Changing owner to $zope_user (for all products) ..."
chown -R "$zope_user" "$proddir"
done
echo ""
echo "Restart your zope server(s) now (if not running in debug mode)"

155
installpasswd Executable file
View file

@ -0,0 +1,155 @@
#!/usr/bin/perl -wT
#
# TWiki Collaboration Platform, http://TWiki.org/
#
# Copyright (C) 2001 Klaus Wriessnegger, kw@sap.com
# Copyright (C) 2001 Andrea Sterbini, a.sterbini@flashnet.it
# Copyright (C) 2001-2003 Peter Thoeny, peter@thoeny.com
#
# For licensing info read license.txt file in the TWiki root.
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program 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 General Public License for more details, published at
# http://www.gnu.ai.mit.edu/copyleft/gpl.html
#
# 26-5-01 Password installation (only by the $superAdminGroup)
#
#usage example:
#
#I n s t a l l
#
#</form>
#<form name="passwd" action="/%SCRIPTURLPATH%/passwd%SCRIPTSUFFIX%/%WEB%/">
#Username:EncryptedPW <input type="text" name="encryptedpassword" value="" size="16" /> <br />
#<input type="submit" name="passwd" />
#<input type="hidden" name="install" value="on" />
#</form>
# Set library paths in @INC, at compile time
BEGIN { unshift @INC, '.'; require 'setlib.cfg'; }
use CGI::Carp qw(fatalsToBrowser);
use CGI;
use TWiki;
$query= new CGI;
&main();
sub main
{
# get all parameters from the form
my $wikiName = $query->param( 'username' );
#initialize
my $topicName = $query->param( 'TopicName' );
my $thePathInfo = $query->path_info();
my $theUrl = $query->url;
( $topic, $webName ) =
&TWiki::initialize( $thePathInfo, $wikiName, $topicName, $theUrl, $query );
my $text = "";
my $url = "";
my $theRemoteUser = $query->remote_user();
my ( $dummy1, $dummy2, $dummy3, $userName ) =
&TWiki::initialize( $thePathInfo, $theRemoteUser, $topicName, $theUrl, $query );
my $wikiUserName = &TWiki::userToWikiName( $userName );
if( ! &TWiki::Access::userIsInGroup( $wikiUserName, $TWiki::superAdminGroup ) ) {
# user has no permission to install the password
my $url = &TWiki::getOopsUrl( $webName, $topic, "oopsaccessgroup", "$TWiki::mainWebname.$TWiki::superAdminGroup" );
TWiki::redirect( $query, $url );
return;
}
my $theCryptPassword = $query->param( 'encryptedPassword' ) || '';
if ( ! $theCryptPassword ) {
# missing username:encryptedpassword
$url = &TWiki::getOopsUrl( $webName, $topic, "oopsregrequ", );
TWiki::redirect( $query, $url );
return;
}
# TODO: I18N fix here once basic auth problem with 8-bit user names is
# solved
if ( $theCryptPassword =~ m/^([A-Z][a-zA-Z]+[A-Z][a-zA-Z]*)\:.{13}$/ ) {
$wikiName = $1;
} else {
# bad format
$url = &TWiki::getOopsUrl( $webName, $topic, "oopsbadpwformat", $theCryptPassword);
TWiki::redirect( $query, $url );
return;
}
# check if user entry exists
if( ( $wikiName ) && (! htpasswdExistUser( $wikiName ) ) ){
# PTh 20 Jun 2000: changed to getOopsUrl
$url = &TWiki::getOopsUrl( $webName, $topic, "oopsnotwikiuser", $wikiName );
TWiki::redirect( $query, $url );
return;
}
# old password
my $oldcrypt = htpasswdReadPasswd( $wikiName );
# OK - password may be changed
my $oldCryptPassword = "$wikiName\:$oldcrypt";
htpasswdAddUser( $oldCryptPassword, $theCryptPassword );
# OK - password changed
$url = &TWiki::getOopsUrl( $webName, $topic, "oopschangepasswd" );
TWiki::redirect( $query, $url );
return;
}
#=========================
sub htpasswdReadPasswd
{
my ( $user ) = @_;
if( ! $user ) {
return "";
}
my $text = &TWiki::Store::readFile( $TWiki::htpasswdFilename );
if( $text =~ /$user\:(\S+)/ ) {
return $1;
}
return "";
}
sub htpasswdExistUser
{
my ( $user ) = @_;
if( ! $user ) {
return "";
}
my $text = &TWiki::Store::readFile( $TWiki::htpasswdFilename );
if( $text =~ /$user\:/go ) {
return "1";
}
return "";
}
sub htpasswdAddUser
{
my ( $oldUserEntry, $newUserEntry ) = @_;
# can't use `htpasswd $wikiName` because htpasswd doesn't understand stdin
# simply add name to file, but this is a security issue
my $text = &TWiki::Store::readFile( $TWiki::htpasswdFilename );
$text =~ s/$oldUserEntry/$newUserEntry/;
&TWiki::Store::saveFile( $TWiki::htpasswdFilename, $text );
}

27
ipg Normal file
View file

@ -0,0 +1,27 @@
#! /bin/sh
modprobe pktgen
PGDEV=/proc/net/pktgen/pg0
function pgset() {
local result
echo $1 > $PGDEV
result=`cat $PGDEV | fgrep "Result: OK:"`
if [ "$result" = "" ]; then
cat $PGDEV | fgrep Result:
fi
}
function pg() {
echo inject > $PGDEV
cat $PGDEV
}
pgset "odev eth0"
pgset "dst 0.0.0.0"

18
ips-dup Normal file
View file

@ -0,0 +1,18 @@
START="1"
END="254"
DEVICE="eth0"
BASE_IP="192.168.0."
i=$START
if [ $# -lt 1 ]; then
echo "So nicht meister."
echo "$0 [up|down]"
exit 1
fi
while [ $i -lt $END ]; do
ifconfig "$DEVICE":"$[i+3]" "$BASE_IP""$i" $1
i=$[$i+1]
done

1
ips-hinzu.sh Executable file
View file

@ -0,0 +1 @@
for i in $(seq 67 80); do ip addr add 62.65.138.$i dev eth0; done

10
irda_connect Normal file
View file

@ -0,0 +1,10 @@
modprobe ppp_generic
modprobe ppp_async
modprobe ppp_deflate
modprobe ppp_synctty
modprobe 8250 #serial 2.5
modprobe serial #serial 2.4
modprobe bsd_comp
modprobe irport
modprobe irtty
pppd user arcor

4
irkerd Executable file
View file

@ -0,0 +1,4 @@
#!/bin/sh
. /home/users/nico/p/foreign/irker/virtualenv/bin/activate
/home/users/nico/p/foreign/irker/irker/irkerd "$@"

193
kbd Normal file
View file

@ -0,0 +1,193 @@
#! /bin/sh
# Copyright (c) 1995-2000 SuSE GmbH Nuernberg, Germany.
#
# Author: Burchard Steinbild <bs@suse.de>
# Werner Fink <werner@suse.de>
#
# /sbin/init.d/kbd
#
# and symbolic its link
#
# /sbin/rckbd
#
### BEGIN INIT INFO
# Provides: kbd
# Required-Start: $remote_fs
# Required-Stop:
# Default-Start: 1 2 3 5 S
# Default-Stop:
# Description: Keyboard settings
### END INIT INFO
. /etc/rc.status
. /etc/rc.config
MACHINE=`/bin/uname -m 2> /dev/null`
if [ "$MACHINE" = "sparc" -o "$MACHINE" = "sparc64" ]; then
# Test if we have a serial console.
(test -c /dev/tty1 && > /dev/tty1 ) > /dev/null 2>&1 || exit 0
fi
test -n "$KEYTABLE" -a "$KEYTABLE" != YAST_ASK || {
echo KEYTABLE is not set in /etc/rc.config. Exit.
exit 0
}
KEYTABLE=${KEYTABLE%.map*}
#
# first search the wanted keytable.
#
if [ $MACHINE = ppc ]; then
test -f /proc/cpuinfo || mount -n -t proc proc /proc 2>/dev/null
while read line; do
case "$line" in
*MacRISC*) MACHINE="mac";;
*CHRP*) MACHINE="chrp";;
*PReP*) MACHINE="prep" ;;
esac
done < /proc/cpuinfo
fi
case "$MACHINE" in
i?86|ia64|alpha|prep|chrp) KDBLIB="/usr/lib/kbd/keymaps/i386/*/" ;;
sparc*)
case "$KEYTABLE" in
sun*) KDBLIB="/usr/lib/kbd/keymaps/sun/" ;;
*) KDBLIB="/usr/lib/kbd/keymaps/i386/*/" ;;
esac
;;
mac) KDBLIB="/usr/lib/kbd/keymaps/mac/" ;;
*) echo "No available keymaps for machine $MACHINE found"; exit 1
;;
esac
KEYMAP=""
if test -e /$KEYTABLE ; then
KEYMAP=$KEYTABLE
else
K="${KDBLIB}${KEYTABLE}"
case "$KEYTABLE" in
*.gz) KDBPATH="${K}" ;;
*.map) KDBPATH="${K} ${K}.gz" ;;
*) KDBPATH="${K} ${K}.gz ${K}.map.gz ${K}.map" ;;
esac
for K in ${KDBPATH} ; do
test -e "$K" || continue
test -n "$KEYMAP" && KEYMAP="$KEYMAP $K" || KEYMAP=$K
done
fi
rc_reset
case "$1" in
start|restart|reload)
if test -z "$KEYMAP" ; then
if test -r /etc/defkeymap.map ; then
echo "Can not find a keymap for ${KEYTABLE}, trying fallback."
KEYMAP=/etc/defkeymap.map
else
echo "Can not find a keymap for ${KEYTABLE}, Exit."
rc_failed
fi
else
if test ! -e "$KEYMAP" ; then
echo "Found more than one keymap ${KEYTABLE}"
KEYMAP=$K
echo "Using $KEYMAP."
echo "If you want another one, please add complete path to"
echo "KEYTABLE in /etc/rc.config."
fi
fi
rc_status && retmsg="`loadkeys $KEYMAP 2>&1`"
if test $? -eq 0 && ( > /var/run/keymap ) > /dev/null 2>&1 ; then
echo "$KEYMAP" > /var/run/keymap
if test ! -s /etc/defkeymap.map ; then
( dumpkeys > /etc/defkeymap.map ) > /dev/null 2>&1
fi
else
rc_failed
fi
echo "Loading keymap ${retmsg#Loading*/usr/lib/kbd/keymaps/*/}"
rc_status -v1 -r
# Load compose tables
if test ! -z "$COMPOSETABLE"; then
unset COMPOSELOADED COMPOSECLEAR
for name in $COMPOSETABLE; do
# Test for compose clear flag
if test "$name" = "-c" -o "$name" = "clear"; then
COMPOSECLEAR=-c
continue
fi
# Handle the first table differently ...
if test -z "$COMPOSELOADED"; then
echo -n "Loading compose table $name"
loadkeys $COMPOSECLEAR compose.$name >/dev/null 2>&1
rc_check
if test $name = clear; then rc_reset; fi
COMPOSELOADED=1
else
echo -n " $name"
loadkeys compose.$name >/dev/null 2>&1
rc_check
fi
done
if test ! -z "$COMPOSELOADED"; then
rc_status -v -r
fi
fi
# setfont
if test -d /usr/lib/kbd/consolefonts -a \
-n "$CONSOLE_FONT" -a "$CONSOLE_FONT" != "YAST_ASK"
then
if test -x /usr/bin/setfont ; then
echo Loading console font $CONSOLE_FONT
/usr/bin/setfont $CONSOLE_FONT
rc_status -v1 -r
fi
# unimap
if test -n "$CONSOLE_UNICODEMAP" -a \
"$CONSOLE_UNICODEMAP" != "none" -a \
-x /usr/bin/setfont
then
echo Loading unimap $CONSOLE_UNICODEMAP
/usr/bin/setfont -u $CONSOLE_UNICODEMAP
rc_status -v1 -r
fi
# screenmap
if test -n "$CONSOLE_SCREENMAP" -a \
"$CONSOLE_SCREENMAP" != "none" -a \
-x /usr/bin/setfont
then
echo Loading screenmap $CONSOLE_SCREENMAP
/usr/bin/setfont -m $CONSOLE_SCREENMAP
rc_status -v1 -r
fi
# console magic init string
if test -n "$CONSOLE_MAGIC" -a "$CONSOLE_MAGIC" != "none" ; then
echo Setting up console ttys
for i in /dev/tty[1-24]; do
echo -en "\033$CONSOLE_MAGIC" > $i
rc_status
done
rc_status -v1 -r
fi
fi
;;
stop)
;;
check|status)
if test -r /var/run/keymap ; then
read current < /var/run/keymap
echo "Keymap $current is loaded."
else
rc_failed
fi
;;
*)
echo "Usage: $0 {start|stop|restart|reload|status|check}"
exit 1
;;
esac
rc_exit

240
kbd.new Normal file
View file

@ -0,0 +1,240 @@
#!/bin/sh
#
# Author: Nico Schottelius <nico AT schottelius DOT org>
# Date: 30. April 2k+1
# Last Changed: 30. April 2k+1
# Comment: Keyboard (KBD) init script
#
. /etc/sys/combined
. /etc/sys/boot/named
test `basename $0` = named && START_KBD="yes"
test "$START_KBD" = yes || exit 0
back="$DONE"
case "$1" in
start) $SYS_ECHO -n "$START $KBD_TEXT "
|| back=$FAIL
$SYS_ECHO "$back"
;;
stop) $SYS_ECHO -n "$STOP $NAMED_TEXT "
killproc -TERM /usr/sbin/named || back=$FAIL
$SYS_ECHO "$back"
;;
restart)
$0 stop && $0 start || back=$FAIL
;;
reload) $SYS_ECHO -n "$RELOAD $NAMED_TEXT"
killproc -HUP /usr/sbin/named || back=$FAIL
$SYS_ECHO "$back"
;;
status) checkproc /usr/sbin/named && $SYS_ECHO $OK || $SYS_ECHO $NOP
;;
*) $SYS_ECHO "$USAGE $0 {start|stop|restart|reload|status}"
exit 1
esac
# Test if back is equal to DONE, if not exit 1. Else exit 0
test "$back" = "$DONE" || exit 1
exit 0
#! /bin/sh
# Copyright (c) 1995-2000 SuSE GmbH Nuernberg, Germany.
#
# Author: Burchard Steinbild <bs@suse.de>
# Werner Fink <werner@suse.de>
#
# /sbin/init.d/kbd
#
# and symbolic its link
#
# /sbin/rckbd
#
### BEGIN INIT INFO
# Provides: kbd
# Required-Start: $remote_fs
# Required-Stop:
# Default-Start: 1 2 3 5 S
# Default-Stop:
# Description: Keyboard settings
### END INIT INFO
. /etc/rc.status
. /etc/rc.config
MACHINE=`/bin/uname -m 2> /dev/null`
if [ "$MACHINE" = "sparc" -o "$MACHINE" = "sparc64" ]; then
# Test if we have a serial console.
(test -c /dev/tty1 && > /dev/tty1 ) > /dev/null 2>&1 || exit 0
fi
test -n "$KEYTABLE" -a "$KEYTABLE" != YAST_ASK || {
echo KEYTABLE is not set in /etc/rc.config. Exit.
exit 0
}
KEYTABLE=${KEYTABLE%.map*}
#
# first search the wanted keytable.
#
if [ $MACHINE = ppc ]; then
test -f /proc/cpuinfo || mount -n -t proc proc /proc 2>/dev/null
while read line; do
case "$line" in
*MacRISC*) MACHINE="mac";;
*CHRP*) MACHINE="chrp";;
*PReP*) MACHINE="prep" ;;
esac
done < /proc/cpuinfo
fi
case "$MACHINE" in
i?86|ia64|alpha|prep|chrp) KDBLIB="/usr/lib/kbd/keymaps/i386/*/" ;;
sparc*)
case "$KEYTABLE" in
sun*) KDBLIB="/usr/lib/kbd/keymaps/sun/" ;;
*) KDBLIB="/usr/lib/kbd/keymaps/i386/*/" ;;
esac
;;
mac) KDBLIB="/usr/lib/kbd/keymaps/mac/" ;;
*) echo "No available keymaps for machine $MACHINE found"; exit 1
;;
esac
KEYMAP=""
if test -e /$KEYTABLE ; then
KEYMAP=$KEYTABLE
else
K="${KDBLIB}${KEYTABLE}"
case "$KEYTABLE" in
*.gz) KDBPATH="${K}" ;;
*.map) KDBPATH="${K} ${K}.gz" ;;
*) KDBPATH="${K} ${K}.gz ${K}.map.gz ${K}.map" ;;
esac
for K in ${KDBPATH} ; do
test -e "$K" || continue
test -n "$KEYMAP" && KEYMAP="$KEYMAP $K" || KEYMAP=$K
done
fi
rc_reset
case "$1" in
start|restart|reload)
if test -z "$KEYMAP" ; then
if test -r /etc/defkeymap.map ; then
echo "Can not find a keymap for ${KEYTABLE}, trying fallback."
KEYMAP=/etc/defkeymap.map
else
echo "Can not find a keymap for ${KEYTABLE}, Exit."
rc_failed
fi
else
if test ! -e "$KEYMAP" ; then
echo "Found more than one keymap ${KEYTABLE}"
KEYMAP=$K
echo "Using $KEYMAP."
echo "If you want another one, please add complete path to"
echo "KEYTABLE in /etc/rc.config."
fi
fi
rc_status && retmsg="`loadkeys $KEYMAP 2>&1`"
if test $? -eq 0 && ( > /var/run/keymap ) > /dev/null 2>&1 ; then
echo "$KEYMAP" > /var/run/keymap
if test ! -s /etc/defkeymap.map ; then
( dumpkeys > /etc/defkeymap.map ) > /dev/null 2>&1
fi
else
rc_failed
fi
echo "Loading keymap ${retmsg#Loading*/usr/lib/kbd/keymaps/*/}"
rc_status -v1 -r
# Load compose tables
if test ! -z "$COMPOSETABLE"; then
unset COMPOSELOADED COMPOSECLEAR
for name in $COMPOSETABLE; do
# Test for compose clear flag
if test "$name" = "-c" -o "$name" = "clear"; then
COMPOSECLEAR=-c
continue
fi
# Handle the first table differently ...
if test -z "$COMPOSELOADED"; then
echo -n "Loading compose table $name"
loadkeys $COMPOSECLEAR compose.$name >/dev/null 2>&1
rc_check
if test $name = clear; then rc_reset; fi
COMPOSELOADED=1
else
echo -n " $name"
loadkeys compose.$name >/dev/null 2>&1
rc_check
fi
done
if test ! -z "$COMPOSELOADED"; then
rc_status -v -r
fi
fi
# setfont
if test -d /usr/lib/kbd/consolefonts -a \
-n "$CONSOLE_FONT" -a "$CONSOLE_FONT" != "YAST_ASK"
then
if test -x /usr/bin/setfont ; then
echo Loading console font $CONSOLE_FONT
/usr/bin/setfont $CONSOLE_FONT
rc_status -v1 -r
fi
# unimap
if test -n "$CONSOLE_UNICODEMAP" -a \
"$CONSOLE_UNICODEMAP" != "none" -a \
-x /usr/bin/setfont
then
echo Loading unimap $CONSOLE_UNICODEMAP
/usr/bin/setfont -u $CONSOLE_UNICODEMAP
rc_status -v1 -r
fi
# screenmap
if test -n "$CONSOLE_SCREENMAP" -a \
"$CONSOLE_SCREENMAP" != "none" -a \
-x /usr/bin/setfont
then
echo Loading screenmap $CONSOLE_SCREENMAP
/usr/bin/setfont -m $CONSOLE_SCREENMAP
rc_status -v1 -r
fi
# console magic init string
if test -n "$CONSOLE_MAGIC" -a "$CONSOLE_MAGIC" != "none" ; then
echo Setting up console ttys
for i in /dev/tty[1-24]; do
echo -en "\033$CONSOLE_MAGIC" > $i
rc_status
done
rc_status -v1 -r
fi
fi
;;
stop)
;;
check|status)
if test -r /var/run/keymap ; then
read current < /var/run/keymap
echo "Keymap $current is loaded."
else
rc_failed
fi
;;
*)
echo "Usage: $0 {start|stop|restart|reload|status|check}"
exit 1
;;
esac
rc_exit

61
latest-kernel Executable file
View file

@ -0,0 +1,61 @@
#!/bin/sh
#
# Nico Schottelius <nico@schottelius.(net|org)>
# Date: 21-Oct-2003
# Last Modified:
# Versions:
# 1.6 2007-03-10
# Only mail, if new kernel is newer.
# 1.5: 2006-03-20
# Added URL to download kernel
# 1.4: 2006-02-03
# Added Changelog
#set -x
MAILTO="kernel-announce@lists.schottelius.org"
USERFILE=$HOME/.latest-kernel
#VERSION=`curl ftp://ftp.kernel.org/pub/linux/kernel/v2.6/ | grep linux-2.6.0 | sort | tail -n 1 | awk ' { print $9 }' 2>/dev/null`
#VERSION=`curl ftp://ftp.kernel.org/pub/linux/kernel/v2.6/ | grep linux | awk '{ print $6 " " $7 " " $8 " " $9 }' | sort -M | tail -n 1`
#VERSION=`curl ftp://ftp.kernel.org/pub/linux/kernel/v2.6/ 2>/dev/null| awk '/linux/ { print $9 }' | sort | tail -n 1`
#VERSION=`curl ftp://ftp.kernel.org/pub/linux/kernel/v2.6/ 2>/dev/null| awk '/linux/ { print $9 }' | sort | tail -n 1 | sed 's/\.tar.*//'`
#VERSION=`curl ftp://ftp.kernel.org/pub/linux/kernel/v2.6/ 2>/dev/null| awk '/linux/ { print $9 }' | sed 's/\.tar.*//' | sort | tail -n 1`
#VERSION=$(curl -s http://ftp.kernel.org/pub/linux/kernel/v2.6/ 2>/dev/null | grep LATEST-IS | sed 's/.*LATEST-IS-//')
VERSION=$(curl -s http://ftp.kernel.org/pub/linux/kernel/v2.6/ | grep LATEST-IS- | sed 's/.*LATEST-IS-\(.*\)<\/a.*/\1/')
OLDVERSION=`cat $USERFILE 2>/dev/null`
if [ "$OLDVERSION" != "$VERSION" -a -n "$VERSION" ]; then
i=1
newpart=$(echo $VERSION | cut -f${i} -d.)
while [ "$newpart" ]; do
oldpart=$(echo $OLDVERSION | cut -f${i} -d.)
echo "${oldpart}::${newpart}"
if [ "$oldpart" -gt "$newpart" ]; then
echo "Abort: $VERSION is older then old $OLDVERSION"
exit 1
fi
i=$(($i+1))
newpart=$(echo $VERSION | cut -f${i} -d.)
done
CHANGELOG="http://www.kernel.org/pub/linux/kernel/v2.6/ChangeLog-${VERSION}"
BASEURL="http://www.kernel.org/pub/linux/kernel/v2.6/linux-"
EXTENSION=".tar.bz2"
FULL_URL=${BASEURL}${VERSION}${EXTENSION}
(
echo "Download kernel at $FULL_URL"
echo ""
curl -s ${CHANGELOG}
#) | mail -s "New Linux-Kernel: $VERSION" "$MAILTO"
) | mutt -s "New Linux-Kernel: $VERSION" "$MAILTO"
echo "$VERSION" > "$USERFILE"
echo "Neue Version ($VERSION) gesendet"
fi

16
link-webs Executable file
View file

@ -0,0 +1,16 @@
#!/bin/sh
WEBS=/home/server/www/webs
WWW=/home/server/www
for tlds in $WEBS/*/*; do
mkdir -p $WWW/`basename $tlds`
cd $WWW/`basename $tlds`;
for domain in $tlds/*; do
mkdir -p `basename $domain`
cd `basename $domain`
for subdomain in $domain/*; do
ln -s $subdomain
done
done
done

19
linkall Normal file
View file

@ -0,0 +1,19 @@
cd /usr/bin
find /usr/*/bin/ | xargs ln -s
cd /usr/lib
for a in /usr/*/lib/*; do
ln -s $a
done
cd /usr/sbin
for a in /usr/*/sbin/*; do
ln -s $a
done
cd /usr/include
for a in /usr/*/include/*; do
ln -s $a
done

36
linux/get_logs.sh Executable file
View file

@ -0,0 +1,36 @@
#!/bin/sh
#
# 2011 Nico Schottelius (nico-nsbin at schottelius.org)
#
# This file is part of nsbin.
#
# nsbin is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# nsbin 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 General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with nsbin. If not, see <http://www.gnu.org/licenses/>.
#
# Initially written for SyGroup (www.sygroup.ch)
# Date: Mon Nov 14 11:45:11 CET 2005
#
# Create report for kernel hackers
#
#
# Standard variables (stolen from cconf)
#
__pwd="$(pwd -P)"
__mydir="${0%/*}"; __abs_mydir="$(cd "$__mydir" && pwd -P)"
__myname=${0##*/}; __abs_myname="$__abs_mydir/$__myname"
prefix=$(uname -r)
dmesg > $prefix.dmesg
cp /var/log/Xorg.0.log $prefix.xorg
cp /proc/config.gz $prefix.config.gz

5
loadipsec Normal file
View file

@ -0,0 +1,5 @@
modprobe esp4
modprobe ah4
modprobe ip_gre
modprobe ipcomp
modprobe af_key

1
loch2 Executable file
View file

@ -0,0 +1 @@
sshfs nutzer@loch.schottelius.org:/home/services/bibliothek/photos ~/photos

2
logoff Executable file
View file

@ -0,0 +1,2 @@
killall tail
killall tail

4
logon Executable file
View file

@ -0,0 +1,4 @@
/root/bin/show_apache_logs &
tail -f /var/log/syslog &
tail -f /var/log/mail.log &
tail -f /var/log/xferlog &

72
mail.add.wddb Executable file
View file

@ -0,0 +1,72 @@
BASEDIR=/home/server/www/org/wddb/www/
function report()
{
# sender
UFLINE
# return path
RPLINE
# we
RECIPIENT
# delivered to..
DTLINE
# set
}
# continent
continent=`grep "^continent" "$1" | sed 's/.*="\(.*\)"/\1/'`
case "$continent" in
africa|asia|australia|europe|northamerica|southamerica) ;;
*) report "Allowed continents: africa|asia|australia|europe|northamerica|southamerica" ;;
esac
# other vars
essid=`grep "^essid" "$1" | sed 's/.*="\(.*\)"/\1/'`
# remove possible dots
country=`grep "^country" "$1" | sed 's/.*="\(.*\)"/\1/' | sed 's/\.\.//g'`
area=`grep "^area" "$1" | sed 's/.*="\(.*\)"/\1/' | sed 's/\//-/g' | sed 's/ //c'`
mac=`grep "^mac" "$1" | sed 's/.*="\(.*\)"/\1/'`
rate=`grep "^rate" "$1" | sed 's/.*="\(.*\)"/\1/'`
wep=`grep "^wep" "$1" | sed 's/.*="\(.*\)"/\1/'`
hints=`grep "^hints" "$1" | sed 's/.*="\(.*\)"/\1/'`
location=`grep "^location" "$1" | sed 's/.*="\(.*\)"/\1/'`
# check for empty fields
for a in essid country area mac rate wep hints location; do
eval tmp="\$$a"
if [ -z "$tmp" ]; then
report "Empty field: $a"
fi
done
if [ ! -f $BASEDIR/$continent/$country/$area.html ]; then
cat << EOF > "$1"
<html>
<head>
<title>wddb.org - WarDriver's DataBase</title>
</head>
<BODY bgcolor="#000000" color="#ef0000" font-color="#ef0000">
<FONT COLOR="#ef0000">
else
lines=`cat "$BASEDIR/$continent/$country/$area.html" | wc |awk '{ print $1 }'`
use_lines=$[$lines-7]
head -n $use_lines "$BASEDIR/$continent/$country/$area.html" > "$1"
fi
cat << EOF >> "$1"
</TABLE>
<HR>
<A HREF="../index.html"> << One step back</A>
<P><A HREF="/submit-new.html">Submit new network or changes<A>
</FONT>
</BODY>
</HTML>
EOF

9
maildirnotmuchdump Executable file
View file

@ -0,0 +1,9 @@
#!/bin/sh
set -e
file=.notmuch/dump.xz
cd ~/Maildir
notmuch dump | xz > "$file"
git commit -m "Update notmuch dump" "$file"

218
mailnotify Executable file
View file

@ -0,0 +1,218 @@
#!/usr/bin/perl -wT
#
# TWiki Collaboration Platform, http://TWiki.org/
#
# Copyright (C) 1999-2003 Peter Thoeny, peter@thoeny.com
#
# For licensing info read license.txt file in the TWiki root.
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program 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 General Public License for more details, published at
# http://www.gnu.org/copyleft/gpl.html
# Colas (http://colas.nahaboo.net)
# modifications from mailnotify script from Dec 2001 release:
# - email is now optional, is fetched from the user homepage
# - webs not beginning by a capital letter are ignored ( _default, ...)
# - no mail is sent to TWikiGuest
# - if user is a group, recurses through its members
# Set library paths in @INC, at compile time
BEGIN { unshift @INC, '.'; require 'setlib.cfg'; }
use TWiki;
use TWiki::Net;
my $debug = ! ( @ARGV && $ARGV[0] eq "-q" );
&main();
sub main
{
&TWiki::basicInitialize();
$debug && print "TWiki mail notification\n";
$debug && print "- to suppress all normal output: mailnotify -q\n";
my $dataDir = &TWiki::getDataDir();
opendir( DIR, "$dataDir" ) or die "could not open $dataDir";
@weblist = grep !/^\.\.?$/, readdir DIR;
closedir DIR;
foreach $web ( @weblist ) {
# Only process webs with normal names, i.e. not starting with '_'
if( -d "$dataDir/$web" && &TWiki::isWebName($web) ) {
processWeb( $web );
# remove obsolete .lock files
&TWiki::Store::removeObsoleteTopicLocks( $web );
}
}
$debug && print "End TWiki mail notification\n";
}
sub processWeb
{
my( $web) = @_;
my ( $topic, $webName, $dummy, $userName, $dataDir) =
&TWiki::initialize( "/$web", "nobody" );
$dummy = ""; # to suppress warning
$debug && print "Checking TWiki.$webName\n";
if( ! &TWiki::Store::webExists( $webName ) ) {
print STDERR "* ERROR: TWiki mailnotify does not find web $webName\n";
return;
}
my @notifylist = TWiki::getEmailNotifyList($webName);
unless ( scalar @notifylist ) {
$debug && print "<none>\n";
return;
}
my $emailbody = "";
my $topiclist = "";
my $skin = TWiki::Prefs::getPreferencesValue( "SKIN" );
my $text = TWiki::Store::readTemplate( "changes", $skin );
my $changes= &TWiki::Store::readFile( "$dataDir/$webName/.changes" );
my %exclude;
$text = &TWiki::handleCommonTags($text, $topic);
$text =~ s/\%META{.*?}\%//go; # remove %META{"parent"}%
if( $TWiki::doRemoveImgInMailnotify ) {
# change images to [alt] text if there, else remove image
$text =~ s/<img src=.*?alt=\"([^\"]+)[^>]*>/[$1]/goi;
$text =~ s/<img src=.*?[^>]>//goi;
}
my $before = "";
my $after = "";
( $before, $text, $after) = split( /%REPEAT%/, $text );
$emailbody = &TWiki::getRenderedVersion( $before );
$after = &TWiki::getRenderedVersion( $after );
my $prevLastmodify = &TWiki::Store::readFile( "$dataDir/$webName/.mailnotify" ) || "0";
my $currLastmodify = "";
my $scriptSuffix = $TWiki::scriptSuffix;
my $scriptUrlPath = $TWiki::scriptUrlPath;
my $scriptUrl = "$TWiki::urlHost$scriptUrlPath";
my $frev = "";
foreach( reverse split( /\n/, $changes ) ) {
# Parse lines from .changes:
# <topic> <user> <change time> <revision>
# WebHome FredBloggs 1014591347 21
my ($topicName, $userName, $changeTime, $revision) = split( /\t/);
$newText = $text; # Repeating text from email template
if( ( ! %exclude ) || ( ! $exclude{ $topicName } ) ) {
next unless TWiki::Store::topicExists( $webName, $topicName );
if( ! $currLastmodify ) {
# newest entry
$time = &TWiki::formatGmTime( $prevLastmodify );
if( $prevLastmodify eq $changeTime ) {
# newest entry is same as at time of previous notification
$debug && print "- Note: No topics changed since $time\n";
return;
}
$currLastmodify = $changeTime;
$debug && print "- Changed topics since $time: ";
}
if( $prevLastmodify >= $changeTime ) {
#print "Date: found item of last notification\n";
# found item of last notification
last;
}
$frev = "";
if( $revision ) {
if( $revision > 1 ) {
$frev = "r1.$revision";
} else {
$frev = "<b>NEW</b>";
}
}
# Create entry in HTML attachment
$newText = $text;
$newText =~ s/%TOPICNAME%/$topicName/go;
$wikiuser = &TWiki::userToWikiName( $userName );
$newText =~ s/%AUTHOR%/$wikiuser/go;
$newText =~ s/%LOCKED%//go;
$time = &TWiki::formatGmTime( $changeTime );
$newText =~ s/%TIME%/$time/go;
$newText =~ s/%REVISION%/$frev/go;
$newText = &TWiki::getRenderedVersion( $newText );
$head = &TWiki::Store::readFileHead( "$dataDir\/$webName\/$topicName.txt", 16 );
$head = &TWiki::makeTopicSummary( $head, $topicName, $webName );
$newText =~ s/%TEXTHEAD%/$head/go;
$emailbody .= $newText;
$exclude{ $topicName } = "1";
$debug && print "$topicName ";
# URL-encode topic names for use of I18N topic names in plain text
$webNameEnc = TWiki::handleUrlEncode( $webName );
my $topicNameEnc = TWiki::handleUrlEncode( $topicName );
# Create entry in plain-text email body
$newText = "- $topicName ($wikiuser)\n $scriptUrl/view$scriptSuffix/$webNameEnc/$topicNameEnc\n";
$newText =~ s/Main\.//go;
$topiclist = "$topiclist$newText";
}
}
if( $topiclist eq "" ) {
$debug && print "- Note: Topic list is empty\n";
return;
}
$debug && print "\n";
$emailbody .= $after;
my $from = &TWiki::Prefs::getPreferencesValue("WIKIWEBMASTER");
my $notifylist = join ', ', @notifylist;
$text = &TWiki::Store::readTemplate( "mailnotify", $skin );
$text =~ s/%EMAILFROM%/$from/go;
$text =~ s/%EMAILTO%/$notifylist/go;
$text =~ s/%EMAILBODY%/$emailbody/go;
$text =~ s/%TOPICLIST%/$topiclist/go;
$text =~ s/%LASTDATE%/&TWiki::formatGmTime($prevLastmodify)/geo;
$text = &TWiki::handleCommonTags( $text, $topic );
# change absolute addresses to relative ones & do some cleanup
$text =~ s/(href=\")$scriptUrlPath/$1..\/../goi;
$text =~ s/(action=\")$scriptUrlPath/$1..\/../goi;
$text =~ s|( ?) *</*nop/*>\n?|$1|gois;
$debug && print "- Sending mail notification to: $notifylist\n";
my $error = &TWiki::Net::sendEmail( $text );
if( $error ) {
print STDERR "* $error\n";
$debug && print "- End TWiki.$webName\n";
} else {
&TWiki::Store::saveFile( "$dataDir/$webName/.mailnotify", $currLastmodify );
$debug && print "- End TWiki.$webName, mail notification sent\n";
}
}

2
mainemacs Executable file
View file

@ -0,0 +1,2 @@
#!/bin/sh
emacs --funcall "mu4e" --name mainemacs

266
manage Executable file
View file

@ -0,0 +1,266 @@
#!/usr/bin/perl -wT
#
# TWiki Collaboration Platform, http://TWiki.org/
#
# Copyright (C) 2002-2003 Peter Thoeny, peter@thoeny.com
#
# For licensing info read license.txt file in the TWiki root.
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program 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 General Public License for more details, published at
# http://www.gnu.org/copyleft/gpl.html
#
# The manage script is used to manage some actions like creating
# a new web.
# Set library paths in @INC, at compile time
BEGIN { unshift @INC, '.'; require 'setlib.cfg'; }
use CGI::Carp qw( fatalsToBrowser );
use CGI;
use File::Copy;
use TWiki;
use strict;
&main();
#=========================
sub main
{
my $query = new CGI;
my $action = $query->param( 'action' ) || "";
if( $action eq "createweb" ) {
createWeb( $query );
# } elsif( $action eq "othercommand" ) {
} elsif( $action ) {
oopsRedirectMsg( $query, "", "", "", "msg_unrecognized_action", $action );
} else {
oopsRedirectMsg( $query, "", "", "", "msg_missing_action" );
}
}
#=========================
sub oopsRedirectMsg
{
my( $theQuery, $theWeb, $theTopic, $theOopsTmpl, $theTmplVar, $theMsg2, $theMsg3, $theMsg4 ) = @_;
$theWeb = $TWiki::mainWebname unless( $theWeb );
$theTopic = $TWiki::mainTopicname unless( $theTopic );
$theOopsTmpl = "oopsmanage" unless( $theOopsTmpl );
my $url = &TWiki::getOopsUrl( $theWeb, $theTopic, $theOopsTmpl,
"%TMPL:P{\"$theTmplVar\"}%", $theMsg2, $theMsg3, $theMsg4 );
TWiki::redirect( $theQuery, $url );
}
#=========================
sub createWeb
{
my( $query ) = @_;
my $thePathInfo = $query->path_info();
my $theRemoteUser = $query->remote_user();
my $theTopic = $query->param( 'topic' );
my $newWeb = $query->param( 'newweb' ) || "";
my $newTopic = $query->param( 'newtopic' ) || "";
my $baseWeb = $query->param( 'baseweb' ) || "";
my $webBgColor = $query->param( 'webbgcolor' ) || "";
my $siteMapWhat = $query->param( 'sitemapwhat' ) || "";
my $siteMapUseTo = $query->param( 'sitemapuseto' ) || "";
my $noSearchAll = $query->param( 'nosearchall' ) || "";
my $theUrl = $query->url;
my $oopsTmpl = "oopsmngcreateweb";
# initialize TWiki
my( $topicName, $webName, $dummy, $userName ) =
&TWiki::initialize( $thePathInfo, $theRemoteUser, $theTopic, $theUrl, $query );
$dummy = ""; # avoid warning
# check permission, user authorized to create webs?
my $wikiUserName = &TWiki::userToWikiName( $userName );
unless( &TWiki::Access::checkAccessPermission( "manage", $wikiUserName, "",
$topicName, $webName ) ) {
# user has not permission to change the topic
my $url = &TWiki::getOopsUrl( $webName, $topicName, "oopsaccesscreateweb" );
TWiki::redirect( $query, $url );
return;
}
if( $newWeb =~ /^_[a-zA-Z0-9_]+$/ ) {
# valid template web name, untaint
$newWeb =~ /(.*)/;
$newWeb = $1;
} elsif( TWiki::isWebName( $newWeb ) ) {
# valid web name, untaint
$newWeb =~ /(.*)/;
$newWeb = $1;
} elsif( $newWeb ) {
oopsRedirectMsg( $query, "", "", $oopsTmpl, "msg_web_name" );
return;
} else {
oopsRedirectMsg( $query, "", "", $oopsTmpl, "msg_web_missing" );
return;
}
if( TWiki::Store::topicExists( $newWeb, $TWiki::mainTopicname ) ) {
oopsRedirectMsg( $query, "", "", $oopsTmpl, "msg_web_exist", $newWeb );
return;
}
$baseWeb =~ s/$TWiki::securityFilter//go;
$baseWeb =~ /(.*)/;
$baseWeb = $1;
unless( TWiki::Store::topicExists( $baseWeb, $TWiki::mainTopicname ) ) {
oopsRedirectMsg( $query, "", "", $oopsTmpl, "msg_base_web", $baseWeb );
return;
}
unless( $webBgColor =~ /\#[0-9a-f]{6}/i ) {
oopsRedirectMsg( $query, "", "", $oopsTmpl, "msg_web_color" );
return;
}
# create the empty web
my $err = createEmptyWeb( $newWeb );
if( $err ) {
oopsRedirectMsg( $query, "", "", $oopsTmpl, "msg_web_create", $err );
return;
}
# copy needed topics from base web
$err = copyWebTopics( $baseWeb, $newWeb );
if( $err ) {
oopsRedirectMsg( $query, $newWeb, "", $oopsTmpl, "msg_web_copy_topics", $err );
return;
}
# patch WebPreferences
$err = patchWebPreferences( $newWeb, $TWiki::webPrefsTopicname, $webBgColor,
$siteMapWhat, $siteMapUseTo, $noSearchAll );
if( $err ) {
oopsRedirectMsg( $query, $newWeb, $TWiki::webPrefsTopicname, $oopsTmpl, "msg_patch_webpreferences", $err );
return;
}
# everything OK, redirect to last message
$newTopic = $TWiki::mainTopicname unless( $newTopic );
oopsRedirectMsg( $query, $newWeb, $newTopic, $oopsTmpl, "msg_create_web_ok" );
return;
}
#=========================
sub createEmptyWeb
{
my ( $theWeb ) = @_;
my $dir = "$TWiki::dataDir/$theWeb";
umask( 0 );
unless( mkdir( $dir, 0775 ) ) {
return( "Could not create $dir, error: $!" );
}
if ( $TWiki::useRcsDir ) {
unless( mkdir( "$dir/RCS", 0775 ) ) {
return( "Could not create $dir/RCS, error: $!" );
}
}
unless( open( FILE, ">$dir/.changes" ) ) {
return( "Could not create changes file $dir/.changes, error: $!" );
}
print FILE ""; # empty file
close( FILE );
unless( open( FILE, ">$dir/.mailnotify" ) ) {
return( "Could not create mailnotify timestamp file $dir/.mailnotify, error: $!" );
}
print FILE ""; # empty file
close( FILE );
return "";
}
#=========================
sub copyWebTopics
{
my ( $theBaseWeb, $theNewWeb ) = @_;
my $err = "";
my @topicList = &TWiki::Store::getTopicNames( $theBaseWeb );
unless( $theBaseWeb =~ /^_/ ) {
# not a template web, so filter for only Web* topics
@topicList = grep { /^Web/ } @topicList;
}
foreach my $topic ( @topicList ) {
$topic =~ s/$TWiki::securityFilter//go;
$topic =~ /(.*)/;
$topic = $1;
$err = copyOneTopic( $theBaseWeb, $topic, $theNewWeb );
return( $err ) if( $err );
}
return "";
}
#=========================
sub copyOneTopic
{
my ( $theFromWeb, $theTopic, $theToWeb ) = @_;
# FIXME: This should go into TWiki::Store
# copy topic file
my $from = "$TWiki::dataDir/$theFromWeb/$theTopic.txt";
my $to = "$TWiki::dataDir/$theToWeb/$theTopic.txt";
unless( copy( $from, $to ) ) {
return( "Copy file ( $from, $to ) failed, error: $!" );
}
umask( 002 );
chmod( 0644, $to );
# copy repository file
# FIXME: Hack, no support for RCS subdirectory
$from .= ",v";
$to .= ",v";
unless( copy( $from, $to ) ) {
return( "Copy file ( $from, $to ) failed, error: $!" );
}
umask( 002 );
chmod( 0644, $to );
# FIXME: Copy also attachments if present
return "";
}
#=========================
sub patchWebPreferences
{
my ( $theWeb, $theTopic, $theWebBgColor, $theSiteMapWhat, $theSiteMapUseTo, $doNoSearchAll ) = @_;
my( $meta, $text ) = &TWiki::Store::readTopic( $theWeb, $theTopic );
my $siteMapList = "";
$siteMapList = "on" if( $theSiteMapWhat );
$text =~ s/(\s\* Set WEBBGCOLOR =)[^\n\r]*/$1 $theWebBgColor/os;
$text =~ s/(\s\* Set SITEMAPLIST =)[^\n\r]*/$1 $siteMapList/os;
$text =~ s/(\s\* Set SITEMAPWHAT =)[^\n\r]*/$1 $theSiteMapWhat/os;
$text =~ s/(\s\* Set SITEMAPUSETO =)[^\n\r]*/$1 $theSiteMapUseTo/os;
$text =~ s/(\s\* Set NOSEARCHALL =)[^\n\r]*/$1 $doNoSearchAll/os;
my $err = &TWiki::Store::saveTopic( $theWeb, $theTopic, $text, $meta );
return $err;
}
#=========================
# EOF

2
map-touchscreen Executable file
View file

@ -0,0 +1,2 @@
#!/bin/sh
xinput map-to-output "ELAN Touchscreen" eDP1

3
minifirewall Normal file
View file

@ -0,0 +1,3 @@
modprobe ip_tables
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
echo 1 > /proc/sys/net/ipv4/ip_forward

36
monotone-snapshotting Executable file
View file

@ -0,0 +1,36 @@
#!/bin/sh
#
# Nico Schottelius (nico-linux@schottelius.org)
# Juli 2004
# extract a snapshot from a monotone database
# Version: 0.1
#
######### must be changed ############
DESTINATION=/home/server/ftp/pub/linux/gpm/
PACKAGE=gpm
DB=/home/server/monotone/gpm-new.db
BRANCH=org.schottelius.gpm
######### may be changed ############
MONOTONE=/usr/packages/monotone-0.17/bin/monotone
TMP=/tmp
########### no changes below here needed ########
DATE=`date +%Y-%m-%d`
YESTERDAY=`date -d yesterday +%Y-%m-%d`
DIRNAME="$PACKAGE"-snapshot-"$DATE"
TARNAME="${DIRNAME}.tar.bz2"
YESTERDAY_TARFILE="${DESTINATION}/${PACKAGE}-snapshot-${YESTERDAY}.tar.bz2"
########### program code ########
cd "$TMP"
"$MONOTONE" --db="$DB" --branch="$BRANCH" co "$DIRNAME" 2>/dev/null
tar cfj "$TARNAME" "$DIRNAME" && mv "$TARNAME" "$DESTINATION"
# cleanup
rm -f "$YESTERDAY_TARFILE"
rm -fr "$DIRNAME" "$TARNAME"

1
mount-luchsingen Executable file
View file

@ -0,0 +1 @@
sshfs nutzer@luchsingen.schottelius.org:/ ~/.loch

3
mplayer-audio-hdmi Executable file
View file

@ -0,0 +1,3 @@
#!/bin/sh
mplayer -ao alsa:device=hw=0.7 "$@"

53
mysql-db-dump.sh Executable file
View file

@ -0,0 +1,53 @@
#!/bin/sh
# Nico Schottelius
# written for SyGroup (www.sygroup.ch)
# Date: Fr Nov 18 11:41:25 CET 2005
# Last Modified:
if [ $# -ne 1 ]; then exit 23; fi
DB=$1
export DESTDIR=/home/server/backup/db/
export GITDIR=/home/server/git/datenbank
export LOG=/var/log/gitdump.log
export DATUM=$(date +%Y-%m-%d)
export ZEIT=$(date +%H:%M)
export DDIR="$DESTDIR/$DATUM"
export DFILE="$DDIR/$ZEIT"
export GITFILE="$GITDIR/current"
echo "Start: $(date) $DB" >> "$LOG"
mkdir -p "$DDIR"
#
# -u root \
# -p \
# Dump ins archiv mit heilen umlauten, unlesbar
mysqldump \
--opt \
--add-drop-table \
--add-locks \
--all \
--quick \
--lock-tables \
"$DB" > ${DFILE}
#ln -f "$DFILE" "$GITDIR/current"
# Dump ins git mit kaputten umlauten, aber lesbar
mysqldump \
--skip-opt \
--add-drop-table \
--add-locks \
--all \
--quick \
--lock-tables \
-c \
"$DB" > ${GITFILE}
( cd "$GITDIR"; cg-commit -m "DB-Dump: $DB vom $DATUM um $ZEIT" >> "$LOG" 2>&1 )
echo "Ende: $(date) $DB" >> "$LOG"

27
new.wddb.entry Normal file
View file

@ -0,0 +1,27 @@
# continent="africa|asia|australia|europe|northamerica|southamerica"
continent="europe"
# the country, spoken in english
country="germany"
# use: state/city/part_of_city/anymoredetailedinfo
# you need to follow the '/' syntax!
area="niedersachsen/garbsen/garbsen-mitte/"
# network id
essid="Waevelan"
# mac
mac="00:00:00:00:00"
# rate in Mbit/s
rate="11"
# Wireless Insecure Privacy? (y/n)
wep="n"
# any hints?
hints="dhcp available"
# exact location description
location="on the road from Schloss Ricklingen to Garbsen"

118
newnameserver Normal file
View file

@ -0,0 +1,118 @@
#!/bin/bash
# Author: Nico Schottelius ( nicos@pcsystems.de )
# Last Modified by:
# Date: 20th of January 2000
# Last Changed: 20th of January
# Description: Skript which does mapping and reverse
#
# My variables :-)
host=""
ip=""
choice="y"
class=""
domain="mignet.magrathea.de"
# Title
echo "## Neuer Nameserver-Eintrag ##"
read -p "Bitte Domain eingeben ($domain) : " domain
# Check if zero domain
if [ -z "$domain" ]; then domain="mignet.magrathea.de";fi
# Main loop for more than one host in a domain
while [ "$choice" = "y" -o "$choice" = "Y" ]
do
read -p "Hostname tippen: " host
read -p "IP klopfen: " ip
read -p "NetClass eingeben: (a,b,c): " class
echo -n "Uno momento..."
# The real program
# First mapping
if [ -e /var/named/$domain ];
then
echo "$host IN A $ip" >> /var/named/$domain
else
cat << EOF >> /etc/named.conf
zone "$domain" in {
type master;
file "$domain";
};
EOF
cat /var/named/sample/domain > /var/named/$domain
echo "$host IN A $ip" >> /var/named/$domain
fi
echo -n "."
# Lookup the host and net id, to choose the right arpa file
# For A it is net=172 host=16.1.1
if [ $class = a -o $class = A ];
then
# Get the arpa file
net=`echo $ip | cut -d. -f1`
# Get the hostid.
ho=`echo $ip |cut -d. -f2-4`
# The reverse Net
rnet=$net
# For B it is net=172.16 host=1.1
elif [ $class = b -o $class = B ];
then
# Get the arpa file
net=`echo $ip | cut -d. -f1-2`
# Get the hostid.
ho=`echo $ip | cut -d. -f3-4`
# The reverse Net
rnet1=`echo $ip | cut -d. -f1`
rnet2=`echo $ip | cut -d. -f2`
rnet="$rnet2.$rnet1"
# For C it is net=172.16.1 host=1
elif [ $class = c -o $class = C ];
then
# Get the arpa file
net=`echo $ip | cut -d. -f1-3`
# Get the hostid.
ho=`echo $ip | cut -d. -f4`
# The reverse Net
rnet1=`echo $ip | cut -d. -f1`
rnet2=`echo $ip | cut -d. -f2`
rnet3=`echo $ip | cut -d. -f3`
rnet="$rnet3.$rnet2.$rnet1"
fi
echo -n "."
if [ -e /var/named/reverse/$net ];
then
echo "$ho IN PTR $host.$domain." >> /var/named/reverse/$net
else
cat << EOF >> /etc/named.conf
zone "${rnet}.in-addr.arpa" in {
type master;
file "reverse/$net";
};
EOF
cat /var/named/sample/reverse > /var/named/reverse/$net
echo "$ho IN PTR $host.$domain." >> /var/named/reverse/$net
fi
echo -n "."
echo 'Finito :-)'
read -p "Noch einen Host in $domain eintragen ? " choice
done

9
nmapscan Normal file
View file

@ -0,0 +1,9 @@
BASE=192.168.0
SMBCLIENT="nmap"
i=0
while [ $i -lt 255 ]; do
$SMBCLIENT "$BASE"."$i"
i=$[$i+1]
done

151
notmuch-emacs-mua Normal file
View file

@ -0,0 +1,151 @@
#!/usr/bin/env bash
#
# notmuch-emacs-mua - start composing a mail on the command line
#
# Copyright © 2014 Jani Nikula
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program 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 General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see http://www.gnu.org/licenses/ .
#
# Authors: Jani Nikula <jani@nikula.org>
#
set -eu
# escape: "expand" '\' as '\\' and '"' as '\"'
# calling convention: escape -v var "$arg" (like in bash printf).
escape ()
{
local __escape_arg__=${3//\\/\\\\}
printf -v $2 '%s' "${__escape_arg__//\"/\\\"}"
}
EMACS=${EMACS:-emacs}
EMACSCLIENT=${EMACSCLIENT:-emacsclient}
PRINT_ONLY=
NO_WINDOW=
USE_EMACSCLIENT=
AUTO_DAEMON=
CREATE_FRAME=
# The crux of it all: construct an elisp progn and eval it.
ELISP="(prog1 'done (require 'notmuch) (notmuch-mua-new-mail)"
# Short options compatible with mutt(1).
while getopts :s:c:b:i:h opt; do
# Handle errors and long options.
case "${opt}" in
:)
echo "$0: short option -${OPTARG} requires an argument." >&2
exit 1
;;
\?)
opt=$1
if [ "${OPTARG}" != "-" ]; then
echo "$0: unknown short option -${OPTARG}." >&2
exit 1
fi
case "${opt}" in
# Long options with arguments.
--subject=*|--to=*|--cc=*|--bcc=*|--body=*)
OPTARG=${opt#--*=}
opt=${opt%%=*}
;;
# Long options without arguments.
--help|--print|--no-window-system|--client|--auto-daemon|--create-frame)
;;
*)
echo "$0: unknown long option ${opt}, or argument mismatch." >&2
exit 1
;;
esac
# getopts does not do this for what it considers errors.
OPTIND=$((OPTIND + 1))
;;
esac
escape -v OPTARG "${OPTARG-none}"
case "${opt}" in
--help|h)
exec man notmuch-emacs-mua
;;
--subject|s)
ELISP="${ELISP} (message-goto-subject) (insert \"${OPTARG}\")"
;;
--to)
ELISP="${ELISP} (message-goto-to) (insert \"${OPTARG}, \")"
;;
--cc|c)
ELISP="${ELISP} (message-goto-cc) (insert \"${OPTARG}, \")"
;;
--bcc|b)
ELISP="${ELISP} (message-goto-bcc) (insert \"${OPTARG}, \")"
;;
--body|i)
ELISP="${ELISP} (message-goto-body) (cd \"${PWD}\") (insert-file \"${OPTARG}\")"
;;
--print)
PRINT_ONLY=1
;;
--no-window-system)
NO_WINDOW="-nw"
;;
--client)
USE_EMACSCLIENT="yes"
;;
--auto-daemon)
AUTO_DAEMON="--alternate-editor="
CREATE_FRAME="-c"
;;
--create-frame)
CREATE_FRAME="-c"
;;
*)
# We should never end up here.
echo "$0: internal error (option ${opt})." >&2
exit 1
;;
esac
shift $((OPTIND - 1))
OPTIND=1
done
# Positional parameters.
for arg; do
escape -v arg "${arg}"
ELISP="${ELISP} (message-goto-to) (insert \"${arg}, \")"
done
# Kill the terminal/frame if we're creating one.
if [ -z "$USE_EMACSCLIENT" -o -n "$CREATE_FRAME" -o -n "$NO_WINDOW" ]; then
ELISP="${ELISP} (setq message-exit-actions (list #'save-buffers-kill-terminal))"
fi
# End progn.
ELISP="${ELISP})"
if [ -n "$PRINT_ONLY" ]; then
echo ${ELISP}
exit 0
fi
if [ -n "$USE_EMACSCLIENT" ]; then
# Evaluate the progn.
exec ${EMACSCLIENT} ${NO_WINDOW} ${CREATE_FRAME} ${AUTO_DAEMON} --eval "${ELISP}"
else
exec ${EMACS} ${NO_WINDOW} --eval "${ELISP}"
fi

527
nottoomuch-addresses.sh Executable file
View file

@ -0,0 +1,527 @@
#!/bin/sh
# -*- cperl -*-
case $* in (''|--*) exec perl -x "$0" "$@" ;; (???*) ;; (*) exit 0 ;; esac
grep -aiF "$*" "${XDG_CONFIG_HOME:-$HOME/.config}/nottoomuch/addresses.active"
case $? in 0|1) exit 0; esac
exit $?
# $ nottoomuch-addresses.sh $
#
# Created: Thu 27 Oct 2011 17:38:46 EEST too
# Last modified: Sat 29 Mar 2014 17:12:14 +0200 too
# Add this to your notmuch elisp configuration file:
#
# (require 'notmuch-address)
# (setq notmuch-address-command "/path/to/nottoomuch-addresses.sh")
# (notmuch-address-message-insinuate)
# Documentation at the end. Encoding: utf-8.
#!perl
# line 24
# - 24 -^
# HISTORY
#
# Version 2.2 2014-03-29 15:12:14 UTC
# * In case there is both {phrase} and (comment) in an email address,
# append comment to the phrase. This will make more duplicates to be
# removed. Now there can be:
# <user@host>
# "phrase" <user@host>
# "phrase (comment)" <user@host>
# <user@host> (comment)
# * In case email address is in form "someuser@somehost" <someuser@somehost>
# i.e. the phrase is exactly the same as <address>, phrase is dropped.
#
# Version 2.1 2012-02-22 14:58:58 UTC
# * Fixed a bug where decoding matching but unknown or malformed =?...?=-
# encoded parts in email addresses lead to infinite loop.
#
# Version 2.0 2012-01-14 03:45:00 UTC
# * Added regexp-based ignores using /regexp/[i] syntax in ignore file.
# * Changed addresses file header to v4; 'addresses' file now contains all
# found addresses plus some metainformation added at the end of the file.
# Filtered (by ignores) address list is now in new 'addresses.active'
# file and the fgrep code at the beginning now uses this "active" file.
# Addresses file with header v2 and v3 are supported for reading.
# * Encoded address content is now recursively decoded.
#
# Version 1.6 2011-12-29 06:42:42 UTC
# * Fixed 'encoded-text' recognition and concatenations, and underscore
# to space replacements. Now quite RFC 2047 "compliant".
#
# Version 1.5 2011-12-22 20:20:32 UTC
# * Changed search to exit with zero value (also) if no match found.
# * Changed addresses file header (v3) to use \t as separator. Addresses
# file containing previous version header (v2) can also be read.
# * Removed outdated information about sorting in ASCII order.
#
# Version 1.4 2011-12-14 19:24:28 UTC
# * Changed to run notmuch search --sort=newest-first --output=files ...
# (instead of notmuch show ...) and read headers from files internally.
# * Fixed away joining uninitialized $phrase value to address line.
#
# Version 1.3 2011-12-12 15:41:05 UTC
# * Changed to store/show addresses in 'newest first' order.
# * Changed addresses file header to force address file rebuild.
#
# Version 1.2 2011-12-06 18:00:00 UTC
# * Changed search work case-insensitively -- grep(1) does it locale-aware.
# * Changed this program execute from /bin/sh (wrapper).
#
# Version 1.1 2011-12-02 17:11:33 UTC
# * Removed Naïve assumption that no-one runs update on 'dumb' terminal.
# * Check address database file first line whether it is known to us.
#
# Thanks to Bart Bunting for providing a good bug report.
#
# Version 1.0 2011-11-30 20:56:10 UTC
# * Initial release.
use 5.8.1;
use strict;
use warnings;
use Encode qw/encode_utf8 find_encoding/;
use MIME::Base64 'decode_base64';
use MIME::QuotedPrint 'decode_qp';
no encoding;
my $configdir = ($ENV{XDG_CONFIG_HOME}||$ENV{HOME}.'/.config').'/nottoomuch';
my $adbpath = $configdir . '/addresses';
my $ignpath = $configdir . '/addresses.ignore';
my $actpath = $configdir . '/addresses.active';
unless (@ARGV)
{
require Pod::Usage;
Pod::Usage::pod2usage( -verbose => 0, -exitval => 0 );
exit 1;
}
if ($ARGV[0] eq '--help')
{
$SIG{__DIE__} = sub {
$SIG{__DIE__} = 'DEFAULT';
require Pod::Usage;
Pod::Usage::pod2usage( -verbose => 2, -exitval => 0, -noperldoc => 1 );
exit 1;
};
require Pod::Perldoc;
$SIG{__DIE__} = 'DEFAULT';
# in case PAGER is not set, perldoc runs /usr/bin/perl -isr ...
if ( ($ENV{PAGER} || '') eq 'less') {
$ENV{LESS} .= 'R' if ($ENV{LESS} || '') !~ /[rR]/;
}
@ARGV = ( $0 );
exit ( Pod::Perldoc->run() );
}
my @list;
if ($ARGV[0] eq '--update')
{
sub mkdirs($);
sub mkdirs($) {
die "'$_[0]': not a (writable) directory\n" if -e $_[0];
return if mkdir $_[0]; # no mode: 0777 & ~umask used
local $_ = $_[0];
mkdirs $_ if s|/?[^/]+$|| and $_;
mkdir $_[0] or die "Cannot create '$_[0]': $!\n";
}
mkdirs $configdir unless -d $configdir;
unlink $adbpath if defined $ARGV[1] and $ARGV[1] eq '--rebuild';
my ($sstr, $acount) = (0, 0);
if (-s $adbpath) {
die "Cannot open '$adbpath': $!\n" unless open I, '<', $adbpath;
sysread I, $_, 18;
# new header: "v4/dd/dd/dd/dd/dd\n" where / == '\t' (but match also v2)
if (/^v[234]\s(\d\d)\s(\d\d)\s(\d\d)\s(\d\d)\s(\d\d)\n$/) {
$sstr = "$1$2$3$4$5" - 86400 * 7; # one week extra to (re)look.
$sstr = 0 if $sstr < 0;
}
close I if $sstr == 0;
}
if ($sstr > 0) {
print "Updating '$adbpath', since $sstr.\n";
$sstr .= '..';
}
else {
print "Creating '$adbpath'. This may take some time...\n";
$sstr = '*';
}
my (%ign_hash, @ign_relist);
if (-f $ignpath) {
die "Cannot open '$ignpath': $!\n" unless open J, '<', $ignpath;
while (<J>) {
next if /^\s*#/;
if (m|^/(.*)/(\w*)\s*$|) {
if ($2 eq 'i') {
push @ign_relist, qr/$1/i;
}
else {
push @ign_relist, qr/$1/;
}
}
else {
s/\s+$/\n/;
$ign_hash{$_} = 1;
}
}
close J;
}
my $sometime = time;
die "Cannot open '$adbpath.new': $!\n" unless open O, '>', $adbpath.'.new';
die "Cannot open '$actpath.new': $!\n" unless open A, '>', $actpath.'.new';
$_ = $sometime; s/(..)\B/$1\t/g; # FYI: s/..\B\K/\t/g requires perl 5.10.
print O "v4\t$_\n";
# The following code block is from Email::Address, almost verbatim.
# The reasons to snip code I instead of just 'use Email::Address' are:
# 1) Some systems ship Mail::Address instead of Email::Address
# 2) Every user doesn't have ability to install Email::Address
# --8<----8<----8<----8<----8<----8<----8<----8<----8<----8<----8<--
## no critic RequireUseWarnings
# support pre-5.6
#$VERSION = '1.889';
my $COMMENT_NEST_LEVEL = 2;
my $CTL = q{\x00-\x1F\x7F};
my $special = q{()<>\\[\\]:;@\\\\,."};
my $text = qr/[^\x0A\x0D]/;
my $quoted_pair = qr/\\$text/;
my $ctext = qr/(?>[^()\\]+)/;
my ($ccontent, $comment) = (q{})x2;
for (1 .. $COMMENT_NEST_LEVEL) {
$ccontent = qr/$ctext|$quoted_pair|$comment/;
$comment = qr/\s*\((?:\s*$ccontent)*\s*\)\s*/;
}
my $cfws = qr/$comment|\s+/;
my $atext = qq/[^$CTL$special\\s]/;
my $atom = qr/$cfws*$atext+$cfws*/;
my $dot_atom_text = qr/$atext+(?:\.$atext+)*/;
my $dot_atom = qr/$cfws*$dot_atom_text$cfws*/;
my $qtext = qr/[^\\"]/;
my $qcontent = qr/$qtext|$quoted_pair/;
my $quoted_string = qr/$cfws*"$qcontent+"$cfws*/;
my $word = qr/$atom|$quoted_string/;
# XXX: This ($phrase) used to just be: my $phrase = qr/$word+/; It was changed
# to resolve bug 22991, creating a significant slowdown. Given current speed
# problems. Once 16320 is resolved, this section should be dealt with.
# -- rjbs, 2006-11-11
#my $obs_phrase = qr/$word(?:$word|\.|$cfws)*/;
# XXX: ...and the above solution caused endless problems (never returned) when
# examining this address, now in a test:
# admin+=E6=96=B0=E5=8A=A0=E5=9D=A1_Weblog-- ATAT --test.socialtext.com
# So we disallow the hateful CFWS in this context for now. Of modern mail
# agents, only Apple Web Mail 2.0 is known to produce obs-phrase.
# -- rjbs, 2006-11-19
my $simple_word = qr/$atom|\.|\s*"$qcontent+"\s*/;
my $obs_phrase = qr/$simple_word+/;
my $phrase = qr/$obs_phrase|(?:$word+)/;
my $local_part = qr/$dot_atom|$quoted_string/;
my $dtext = qr/[^\[\]\\]/;
my $dcontent = qr/$dtext|$quoted_pair/;
my $domain_literal = qr/$cfws*\[(?:\s*$dcontent)*\s*\]$cfws*/;
my $domain = qr/$dot_atom|$domain_literal/;
my $display_name = $phrase;
my $addr_spec = qr/$local_part\@$domain/;
my $angle_addr = qr/$cfws*<$addr_spec>$cfws*/;
my $name_addr = qr/$display_name?$angle_addr/;
my $mailbox = qr/(?:$name_addr|$addr_spec)$comment*/;
# --8<----8<----8<----8<----8<----8<----8<----8<----8<----8<----8<--
# In this particular purpose the cache code used in...
my %seen; # ...Email::Address is "replaced" by %seen & %hash.
my %hash;
my $ptime = $sometime + 5;
my $addrcount = 0;
$| = 1;
open P, '-|', qw/notmuch search --sort=newest-first --output=files/, $sstr;
while (<P>) {
chomp;
open M, '<', $_ or next;
while (<M>) {
last if /^\s*$/;
next unless s/^(From|To|Cc|Bcc):\s+//i;
s/\s+$//;
my @a = ( $_ );
while (<M>) {
# XXX leaks to body in case empty line is found in this loop...
# XXX Note that older code leaked to mail body always...
if (s/^\s+// or s/^(From|To|Cc|Bcc):\s+/,/i) {
s/\s+$//;
push @a, $_;
next;
}
last;
}
$_ = join ' ', @a;
if (time > $ptime) {
my $c = qw(/ - \ |)[int ($ptime / 5) % 4];
print $c, ' active addresses gathered: ', $addrcount, "\r";
$ptime += 5;
}
# The parse function from Email::Address heavily modified
# to fit ok in this particular purpose. New bugs are mine!
# --8<----8<----8<----8<----8<----8<----8<----8<----8<----8<----8<--
s/[ \t]+/ /g;
s/\?= =\?/\?==\?/g;
my (@mailboxes) = (/$mailbox/go);
L: foreach (@mailboxes) {
next if $seen{$_};
$seen{$_} = 1;
my @comments = /($comment)/go;
s/$comment//go if @comments;
my ($user, $host);
($user, $host) = ($1, $2) if s/<($local_part)\@($domain)>//o;
if (! defined($user) || ! defined($host)) {
s/($local_part)\@($domain)//o;
($user, $host) = ($1, $2);
}
sub decode_substring ($) {
my $t = lc $2;
my $s;
if ($t eq 'b') { $s = decode_base64($3); }
elsif ($t eq 'q') { $s = decode_qp($3); }
else {
$_[0] = 0;
return "=?$1?$2?$3?=";
}
$s =~ tr/_/ /;
return $s if lc $1 eq 'utf-8';
my $o = find_encoding($1);
$_[0] = 0, return "=?$1?$2?$3?=" unless ref $o;
return encode_utf8($o->decode($s));
}
sub decode_data () {
my $loopmax = 5;
while ( s{ =\?([^?]+)\?(\w)\?(.*?)\?= }
{ decode_substring($loopmax) }gex ) {
last if --$loopmax <= 0;
};
}
my @phrase = /($display_name)/o;
decode_data foreach (@phrase);
for ( @phrase, $host, $user, @comments ) {
next unless defined $_;
s/^[\s'"]+//; ## additions 20111123 too
s/[\s'"]+$//; ## additions 20111123 too
$_ = undef unless length $_;
}
# here we want to have email address always // 20111123 too
next unless defined $user and defined $host;
my $userhost = lc "<$user\@$host>";
#my $userhost = "<$user\@$host>";
@comments = grep { defined or return 0; decode_data; 1; } @comments;
# "trim" phrase, if equals to user@host after trimming, drop it.
if (defined $phrase[0]) {
#$phrase[0] =~s/\A"(.+)"\z/$1/;
$phrase[0] =~ tr/\\//d; ## 20111124 too
$phrase[0] =~ s/\"/\\"/g;
@phrase = () if lc "<$phrase[0]>" eq $userhost;
}
# In case we would have {phrase} <user@host> (comment),
# make that "{phrase} (comment)" <user@host> ...
if (defined $phrase[0]) {
if (@comments) {
$phrase[0] = qq/"$phrase[0] / . join(' ', @comments) . '"';
@comments = ();
}
else {
$phrase[0] = qq/"$phrase[0]"/;
}
}
else {
@phrase = ();
}
$_ = join(' ', @phrase, $userhost, @comments) . "\n";
next if defined $hash{$_};
print O $_;
$hash{$_} = 1;
next if defined $ign_hash{$_};
foreach my $re (@ign_relist) {
next L if $_ =~ $re;
}
print A $_;
$addrcount++;
}
# --8<----8<----8<----8<----8<----8<----8<----8<----8<----8<----8<--
}
close M;
}
undef %seen;
close P;
my $oldaddrcount = 0;
if ($sstr ne '*') {
L: while (<I>) {
last if /^---/;
next if defined $hash{$_};
print O $_;
next if defined $ign_hash{$_};
foreach my $re (@ign_relist) {
next L if $_ =~ $re;
}
print A $_;
$addrcount++;
}
while (<I>) {
$oldaddrcount = ($1 + 0), next if /^active:\s+(\d+)\s*$/;
}
close I;
}
print O "---\n";
print O "active: ", $addrcount, "\n";
close O;
close A;
undef %hash;
#link $adbpath, $adbpath . '.' . $sometime;
rename $adbpath . '.new', $adbpath or
die "Cannot rename '$adbpath.new' to '$adbpath': $!\n";
rename $actpath . '.new', $actpath or
die "Cannot rename '$actpath.new' to '$actpath': $!\n";
if ($oldaddrcount or $sstr eq '*') {
$sometime = time - $sometime;
my $new = $addrcount - $oldaddrcount;
print "Added $new active addresses in $sometime seconds.\n";
}
print "Total number of active addresses: $addrcount.\n";
exit 0;
}
die "$0: '$ARGV[0]': unknown option.\n";
__END__
=encoding utf8
=head1 NAME
nottoomuch-addresses.sh -- address completion/matching (for notmuch)
=head1 SYNOPSIS
nottoomuch-addresses.sh ( --update [--rebuild] | <search string> )
B<nottoomuch-addresses.sh --help> for more help
=head1 VERSION
2.2 (2014-03-29)
=head1 OPTIONS
=head2 B<--update>
This option is used to initially create the "address database" for
searches to be done, and then incrementally update it with new
addresses that are available in mails received since last update.
In case you want to rebuild the database from scratch, add
B<--rebuild> after --update on command line. This is necessary if some
of the new emails received have Date: header point too much in the
past (one week before last update). Update used emails Date:
information to go through new emails to be checked for new addresses
with one week's overlap. Other reason for rebuild could be
enhancements in new versions of this program which change the email
format in database.
=head2 <SEARCH STRING>
In case no option argument is given on command line, the command line
arguments are used as fixed search string. Search goes through all
email addresses in database and outputs every address (separated by
newline) where a substring match with the given search string is
found. No wildcard of regular expression matching is used.
Search is not done unless there is at least 3 octets in search string.
=head1 IGNORE FILE
Some of the addresses collected may be valid but those still seems to
be noisy junk. One may additionally want to just hide some email
addresses.
When running B<--update> the output shows the path of address database
file (usually C<$HOME/.config/nottoomuch/addresses>). If there is file
C<addresses.ignore> in the same directory that file is read as
newline-separated list of addresses which are not to be included in
address database file.
Use your text editor to open both of these files. Then move address
lines to be ignored from B<addresses> to B<addresses.ignore>. After
saving these 2 files the moved addresses will not reappear in
B<addresses> file again.
Version 2.0 of nottoomuch-addresses.sh supports regular expressions in
ignore file. Lines in format I</regexp/> or I</regexp/i> defines (perl)
I<regexp>s which are used to match email addresses for ignoring. The
I</i> format makes regular expression case-insensitive -- although this
is only applied to characters in ranges I<A-Z> and I<a-z>. Remember that
I</^.*regexp.*$/> and I</regexp/> provides same set of matching lines.
=head1 LICENSE
This program uses code from Email::Address perl module. Inclusion of
that makes it easy to define license for the whole of this code base:
Terms of Perl itself
a) the GNU General Public License as published by the Free
Software Foundation; either version 1, or (at your option) any
later version, or
b) the "Artistic License"
=head1 SEE ALSO
L<notmuch>, L<Email::Address>
=head1 AUTHOR
Tomi Ollila -- too ät iki piste fi
=head1 ACKNOWLEDGMENTS
This program uses code from Email::Address, Copyright (c) by Casey West
and maintained by Ricardo Signes. Thank you. All new bugs are mine,
though.

2
nsnat Normal file
View file

@ -0,0 +1,2 @@
iptables -t nat -A POSTROUTING -o eth0 -s 172.16.23.10 -j SNAT --to 62.65.138.74
iptables -t nat -A POSTROUTING -o eth0 -s 172.16.23.6 -j SNAT --to 62.65.138.74

4
nsstart Normal file
View file

@ -0,0 +1,4 @@
~/bin/home/route start
cd /tmp/seti
./setiathome &
su -l nico -c startx

71
oops Executable file
View file

@ -0,0 +1,71 @@
#!/usr/bin/perl -wT
#
# TWiki Collaboration Platform, http://TWiki.org/
#
# Copyright (C) 1999-2003 Peter Thoeny, peter@thoeny.com
#
# For licensing info read license.txt file in the TWiki root.
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program 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 General Public License for more details, published at
# http://www.gnu.org/copyleft/gpl.html
# Set library paths in @INC, at compile time
BEGIN { unshift @INC, '.'; require 'setlib.cfg'; }
use CGI::Carp qw(fatalsToBrowser);
use CGI;
use TWiki;
use strict;
&main();
sub main
{
my $query = new CGI;
my $thePathInfo = $query->path_info();
my $theRemoteUser = $query->remote_user();
my $theTopic = $query->param( 'topic' );
my $theUrl = $query->url;
my( $topic ) =
&TWiki::initialize( $thePathInfo, $theRemoteUser, $theTopic, $theUrl, $query );
my $tmplName = $query->param( 'template' ) || "oops";
my $skin = $query->param( "skin" ) || TWiki::Prefs::getPreferencesValue( "SKIN" );
my $tmplData = TWiki::Store::readTemplate( $tmplName, $skin );
if( ! $tmplData ) {
TWiki::writeHeader( $query );
print "<html><body>\n"
. "<h1>TWiki Installation Error</h1>\n"
. "Template file $tmplName.tmpl not found or template directory \n"
. "$TWiki::templateDir not found.<p />\n"
. "Check the \$templateDir variable in TWiki.cfg.\n"
. "</body></html>\n";
return;
}
my $param = $query->param( 'param1' ) || "";
$tmplData =~ s/%PARAM1%/$param/go;
$param = $query->param( 'param2' ) || "";
$tmplData =~ s/%PARAM2%/$param/go;
$param = $query->param( 'param3' ) || "";
$tmplData =~ s/%PARAM3%/$param/go;
$param = $query->param( 'param4' ) || "";
$tmplData =~ s/%PARAM4%/$param/go;
$tmplData = &TWiki::handleCommonTags( $tmplData, $topic );
$tmplData = &TWiki::getRenderedVersion( $tmplData );
$tmplData =~ s|( ?) *</*nop/*>\n?|$1|gois; # remove <nop> tags (PTh 06 Nov 2000)
TWiki::writeHeader( $query );
print $tmplData;
}

31
placeholder.rb Executable file
View file

@ -0,0 +1,31 @@
#!/usr/bin/env ruby
def createPlaceholder(dir, level = 0)
dir = dir + '/' if(!dir.empty? && dir[-1].chr != '/')
entries = Array.new
entries = File.new("#{dir}menu.def").readlines if(FileTest.exists?("#{dir}menu.def"))
rel = ''
level.times {
rel += '../'
}
entries.each { |x|
entry = x.split(/\s*\|\s*/, 2)
if(!FileTest.exists?(dir + entry[0] + '.html'))
File.symlink("#{rel}placeholder.html", dir + entry[0] + '.html')
end
if(FileTest.directory?(dir + entry[0]))
createPlaceholder(dir + entry[0], level + 1)
end
}
end
if(!ARGV[0])
puts 'Need a directory'
end
createPlaceholder(ARGV[0], 0)

4
post-commit Executable file
View file

@ -0,0 +1,4 @@
#!/bin/sh
. /home/users/nico/p/foreign/irker/virtualenv/bin/activate
/home/users/nico/p/foreign/irker/irker/irkerhook.py "$@"

16
postgresfixmailneu.sh Normal file
View file

@ -0,0 +1,16 @@
#!/bin/sh
[ "$#" -eq 2 ] || exit 1
user="$1"
domain="$2"
password="$3"
base=/home/server/mail
maildirmake.dovecot
cat << eof
insert into mailboxes values ('$user','$domain','$password','$domain/$user',1,1)
eof | psql mail

160
preview Executable file
View file

@ -0,0 +1,160 @@
#!/usr/bin/perl -wT
#
# TWiki Collaboration Platform, http://TWiki.org/
#
# Copyright (C) 1999-2003 Peter Thoeny, peter@thoeny.com
#
# For licensing info read license.txt file in the TWiki root.
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program 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 General Public License for more details, published at
# http://www.gnu.org/copyleft/gpl.html
# Set library paths in @INC, at compile time
BEGIN { unshift @INC, '.'; require 'setlib.cfg'; }
use CGI::Carp qw(fatalsToBrowser);
use CGI;
use TWiki;
use strict;
&main();
sub main
{
my $query = new CGI;
my $thePathInfo = $query->path_info();
my $theRemoteUser = $query->remote_user();
my $theTopic = $query->param( 'topic' );
my $theUrl = $query->url;
my( $topic, $webName, $dummy, $userName ) =
&TWiki::initialize( $thePathInfo, $theRemoteUser, $theTopic, $theUrl, $query );
$dummy = ""; # to suppress warning
my $tmpl = "";
my $text = "";
my $ptext = "";
my $meta = "";
my $formFields = "";
my $wikiUserName = &TWiki::userToWikiName( $userName );
if( ! &TWiki::Store::webExists( $webName ) ) {
my $url = &TWiki::getOopsUrl( $webName, $topic, "oopsnoweb" );
TWiki::redirect( $query, $url );
return;
}
my( $mirrorSiteName, $mirrorViewURL ) = &TWiki::readOnlyMirrorWeb( $webName );
if( $mirrorSiteName ) {
my $url = &TWiki::getOopsUrl( $webName, $topic, "oopsmirror", $mirrorSiteName, $mirrorViewURL );
TWiki::redirect( $query, $url );
return;
}
# reset lock time, this is to prevent contention in case of a long edit session
&TWiki::Store::lockTopic( $topic );
my $skin = $query->param( "skin" ) || &TWiki::Prefs::getPreferencesValue( "SKIN" );
# Is user looking to change the form used? Sits oddly in preview, but
# to avoid Javascript and pick up text on edit page it has to be in preview.
my $changeform = $query->param( 'submitChangeForm' ) || "";
if( $changeform ) {
&TWiki::Form::changeForm( $webName, $topic, $query );
return;
}
# get view template, standard view or a view with a different skin
$tmpl = &TWiki::Store::readTemplate( "preview", $skin );
my $dontNotify = $query->param( "dontnotify" ) || "";
$tmpl =~ s/%DONTNOTIFY%/$dontNotify/go;
my $saveCmd = $query->param( "cmd" ) || "";
if( $saveCmd ) {
if( ! &TWiki::Access::userIsInGroup( $wikiUserName, $TWiki::superAdminGroup ) ) {
# user has no permission to execute undocumented cmd=... parameter
my $url = &TWiki::getOopsUrl( $webName, $topic, "oopsaccessgroup", "$TWiki::mainWebname.$TWiki::superAdminGroup" );
TWiki::redirect( $query, $url );
return;
}
$tmpl =~ s/\(preview\)/\(preview cmd=$saveCmd\)/go;
}
$tmpl =~ s/%CMD%/$saveCmd/go;
if( $saveCmd ne "repRev" ) {
my $dummy = "";
( $meta, $dummy ) = &TWiki::Store::readTopic( $webName, $topic );
# parent setting
my $theParent = $query->param( 'topicparent' ) || "";
if( $theParent ) {
$tmpl =~ s/%TOPICPARENT%/$theParent/go;
$meta->put( "TOPICPARENT", ( "name" => $theParent ) );
}
$tmpl =~ s/%TOPICPARENT%/$theParent/;
my $formTemplate = $query->param( "formtemplate" );
if( $formTemplate ) {
$meta->remove( "FORM" );
$meta->put( "FORM", ( name => $formTemplate ) ) if( $formTemplate ne "none" );
$tmpl =~ s/%FORMTEMPLATE%/$formTemplate/go;
} else {
$tmpl =~ s/%FORMTEMPLATE%//go;
}
# get the edited text and combine text, form and attachments for preview
&TWiki::Form::fieldVars2Meta( $webName, $query, $meta );
$text = $query->param( "text" );
if( ! $text ) {
# empty topic not allowed
my $url = &TWiki::getOopsUrl( $webName, $topic, "oopsempty" );
print $query->redirect( $url );
return;
}
#AS added hook for plugins that want to do heavy stuff
TWiki::Plugins::afterEditHandler( $text, $topic, $webName );
$ptext = $text;
if( $meta->count( "FORM" ) ) {
$formFields = &TWiki::Form::getFieldParams( $meta );
}
} else {
# undocumented "repRev" mode
$text = $query->param( "text" ); # text to save
( $meta, $ptext ) = &TWiki::Store::_extractMetaData( $webName, $topic, $text );
$text =~ s/%_(.)_%/%__$1__%/go;
}
my @verbatim = ();
$ptext = &TWiki::takeOutVerbatim( $ptext, \@verbatim );
$ptext =~ s/ {3}/\t/go;
$ptext = &TWiki::handleCommonTags( $ptext, $topic );
$ptext = &TWiki::getRenderedVersion( $ptext );
# do not allow click on link before save:
$ptext =~ s@(href=".*?")@href="%SCRIPTURLPATH%/oops%SCRIPTSUFFIX%/%WEB%/%TOPIC%\?template=oopspreview"@goi;
$ptext = &TWiki::handleCommonTags( $ptext, $topic );
$ptext = &TWiki::putBackVerbatim( $ptext, "pre", @verbatim );
$tmpl = &TWiki::handleCommonTags( $tmpl, $topic );
$tmpl = &TWiki::handleMetaTags( $webName, $topic, $tmpl, $meta );
$tmpl = &TWiki::getRenderedVersion( $tmpl );
$tmpl =~ s/%TEXT%/$ptext/go;
$text = &TWiki::encodeSpecialChars( $text );
$tmpl =~ s/%HIDDENTEXT%/$text/go;
$tmpl =~ s/%FORMFIELDS%/$formFields/go;
$tmpl =~ s|( ?) *</*nop/*>\n?|$1|gois; # remove <nop> tags (PTh 06 Nov 2000)
&TWiki::writeHeader( $query );
print $tmpl;
}

1
price-vm-hosting.py Symbolic link
View file

@ -0,0 +1 @@
../.ungleich/ungleich/vcs/ungleich-bin/price-vm-hosting.py

8
pwhome Executable file
View file

@ -0,0 +1,8 @@
#!/bin/sh
touch ~/privat/rechner/eigene/.lastsync
rsync -av --delete --progress \
"$@" \
~/.ssh ~/.gnupg ~/privat/rechner/eigene/ \
/mnt

31
python-bin-wrapper Executable file
View file

@ -0,0 +1,31 @@
#!/bin/sh
# -*- coding: utf-8 -*-
#
# 2013 Nico Schottelius (nico-nsbin at schottelius.org)
#
# This file is part of nsbin.
#
# nsbin is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# nsbin 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 General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with nsbin. If not, see <http://www.gnu.org/licenses/>.
#
#
# Wrapper for real script to allow execution from checkout
dir=${0%/*}
libdir=$(cd "${dir}/../" && pwd -P)
project=${libdir##*/}
export PYTHONPATH="${libdir}"
"$dir/../scripts/${project}" "$@"

66
qos-neu Executable file
View file

@ -0,0 +1,66 @@
INET=ppp0
MAXRATE=126kbit
# flush
iptables -t mangle -F
tc qdisc del dev $INET root
# group0
# acks 6kbit
# group1:
# dns
# ssh 40kbit
# group2: 60kbit
# apache
# smtp
# pop3
# group3: 20kbit
# identd
# ftp
# rsync
# icmp
# standards
# root class (root o all evil)
tc qdisc add dev $INET root handle 1:0 htb default 23
# hauptklasse... mamapapa ichselber alg minimal maximal
tc class add dev $INET parent 1:0 classid 1:1 htb rate $MAXRATE ceil $MAXRATE
# acks
tc class add dev $INET parent 1:1 classid 1:10 htb rate 6kbit ceil $MAXRATE prio 1
tc filter add dev $INET parent 1:0 prio 0 protocol ip handle 10 fw flowid 1:10
# ssh / dns
iptables -t mangle -A POSTROUTING -o $INET -p tcp --source-port 22 -j MARK --set-mark 11
iptables -t mangle -A POSTROUTING -o $INET -p tcp --source-port 53 -j MARK --set-mark 11
iptables -t mangle -A POSTROUTING -o $INET -p udp --source-port 53 -j MARK --set-mark 11
# das ist nur die rule. wie es sein soll.
tc class add dev $INET parent 1:1 classid 1:11 htb rate 40kbit ceil $MAXRATE prio 2
# das ist der eintrag der in aktiv macht, auf das handle (==mark)
tc filter add dev $INET parent 1:0 prio 0 protocol ip handle 11 fw flowid 1:11
# apache / smtp / pop
iptables -t mangle -A POSTROUTING -o $INET -p tcp --source-port 80 -j MARK --set-mark 12
iptables -t mangle -A POSTROUTING -o $INET -p tcp --source-port pop3 -j MARK --set-mark 12
iptables -t mangle -A POSTROUTING -o $INET -p tcp --source-port smtp -j MARK --set-mark 12
tc class add dev $INET parent 1:1 classid 1:12 htb rate 60kbit ceil $MAXRATE prio 2
tc filter add dev $INET parent 1:0 prio 0 protocol ip handle 12 fw flowid 1:12
# ftp / rsync / auth / icmp
iptables -t mangle -A POSTROUTING -o $INET -p tcp --source-port 20:21 -j MARK --set-mark 13
iptables -t mangle -A POSTROUTING -o $INET -p tcp --source-port rsync -j MARK --set-mark 13
iptables -t mangle -A POSTROUTING -o $INET -p tcp --source-port auth -j MARK --set-mark 13
iptables -t mangle -A POSTROUTING -o $INET -p icmp -j MARK --set-mark 13
tc class add dev $INET parent 1:1 classid 1:13 htb rate 20kbit ceil $MAXRATE prio 2
tc filter add dev $INET parent 1:0 prio 0 protocol ip handle 13 fw flowid 1:13

269
rdiff Executable file
View file

@ -0,0 +1,269 @@
#!/usr/bin/perl -wT
#
# TWiki Collaboration Platform, http://TWiki.org/
#
# Copyright (C) 1999-2003 Peter Thoeny, peter@thoeny.com
#
# For licensing info read license.txt file in the TWiki root.
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program 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 General Public License for more details, published at
# http://www.gnu.org/copyleft/gpl.html
# Set library paths in @INC, at compile time
BEGIN { unshift @INC, '.'; require 'setlib.cfg'; }
use CGI::Carp qw(fatalsToBrowser);
use CGI;
use TWiki;
$query= new CGI;
&main();
# =========================
sub renderCellData
{
my( $data, $topic ) = @_;
if( $data ) {
$data = &TWiki::handleCommonTags( $data, $topic );
$data = &TWiki::getRenderedVersion( $data );
if( $data =~ m/<\/?(th|td|table)/i )
{
# data has <th> or <td>, need to fix <table>
my $bTable = ( $data =~ s/(<table)/$1/gois ) || 0;
my $eTable = ( $data =~ s/(<\/table)/$1/gois ) || 0;
my $i = 0;
if( $bTable > $eTable ) {
for( $i = $eTable; $i < $bTable; $i++ ) {
$data .= "</table>";
}
} elsif( $bTable < $eTable ) {
for( $i = $bTable; $i < $eTable; $i++ ) {
$data = "\n<table>$data";
}
} elsif( ( $bTable == 0 ) && ( $eTable == 0 ) ) {
$data = "\n<table>$data\n</table>";
}
}
}
return $data;
}
# =========================
sub renderRevisionDiff
{
my( $text, $topic ) = @_;
$text =~ s/\r//go; # cut CR
my $result = "<table width=\"100%\" cellspacing=\"0\">\n<tr><td>";
my $data = "";
foreach( split( /\n/, $text ) ) {
if( /^[0-9]/ ) {
$data = renderCellData( $data, $topic );
$result .= $data;
$data = "";
s/^([0-9\,]+)d([0-9\,]+)/\n<\/td><\/tr>\n<tr><td bgcolor="#FFD7D7" colspan ="2"><b> Deleted: <\/b><\/td><\/tr>\n<tr><td bgcolor="#FF4040" valign="top" width="1%">&lt;<br \/>&lt;<\/td><td>/go;
s/^([0-9\,]+)a([0-9\,]+)/\n<\/td><\/tr>\n<tr><td bgcolor="#D0FFD0" colspan ="2"><b> Added: <\/b><\/td><\/tr>\n<tr><td bgcolor="#40FF40" valign="top" width="1%">&gt;<br \/>&gt;<\/td><td>/go;
s/^([0-9\,]+)c([0-9\,]+)/\n<\/td><\/tr>\n<tr><td bgcolor="#D0FFD0" colspan ="2"><b> Changed: <\/b><\/td><\/tr>\n<tr><td bgcolor="#FF4040" valign="top" width="1%">&lt;<br \/>&lt;<\/td><td>/go;
$result .= $_;
} elsif( /^[<>]/ ) {
s/^[<>] (.*)/$1/go;
$data .= "\n$_";
} elsif( /^--*/ ) {
$data = renderCellData( $data, $topic );
$result .= $data;
$data = "";
$result .= "\n</td></tr><tr><td bgcolor=\"#40FF40\" valign=\"top\" width=\"1%\">&gt;<br />&gt;</td><td>\n";
}
}
$data = renderCellData( $data, $topic );
$result .= $data;
$data = "";
$text = "$result<\/td><\/tr>\n<\/table>";
return $text;
}
sub getRevInfo
{
my( $web, $rev, $topic, $short ) = @_;
my( $date, $user ) = &TWiki::Store::getRevisionInfo( $web, $topic, "1.$rev", 1 );
$user = TWiki::getRenderedVersion( TWiki::userToWikiName( $user ) );
if( $short ) {
# cut time
$date =~ s/ \- [0-9]*\:[0-9]+$//go;
# eliminate white space to prevent wrap around in HR table:
$date =~ s/ /\&nbsp\;/go;
} else {
$date .= " GMT";
}
my $revInfo = "$date - $user";
$revInfo =~ s/[\n\r]*//go;
return $revInfo;
}
sub main
{
my $thePathInfo = $query->path_info();
my $theRemoteUser = $query->remote_user();
my $theTopic = $query->param('topic');
my $theUrl = $query->url;
( $topic, $webName, $scriptUrlPath, $userName ) =
&TWiki::initialize( $thePathInfo, $theRemoteUser, $theTopic, $theUrl, $query );
my $tmpl = "", $text = "", $diff = "";
my $rev1 = $query->param( "rev1" );
my $rev2 = $query->param( "rev2" );
my $maxrev= 1;
my $i = $maxrev, $j = $maxrev;
my $revTitle1 = "", $revTitle2 = "";
my $revInfo1 = "", $revInfo2 = "";
my $isMultipleDiff = 0;
if( ! &TWiki::Store::webExists( $webName ) ) {
my $url = &TWiki::getOopsUrl( $webName, $topic, "oopsnoweb" );
TWiki::redirect( $query, $url );
return;
}
# get view template, standard view or a view with a different skin
my $skin = $query->param( "skin" ) || &TWiki::Prefs::getPreferencesValue( "SKIN" );
$tmpl = &TWiki::Store::readTemplate( "rdiff", $skin );
$tmpl =~ s/\%META{.*?}\%//go; # remove %META{"parent"}%
my( $before, $difftmpl, $after) = split( /%REPEAT%/, $tmpl);
my $topicExists = &TWiki::Store::topicExists( $webName, $topic );
if( $topicExists ) {
$maxrev = &TWiki::Store::getRevisionNumber( $webName, $topic );
$maxrev =~ s/r?1\.//go; # cut 'r' and major
if( ! $rev1 ) { $rev1 = 0; }
if( ! $rev2 ) { $rev2 = 0; }
$rev1 =~ s/r?1\.//go; # cut 'r' and major
$rev2 =~ s/r?1\.//go; # cut 'r' and major
if( $rev1 < 1 ) { $rev1 = $maxrev; }
if( $rev1 > $maxrev ) { $rev1 = $maxrev; }
if( $rev2 < 1 ) { $rev2 = 1; }
if( $rev2 > $maxrev ) { $rev2 = $maxrev; }
$revTitle1 = "r1.$rev1";
$revInfo1 = getRevInfo( $webName, $rev1, $topic );
if( $rev1 != $rev2 ) {
$revTitle2 = "r1.$rev2";
$revInfo2 = getRevInfo( $webName, $rev2, $topic );
}
} else {
$rev1 = 1;
$rev2 = 1;
}
# check access permission
my $wikiUserName = &TWiki::userToWikiName( $userName );
my $viewAccessOK = &TWiki::Access::checkAccessPermission( "view", $wikiUserName, "", $topic, $webName );
if( ( $TWiki::readTopicPermissionFailed ) || ( ! $viewAccessOK ) ) {
my $url = &TWiki::getOopsUrl( $webName, $topic, "oopsaccessview" );
TWiki::redirect( $query, $url );
return;
}
# format "before" part
$before =~ s/%REVTITLE1%/$revTitle1/go;
$before =~ s/%REVTITLE2%/$revTitle2/go;
$before = &TWiki::handleCommonTags( $before, $topic );
$before = &TWiki::getRenderedVersion( $before );
$before =~ s|( ?) *</*nop/*>\n?|$1|gois; # remove <nop> tags (PTh 06 Nov 2000)
&TWiki::writeHeader( $query );
print $before;
# do one or more diffs
$difftmpl = &TWiki::handleCommonTags( $difftmpl, $topic );
if( $topicExists ) {
my $r1 = $rev1, $r2 = $rev2, $rInfo = "";
if( $r1 > $r2 + 1) {
$r2 = $r1 - 1;
$isMultipleDiff = 1;
}
do {
$diff = $difftmpl;
$diff =~ s/%REVTITLE1%/r1\.$r1/go;
$rInfo = getRevInfo( $webName, $r1, $topic, 1 );
$diff =~ s/%REVINFO1%/$rInfo/go;
$text = &TWiki::Store::getRevisionDiff( $webName, $topic, "1.$r2", "1.$r1" );
$text = renderRevisionDiff( $text, $topic );
$diff =~ s/%TEXT%/$text/go;
$diff =~ s|( ?) *</*nop/*>\n?|$1|gois; # remove <nop> tags (PTh 06 Nov 2000)
print $diff;
$r1 = $r1 - 1;
$r2 = $r2 - 1;
if( $r2 < 1 ) { $r2 = 1; }
} while( ( $r1 > $rev2 ) || ( $r1 == 1 ) );
} else {
$diff = $difftmpl;
$diff =~ s/%REVTITLE1%/$revTitle1/go;
$diff =~ s/%REVTITLE2%/$revTitle2/go;
$diff =~ s/%TEXT%//go;
$diff =~ s|( ?) *</*nop/*>\n?|$1|gois; # remove <nop> tags (PTh 06 Nov 2000)
print $diff;
}
if( $TWiki::doLogTopicRdiff ) {
# write log entry
&TWiki::Store::writeLog( "rdiff", "$webName.$topic", "r1.$rev1 r1.$rev2" );
}
# format "after" part
$i = $maxrev;
$j = $maxrev;
my $revisions = "";
my $breakRev = 0;
if( ( $TWiki::numberOfRevisions > 0 ) && ( $TWiki::numberOfRevisions < $maxrev ) ) {
$breakRev = $maxrev - $TWiki::numberOfRevisions + 1;
}
while( $i > 0 ) {
$revisions .= " | <a href=\"$scriptUrlPath/view%SCRIPTSUFFIX%/%WEB%/%TOPIC%?rev=1.$i\">r1.$i</a>";
if( $i != 1 ) {
if( $i == $breakRev ) {
# Now obsolete because of 'More' link
# $revisions = "$revisions | <a href=\"$scriptUrlPath/oops%SCRIPTSUFFIX%/%WEB%/%TOPIC%?template=oopsrev&amp;param1=1.$maxrev\">&gt;...</a>";
$i = 1;
} else {
if( ( $i == $rev1 ) && ( !$isMultipleDiff ) ) {
$revisions .= " | &gt;";
} else {
$j = $i - 1;
$revisions .= " | <a href=\"$scriptUrlPath/rdiff%SCRIPTSUFFIX%/%WEB%/%TOPIC%?rev1=1.$i&amp;rev2=1.$j\">&gt;</a>";
}
}
}
$i = $i - 1;
}
$after =~ s/%REVISIONS%/$revisions/go;
$after =~ s/%CURRREV%/1.$rev1/go;
$after =~ s/%MAXREV%/1.$maxrev/go;
$after =~ s/%REVTITLE1%/$revTitle1/go;
$after =~ s/%REVINFO1%/$revInfo1/go;
$after =~ s/%REVTITLE2%/$revTitle2/go;
$after =~ s/%REVINFO2%/$revInfo2/go;
$after = &TWiki::handleCommonTags( $after, $topic );
$after = &TWiki::getRenderedVersion( $after );
$after =~ s|( ?) *</*nop/*>\n?|$1|gois; # remove <nop> tags (PTh 06 Nov 2000)
print $after;
}

27
recover_all_vim_files Executable file
View file

@ -0,0 +1,27 @@
#!/bin/sh
#
# 2010 Nico Schottelius (nico-nsbin at schottelius.org)
#
# This file is part of nsbin.
#
# nsbin is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# nsbin 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 General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with nsbin. If not, see <http://www.gnu.org/licenses/>.
#
#
# Recover and write all vim files in current directory
#
#
Does not work: vim reads from stdin!
find . -name \*.swp | while read l ; do a=$(echo $l | sed -e 's;/\.;;' -e 's/\.swp$//'); vi -r -c ':x' $a; done

18
redmine.sh Normal file
View file

@ -0,0 +1,18 @@
#!/bin/sh
read -d '' data << EOF
<?xml version="1.0"?>
<issue>
<subject>Delete/Remove Project</subject>
<description>The user can remove a project from the list with or without deleting it on disk</description>
<parent_issue_id>2762</parent_issue_id>
<project_id>2</project_id>
<priority_id>2</priority_id>
<tracker_id>6</tracker_id>
<status_id>1</status_id>
<assigned_to_id><YOUR_USER_ID></assigned_to_id>
</issue>
EOF
echo $data | curl -k --request POST --header "Content-type: application/xml" --data-binary @- https://dev.rdit.ch/issues.json?key=<YOUR_API_KEY>

3
rekursivperms Normal file
View file

@ -0,0 +1,3 @@
for a in `seq 1 $#`; do
eval find \$$a -exec /root/scripts/set_correct_bits {} \\\;
done

16
release_dlna Executable file
View file

@ -0,0 +1,16 @@
#!/bin/sh -e
dir=/home/services/dlna
for file in "$@"; do
fname=${file##*/}
done
[ -z "$file" ] && exit 1
bfile="$(basename "$file")"
scp "$file" "${host}:$dir"
ssh $host "chmod a+r \"$dir/$bfile\""
echo "Pre-released ${url}/${bfile}"

18
remove-links Normal file
View file

@ -0,0 +1,18 @@
if [ -z "$1" ]; then
echo noe
exit 1
fi
for dirs in bin sbin lib include share; do
cd "$1/$dirs"
for file in *; do
if [ -L /usr/$dirs/"$file" ]; then
echo removing link $file
rm /usr/$dirs/"$file"
elif [ -d /usr/$dirs/"$file" ]; then
rmdir /usr/$dirs/"$file"
else
echo /usr/$dirs/"$file" is not a link...
fi
done
done

8
remove-pcsystems Executable file
View file

@ -0,0 +1,8 @@
#!/bin/sh
NEW="nico-webdesign at schottelius.org"
OLD="nicos@pcsystems.de"
if [ ! -d "$1" ]; then
cat "$1" | sed "s,$OLD,$NEW," > $1.tmp
mv $1.tmp $1
fi

Some files were not shown because too many files have changed in this diff Show more