A bash plugin to make files executable
(Skip this step if you already have a bash_plugins folder.)
{
# simply copy-pasta this whole block, or customize these vars and copy-pasta the rest
#!/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` |
I ran into the battle of running all of my VMs and the host node under a single public IP address. Luckily, the host is just pure Debian, and ships with iptables. | |
What needs to be done is essentially to run all the VMs on a private internal network. Outbound internet access is done via NAT. Inbound access is via port forwarding. | |
Network configuration | |
Here’s how it’s done: | |
Create a virtual interface that serves as the gateway for your VMs: |
#!/usr/bin/env bash | |
echo "Install dependencies now..." | |
sudo -- sh -c "apt update && apt install -y curl fzf gawk git python3-pygments sqlite3 ssh-askpass wget zsh" | |
if [ -f ~/.zshrc ]; then | |
mv ~/.zshrc ~/.zshrc.`date +%s`.bak | |
fi | |
if [ -d ~/.oh-my-zsh ]; then | |
echo "Oh My ZSH exists, update it now..." | |
git -C ~/.oh-my-zsh pull |
#sudo bash expand-pi-image.sh <img-file> | |
#sudo setup-chroot.sh <img-file> | |
#run changes and type exit | |
if [ "$1" ]; then | |
real_file_path=`realpath "${1}"` | |
echo "Img File: ${real_file_path}" | |
dd if=/dev/zero bs=1M count=1024 >> $real_file_path | |
sudo kpartx -v -a $real_file_path | |
loop_device=`losetup --list | grep "${real_file_path}" | cut -d ' ' -f1 | cut -d'/' -f3` | |
echo "Loop Device => /dev/${loop_device}" |
#!/bin/bash | |
#!/usr/bin/env bash |
#!/bin/bash | |
# Set to true to just see what command | |
# would be run | |
DRY_RUN=false | |
TITLE='MY-TEST-CONTAINER' | |
IMAGE='MY-IMAGE' | |
# Local volume to be mapped into the container any time you run it | |
# usually with config files or whatnot |
#!/usr/bin/env bash | |
######################################## | |
### | |
######################################## | |
######################################## | |
### | |
### | |
### |
#!/usr/bin/env bash | |
echo "Install dependencies now..." | |
sudo -- sh -c "apt update && apt install -y curl fzf gawk git python3-pygments sqlite3 ssh-askpass wget zsh" | |
if [ -f ~/.zshrc ]; then | |
mv ~/.zshrc ~/.zshrc.$(date +%s).bak | |
fi | |
if [ -d ~/.oh-my-zsh ]; then | |
echo "Oh My ZSH exists, update it now..." | |
git -C ~/.oh-my-zsh pull |