Skip to content

Instantly share code, notes, and snippets.

View florianbussmann's full-sized avatar
📚
💻

Florian Bussmann florianbussmann

📚
💻
View GitHub Profile
@florianbussmann
florianbussmann / ssh_tcp_forwarding.MD
Last active July 16, 2023 18:08
ssh_tcp_forwarding

e. g. for rclone config update on headless machine

requirements

In /etc/ssh/sshd_config set AllowTcpForwarding yes

systemctl restart sshd

forwarding

ssh -L 53682:127.0.0.1:53682 user@host -p -4 -g -N

@florianbussmann
florianbussmann / extract_large.sh
Created May 22, 2023 05:43
Move large files away
find "/media/pi/" -type f -name *.mp4 -size +3G -print0 | xargs -d '\n' -0 sh -c '
for file do
echo "$file"
destination="'"../large"'"
mkdir -p "$destination/${file%/*}"
mv -v "$file" "$destination/$file"
done'
@florianbussmann
florianbussmann / cleanup_shorts.sh
Last active May 21, 2023 21:28
Clean videos by duration threshold
find . -type f -name *.mp4 -size -10M -print0 | xargs -d '\n' -0 sh -c '
for file do
echo "$file"
duration=`/volume1/@appstore/ffmpeg/bin/ffprobe -i "$file" -show_entries format=duration -v quiet -of csv="p=0"`
echo $duration
if [ "${duration%.*}" -lt 10 ]; then
echo "Lower than threshold"
rm -v "$file"
fi
done'
@florianbussmann
florianbussmann / Synology Virtual Disks
Created May 21, 2023 14:56
Mounting Synology Virtual Disks manually
ls -la /volume1/@iSCSI/LUN/VDISK_BLUN/
# analyze disk
sudo fdisk -l -u=sectors <DISK>
# mount disk
mount -o ro,offset=<SECTOR_SIZE*START> <DISK> <MOUNT>
@florianbussmann
florianbussmann / funkwhale
Last active May 21, 2023 12:14
Funkwhale Docker setup
https://dev.funkwhale.audio/funkwhale/funkwhale/-/blob/develop/deploy/env.prod.sample
https://dev.funkwhale.audio/funkwhale/funkwhale/-/blob/develop/deploy/docker-compose.yml
docker exec -it funkwhale_api_1 bash
funkwhale-manage createsuperuser
login and create library using WebUI
funkwhale-manage import_files <LIBRARY_ID> "/opt/docker/funkwhale/audio/Music/" --recursive --noinput --in-place
@florianbussmann
florianbussmann / prepare-go-for-linux.bat
Created May 7, 2023 19:48
Build Go project for linux on Windows
set GOOS=linux&& set GOARCH=amd64&& go build
@florianbussmann
florianbussmann / config
Created February 23, 2022 09:28
git.florian-bussmann.de
Host git.florian-bussmann.de
User git
Port 30001
@florianbussmann
florianbussmann / LongPathsEnabled.reg
Created April 6, 2021 10:48
Enable Long Paths in Windows 10, Version 1607, and Later
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem]
"LongPathsEnabled"=dword:00000001
# merge multiple image files
convert -append *.png full.png