From f5a8cd1259decb311e0d425db3ad8885e51774c8 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Mon, 28 Dec 2009 20:14:14 +0100 Subject: [PATCH] add files that are living in ~/bin for a while Signed-off-by: Nico Schottelius --- conkeror | 1 + conkeror-spawn-helper | 1 + eth/bonnie-graphs.sh | 13 ++++++++ eth/bonnie.html | 71 ++++++++++++++++++++++++++++++++++++++++++ eth/swisscom-vpn.sh | 7 +++++ eth/system-test.sh | 42 +++++++++++++++++++++++++ eth/ts.sh | 9 ++++++ git-fetch-merge-all.sh | 45 ++++++++++++++++++++++++++ hsztwlan.sh | 7 +++++ mp | 5 +++ permissions.web | 10 ++++++ rtorrent_mail.sh | 2 ++ stressall.sh | 5 +++ testdisks.sh | 27 ++++++++++++++++ x-terminal-emulator | 3 ++ xrandr-update.sh | 6 ++++ 16 files changed, 254 insertions(+) create mode 120000 conkeror create mode 120000 conkeror-spawn-helper create mode 100755 eth/bonnie-graphs.sh create mode 100644 eth/bonnie.html create mode 100755 eth/swisscom-vpn.sh create mode 100644 eth/system-test.sh create mode 100755 eth/ts.sh create mode 100755 git-fetch-merge-all.sh create mode 100755 hsztwlan.sh create mode 100755 mp create mode 100755 permissions.web create mode 100755 rtorrent_mail.sh create mode 100644 stressall.sh create mode 100755 testdisks.sh create mode 100755 x-terminal-emulator create mode 100755 xrandr-update.sh diff --git a/conkeror b/conkeror new file mode 120000 index 0000000..972132b --- /dev/null +++ b/conkeror @@ -0,0 +1 @@ +/home/users/nico/b/conkeror/contrib/run-conkeror \ No newline at end of file diff --git a/conkeror-spawn-helper b/conkeror-spawn-helper new file mode 120000 index 0000000..ce1b63d --- /dev/null +++ b/conkeror-spawn-helper @@ -0,0 +1 @@ +/home/users/nico/b/conkeror/conkeror-spawn-helper \ No newline at end of file diff --git a/eth/bonnie-graphs.sh b/eth/bonnie-graphs.sh new file mode 100755 index 0000000..9e1bdee --- /dev/null +++ b/eth/bonnie-graphs.sh @@ -0,0 +1,13 @@ +#!/bin/sh + +out=bonnie.html +hosts="root@sgss5520ur01:/root/bonnie-mnt3 root@sgsr61001:/root/bonnie-local2" +tmp=$(mktemp -d /tmp/anyhow.XXXXXXXXXXXXX) + +for host in $hosts; do + scp $host $tmp +done + +cat $tmp/* | bon_csv2html > $out + +echo rm -rf "$tmp" diff --git a/eth/bonnie.html b/eth/bonnie.html new file mode 100644 index 0000000..0e4e004 --- /dev/null +++ b/eth/bonnie.html @@ -0,0 +1,71 @@ + + +Bonnie++ V1.03e Benchmark results + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Sequential OutputSequential InputRandom
Seeks
Sequential CreateRandom Create
Size:Chunk SizePer CharBlockRewritePer CharBlockNum FilesCreateReadDeleteCreateReadDelete
K/sec% CPUK/sec% CPUK/sec% CPUK/sec% CPUK/sec% CPU/ sec% CPU/ sec% CPU/ sec% CPU/ sec% CPU/ sec% CPU/ sec% CPU/ sec% CPU
sgsr6100148G657538278869133390767600491773026277.30643591192++++++++96482993939399++++++++97550100
sgsr6100148G710588879082143383467671791773496279.30643587594++++++++83248993751298++++++++8892099
sgsr6100148G648298278625133399367646891773486277.90643550792++++++++971171003835599++++++++9924599
sgsr6100148G717018977954133393367611591770636260.90643878599++++++++96453993453694++++++++5137153
sgsr6100148G713888877637133389767619991769356265.40643681399++++++++955511003587099++++++++7171279
sgsr6100148G709089078200133394567683592773536272.10643823799++++++++97041993440099++++++++8754191
sgsr6100148G705488979044133383967661692773106275.70643674594++++++++95941993780699++++++++9633099
sgsr6100148G700798978439133386067639291771276268.10643838499++++++++962851003789299++++++++7309074
sgsr6100148G708888878635143388167703792773466277.20643867799++++++++962771003842399++++++++7438779
sgsr6100148G656298179380143379067654291772486279.00643571495++++++++96771993704499++++++++98039100
sgsr6100148G707318879882143375867658391773056272.50643670296++++++++97334993740799++++++++9660599
sgsr6100148G703818978799133382667674892772956273.60643503693++++++++98061993590599++++++++101660100
sgsr6100148G700088779536143374367668991773106275.20643395195++++++++97018993859199++++++++99202100
sgsr6100148G700108778279143394667671791773526274.60643602594++++++++985711003683799++++++++9802799
sgsr6100148G700998878873133386267693092773066279.40643697199++++++++958741003723599++++++++9745999
sgsr6100148G708448778292133393467661992773126279.60643589094++++++++985211003752099++++++++97987100
sgsr6100148G643408278533133389067697492773366275.40643629797++++++++99438993774798++++++++7378075
sgsr6100148G704688778672133389667681992773026278.60643636493++++++++97647993660998++++++++9990299
sgsr6100148G657708278660133393167669792773306278.90643558494++++++++972501003576399++++++++9820799
sgsr6100148G709318878705133387267665392773356278.70643459593++++++++95670993832799++++++++97588100
sgsr6100148G657748378968143376367708192772836277.20643556495++++++++968881003869398++++++++9785299
sgsr6100148G712018877954133387267640992770756264.70643880899++++++++98085993777499++++++++7618079
sgsr6100148G709969178076133384067643391769796261.00643561199++++++++980311003559699++++++++97464100
sgsr6100148G705888978518133385567665091773086280.00643496092++++++++96657993776399++++++++9836099
sgss5520ur0148G60001989031018454799580698910821012108.00647743092++++++++96620996805080++++++++8002684
sgss5520ur0148G58996989010518453059580598810820812108.90647571893++++++++68553716735279++++++++9039596
sgss5520ur0148G59456988978218453369568708710820812110.10647676992++++++++95635996529978++++++++9485199
sgss5520ur0148G59726989002318453919576698810830612108.20647573591++++++++69708735958171++++++++94869100
sgss5520ur0148G59368988955218453419580038910817512108.00647670293++++++++96855996431178++++++++93140100
sgss5520ur0148G58814988993918453829578198910835612107.90646663182++++++++937121005307963++++++++94472100
sgss5520ur0148G59129988989718454579566388710824512108.70647710692++++++++98435995572366++++++++97098100
sgss5520ur0148G59657988970918452649581518910820812108.00646309175++++++++958561005204062++++++++96428100
sgss5520ur0148G59365989002118452329576858910821412110.00645825670++++++++95465996552179++++++++8411489
sgss5520ur0148G58694988948518453489576588810823712108.80647495190++++++++71109725603067++++++++9408499
sgss5520ur0148G59634988924318453769571058710814812108.70647635091++++++++71828757686591++++++++9457199
sgss5520ur0148G59523988976818453699576478810825712108.00647812793++++++++95588996598177++++++++9774899
sgss5520ur0148G59767989026718452799578608810815712108.50647635993++++++++67447715151261++++++++93454100
sgss5520ur0148G59049988933718451629583718910818511108.40647560692++++++++947821005478365++++++++9437599
sgss5520ur0148G59458988992218452219578968910820012108.10647789194++++++++95164996247875++++++++97582100
sgss5520ur0148G59749989000118452909575038810822212109.00647583192++++++++96297995355764++++++++9436499
sgss5520ur0148G59351988951618452589573478810814812108.80647630991++++++++981791006405377++++++++9452599
sgss5520ur0148G58952988936218445329571128710828212108.50647810094++++++++982081005630066++++++++9497599
sgss5520ur0148G58985988643617438508566188710402010104.70647217687++++++++74292785077560++++++++93842100
sgss5520ur0148G59376988705317438319565618610411411103.50647620392++++++++97907995149861++++++++9448999
sgss5520ur0148G59305988678417437558562878610405011105.90646127175++++++++97221995082560++++++++9317099
sgss5520ur0148G58621988656317437418561098610397911105.30647595192++++++++63413665524165++++++++93281100
sgss5520ur0148G59365988678017437198566568610395311104.90645964272++++++++948621005085460++++++++9455199
sgss5520ur0148G59398988706417438258567058710392911103.90646654380++++++++94912995172461++++++++92049100
+ + diff --git a/eth/swisscom-vpn.sh b/eth/swisscom-vpn.sh new file mode 100755 index 0000000..a8a3837 --- /dev/null +++ b/eth/swisscom-vpn.sh @@ -0,0 +1,7 @@ +#!/bin/sh +set -e +set -x +iwconfig wlan0 essid MOBILE +sleep 2 +udhcpc -nfqi wlan0 +vpnc ~nico/ethz/vpn/pc diff --git a/eth/system-test.sh b/eth/system-test.sh new file mode 100644 index 0000000..b4c9992 --- /dev/null +++ b/eth/system-test.sh @@ -0,0 +1,42 @@ +#!/bin/sh + +# 1. collect information about the system: +# - cpu +# - memory +# - lshw +# - dmesg +# - +# 2. test memory +# 2. test harddrive +# - raid? +# - performance +# test reboots +# +# + +cores="$1"; shift +scratch="$1"; shift +mem="$1"; shift + +# 7d +cpuburn + +# 7d +stress -i "$cores" + +# 64 samples +wget http://www.coker.com.au/bonnie++/bonnie++-1.03d.tgz +tar xfvz bonnie++-1.03d.tgz +cd bonnie++-1.03d +./configure && make +cd $scratch + +bonnie++ -d . -s 36g -n 256 -n 64 -u 0 | tee /root/bonnie-mnt + +# +iozone -A + +# 24h +reboot + +# netperf diff --git a/eth/ts.sh b/eth/ts.sh new file mode 100755 index 0000000..f615fdc --- /dev/null +++ b/eth/ts.sh @@ -0,0 +1,9 @@ +#!/bin/sh +# Nico Schottelius +# 2009-07-24 +# Connect to a terminal server + +opts="-u nicosc -d d -g 1260x780" +# use xrandr -q | awk '/\*/ { print $1 }' later + +rdesktop $opts sgterm1.inf.ethz.ch || rdesktop $opts sgterm2.inf.ethz.ch diff --git a/git-fetch-merge-all.sh b/git-fetch-merge-all.sh new file mode 100755 index 0000000..351dce4 --- /dev/null +++ b/git-fetch-merge-all.sh @@ -0,0 +1,45 @@ +#!/bin/sh +# +# 2009 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 . +# +# +# Fetches all remotes and merges tracked trees +# +# Idea is to track only interesting remote branches (see linux/likenext-init.sh) +# + +failed="" + +# update first, so we can continue to work if we go offline later +for remote in $(git remote); do + git fetch -v "$remote" +done + +# merge +for rbranch in $(git branch -r); do + if ! git merge "$rbranch"; then + failed="$failed $rbranch" + git reset --hard + fi +done + +if [ "$failed" ]; then + echo "Failed merges: $failed" + exit 1 +fi + diff --git a/hsztwlan.sh b/hsztwlan.sh new file mode 100755 index 0000000..aeee907 --- /dev/null +++ b/hsztwlan.sh @@ -0,0 +1,7 @@ +#!/bin/sh + +ip l s eth0 down +ip l s wlan0 up +iwconfig wlan0 essid hotspot-hsz-t +udhcpc -nfqi wlan0 + diff --git a/mp b/mp new file mode 100755 index 0000000..ca5e4de --- /dev/null +++ b/mp @@ -0,0 +1,5 @@ +#!/bin/sh +dir="${HOME}/privat/freunde/" +file="mobile.nummer" + +cat "${dir}/$1/${file}" diff --git a/permissions.web b/permissions.web new file mode 100755 index 0000000..dd8669e --- /dev/null +++ b/permissions.web @@ -0,0 +1,10 @@ +#!/bin/sh + +# +# /usr/bin is obsolete +# /usr/lib is obsolete +# /usr/*/{bin,lib,...} is now the correct path +# + +find "$1" -type f -exec chmod 0644 {} \; +find "$1" -type d -exec chmod 0755 {} \; diff --git a/rtorrent_mail.sh b/rtorrent_mail.sh new file mode 100755 index 0000000..97df189 --- /dev/null +++ b/rtorrent_mail.sh @@ -0,0 +1,2 @@ +#!/bin/sh +echo "$(date) : $1 - Download completed." | mail -s "[rtorrent] - Download completed : $1" nico-rtorrent-notify@schottelius.org diff --git a/stressall.sh b/stressall.sh new file mode 100644 index 0000000..d514370 --- /dev/null +++ b/stressall.sh @@ -0,0 +1,5 @@ +#!/bin + +count="$1" + + diff --git a/testdisks.sh b/testdisks.sh new file mode 100755 index 0000000..2f23c7a --- /dev/null +++ b/testdisks.sh @@ -0,0 +1,27 @@ +#!/bin/sh +# Nico Schottelius +# 2007-05-21 +# Script used to test our fbsd dell servers +# => kills it +# => runs fine on my linux workstation :( + +sequences=10 +forks=50 +count=140240 +tmp=/tmp/testdisks +dev=/dev/zero + +i=0 + +while [ "$i" -lt "$sequences" ]; do + echo "Run: $i ..." + k=0 + while [ "$k" -lt "$forks" ]; do + file=$(mktemp "$tmp/$(basename $0).XXXXXXXXXXXXXXXX") + ( dd if=$dev of="$file" bs=512 count=$count; rm -f "$file" ) & + k=$(($k+1)) + done + echo "Waiting ..." + wait + i=$(($i+1)) +done diff --git a/x-terminal-emulator b/x-terminal-emulator new file mode 100755 index 0000000..76f0b0a --- /dev/null +++ b/x-terminal-emulator @@ -0,0 +1,3 @@ +#!/bin/sh + +exec urxvtc diff --git a/xrandr-update.sh b/xrandr-update.sh new file mode 100755 index 0000000..5044e8e --- /dev/null +++ b/xrandr-update.sh @@ -0,0 +1,6 @@ +#!/bin/sh +# Enable connected, disable disconnected outputs + +for output in $(xrandr -q | grep -v ^Screen | awk '/^[^ ]/ { print $1 }'); do + xrandr --output $output --auto +done