Skip to content

Instantly share code, notes, and snippets.

@ilude
ilude / !proxmox_k3s_cluster.sh
Last active January 5, 2024 00:09
Proxmox k3s cluster creation scripts
#!/bin/bash
# curl -s https://gist.githubusercontent.com/ilude/457f2ef2e59d2bff8bb88b976464bb91/raw/cluster_create_setup.sh?$(date +%s) > ~/bin/setup_cluster.sh; chmod +x ~/bin/setup_cluster.sh; setup_cluster.sh
echo "begin cluster_create_setup.sh"
export CREATE_TEMPLATE=1 #false
while test $# -gt 0; do
case "$1" in
--template)
export CREATE_TEMPLATE=0 #true
@ilude
ilude / !pxe_history
Last active September 15, 2020 16:02
sudo systemctl disable systemd-resolved
sudo rm -v /etc/resolv.conf
echo "nameserver 9.9.9.9" | sudo tee /etc/resolv.conf
sudo apt install dnsmasq -y
# https://opensource.com/article/18/3/manage-workstation-ansible
# https://docs.ansible.com/ansible/latest/installation_guide/intro_installation.html#installing-ansible-on-ubuntu
# https://stackoverflow.com/questions/39819378/ansible-get-current-target-hosts-ip-address
# Currently ubuntu 20.04 focus does not have a ppa repo
# https://stackoverflow.com/a/61922637
@ilude
ilude / aws_var_setup.sh
Last active September 22, 2020 19:35
move /var to different disk on AWS
lsblk
sudo fdisk /dev/xvdf
sudo mkfs -t ext4 /dev/xvdf1
mount /dev/xvdf1 /mnt
sudo rsync -aulvXpogtr /var/* /mnt
umount /mnt
sudo nano /etc/fstab
/dev/xvdf1 /var ext4 defaults,noatime,nofail 0 2
@ilude
ilude / !media_server_setup.md
Last active January 26, 2022 06:11
Plex Server and associated services

Setup a docker-compose based plex server

@ilude
ilude / !BashCommand.sh
Last active March 13, 2022 02:21
PXE Notes
curl -s https://gist.githubusercontent.com/ilude/bf6d435352610528794d5cac4a0845a1/raw/%21ImageSetup.sh | /bin/bash -s | tee build.log
@ilude
ilude / Arch Notes
Last active January 16, 2020 05:45
Arch Notes
# Fix “invalid or corrupted package (PGP signature)”
sudo pacman -S archlinux-keyring
# update system --noconfirm
sudo pacman -Su
# remove package
sudo pacman -R <package_name>
# add package
@ilude
ilude / ffmpeg notes
Last active January 25, 2020 15:12
ffmpeg optimize
input=<>.mkv
output=<>.mp4
ffmpeg -i ${input} -vcodec libx265 -crf 20 ${output}
# https://stackoverflow.com/questions/23775693/best-video-format-using-ffmpeg-converter?rq=1
"-b:v 200k -vcodec libx264 -acodec aac -b:a 96k -strict -2"
@ilude
ilude / Scale Setup
Created June 19, 2019 13:26
Scale Setup
#idVendor 0x0b67 Fairbanks Scales
#idProduct 0x555e SCB-R9000
sudo apt-get update
sudo apt-get install -y ruby ruby-dev bundler samba samba-common-bin libusb-dev libhidapi-hidraw0 libhidapi-libusb0
sudo cp /etc/samba/smb.conf /etc/samba/smb.conf.orig
sudo bash -c "cat /dev/null > /etc/samba/smb.conf"
sudo tee -a /etc/samba/smb.conf >/dev/null <<'EOF'
[global]
@ilude
ilude / cloudflare-iptables
Created June 17, 2019 15:00
Create an ip set and us it to only allow cloudflare ip addresses through to port 4443
#!/bin/bash
# create the default iplist
sudo ipset create -exist cf4 hash:net
# check if the iptables rule exists and create it if it does not exist
sudo iptables -C INPUT -m set --match-set cf4 src -p tcp --dport 4443 -j ACCEPT > /dev/null 2>&1
if [ $? -eq 0 ]; then
echo "cf4 rule already exists!"
else
@ilude
ilude / snmp.yml
Created April 12, 2019 15:35 — forked from h3po/snmp.yml
Config for prometheus-snmp-exporter polling the most important metrics (mtu, bandwith, packet/byte counters, plug status) from a cisco switch stack, with static port properties (index, descr, type, mac, name, alias) as labels
#http://www.oidview.com/mibs/0/IF-MIB.html
#http://www.net-snmp.org/docs/mibs/interfaces.html
cisco_custom:
version: 2
auth:
community: public
walk:
- 1.3.6.1.2.1.2.2.1
- 1.3.6.1.2.1.31.1.1.1
metrics: