diff options
| author | miguel <miguel@megaloman.softwarefools.com> | 2021-01-24 21:33:31 +0100 |
|---|---|---|
| committer | miguel <miguel@megaloman.softwarefools.com> | 2021-01-24 21:33:31 +0100 |
| commit | 115a65be0583658a7f39a7abaeb2401448f0d7c9 (patch) | |
| tree | 3c75fc44222b72f11900d098da5d5ff157c19542 | |
| parent | 5ec428a0c177025b9c04330ae3f39cbde27a2d81 (diff) | |
add some stuff from megaloman
| -rw-r--r-- | 502.sh | 6 | ||||
| -rw-r--r-- | backup.sh | 2 | ||||
| -rw-r--r-- | backup_ex40_root.sh | 1 | ||||
| -rwxr-xr-x | migdon/bash_migdeon.sh | 17 | ||||
| -rwxr-xr-x | migdon/migdon.py | 28 | ||||
| -rw-r--r-- | migdon/migdon_wrapper.sh | 2 | ||||
| -rwxr-xr-x | miguel_backup.sh | 61 | ||||
| -rw-r--r-- | mount_acer.sh | 1 | ||||
| -rwxr-xr-x | penis.sh | 8 | ||||
| -rwxr-xr-x | retardX11.sh | 17 | ||||
| -rwxr-xr-x | show_backup_diffs.sh | 9 | ||||
| -rwxr-xr-x | status.sh | 10 | ||||
| -rwxr-xr-x | terminalcols.sh | 16 | ||||
| -rwxr-xr-x | tunnel.sh | 25 | ||||
| -rwxr-xr-x | vnc_blackeye.sh | 1 | ||||
| -rw-r--r-- | wacom.sh | 24 |
16 files changed, 228 insertions, 0 deletions
@@ -0,0 +1,6 @@ +for id in `xinput --list|grep 'Logitech Gaming Mouse G502'|perl -ne 'while (m/id=(\d+)/g){print "$1\n";}'`; do + echo "setting device ID $id" + #notify-send -t 50000 'Mouse fixed' + xinput set-prop $id "Device Accel Velocity Scaling" 100 + xinput set-prop $id "Device Accel Constant Deceleration" 200 +done diff --git a/backup.sh b/backup.sh new file mode 100644 index 0000000..ce7d70c --- /dev/null +++ b/backup.sh @@ -0,0 +1,2 @@ +cd /home/miguel +tar --exclude=mnt --exclude=.stack --exclude=.cache --exclude==zsyp -cf home_miguel.tar . diff --git a/backup_ex40_root.sh b/backup_ex40_root.sh new file mode 100644 index 0000000..5e5ac22 --- /dev/null +++ b/backup_ex40_root.sh @@ -0,0 +1 @@ +sudo tar --exclude='/home' --exclude='/proc' --exclude='/dev' --exclude='/sys' -cvf /home/miguel/backup_ex40_root.tar / diff --git a/migdon/bash_migdeon.sh b/migdon/bash_migdeon.sh new file mode 100755 index 0000000..95bd7ca --- /dev/null +++ b/migdon/bash_migdeon.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +PPID=`ps -o ppid -p $$` + +echo parent PID $PPID + +PTTY=`ps -p $PPID -o tty --no-headers` + +echo parent TTY $PTTY + +while IFS= read -r line; do + echo "read one line"; +done + +while IFS= read -r line; do + echo "read one line 2"; +done < /dev/$PTTY diff --git a/migdon/migdon.py b/migdon/migdon.py new file mode 100755 index 0000000..3e03193 --- /dev/null +++ b/migdon/migdon.py @@ -0,0 +1,28 @@ +#!/usr/bin/env python + +import fileinput +import os +import sys +import shlex +import subprocess +import re + +colourFormat = '\033[{0}m' +colourStr = colourFormat.format(32) +resetStr = colourFormat.format(0) + +#while True: +# try: +# c = sys.stdin.buffer.read(1) +# except EOFError: +# print("EOF") +# break; +# print(c) +# sys.stdout.buffer.write(c) + +for line in fileinput.input(): +# print re.sub(r'([0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3})', colourStr+ r'\1' + resetStr, line), + ips=re.findall(r'([0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3})', line) + for ip in ips: + print "ipv4 detected: "+colourStr+ip+resetStr + diff --git a/migdon/migdon_wrapper.sh b/migdon/migdon_wrapper.sh new file mode 100644 index 0000000..8f79f06 --- /dev/null +++ b/migdon/migdon_wrapper.sh @@ -0,0 +1,2 @@ +TTY=$(tty) +bash | ./migdon.py > $TTY diff --git a/miguel_backup.sh b/miguel_backup.sh new file mode 100755 index 0000000..63a58c7 --- /dev/null +++ b/miguel_backup.sh @@ -0,0 +1,61 @@ +#!/bin/bash + +# tar -cf /mnt/DATA/DATA/20180803_miguel_int.tar /mnt/DATA/DATA/INT/ +# tar --exclude="/home/miguel/ext" --exclude="/home/miguel/int_archive" --exclude="/home/miguel/temp" -cf /mnt/DATA/DATA/20180803_miguel.tar /home/miguel/ + +#TODO: /usr/local +#TODO: keep multiple backup-points in sync! + +PROGRAMM="Miguel's Foolish Backuper" +VERSION="0.1" +TIMESTAMP=`date +"%Y%m%d_%H%M%S"` + +#TARGET=/mnt/DATA/BACKUP +#TARGET=/mnt/PENIS/BACKUP +TARGET=/mnt/BACKUP/BACKUP + +echo $PROGRAMM +echo $TARGET +echo $TIMESTAMP + +# we exit as soon as a single command fails! +set -e + +sudo tar \ + -C /home/miguel \ + --exclude='./.cache' \ + --exclude='./.stack' \ + --exclude='./opt' \ + --exclude='./Downloads' \ + -cf - . | pv > ${TARGET}/${TIMESTAMP}_home_miguel.tar + +sudo tar \ + -C /home/miguel/int \ + -cf - . | pv > ${TARGET}/${TIMESTAMP}_home_miguel_int.tar +## +## sudo tar \ +## -C /usr/local \ +## -cf - . | pv > ${TARGET}/${TIMESTAMP}_usr_local.tar +## +## sudo tar \ +## -C / \ +## --exclude='./home' \ +## --exclude='./mnt' \ +## --exclude='./media' \ +## \ +## --exclude='./proc' \ +## --exclude='./run' \ +## --exclude='./dev' \ +## --exclude='./sys' \ +## \ +## --exclude='./tmp' \ +## --exclude='./usr' \ +## --exclude='./var/log' \ +## --exclude='./var/cache' \ +## \ +## --exclude='./var/lib/docker' \ +## --exclude='./var/lib/mlocate' \ +## --exclude='./var/lib/apt' \ +## --exclude='./var/lib/dpkg' \ +## -cf - . | pv > ${TARGET}/${TIMESTAMP}_root.tar +## diff --git a/mount_acer.sh b/mount_acer.sh new file mode 100644 index 0000000..1c9df94 --- /dev/null +++ b/mount_acer.sh @@ -0,0 +1 @@ +sshfs miguel@192.168.0.206:/home/miguel/BACKUPS /mnt/ACER/ diff --git a/penis.sh b/penis.sh new file mode 100755 index 0000000..10e63e3 --- /dev/null +++ b/penis.sh @@ -0,0 +1,8 @@ +#!/bin/sh +DISPLAY=:0.0 +XAUTHORITY=/home/miguel/.Xauthority + +notify-send "Penis Drive Detected!" +date >> /home/miguel/penis.log +echo $(whoami) >> /home/miguel/penis.log +echo dupa >> /home/miguel/penis.log diff --git a/retardX11.sh b/retardX11.sh new file mode 100755 index 0000000..3be0261 --- /dev/null +++ b/retardX11.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +case $1 in + start) + echo starting retard X access + xhost +SI:localuser:retard + sudo su retard + ;; + + stop) + echo stopping retard X access + xhost -SI:localuser:retard + ;; + + *) + echo "stop or start?" +esac diff --git a/show_backup_diffs.sh b/show_backup_diffs.sh new file mode 100755 index 0000000..e2d5c36 --- /dev/null +++ b/show_backup_diffs.sh @@ -0,0 +1,9 @@ +#!/bin/sh + +# use -c to enforce chekcsum comparison as well +echo BACKUP against DATA +rsync -nrv --delete /mnt/BACKUP/BACKUP/ /mnt/DATA/BACKUP/ +echo BACKUP against PENIS +rsync -nrv --delete /mnt/BACKUP/BACKUP/ /mnt/PENIS/BACKUP/ +echo PENIS against DATA +rsync -nrv --delete /mnt/PENIS/BACKUP/ /mnt/DATA/BACKUP/ diff --git a/status.sh b/status.sh new file mode 100755 index 0000000..55fc00a --- /dev/null +++ b/status.sh @@ -0,0 +1,10 @@ +#!/bin/sh +echo --------------------------------------------------- +cat /proc/mdstat +echo --------------------------------------------------- +sudo virsh list +echo --------------------------------------------------- +df -h +echo --------------------------------------------------- +last -x shutdown -x reboot | head -n4 +sleep 1 diff --git a/terminalcols.sh b/terminalcols.sh new file mode 100755 index 0000000..b681365 --- /dev/null +++ b/terminalcols.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +#https://askubuntu.com/questions/27314/script-to-display-all-terminal-colors + +for x in {0..8}; do + for i in {30..37}; do + for a in {40..47}; do + echo -ne "\e[$x;$i;$a""m\\\e[$x;$i;$a""m\e[0;37;40m " + done + echo + done +done + +echo "" + +# oneliner : for x in {0..8}; do for i in {30..37}; do for a in {40..47}; do echo -ne "\e[$x;$i;$a""m\\\e[$x;$i;$a""m\e[0;37;40m "; done; echo; done; done; echo "" diff --git a/tunnel.sh b/tunnel.sh new file mode 100755 index 0000000..7368a40 --- /dev/null +++ b/tunnel.sh @@ -0,0 +1,25 @@ +#!/bin/bash +# https://www.tunnelbroker.net/ +# MiguelDirty + +case $1 in + + start) + echo starting ipv6 tunnelbroker + ifconfig sit0 up + ifconfig sit0 inet6 tunnel ::216.66.86.114 + ifconfig sit1 up + ifconfig sit1 inet6 add 2001:470:6c:2af::2/64 + route -A inet6 add ::/0 dev sit1 + ;; + + stop) + echo stopping ipv6 tunnelbroker + ifconfig sit0 down + ifconfig sit1 down + ;; + + *) + echo "usage: to start tunnelbroker type: $0 start" + echo " to stop tunnelbroker type: $0 stop" +esac diff --git a/vnc_blackeye.sh b/vnc_blackeye.sh new file mode 100755 index 0000000..e61b62e --- /dev/null +++ b/vnc_blackeye.sh @@ -0,0 +1 @@ +ssvncviewer -scale 1.5 cigar::51248 -passwd /home/miguel/.vnc/passwd diff --git a/wacom.sh b/wacom.sh new file mode 100644 index 0000000..38ea46e --- /dev/null +++ b/wacom.sh @@ -0,0 +1,24 @@ +# https://github.com/linuxwacom/xf86-input-wacom/wiki/Calibration +# https://gist.github.com/Deevad/51820854ffd5ea5cd883 + +xsetwacom --list + +OUTPUT=3840x2400+4225+0 +OUTPUT=1920x1080+1920+0 + +AREA="0 0 44704 27940" #default (checked via --get) +AREA="0 0 44704 25146" #change to 16:9 + +STYLUSID=$(xsetwacom --list | grep STYLUS | sed "s/.*id: \([0-9]*\).*/\1/") +ERASERID=$(xsetwacom --list | grep ERASER | sed "s/.*id: \([0-9]*\).*/\1/") +TOUCHID=$(xsetwacom --list | grep TOUCH | sed "s/.*id: \([0-9]*\).*/\1/") + +echo $STYLUSID STYLUS +echo $ERASERID ERASER +echo $TOUCHID TOUCH + +xsetwacom --set $STYLUSID MapToOutput $OUTPUT # stylus +xsetwacom --set $STYLUSID Area $AREA # stylus +xsetwacom --set $ERASERID MapToOutput $OUTPUT # eraser +xsetwacom --set $ERASERID Area $AREA # stylus +xsetwacom --set $TOUCHID Touch off # touch |
