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
qemu-img create -f qcow2 /mount/path/disk.qcow2 -o preallocation=metadata 20G | |
sudo virsh attach-disk domain --source /mnt/files/VM/work/minikube.qcow2 --target vdc --cache none --persistent |
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
LEN=$1 | |
< /dev/urandom tr -dc _A-Z-a-z-0-9 | head -c$LEN |
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 | |
if [ "$EUID" -ne 0 ]; then | |
echo -e "\nPlease run as root\neg. sudo $0 \n" | |
exit | |
fi | |
GITHUB_USERNAME="ebal" | |
cd `mktemp -d` |
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
qemu-system-x86_64 -m 2048 -accel hvf -smp 2 -net nic -net user -device VGA,vgamem_mb=128,edid=on,xres=1680,yres=1050 -hda arch.img | |
# Mac host, access usb | |
-device pci-ohci | |
# Mac host, access usb raw storage device | |
-hdb /dev/disk2 |
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
mkdir .auth | |
# Create basic auth | |
docker run \ | |
--entrypoint htpasswd \ | |
registry:2 -Bbn testuser testpassword > .auth/htpasswd | |
# Make sure to serve this into an HTTPS load balancer/frontend | |
docker run -d \ | |
-p 5000:5000 \ |
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: v1 | |
kind: Pod | |
metadata: | |
name: <app-name> | |
labels: | |
app: <app-name> | |
spec: | |
containers: | |
- name: <app-name> | |
image: <account>.dkr.ecr.us-west-2.amazonaws.com/<app-name>:latest |
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
echo 'net.netfilter.nf_conntrack_max=65528 | |
net.ipv4.netfilter.ip_conntrack_max=65535' >> /etc/sysctl.conf | |
iptables -A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT | |
sysctl -p /etc/sysctl.conf | |
curl -sfL https://get.k3s.io | sh - |
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
# How many hours | |
DURATION_HRS=1 | |
let DURATION_MINS=$DURATION_HRS*60 | |
aws ec2 request-spot-instances --block-duration-minutes $DURATION_MINS --launch-specification file://bastion-spot-specs.json |
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
# Wipe existing partition | |
sudo wipefs -a /dev/sdX | |
# Create PV | |
sudo pvcreate /dev/sdX | |
# Create VG | |
sudo vgcreate VolGroup00 /dev/sdX | |
# Create LV |
NewerOlder