summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Simianer <p@simianer.de>2014-08-10 11:34:06 +0100
committerPatrick Simianer <p@simianer.de>2014-08-10 11:34:06 +0100
commit33b179f94342ffc08d53a66adcbdae5a331570a9 (patch)
treec3564bdaa3a4d40f38d79e9ba0bf581bb154e4a6
parent5869505d64c04c536bdcd71a197ade918c36bf1c (diff)
fixes
-rw-r--r--README.md14
-rw-r--r--backup-2pac.exclude1
-rwxr-xr-xchromium1
-rw-r--r--func.zsh1
-rwxr-xr-xmagnet1
-rw-r--r--[-rwxr-xr-x]thinkwatt11
-rwxr-xr-xupgrade-kernel9
-rwxr-xr-xxfs-raid3
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
diff --git a/chromium b/chromium
index c0f60ff..39c6931 100755
--- a/chromium
+++ b/chromium
@@ -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 &
diff --git a/func.zsh b/func.zsh
index 470f5db..bf5b3d2 100644
--- a/func.zsh
+++ b/func.zsh
@@ -1,3 +1,4 @@
+
check_root()
{
if [ `whoami` != root ]; then echo "Run this script as root, exiting!"; exit; fi
diff --git a/magnet b/magnet
index c60297d..b1b20ee 100755
--- a/magnet
+++ b/magnet
@@ -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
diff --git a/xfs-raid b/xfs-raid
index 29963f1..97ee225 100755
--- a/xfs-raid
+++ b/xfs-raid
@@ -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)