Skip to content

Instantly share code, notes, and snippets.

View untoreh's full-sized avatar
🐭
munch...

Francesco Giannelli untoreh

🐭
munch...
View GitHub Profile
@untoreh
untoreh / Duplicacy init repo links.md
Created May 18, 2018 12:22
symlink root path to allow backing up from a different repository path
@untoreh
untoreh / Get Duplicacy.md
Created May 17, 2018 15:36
setup duplicacy cli binary on current host
prefix=/opt
alias=dup
osver=duplicacy_linux_x64_
ver=2.1.0
mkdir -p "$prefix$alias" "$prefix/bin"
wget -q "https://github.com/gilbertchen/duplicacy/releases/download/v$ver/$osver$ver" -O "$prefix/$alias"
chmod +x "$prefix/$alias/$alias"
ln -sr "$prefix/$alias/$alias" "$prefix/bin"

Generate a random string with just bash

Adding options to add newlines, choose lowercase or uppercase or both is trivial

rand_string() {
    local c=0
    while [ $c -lt $1 ]; do
        printf "\x$(printf '%x' $((97+RANDOM%25)))"
        c=$((c+1))
 done
@untoreh
untoreh / fix-ppa-keys
Created April 4, 2018 15:48
add all missing ubuntu ppa keys
#!/bin/sh
KEYS=$(apt update 2>/dev/null | grep NO_PUBKEY | sed -r 's/.*NO_PUBKEY (.*)/\1/')
for k in $KEYS; do
apt-key adv --keyserver ha.pool.sks-keyservers.net --recv-keys $k
done

netcat http server

while true ; do nc -l -p 1234 -e 'echo -e "HTTP/1.1 200 OK\n\n $(date)"'; done

@untoreh
untoreh / getalp.md
Last active March 19, 2018 11:46
fetch an alpine chroot

getalp

wget -qO- https://raw.githubusercontent.com/untoreh/scripts/utils/deploy/getalp | bash