qemu-system-x86_64 \
-net nic -net user,hostfwd=tcp::80-:80,hostfwd=tcp::443-:443 \
-smp "$(expr $(nproc) / 2)" \
-m "$(expr $(free -m | awk '/Mem/ {print $2}') / 2)M" \
-localtime \
-enable-kvm \
-drive if=none,format=raw,file=/dev/nvme0n1,id=nvme0 \
-device nvme,drive=nvme0,serial=foo \
-vnc 127.0.0.1:0 \
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh -e | |
for i in $(seq 16 2); do sed -i s/"$(for _c in $(seq 1 $i); do printf ' '; done)"/\t/g ${1}; done |
#!/usr/bin/env bash
LUKSNAME=${1}
KEYPATH=${2:-"${HOME:-$(pwd)}/${LUKSNAME}.key"}
KEYSIZE=${3:-"1020000"}
FILESYSTEM=${4:-"ext4"}
set -uxo pipefail
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
node=${1} | |
if [ -n "${node}" ]; then | |
shift | |
nodeName=$(kubectl get node ${node} -o template --template='{{index .metadata.labels "kubernetes.io/hostname"}}') || exit 1 | |
nodeSelector='"nodeSelector": { "kubernetes.io/hostname": "'${nodeName:?}'" },' | |
podName=${USER+${USER}-}sudo-${node} | |
else | |
nodeSelector="" | |
podName=${USER+${USER}-}sudo |
echo "deb http://deb.debian.org/debian/ unstable main" > /etc/apt/sources.list.d/unstable.list
printf 'Package: *\nPin: release a=unstable\nPin-Priority: 90\n' > /etc/apt/preferences.d/limit-unstable
wget -O - https://ftp-master.debian.org/keys/archive-key-8.asc | apt-key add -
wget -qO- https://ftp-master.debian.org/keys/archive-key-8-security.asc | apt-key add -
apt update
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
GO_VERSION=${1} | |
GO_ARCH=${2:-"amd64"} | |
GO_OS=${3:-"$(uname -s | tr '[:upper:]' '[:lower:]')"} | |
case "${GO_VERSION}" in | |
"") _dl="$(wget -qO- https://golang.org/dl/ | grep -oP "https:\/\/dl\.google\.com\/go\/go([0-9\.]+)\.${GO_OS}-${GO_ARCH}\.tar\.gz" | head -n 1)";; | |
*) _dl="https://dl.google.com/go/go${GO_VERSION}.${GO_OS}-${GO_ARCH}.tar.gz";; | |
esac |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## ubuntu | |
deb http://archive.ubuntu.com/ubuntu/ disco main restricted universe multiverse | |
# deb-src http://archive.ubuntu.com/ubuntu/ disco main restricted universe multiverse | |
deb http://archive.ubuntu.com/ubuntu/ disco-updates main restricted universe multiverse | |
# deb-src http://archive.ubuntu.com/ubuntu/ disco-updates main restricted universe multiverse | |
deb http://archive.ubuntu.com/ubuntu/ disco-backports main restricted universe multiverse | |
# deb-src http://archive.ubuntu.com/ubuntu/ disco-backports main restricted universe multiverse |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# https://stackoverflow.com/a/42544963 | |
git rev-list --objects --all | \ | |
git cat-file --batch-check='%(objecttype) %(objectname) %(objectsize) %(rest)' | \ | |
sed -n 's/^blob //p' | \ | |
sort --numeric-sort --key=2 | \ | |
cut -c 1-12,41- | \ | |
$(command -v gnumfmt || echo numfmt) --field=2 --to=iec-i --suffix=B --padding=7 --round=nearest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
search . | |
nameserver 1.1.1.1 | |
nameserver 2606:4700:4700::1111 | |
nameserver 1.0.0.1 | |
nameserver 2606:4700:4700::1001 | |
options timeout:1 | |
options rotate | |
options no-tld-query | |
options no-reload |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh -e | |
# https://serverfault.com/a/470065 | |
echo -e "\x38\x01\x00\x00\x00\x00\x00\x00\x00" | timeout 10 ncat -u ${1} ${2:-1194} | od -x |