Commit e429c7ad authored by Nico Schottelius's avatar Nico Schottelius

++ cleanup

parent 406bd43f
Only kept for historic reasons:
- use at your own risk
- use for inspiration
- but don't use for production
This diff is collapsed.
#!/bin/sh
limit=$1; shift
task list limit:$limit "$@"
#!/bin/sh
x-terminal-emulator -name mutt -e mutt "$@"
# fstab
cat /etc/fstab | sed 's,^/dev/discs/disc0/part3,#/dev/discs/disc0/part3,' > \
/tmp/fstab
cat /tmp/fstab | sed 's,^/dev/discs/disc0/part1,#/dev/discs/disc0/part1,' > \
/etc/fstab
cat /etc/fstab | sed 's,^\(/dev/root.*\)ext3,\1reiserfs,' > \
/tmp/fstab
mv /tmp/fstab /etc/fstab
# X
cat /etc/X11/XF86Config | sed 's/\(Driver.*\)"ati"/\1"nv"/' > /tmp/xf86conf
cat /tmp/xf86conf | sed 's,\(Option.*"Protocol".*\)"ps/2",\1"MouseMan",' > \
/etc/X11/XF86Config
cat /etc/X11/XF86Config | sed 's,\(Option.*"Device".*\)"/dev/misc/psaux",\1"/dev/tts/0",' > /tmp/xf86conf
mv /tmp/xf86conf /etc/X11/XF86Config
# fstab
cat /etc/fstab | sed 's,^#/dev/discs/disc0/part3,/dev/discs/disc0/part3,' > \
/tmp/fstab
cat /tmp/fstab | sed 's,^#/dev/discs/disc0/part1,/dev/discs/disc0/part1,' > \
/etc/fstab
cat /etc/fstab | sed 's,^\(/dev/root.*\)reiserfs,\1ext3,' > \
/tmp/fstab
mv /tmp/fstab /etc/fstab
# X
cat /etc/X11/XF86Config | sed 's/\(Driver.*\)"nv"/\1"ati"/' > /tmp/xf86conf
cat /tmp/xf86conf | sed 's,\(Option.*"Protocol".*\)"MouseMan",\1"ps/2",' > \
/etc/X11/XF86Config
cat /etc/X11/XF86Config | sed 's,\(Option.*"Device".*\)"/dev/tts/0",\1"/dev/misc/psaux",' > /tmp/xf86conf
mv /tmp/xf86conf /etc/X11/XF86Config
#!/bin/sh
for screen in $(screen -ls | awk '/Detached/ { print $1 }'); do
echo screen -Ux $screen;
screen -Ux $screen;
done
#!/bin/sh
torrent="$1"
logfile="$2"
echo "Logging to $logfile"
#btdownloadheadless --max_upload_rate 1 "$torrent" > "$logfile" 2>&1
btdownloadheadless --display_interval 10 --max_upload_rate 1 "$torrent" 2>&1 | tee "$logfile"
#!/bin/sh
# Nico Schottelius
# find succussfully downloaded torrents
TOPABS=$(cd $(dirname $0); pwd -P)
TORDIR="$TOPABS/torrents"
LOGDIR="$TOPABS/logs"
OUTDIR="$TOPABS/out"
SAVEDIR="$TOPABS/fertig"
SAVETOR="$SAVEDIR/torrents"
SEARCHTERM='time left: Download Succeeded!'
TESTLINES="20"
# place downloads into current diretory/out
cd "$LOGDIR"
#for torrent in ${TORDIR}/*; do
for log in *; do
tail -n${TESTLINES} "$log" | grep -q "$SEARCHTERM" >/dev/null
if [ "$?" -eq 0 ]; then
echo "$log" finished.
file=$(tail -n${TESTLINES} "$log" | awk -F: '/^download to:/ { print $2 }' | tail -n1 | sed 's;^ */;/;')
mv "${file}" "${SAVEDIR}"
mv "${TORDIR}/${log}" "${SAVETOR}"
rm "$log"
fi
done
time left: Download Succeeded!
for file in logs/*;
do
echo -n "${file}: ";
tail -n20 "$file" | grep "percent done:" | tail -n1;
done
#!/bin/sh
#set -x
TOPABS=$(cd $(dirname $0); pwd -P)
TORDIR="$TOPABS/torrents"
LOGDIR="$TOPABS/logs"
OUTDIR="$TOPABS/out"
DNLOADR="$TOPABS/downloader.sh"
rm -f "${LOGDIR}/"*
# place downloads into current diretory/out
cd "$OUTDIR"
for torrent in ${TORDIR}/*; do
logfile="$LOGDIR/$(basename "$torrent")"
#echo screen -d -m btdownloadcurses --max_upload_rate 1 "$torrent" G "$logfile"
#screen -d -m btdownloadheadless --max_upload_rate 1 "$torrent" > "$logfile"
screen -d -m "$DNLOADR" "$torrent" "$logfile"
done
#!/bin/sh
#PIDS=$(ps axuwww | awk '/\/usr\/bin\/btdownloadcurses/ { print $2 }')
PIDS=$(ps axuwww | awk '/\/usr\/bin\/btdownloadheadless/ { print $2 }')
kill -TERM $PIDS
sleep 10
kill -KILL $PIDS 2>/dev/null
#!/bin/sh
scp *torrent zuhause.schottelius.org:torrent/t/ && rm *torrent
#!/bin/sh
# Nico Schottelius
# Date: Mit Nov 9 12:57:04 CET 2005
# Last Modified: Thu Nov 10 12:53:00 CET 2005
#
# Install latest git and cogito to $INSTALL_PREFIX/$name and
# link the binaries to $BINDIR
# Needs git and cogito to work!
# And:
# - libexpat-dev
# - libcurl3-dev
# - libssl-dev
# - libz-dev
#
# Configuration
#
BUILDDIR=${BUILDDIR:-/home/user/nico/build}
INSTALL_PREFIX=${INSTALL_PREFIX:-/usr/packages}
BINDIR=${BINDIR:-/usr/local/bin}
MAKE=${MAKE:-make}
#
# No configuration needed below here
#
BASE_GET=http://www.kernel.org/pub/scm/
PROJECTS="git cogito"
# urls for initial cloning
git_url=http://www.kernel.org/pub/software/scm/git/
cogito_url=http://www.kernel.org/pub/software/scm/cogito/
error_in()
{
echo "[failed] $1"
echo "Exiting now."
exit 1
}
for project in $PROJECTS; do
echo "Working on $project (in $BUILDDIR/$project) ... "
# Test for existence: if git or cogito is missing, install it from
# the current archive
which $project > /dev/null
if [ $? -ne 0 ]; then
echo "$project not found, installing from archive"
eval base_url=\$${project}_url
get_url=$(lynx -dump "$base_url" | awk "/$project-([0-9]\.)*tar.bz2\$/ { print \$2 }" | sort -n | tail -n 1)
echo "Retrieving $project from $get_url"
fi
if [ ! -d "$BUILDDIR/$project" ]; then
echo "Cloning $project"
cg-clone "${BASE_GET}${project}/${project}.git" "$BUILDDIR/$project"
else
echo "Updating $project from \"origin\""
cd "$BUILDDIR/$project" || error_in "$BUILDDIR/$project"
cg-update origin
fi
if [ $? -ne 0 ]; then
echo "Pull or clone failed, ABORTING."
exit 23
fi
cd "$BUILDDIR/$project"
version=$(cg-object-id)
echo "Installing $project (Version: $version)"
DDIR=$INSTALL_PREFIX/$project-$version
$MAKE clean || error_in "Cleaning $project"
$MAKE "prefix=$DDIR" all || error_in "Building $project"
$MAKE "prefix=$DDIR" install || error_in "Installing $project"
echo "Linking files to $BINDIR ..."
for file in "$DDIR/bin/"*; do
ln -sf $file "$BINDIR" || error_in "Linking $file"
done
done
/home/users/nico/localch/vcs/sysadmin-logs/update-puppet-on-host
\ No newline at end of file
#!/bin/sh
# Open vim
# x-terminal-emulator -e vim "$@"
urxvt -e vim "$@"
#!/bin/sh -e
# Nico Schottelius, 20080910 11:09
# The initial version
#
# udhcpc -nfqi wlp0s3 && vpnc ~nico/ethz/vpn/pc.conf
#
# Failed due to many reasons. See the working hack/version below.
#
if [ "$#" -ge 1 ]; then
dev=$1; shift
else
dev=wlp3s0
dev=wlan0
dev=wlp2s0
dev=wlp1s0
dev=wlp4s0
dev=wlp3s0
fi
set -x
set +e
wpa_cli terminate || true
#rmmod b43 bcma
sleep 1
#modprobe b43
set -e
#ip l s eth0 down
# Ensure previous wpa_supplicant is not running
( wpa_cli terminate || exit 0 )
# Ensure the adapter works, reloading the driver helps
# ( rmmod iwlagn; modprobe iwlagn; sleep 2 )
# wpa_supplicant -B -Dwext -iwlp0s3 -c /etc/wpa_supplicant/wpa_supplicant.conf
# wpa_supplicant -B -Dwext -i$dev -c /etc/wpa_supplicant/wpa_supplicant.conf
#wpa_supplicant -B -Dnl80211 -i$dev -c /etc/wpa_supplicant/wpa_supplicant.conf
wpa_supplicant -B -Dnl80211 -i$dev -c /etc/wpa_supplicant/wpa_supplicant-${dev}.conf
# Give wpa some time to connect
sleep 5
# Choose an dhcp client
( udhcpc -nqfi $dev || dhcpcd )
wpa_cli
# vpnc ~nico/ethz/vpn/sg.conf
#vpnc ~nico/firmen/ethz/vpn/vpnc.conf
# vpnc-disconnect
#!/bin/sh
x-off
xrandr --output HDMI1 --auto --rotate normal --left-of eDP1
xrandr --output DP1 --auto --rotate normal --left-of eDP1
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment