Skip to content

Instantly share code, notes, and snippets.

@port19x
port19x / dictate.sh
Created September 10, 2025 18:34
Dictation
#!/bin/sh
echo "Recording. Press C-c to stop..."
ffmpeg -hide_banner -nostats -loglevel quiet -y -f alsa -i default "/tmp/audio.wav"
echo "Transcribing audio..."
whisper "/tmp/audio.wav" --model base --fp16 False --output_format txt -o /tmp/transcription
xclip -selection c < /tmp/transcription/audio.txt
echo "DONE! Check your Clipboard"
@port19x
port19x / gist:1e9b979c04f97b37919118f74bb5b87e
Created November 6, 2024 09:04
how to download a website
nice wget --mirror --execute robots=off --no-verbose --convert-links \
--backup-converted --page-requisites --adjust-extension \
--base=./ --directory-prefix=./ --span-hosts \
--domains=www.example.com,example.com http://www.example.com/
@port19x
port19x / backup.sh
Last active December 26, 2025 13:56
backup script
#!/bin/bash
a=$(date +%d.%m.%y)
du -shc "$HOME/Documents" "$HOME/Pictures" "$HOME/.ssh" "$HOME/Passwords.kdbx" "$HOME/.var/app/io.gitlab.librewolf-community/.librewolf/uw04bqn3.default-default"
printf "Is the backup small enough? (CTRL-C otherwise)"
read
echo "$a: initiating backup"
cd
mkdir "$a"
cp -r "Documents" "Pictures" ".ssh" "Passwords.kdbx" ".var/app/io.gitlab.librewolf-community/.librewolf/uw04bqn3.default-default" "$a"
tar -cf "$a.tar" "$a"
@port19x
port19x / cc0
Created October 17, 2023 21:41
my preferred license for easy copy pasta
CC0 1.0 Universal
Statement of Purpose
The laws of most jurisdictions throughout the world automatically confer
exclusive Copyright and Related Rights (defined below) upon the creator and
subsequent owner(s) (each and all, an "owner") of an original work of
authorship and/or a database (each, a "Work").
Certain owners wish to permanently relinquish those rights to a Work for the
@port19x
port19x / x.md
Last active October 10, 2023 12:19
Out of band wildcard certificate generation with letsencrypt for

./.access should have 400 permissions and should contain dns_digitalocean_token = <redacted>

sudo pacman -S certbot-dns-digitalocean
sudo certbot certonly --dns-digitalocean --dns-digitalocean-credentials ./.access -d '*.hsnipe.moe' -d 'hsnipe.moe'
sudo cat /etc/letsencrypt/live/hsnipe.moe/privkey.pem /etc/letsencrypt/live/hsnipe.moe/cert.pem > haproxy.pem
scp haproxy.pem root@hsnipe.moe:/mnt/

Rest of configuration is done on server side / infra code