more scripts

This commit is contained in:
2021-06-26 16:52:22 +02:00
parent 2ab3f97726
commit a77efb2f8b
8 changed files with 58 additions and 4 deletions

38
backup Executable file
View File

@ -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

View File

@ -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

View File

@ -1,4 +1,4 @@
#!/bin/sh
pid=`cat ~/.pid/droidcam.pid`
kill $pid
kill -2 $pid
rm ~/.pid/droidcam.pid

6
ethw Executable file
View File

@ -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 "$@"

3
md
View File

@ -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"

4
repo-remotes-add Executable file
View File

@ -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

4
screenshot Executable file
View File

@ -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"

View File

@ -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-*")]