more scripts
This commit is contained in:
38
backup
Executable file
38
backup
Executable 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
|
||||||
@ -1,3 +1,4 @@
|
|||||||
#!/bin/sh
|
#!/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
|
echo $! > ~/.pid/droidcam.pid
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
pid=`cat ~/.pid/droidcam.pid`
|
pid=`cat ~/.pid/droidcam.pid`
|
||||||
kill $pid
|
kill -2 $pid
|
||||||
rm ~/.pid/droidcam.pid
|
rm ~/.pid/droidcam.pid
|
||||||
|
|||||||
6
ethw
Executable file
6
ethw
Executable 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
3
md
@ -20,7 +20,7 @@ file_name=`youtube-dl "ytsearch:$1 lyrics" \
|
|||||||
--embed-thumbnail \
|
--embed-thumbnail \
|
||||||
--add-metadata \
|
--add-metadata \
|
||||||
|awk '$1 == "[ffmpeg]" && $2 == "Destination:" {print substr($0, index($0,$3))}'`
|
|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)"
|
temp_dir="/tmp/idntag$(xxd -u -l 16 -p /dev/urandom)"
|
||||||
mkdir "$temp_dir"
|
mkdir "$temp_dir"
|
||||||
temp_file="$temp_dir/$file_name"
|
temp_file="$temp_dir/$file_name"
|
||||||
@ -33,3 +33,4 @@ if checkMetadata "$temp_file"; then
|
|||||||
elif ! checkMetadata "$file_name"; then
|
elif ! checkMetadata "$file_name"; then
|
||||||
echo "enter it manually"
|
echo "enter it manually"
|
||||||
fi
|
fi
|
||||||
|
rm -rf "$temp_dir"
|
||||||
|
|||||||
4
repo-remotes-add
Executable file
4
repo-remotes-add
Executable 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
4
screenshot
Executable 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"
|
||||||
@ -3,7 +3,7 @@ from distutils.version import LooseVersion
|
|||||||
import glob
|
import glob
|
||||||
import os
|
import os
|
||||||
syslinuxCfgPath = "/boot/EFI/syslinux/syslinux.cfg"
|
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"
|
baseName = "bedrock"
|
||||||
os.chdir("/boot")
|
os.chdir("/boot")
|
||||||
lv = [LooseVersion(v) for v in glob.iglob("vmlinuz-*")]
|
lv = [LooseVersion(v) for v in glob.iglob("vmlinuz-*")]
|
||||||
|
|||||||
Reference in New Issue
Block a user