Compare commits

..

10 commits

Author SHA1 Message Date
Simon Rieger
be1447e6c3 README.md aktualisiert 2023-12-13 11:25:29 +01:00
Simon Rieger
37de4af9aa README.md aktualisiert 2023-12-13 11:23:25 +01:00
Simon Rieger
83f23b7993 README.md aktualisiert 2023-12-13 11:07:01 +01:00
Simon Rieger
6e0d748b29 README.md aktualisiert 2023-12-13 10:59:33 +01:00
Simon Rieger
292a253833 README.md aktualisiert 2023-12-13 10:58:58 +01:00
Simon Rieger
d22efb3131 README.md aktualisiert 2023-12-13 10:52:34 +01:00
0732b2e409 add extra parameter 2023-12-11 00:33:34 +01:00
88691a4db0 add script for find last modified files 2023-10-12 09:22:33 +02:00
user
e3644a4319 add auto press tools 2023-08-22 11:51:39 +02:00
3ed5ad8fb7 „raspberry_arch-install.sh“ ändern 2023-05-24 19:58:51 +02:00
4 changed files with 67 additions and 3 deletions

View file

@ -4,20 +4,58 @@ Nützliche shell-scripte
ssh tunnel vom server oder zum server
einrichten mit:
~~~
ssh-keygen -t rsa -b 4096
ssh-copy-id -i ~/.ssh/id_rsa.pub user@server
~~~
oder
~~~
cat id_rsa.pub | ssh server 'cat>> ~/.ssh/authorized_keys'
~~~
### Zum schreiben eines Passworts mittels eines virtuellen Keyboards
https://man.archlinux.org/man/ydotool.1
### ydotool
run deamon with:
~~~
echo '## Give ydotoold access to the uinput device
## Solution by https://github.com/ReimuNotMoe/ydotool/issues/25#issuecomment-535842993
KERNEL=="uinput", GROUP="input", MODE="0660", OPTIONS+="static_node=uinput"
' > /etc/udev/rules.d/80-uinput.rules
sudo usermod -G wheel,uinput simono41
sudo ydotoold
setxkbmap -query
WAYLAND_DISPLAY=wayland-0 localectl set-x11-keymap de
~~~
and run youre command
~~~
sleep 5 && XKB_DEFAULT_LAYOUT=de sudo ydotool type 'Hello World!' -d 20 && notify-send finish
~~~
### mit dotool
~~~
sleep 5 && { echo typedelay 100; echo type ${PASSWORT}; } | DOTOOL_XKB_LAYOUT=de dotool && notify-send done
~~~
### Zum suchen der libinput Treiber mit
~~~
libwacom-list-local-devices
for wort in /usr/share/libwacom/*; do if cat $wort | grep CTL-4100WL; then echo $wort; fi; done
~~~
### Port forwarding using OpenVPN client
~~~
vps# iptables -t nat -A PREROUTING -p tcp --dport 9987 -j DNAT --to-destination 192.168.1.3 (mein Homeserver wenn ich richtig verstanden habe)
vps# iptables -t nat -A POSTROUTING -p tcp --dport 9987 -j MASQUERADE
@ -32,14 +70,20 @@ sysctl -w net.ipv4.ip_forward=1
iptables -t nat -A PREROUTING -d 50.xxx.xxx.xxx -p tcp --dport 8081 -j DNAT --to-dest 192.168.2.86:8081
iptables -t nat -A POSTROUTING -d 192.168.2.86 -p tcp --dport 8081 -j SNAT --to-source 10.0.2.42
~~~
### Find and Remove old Syncthing Files
~~~
find -name "*.tmp" -exec rm -vf {} \;
~~~
### Setzt das Repository auf dem aktuellen HEAD zurück und löscht neue Dateien die bis dahin erzeugt wurden
~~~
git reset --hard 8& git clean -dfx
~~~
### Qemu chroot Raspberry PI
~~~
pacman -S qemu-user-static qemu-user-static-binfmt
https://wiki.archlinux.org/title/QEMU#Chrooting_into_arm/arm64_environment_from_x86_64
~~~

11
find-latest-modified-files.sh Executable file
View file

@ -0,0 +1,11 @@
#!/bin/bash
#
# find and list the latest modified files in a directory with subdirectories and times
#
# https://stackoverflow.com/questions/5566310/how-to-recursively-find-and-list-the-latest-modified-files-in-a-directory-with-s
find $1 -type f -exec stat --format '%Y :%y %n' "{}" \; | sort -nr | cut -d: -f2- | head -n 15
# alternative
# find $1 -type f -print0 | xargs -0 stat --format '%Y :%y %n' | sort -nr | cut -d: -f2- | head -n 15

View file

@ -13,6 +13,9 @@ sfdisk -l
read -p "Welches Laufwerk soll beschrieben werden?: [/dev/sda|/dev/sdb] " device
[[ -z "${device}" ]] && echo "No device is set! Abort..." && exit 1
read -p "If it is a Raspberry Pi version 3 or 4? : [3/4] " version
[[ -z "${version}" ]] && echo "No Version is set! Abort..." && exit 1
echo "Wipe Device ${device} ..."
sleep 5
@ -73,7 +76,9 @@ bsdtar -xpf ArchLinuxARM-rpi-aarch64-latest.tar.gz -C root
sync
# Before unmounting the partitions, update /etc/fstab for the different SD block device compared to the Raspberry Pi 3
sed -i 's/mmcblk0/mmcblk1/g' root/etc/fstab
if [ "${version}" -eq "4" ]; then
sed -i 's/mmcblk0/mmcblk1/g' root/etc/fstab
fi
echo "Move boot files to the first partition..."

View file

@ -6,14 +6,18 @@ if [ "$1" == "--help" ]
then
echo "bash ./youtube-dl.sh URL FORMAT"
echo "Formate: [opus/m4a/video/hd/fullhd/4k]"
echo "Extra: (Zusätzliche Parameter)"
exit 0
fi
url="$1"
format="$2"
extra="$3"
[[ -z "${url}" ]] && read -p "URL: " url
[[ -z "${format}" ]] && read -p "Format [opus/flac/m4a/mp4/video/hd/fullhd/4k]: " format
echo "Wenn man für alle Playlisten Unterordner anlegen will: [-o %(playlist_title)s/%(title)s.%(ext)s] (Praktisch für Downloads ganzer Kanäle"
[[ -z "${extra}" ]] && read -p "Sind noch zusätzliche Parameter gewünscht?: " extra
if [ "$format" == "opus" ]
then
@ -55,4 +59,4 @@ then
format="-S "res:2160" -f "bv+ba/b""
fi
yt-dlp -i -c --socket-timeout 10000 --force-ipv4 --restrict-filenames --embed-thumbnail --embed-metadata --match-filter "!was_live" $format $audio $quality -v $url
yt-dlp -i -c --socket-timeout 10000 --force-ipv4 --restrict-filenames --embed-thumbnail --embed-metadata --match-filter "!was_live" ${format} ${audio} ${quality} -v ${url} ${extra}