diff options
author | Patrick Simianer <p@simianer.de> | 2014-08-10 11:34:06 +0100 |
---|---|---|
committer | Patrick Simianer <p@simianer.de> | 2014-08-10 11:34:06 +0100 |
commit | 33b179f94342ffc08d53a66adcbdae5a331570a9 (patch) | |
tree | c3564bdaa3a4d40f38d79e9ba0bf581bb154e4a6 | |
parent | 5869505d64c04c536bdcd71a197ade918c36bf1c (diff) |
fixes
-rw-r--r-- | README.md | 14 | ||||
-rw-r--r-- | backup-2pac.exclude | 1 | ||||
-rwxr-xr-x | chromium | 1 | ||||
-rw-r--r-- | func.zsh | 1 | ||||
-rwxr-xr-x | magnet | 1 | ||||
-rw-r--r--[-rwxr-xr-x] | thinkwatt | 11 | ||||
-rwxr-xr-x | upgrade-kernel | 9 | ||||
-rwxr-xr-x | xfs-raid | 3 |
8 files changed, 27 insertions, 14 deletions
diff --git a/README.md b/README.md new file mode 100644 index 0000000..56963c9 --- /dev/null +++ b/README.md @@ -0,0 +1,14 @@ +stuff for ~/bin + +contains code from third-parties: +* 256colors https://github.com/joejulian/xterm/blob/master/vttests/256colors2.pl +* blink http://pikeypl.com/index.php?show=code&menu=software&language=bash&code=blink.sh +* pdf2png http://bruxy.regnet.cz/ +* ratcpi https://github.com/jbaber/ratpoison_scripts +* spark https://github.com/holman/spark +* stopwatch http://www.thelinuxdaily.com/2012/03/simple-stopwatch-script/ +* strip-tags http://savvyadmin.com/strip-all-unwanted-mp3-id3-tags/ +* tatort-dl http://gareus.org/wiki/tatort-dl +* thinkwatt https://github.com/mikar/thinkwatt +* xfs-raid http://www.mythtv.org/wiki/Optimizing_Performance#Optimizing_XFS_on_RAID_Arrays + diff --git a/backup-2pac.exclude b/backup-2pac.exclude index 6fb95fc..571287a 100644 --- a/backup-2pac.exclude +++ b/backup-2pac.exclude @@ -1,5 +1,4 @@ /dev -/home/remote /media /mnt /proc @@ -1,4 +1,5 @@ #!/bin/zsh + /usr/bin/chromium-browser --no-referrers --user-agent="\"$(shuf -n 1 /home/pks/bin/user-agents)\"" ${1+"$@"} 2>/dev/null & @@ -1,3 +1,4 @@ + check_root() { if [ `whoami` != root ]; then echo "Run this script as root, exiting!"; exit; fi @@ -1,5 +1,6 @@ #!/bin/bash + cd ~/z [[ "$1" =~ xt=urn:btih:([^&/]+) ]] || exit; echo "d10:magnet-uri${#1}:${1}e" > "meta-${BASH_REMATCH[1]}.torrent" diff --git a/thinkwatt b/thinkwatt index fbdeb94..aa408b9 100755..100644 --- a/thinkwatt +++ b/thinkwatt @@ -32,8 +32,8 @@ EOF errorout() { echo "error: $*" >&2; exit 1; } check_ac() { - local acfile=/sys/class/power_supply/AC/online - [[ $(cat "$acfile") = 0 ]] || errorout 'please unplug the ac adapater first' + [[ "$quiet" ]] && return 0 + [[ $(cat /sys/class/power_supply/*/online) = 0 ]] || echo 'it seems your AC adapter is plugged in' } check_datafile() { [[ -f "$@" ]] || errorout "$@ does not exist" @@ -43,6 +43,7 @@ check_datafile() { [[ "$valid_data" ]] || errorout "$@ does not contain valid data" } countdown() { + [[ "$quiet" ]] || echo "ctrl+c to plot/exit" if [[ "$seconds" =~ ^[0-9]+$ ]];then # count down secs="$seconds" @@ -66,13 +67,13 @@ countdown() { wait done fi - echo + echo } # if we abort the recording process with ctrl+c this will give the option to plot the already recorded data trap ctrl_c INT function ctrl_c() { echo - read -p "plot already recorded data before exiting? y/n " + read -p "plot data? y/n " [[ "$REPLY" = "y" ]] && die=yes || exit 0 } # }}} @@ -126,7 +127,7 @@ record() { if [[ "$SMAPI" ]];then local powerfile=/sys/devices/platform/smapi/BAT0/power_now else - echo "for more accurate results use tp_smapi" + echo "for more accurate results with thinkpads use tp_smapi" local powerfile=/sys/class/power_supply/BAT0/power_now fi diff --git a/upgrade-kernel b/upgrade-kernel index d0ecb19..dd57678 100755 --- a/upgrade-kernel +++ b/upgrade-kernel @@ -1,10 +1,7 @@ #!/bin/sh -# -# NOTE: call from kernel source dir -# - +if [ ! -f .config ]; then echo "Call from kernel source dir!"; exit; fi V=`pwd | ruby -e "puts STDIN.gets.split('/').last.split('-').last"` make mrproper cp -v ../config .config @@ -15,9 +12,9 @@ sudo /sbin/lilo sudo rm /usr/src/linux sudo ln -s $(pwd) /usr/src/linux cd /home/pks/src/tp_smapi/ -sudo make install KVER=$V KSRC=/home/pks/stuff/kernelbuild/linux-$V KBUILD=/home/pks/stuff/kernelbuild/linux-$V +sudo make install KVER=$V KSRC=/home/pks/var/kernelbuild/linux-$V KBUILD=/home/pks/var/kernelbuild/linux-$V sudo make clean -sudo chown -R pks:pks * .* /home/pks/src/tp_smapi/ /home/pks/stuff/kernelbuild/linux-* +sudo chown -R pks:pks * .* /home/pks/src/tp_smapi/ /home/pks/var/kernelbuild/linux-* echo "=================" cd /lib/modules/ pwd @@ -1,11 +1,10 @@ #!/bin/bash -# source: http://www.mythtv.org/wiki/Optimizing_Performance#Optimizing_XFS_on_RAID_Arrays BLOCKSIZE=512 # Make sure this is in bytes CHUNKSIZE=128 # Make sure this is in KiB NUMSPINDLES=3 RAID_TYPE=5 RAID_DEVICE_NAME="/dev/md0" # Specify device name for your RAID device -FSLABEL="stor5" # specify filesystem label for generating mkfs line here +FSLABEL="name" # specify filesystem label for generating mkfs line here case "$RAID_TYPE" in 0) |