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/bash -x | |
sleep 15 | |
_uqmi="/sbin/uqmi" | |
ifdown WWAN || true | |
_cleanup() { | |
/usr/bin/killall "${_uqmi}" 2>/dev/null || true | |
for i in $(/bin/ps www | /usr/bin/awk '/uqmi/ && /cdc-wdm0/ && !/awk/ {print $1}'); do |
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 | |
set -eo pipefail +vx | |
export USERNAME="${REG_USR}" | |
export PASSWORD="${REG_PASS}" | |
case "${USERNAME}" in | |
"") export USERNAME="$(jq -cr '.auths."https://index.docker.io/v1/".auth' ~/.docker/config.json | base64 --decode | cut -d':' -f1)";; | |
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
#!/usr/bin/env bash | |
set -xeo pipefail; | |
IMAGE_SIZE=2000M | |
BOOT_SIZE=256M | |
IMAGE_ARCH=arm64 | |
while getopts "s:" option; do | |
case $option in |
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 | |
dict2json() { | |
local _data="" | |
trap 'if [[ -n "${_data}" ]]; then printf "{%s}" "${_data%?}" | jq -arc .; fi' RETURN | |
case "${#@}" in | |
0) | |
return | |
;; | |
1) |
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 | |
set -xeuo pipefail | |
DISK="${1}" | |
_DISKNAME="$(basename "${DISK}")" | |
openssl rand 4096 >"${_DISKNAME}.key" | |
yes YES | cryptsetup luksFormat -d "${_DISKNAME}.key" "${DISK}" || true |
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 python3 | |
# --- | |
# Copyright 2020 glowinthedark | |
# | |
# Licensed under the Apache License, Version 2.0 (the "License"); | |
# you may not use this file except in compliance with the License. | |
# | |
# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 | |
# | |
# Unless required by applicable law or agreed to in writing, |
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 | |
set -xeo pipefail | |
mem_clean() { | |
for i in {1..3}; do | |
sync | |
echo $i > /proc/sys/vm/drop_caches | |
done | |
} |
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
apiVersion: kubeadm.k8s.io/v1beta1 | |
kind: ClusterConfiguration | |
kubernetesVersion: v1.14.3 # change according to kubeadm supported version | |
apiServer: | |
certSANs: | |
- 127.0.0.1 | |
- cluster-api.example.com # change according to your requirements | |
extraArgs: | |
authorization-mode: Node,RBAC | |
feature-gates: "TTLAfterFinished=true" |
NewerOlder