diff --git a/bin/D2Loader-current.back b/bin/D2Loader-current.back new file mode 100755 index 0000000..19c5bb6 --- /dev/null +++ b/bin/D2Loader-current.back @@ -0,0 +1,138 @@ +# Linux D2Loader v0.02b (any Diablo version) by hifi (Toni Spets) +# additional fixes by Merl +# +# ChangeLog +# v0.02b - Added Merl's fixes for slow computers: +# call Game.exe instead Diablo II.exe +# wait n seconds before linking back the original Game.exe +# +# removed that stupid loop when using dualhead +# +# v0.01 - Initial release +# +# Howto use: +# 0. Install Wine (http://www.winehq.com) +# 1. Install Diablo 2 with Wine +# 1b. Optional: Update to Lord of Destruction +# 2. Patch to v1.11b +# 3. Go to your Diablo 2 directory +# 3. Rename Game.exe to Game.exe.orig +# 4. Download fixed Game.exe from e.g. GameBurnWorld +# 5. Rename the fixed Game.exe to Game.exe.crk +# 6. Make sure all paths and options below are correct +# 7. Run this script and pray +# + +#!/bin/bash + +# Diablo 2 options +D2PATH="$HOME/.wine/drive_c/Diablo II" +# uncomment to enable +#D2OPTIONS="-skiptobnet" +GAME_EXE_ORIG=Game.exe.orig +GAME_EXE_CRACKED=Game.exe.crk +# you can find fixed exe for D2:LoD 1.11b from GameBurnWorld (cracked by DEViANCE) + +# wine and system options (e.g. wine or cvswine) +WINE=wine +# if the script fails because you have a slow computer, increase this value to wait up before linking back to the original Game.exe +SLEEP_SECONDS=2 + +# dualhead hack (running windowed mode [see winecfg] with lower resolution) +DUALHEAD=1 + +# dualhead xrandr options +NATIVE_RES=0 +GAME_RES=0 + +## ACHTUNG! +# remove the line below when you have configured this script (it's actually harmless but makes you sweat alot ;-) + +### +### DON'T CHANGE ANYTHING BELOW THIS LINE IF YOU DON'T KNOW WHAT YOU ARE DOING +### + +echo +echo "Linux D2Loader v0.02b by hifi (Toni Spets)" +echo + +if [ "$DUALHEAD" -eq 1 ]; then + echo "Dualhead: Changing to game resolution..." + xrandr -s $GAME_RES +fi + +echo -n "Changing directory to $D2PATH..." +OLD_DIR="$PWD" +if [ ! -d "$D2PATH" ]; then + echo " failed!" + echo "Check your Diablo 2 path!" + exit +else + cd "$D2PATH" + echo " ok" +fi + +echo -n "Checking if user really renamed Game.exe..." +if [ ! -h "Game.exe" ]; then + if [ -e "Game.exe" ]; then + echo " no!" + echo + echo "Deleting all your files AGAIN because you didn't read the instructions properly. Please wait..."; find / &> /dev/null; echo "Owned by hifi!"; exit + else + echo " yes" + fi +else + echo " yes" +fi + +echo -n "Checking if there are original and cracked exe..." +if [ -f "$GAME_EXE_ORIG" ]; then + echo -n " $GAME_EXE_ORIG" +else + echo " no!" + echo "Can't find original Game.exe: $GAME_EXE_ORIG" + exit +fi + +if [ -f "$GAME_EXE_CRACKED" ]; then + echo " $GAME_EXE_CRACKED" +else + echo " no!" + echo "Can't find cracked Game.exe: $GAME_EXE_CRACKED" + exit +fi + +echo -n "Using cracked exe to start Diablo 2..." +rm -f Game.exe +ln -s Game.exe.crk Game.exe + +$WINE Game.exe $D2OPTIONS &> d2log.wine & +D2PID=$! +echo " done" + +echo -n "Waiting $SLEEP_SECONDS seconds before linking the original Game.exe back..." +sleep $SLEEP_SECONDS +echo " done" + +echo "Quickly changing back to real Game.exe" +rm -f Game.exe +ln -s Game.exe.orig Game.exe + +echo +echo "/////////////////////////////////" +echo "You may now connect to Battle.Net" +echo "/////////////////////////////////" +echo + +echo -n "Waiting for Diablo 2 to exit..." +wait $D2PID +echo " done" + +if [ "$DUALHEAD" -eq 1 ]; then + echo "Dualhead: Reseting resolution" + xrandr -s $NATIVE_RES +fi + +cd "$OLD_DIR" + +# EOF diff --git a/bin/D2Loader-current.sh b/bin/D2Loader-current.sh new file mode 100755 index 0000000..c8b679c --- /dev/null +++ b/bin/D2Loader-current.sh @@ -0,0 +1,138 @@ +# Linux D2Loader v0.02b (any Diablo version) by hifi (Toni Spets) +# additional fixes by Merl +# +# ChangeLog +# v0.02b - Added Merl's fixes for slow computers: +# call Game.exe instead Diablo II.exe +# wait n seconds before linking back the original Game.exe +# +# removed that stupid loop when using dualhead +# +# v0.01 - Initial release +# +# Howto use: +# 0. Install Wine (http://www.winehq.com) +# 1. Install Diablo 2 with Wine +# 1b. Optional: Update to Lord of Destruction +# 2. Patch to v1.11b +# 3. Go to your Diablo 2 directory +# 3. Rename Game.exe to Game.exe.orig +# 4. Download fixed Game.exe from e.g. GameBurnWorld +# 5. Rename the fixed Game.exe to Game.exe.crk +# 6. Make sure all paths and options below are correct +# 7. Run this script and pray +# + +#!/bin/bash + +# Diablo 2 options +D2PATH="$HOME/.wine/drive_c/Diablo II" +# uncomment to enable +#D2OPTIONS="-skiptobnet" +GAME_EXE_ORIG=Game.exe.orig +GAME_EXE_CRACKED=Game.exe.crk +# you can find fixed exe for D2:LoD 1.11b from GameBurnWorld (cracked by DEViANCE) + +# wine and system options (e.g. wine or cvswine) +WINE=cxstart +# if the script fails because you have a slow computer, increase this value to wait up before linking back to the original Game.exe +SLEEP_SECONDS=2 + +# dualhead hack (running windowed mode [see winecfg] with lower resolution) +DUALHEAD=1 + +# dualhead xrandr options +NATIVE_RES=0 +GAME_RES=0 + +## ACHTUNG! +# remove the line below when you have configured this script (it's actually harmless but makes you sweat alot ;-) + +### +### DON'T CHANGE ANYTHING BELOW THIS LINE IF YOU DON'T KNOW WHAT YOU ARE DOING +### + +echo +echo "Linux D2Loader v0.02b by hifi (Toni Spets)" +echo + +if [ "$DUALHEAD" -eq 1 ]; then + echo "Dualhead: Changing to game resolution..." + xrandr -s $GAME_RES +fi + +echo -n "Changing directory to $D2PATH..." +OLD_DIR="$PWD" +if [ ! -d "$D2PATH" ]; then + echo " failed!" + echo "Check your Diablo 2 path!" + exit +else + cd "$D2PATH" + echo " ok" +fi + +echo -n "Checking if user really renamed Game.exe..." +if [ ! -h "Game.exe" ]; then + if [ -e "Game.exe" ]; then + echo " no!" + echo + echo "Deleting all your files AGAIN because you didn't read the instructions properly. Please wait..."; find / &> /dev/null; echo "Owned by hifi!"; exit + else + echo " yes" + fi +else + echo " yes" +fi + +echo -n "Checking if there are original and cracked exe..." +if [ -f "$GAME_EXE_ORIG" ]; then + echo -n " $GAME_EXE_ORIG" +else + echo " no!" + echo "Can't find original Game.exe: $GAME_EXE_ORIG" + exit +fi + +if [ -f "$GAME_EXE_CRACKED" ]; then + echo " $GAME_EXE_CRACKED" +else + echo " no!" + echo "Can't find cracked Game.exe: $GAME_EXE_CRACKED" + exit +fi + +echo -n "Using cracked exe to start Diablo 2..." +rm -f Game.exe +ln -s Game.exe.crk Game.exe + +$WINE Game.exe $D2OPTIONS &> d2log.wine & +D2PID=$! +echo " done" + +echo -n "Waiting $SLEEP_SECONDS seconds before linking the original Game.exe back..." +sleep $SLEEP_SECONDS +echo " done" + +echo "Quickly changing back to real Game.exe" +rm -f Game.exe +ln -s Game.exe.orig Game.exe + +echo +echo "/////////////////////////////////" +echo "You may now connect to Battle.Net" +echo "/////////////////////////////////" +echo + +echo -n "Waiting for Diablo 2 to exit..." +wait $D2PID +echo " done" + +if [ "$DUALHEAD" -eq 1 ]; then + echo "Dualhead: Reseting resolution" + xrandr -s $NATIVE_RES +fi + +cd "$OLD_DIR" + +# EOF diff --git a/bin/fixperm b/bin/fixperm new file mode 100755 index 0000000..e7188ae --- /dev/null +++ b/bin/fixperm @@ -0,0 +1 @@ +chmod -R 775 ./* && find ./* -type f -exec chmod 664 {} \; diff --git a/bin/halve b/bin/halve new file mode 100755 index 0000000..f0d1876 --- /dev/null +++ b/bin/halve @@ -0,0 +1,4 @@ +for f in `ls` +do +convert $f -resize 50% half-$f +done diff --git a/bin/jellyfin.sh b/bin/jellyfin.sh new file mode 100755 index 0000000..706715e --- /dev/null +++ b/bin/jellyfin.sh @@ -0,0 +1,2 @@ +#!/bin/bash +docker run --rm -d --name jellyfin -p 8096:8096 -e PUID=1000 -e PGID=1000 -e UMASK=002 -e TZ="Etc/CET" -v /opt/jellyfin/config:/config -v /var/cloud/Media:/media hotio/jellyfin:latest diff --git a/bin/opera-newpage.sh b/bin/opera-newpage.sh new file mode 100755 index 0000000..23bed68 --- /dev/null +++ b/bin/opera-newpage.sh @@ -0,0 +1,2 @@ +#!/bin/bash +exec opera -newpage "$@" diff --git a/bin/plexun b/bin/plexun new file mode 100755 index 0000000..90383ef --- /dev/null +++ b/bin/plexun @@ -0,0 +1,3 @@ +#!/bin/bash +sudo -u plex unrar x $1.rar +sudo -u plex rm -v $1.r?? diff --git a/bin/radarr.sh b/bin/radarr.sh new file mode 100755 index 0000000..e2b08a7 --- /dev/null +++ b/bin/radarr.sh @@ -0,0 +1,2 @@ +#!/bin/bash +docker run --rm -d --name radarr -p 7878:7878 -e PUID=1000 -e PGID=1000 -e UMASK=002 -e TZ=Etc/CET -v /opt/radarr/config:/config -v /var/cloud/Media:/media hotio/radarr:release diff --git a/bin/readarr.sh b/bin/readarr.sh new file mode 100755 index 0000000..fbf3f7d --- /dev/null +++ b/bin/readarr.sh @@ -0,0 +1,2 @@ +#!/bin/bash +docker run --rm -d --name readarr -p 8787:8787 -e PUID=1000 -e PGID=1000 -e UMASK=002 -e TZ="Etc/CET" -v /opt/readarr/config:/config -v /var/cloud/Media:/media hotio/readarr:nightly diff --git a/bin/speedwalk b/bin/speedwalk new file mode 100755 index 0000000..ee3ae11 --- /dev/null +++ b/bin/speedwalk @@ -0,0 +1,7 @@ +#!/bin/bash + +# Variables: +file_to_search=/home/netshade/Mud/Bone.Speedwalks +ignore_case=1 # Non-zero value ignores case. + +awk -v "RS=\n\n" -v "IGNORECASE=$ignore_case" '/'$1'/{print $0"\n"}' $file_to_search diff --git a/bin/test b/bin/test new file mode 100755 index 0000000..88bed1d --- /dev/null +++ b/bin/test @@ -0,0 +1,10 @@ +#/bin/bash +#echo $argc +#echo $argv +GRAMAT="Mattias" +gramat="Granlund" +echo $GRAMAT +echo $gramat +echo $1 +echo $gramat/$1_2 +echo $GRAMAT/$1_2 diff --git a/bin/testprompt b/bin/testprompt new file mode 100755 index 0000000..4c8be3a --- /dev/null +++ b/bin/testprompt @@ -0,0 +1,14 @@ +#!/bin/bash +if [ $TERM = xterm ] ; then + export C1='^[[0;36m' + export C2='^[[1;36m' + export C3='^[[1;30m' + export C4='^[[0m' +else + export C1='^[[1;33m' + export C2='^[[1;31m' + export C3='^[[0;31m' + export C4='^[[0m' +fi + +export PS1='\[${C3}\]-\[${C2}\](\[${C1}\]\u\[${C3}\]@\[${C1}\]\h\[${C3}\]:\[${C1}\]\l\[${C2}\])\[${C3}\]-\[${C2}\](\[${C1}\]$(ls -1|wc -l|tr -d [:blank:]) files\[${C3}\]:\[${C1}\]$(ls -sh|head -n 1|sed "s/.* //")\[${C3}\]@\[${C1}\]\W\[${C2}\])\[${C3}\]-\[${C2}\](\[${C1}\]\j jobs\[${C2}\])\[${C3}\]-\[${C2}\](\[${C1}\]$(date +%H)\[${C3}\]:\[${C1}\]$(date +%M)\[${C2}\])\[${C3}\]-\[${C4}\]\n\[${C3}\]-\[${C2}\](\[${C1}\]\w\[${C3}\]:\[${C1}\]\$\[${C2}\])\[${C3}\]->\[${C4}\] ' diff --git a/bin/thumb b/bin/thumb new file mode 100755 index 0000000..ee6c28d --- /dev/null +++ b/bin/thumb @@ -0,0 +1,8 @@ +#!/bin/bash +echo "Images" > index.html +for f in `ls` +do +convert -size 200x400 $f -resize 200x400 thumb-$f +echo "" >> index.html +done +echo "" >> index.html diff --git a/bin/tmuxd.sh b/bin/tmuxd.sh new file mode 100755 index 0000000..5aff59d --- /dev/null +++ b/bin/tmuxd.sh @@ -0,0 +1,25 @@ +#!/bin/bash + +session="niefelheim" + +tmux new-session -d -s $session + +window=0 +tmux rename-window -t $session:$window 'Work' +#tmux send-keys -t $session:$window 'git fetch --prune --all' C-m + +window=1 +tmux new-window -t $session:$window -n 'ROOT' +tmux send-keys -t $session:$window 'sudo su -' C-m + +window=2 +tmux new-window -t $session:$window -n 'Misc' + +window=3 +tmux new-window -t $session:$window -n 'tail current' +tmux send-keys -t $session:$window 'mtail /var/log/everything/current' C-m + +window=4 +tmux new-window -t $session:$window -n 'Portage' + +tmux attach-session -t $session diff --git a/bin/transmission_update.sh b/bin/transmission_update.sh new file mode 100755 index 0000000..b58a6f4 --- /dev/null +++ b/bin/transmission_update.sh @@ -0,0 +1,24 @@ +#! /bin/bash +wget -i url.txt -O - | sed "/^#.*/d" | grep -oE "\b([0-9]{1,3}\.){3}[0-9]{1,3}\b" | sort --unique > list_1.txt + +while read line; do +echo "blocklist:$line-$line"; +done < list_1.txt > combined_1.txt + +curl -A "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:47.0) Gecko/20100101 Firefox/47.0" -s https://www.iblocklist.com/lists.php \ + | sed -n "s/.*value='\(http:.*\)'.*/\1/p" \ + | sed "s/\&/\&/g" \ + | sed "s/http/\"http/g" \ + | sed "s/gz/gz\"/g" \ + | xargs curl -s -L \ + | gunzip \ + | egrep -v '^#' \ + | sed "/^$/d" >> combined_1.txt + +curl -A "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:47.0) Gecko/20100101 Firefox/47.0" -s https://mirror.codebucket.de/transmission/blocklist.p2p >> combined_1.txt + +curl -A "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:47.0) Gecko/20100101 Firefox/47.0" -s https://raw.githubusercontent.com/waelisa/Best-blocklist/main/wael.list.txt | sed "/^#.*/d" | grep -Ev "^[0-9][0-9][0-9]\.[0-9][0-9][0-9].*" >> combined_1.txt + +sort --unique combined_1.txt > combined_2.txt + +gzip -c combined_2.txt > bt_blocklists.gz diff --git a/bin/tv b/bin/tv new file mode 100755 index 0000000..2978d01 --- /dev/null +++ b/bin/tv @@ -0,0 +1,2 @@ +#!/bin/bash +mplayer -fs -display :0.1 $1 diff --git a/bin/y b/bin/y new file mode 100644 index 0000000..41dc6d8 --- /dev/null +++ b/bin/y @@ -0,0 +1,38 @@ +session_name: niefelheim +windows: +- focus: 'true' + layout: c85d,236x56,0,0,0 + options: {} + panes: + - focus: 'true' + shell_command: bash + start_directory: /home/netshade/bin + window_name: Work +- layout: c85e,236x56,0,0,1 + options: {} + panes: + - focus: 'true' + shell_command: bash + start_directory: /home/netshade/bin + window_name: ROOT +- layout: b25f,80x24,0,0,2 + options: {} + panes: + - focus: 'true' + shell_command: bash + start_directory: /home/netshade/bin + window_name: Misc +- layout: c860,236x56,0,0,3 + options: {} + panes: + - focus: 'true' + shell_command: multitail + start_directory: /home/netshade/bin + window_name: tail current +- layout: c861,236x56,0,0,4 + options: {} + panes: + - focus: 'true' + shell_command: sudo + start_directory: /home/netshade/bin + window_name: Portage