Skip to content

Instantly share code, notes, and snippets.

@ebal
ebal / cloud-init.sh
Created November 18, 2018 10:10
Cloud-init example using a Generic Cloud CentOS-7 on a libvirtd qmu/kvm lab
#!/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`
@basoro
basoro / proxmox-proxy
Created May 25, 2019 20:45
Running Proxmox behind a single IP address
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:
@grammy-jiang
grammy-jiang / zsh configuration.sh
Last active January 7, 2023 14:36
zsh configuration
#!/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
@RichardBronosky
RichardBronosky / README.md
Last active August 17, 2023 15:34
A bash plugin to make files executable

bash-plusx

A bash plugin to make files executable

Installation

Set up bash_plugins folder

(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
@Robokishan
Robokishan / expand-pi-image.sh
Last active June 13, 2025 11:03
Expand pi image
#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}"
@Voronenko
Voronenko / Bash Script Header.sh
Created November 11, 2021 15:06
bash bash bash
#!/bin/bash
#!/usr/bin/env bash
@gistbucket
gistbucket / run-docker-container.sh
Created March 12, 2022 22:01 — forked from clcollins/run-docker-container.sh
Bash script to easily setup and run Docker containers to test any given project
#!/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
@gistbucket
gistbucket / $ remember where you were.gif
Created July 27, 2022 15:01 — forked from RafaelKuhn/$ remember where you were.gif
🚀 Productivity shell functions
$ remember where you were.gif
@gistbucket
gistbucket / 5_deploy-helpers.functions.sh
Last active July 27, 2022 15:43 — forked from rdmarsh/rdmfuncs.sh
include>>Deploy.sh. Standard shell script functions
#!/usr/bin/env bash
########################################
###
########################################
########################################
###
###
###
@gistbucket
gistbucket / zsh configuration.sh
Last active April 28, 2024 10:16 — forked from grammy-jiang/zsh configuration.sh
zsh configuration
#!/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