Commit df2daf52 authored by Nico Schottelius's avatar Nico Schottelius
parent 256dc987
#!/bin/sh
cd /home/users/nico/p/foreign/alot
export PYTHONPATH=$(pwd -P)
python2 ./bin/alot
/root/scripts/add-links "$1"
/root/scripts/rekursivperms "$1"
chown -R .util "$1"
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
modprobe usb-storage
modprobe ohci-hcd
modprobe sd_mod
#!/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" \;
#!/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"
#!/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
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"
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
#!/bin/sh
mkdir ~/p/
mr checkout
#!/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
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
~/scripts/enab_fbdev
~/scripts/enab_sound
mplayer -nogui -vo fbdev -dvd 1 /dev/cdroms/cdrom0 "$@"
~/scripts/enab_fbdev
~/scripts/enab_sound
mplayer -nogui -vo fbdev -vcd 1 /dev/cdroms/cdrom0 "$@"
mkdir logs; chown www-data:www-data logs
#!/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
#!/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" \;
#!/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 \
"