Skip to content

Instantly share code, notes, and snippets.

View pojntfx's full-sized avatar
💭
🍂

Felicitas Pojtinger pojntfx

💭
🍂
View GitHub Profile
@pojntfx
pojntfx / main.sh
Created October 24, 2023 15:34
Find the 20 largest files on a Linux system
#!/bin/bash
find / -type f -exec du -h {} + 2>/dev/null | sort -rh | head -n 20
@pojntfx
pojntfx / main.sh
Created September 22, 2023 17:02
Generate Flatpak dependencies/sources for a Go app
#!/bin/bash
go run github.com/dennwc/flatpak-go-mod@latest .
@pojntfx
pojntfx / main.sh
Created September 14, 2023 22:55
Install Firecracker with Live Migration Support
#!/bin/bash
git clone https://github.com/loopholelabs/firecracker /tmp/firecracker
cd /tmp/firecracker
cargo build --target x86_64-unknown-linux-gnu
sudo install ./build/cargo_target/x86_64-unknown-linux-gnu/debug/firecracker /usr/local/bin/
@pojntfx
pojntfx / main.sh
Last active September 3, 2023 16:11
Generate icons in FreeDesktop-compliant sizes with ImageMagick/`convert`
#!/bin/bash
for icon in 16x16 22x22 24x24 32x32 36x36 48x48 64x64 72x72 96x96 128x128 192x192 256x256 512x512; do
convert -background none icon.svg -resize ${icon} icon-${icon}.png
done
@pojntfx
pojntfx / main.sh
Last active August 12, 2023 11:32
Play a Dolby Vision file with MPV
#!/bin/bash
flatpak run io.mpv.Mpv --vo=gpu-next --gpu-api=vulkan file.mp4
@pojntfx
pojntfx / main.sh
Created July 27, 2023 03:43
Fix Brasero hanging while burning a CD on Fedora 38
#!/bin/bash
# From https://bugs.launchpad.net/ubuntu/+source/brasero/+bug/1770502
sudo chmod -v 4711 /usr/bin/cdrdao
sudo chmod -v 4711 /usr/bin/wodim
sudo chmod -v 0755 /usr/bin/growisofs
@pojntfx
pojntfx / main.sh
Created July 26, 2023 03:27
Add artificial latency to a network device in Docker
./hack/build-transport-container.sh && hydrun -o pojntfx/transport -e '--privileged -p 1337:1337' -i "tc qdisc add dev eth0 root netem delay 100ms && transport-server --grpc"
@pojntfx
pojntfx / main.sh
Last active July 12, 2023 16:07
Use Serveo to forward a port over SSH to the public internet via HTTPS
#!/bin/bash
ssh -R houston.serveo.net:80:localhost:40080 serveo.net # houston.serveo.net is the custom domain you want to use, leave it empty to create a random domain
@pojntfx
pojntfx / main.sh
Last active July 11, 2023 20:38
Git Submodule Cheatsheet
#!/bin/bash
# Add a submodule
git submodule add 'https://github.com/pojntfx/green-guardian-gateway.git' gateway
# Pull submodules in a repo that already has them set up
git submodule update --init --recursive
# Update submodules to point to the latest remote ref (e.g. `main`)
git submodule update --remote --recursive
@pojntfx
pojntfx / main.sh
Created April 25, 2023 02:11
Fix "Failed to load db from '~/.local/share/flatpak/db/documents': invalid gvdb header" error in Flatpak
#!/bin/bash
rm -f ~/.local/share/flatpak/db/documents
# Now restart your system