diff --git a/backup b/backup new file mode 100755 index 0000000..ebbc4b6 --- /dev/null +++ b/backup @@ -0,0 +1,38 @@ +#!/bin/bash +tempDir=/tmp/backup +mountRemote() { + rclone mount schulev: "$tempDir" --daemon +} +umountRemote() { + umount "$tempDir" +} +case $1 in + restore) + mountRemote + find "$tempDir" -type f | xargs -n 1 tar -xf + umountRemote + ;; + backup) + mountRemote + declare -A hashes + while IFS= read -r file; do + hash="$(echo -n "$file" | openssl dgst -binary -sha256 | openssl base64 | sed -e 's/\//@/g')" + hashes[s]=0 + file_hash="$tempDir/$hash" + hashes[$hash]=0 + if [[ ! -f "$file_hash" || $(tar -df "$file_hash") ]]; then + tar -cf "$file_hash" "$file" + fi + done < <(find -type f,l; find -type d -empty) + cd "$tempDir" + for file in *; do + if [ ! -v hashes[$file] ]; then + rm "$file" + fi + done + umountRemote + ;; + *) + echo "use backup or restore as argument" + ;; + esac diff --git a/droidcamStart b/droidcamStart index 1798802..6e42035 100755 --- a/droidcamStart +++ b/droidcamStart @@ -1,3 +1,4 @@ #!/bin/sh -droidcam-cli 192.168.2.50 4747 & +adb forward tcp:4747 tcp:4747 +droidcam-cli 127.0.0.1 4747 echo $! > ~/.pid/droidcam.pid diff --git a/droidcamStop b/droidcamStop index 6130148..f4fee17 100755 --- a/droidcamStop +++ b/droidcamStop @@ -1,4 +1,4 @@ #!/bin/sh pid=`cat ~/.pid/droidcam.pid` -kill $pid +kill -2 $pid rm ~/.pid/droidcam.pid diff --git a/ethw b/ethw new file mode 100755 index 0000000..b6b2521 --- /dev/null +++ b/ethw @@ -0,0 +1,6 @@ +#!/bin/sh +WEB3_RPC_URL='https://mainnet.infura.io/v3/6570d341bf4b4d499a5b5026c46e20ba' +export WEB3_RPC_URL +WEB3_PRIVATE_KEY=0x` keepassxc-cli show ~/keys/Passwörter.kdbx 'ether wallet' -k ~/keys/passwörter.key -s | awk '{ if($1 == "Password:") {printf "%s", $2} }' | node ~/mining/ethGetPk/index.js` +export WEB3_PRIVATE_KEY +exec web3 "$@" diff --git a/md b/md index 161ccc0..20d7709 100755 --- a/md +++ b/md @@ -20,7 +20,7 @@ file_name=`youtube-dl "ytsearch:$1 lyrics" \ --embed-thumbnail \ --add-metadata \ |awk '$1 == "[ffmpeg]" && $2 == "Destination:" {print substr($0, index($0,$3))}'` -r128gain "$file_name" > /dev/null +r128gain "$file_name" 2> /dev/null temp_dir="/tmp/idntag$(xxd -u -l 16 -p /dev/urandom)" mkdir "$temp_dir" temp_file="$temp_dir/$file_name" @@ -33,3 +33,4 @@ if checkMetadata "$temp_file"; then elif ! checkMetadata "$file_name"; then echo "enter it manually" fi +rm -rf "$temp_dir" diff --git a/repo-remotes-add b/repo-remotes-add new file mode 100755 index 0000000..c9ab4de --- /dev/null +++ b/repo-remotes-add @@ -0,0 +1,4 @@ +#!/bin/sh +git remote add all "gitea:MrGeorgen/$1.git" +git remote set-url --add all "github:MrGeorgen/$1.git" +git push -u all master diff --git a/screenshot b/screenshot new file mode 100755 index 0000000..4ef098b --- /dev/null +++ b/screenshot @@ -0,0 +1,4 @@ +#!/bin/sh +file=~/Bilder/screenshots/$(date +%m_%d_%y_%T).png +import -window root "$file" +xclip -sel clip -t image/png "$file" diff --git a/syslinux-mkconfig b/syslinux-mkconfig index a82a746..498ce2f 100755 --- a/syslinux-mkconfig +++ b/syslinux-mkconfig @@ -3,7 +3,7 @@ from distutils.version import LooseVersion import glob import os syslinuxCfgPath = "/boot/EFI/syslinux/syslinux.cfg" -options = "APPEND root=PARTUUID=6ce9f430-9a06-d64f-ad4e-806594365431 rootflags=subvol=bedrock" +options = "APPEND root=PARTUUID=6ce9f430-9a06-d64f-ad4e-806594365431 rootflags=subvol=bedrock,compress-force=zstd" baseName = "bedrock" os.chdir("/boot") lv = [LooseVersion(v) for v in glob.iglob("vmlinuz-*")]