Skip to content

Instantly share code, notes, and snippets.

View ilium007's full-sized avatar

ilium007

  • NSW, Australia
View GitHub Profile
@ilium007
ilium007 / dhcp-leases-to-dns.rsc
Created November 17, 2023 07:36 — forked from SmartFinn/dhcp-leases-to-dns.rsc
MikroTik (RouterOS) script for automatically setting DNS records for clients when they obtain a DHCP lease
# MikroTik (RouterOS) script for automatically setting DNS records
# for clients when they obtain a DHCP lease.
#
# author SmartFinn <https://gist.github.com/SmartFinn>
:local dnsTTL "00:15:00";
:local token "$leaseServerName-$leaseActMAC";
# Normalize hostname (e.g. "-= My Phone =-" -> "My-Phone")
# - truncate length to 63 chars
@ilium007
ilium007 / proxmox-cli-and-tips.md
Created July 21, 2022 04:33 — forked from dragolabs/proxmox-cli-and-tips.md
Useful proxmox commands

Find next free VM ID

pvesh get /cluster/nextid

Create containter with external and internal nets

pct create 100 \
    local:vztmpl/ubuntu-16.04-standard_16.04-1_amd64.tar.gz \
    --cores 2 --cpuunits 1024 \
@ilium007
ilium007 / simple_device.py
Created April 12, 2022 15:07 — forked from Karn/simple_device.py
Python State Machine - Simple State Machine
from states import LockedState
class SimpleDevice(object):
"""
A simple state machine that mimics the functionality of a device from a
high level.
"""
def __init__(self):
""" Initialize the components. """
@ilium007
ilium007 / Securing-SWAG.md
Created May 31, 2021 00:15 — forked from quietsy/Securing-SWAG.md
Securing SWAG

Securing SWAG

SWAG - Secure Web Application Gateway (formerly known as linuxserver/letsencrypt) is a full fledged web server and reverse proxy with Nginx, PHP7, Certbot (Let's Encrypt™ client) and Fail2Ban built in. SWAG allows you to expose applications to the internet, doing so comes with a risk and there are security measures that help reduce that risk. This article details how to configure SWAG and enhance it's security.

This article assumes that you already have a functional SWAG setup. Following is the compose yaml used to create the SWAG container referenced in this article. Keep in mind your local mount paths will be different so adjust accordingly.

---
version: "2.1"
services:
  swag:
#!/usr/bin/env bash
## Configs ##
ZFSSNAPSHOTNAME="duplicacy"
DUPLICACY_CMD="/root/duplicacy"
mountSnapshots () {
mkdir -p "/mnt/$ZFSSNAPSHOTNAME"
mount -t zfs "$ZFSSNAPSHOTBASE@$ZFSSNAPSHOTNAME" "/mnt/$ZFSSNAPSHOTNAME"
@ilium007
ilium007 / rclone-backup.sh
Last active October 31, 2019 12:01 — forked from cnrd/rclone-backup.sh
Backup script that uses rclone and ZFS snapshots to create incremental backups
#!/usr/bin/env bash
## Configs ##
ZFSSNAPSHOTNAME="rclone"
RCLONECONFIGPATH="/root/.config/rclone/rclone.conf"
BWLIMIT="10M"
TRANSFERS=15
KEEPSNAPSHOTS=7
usage ()
@ilium007
ilium007 / viscosity-to-ios-connect.rb
Last active November 24, 2018 13:10 — forked from chrisboulton/viscosity-to-ios-connect.rb
Quickly convert all of your Viscosity connections into OVPN configuration files for OpenVPN for iOS (bundles certificates and keys in the files too)
config_files = Dir.glob("#{ENV['HOME']}/Library/Application Support/Viscosity/OpenVPN/*/config.conf")
config_files.each do |file|
certificate_files = ['ca', 'cert', 'key', 'tls-auth']
config_dir = File.dirname(file)
connection_name = nil
new_config = []
File.read(file).each_line do |line|
line.strip!
@ilium007
ilium007 / tomato_backup.sh
Created December 22, 2016 03:58
Tomato router backup script.
#!/bin/sh
#USE AT YOUR OWN RISK.
#THIS SCRIPT DOES NOT COME WITH ANY WARRANTY WHATSOEVER.
#
#Backs up selected nvram variables in "nvram export --set" format.
#
#Correctly handles multi-line entries.
#
#Thanks to ryzhov_al for basic approach.
@ilium007
ilium007 / install_cygwin_sshd.txt
Created September 16, 2017 07:46 — forked from roxlu/install_cygwin_sshd.txt
Installing CYGWIN + SSHD for remote access through SSH on windows
Installing CYGWIN with SSH
1) Download cygwin setup.exe from http://www.cygwin.com
- Execute setup.exe
- Install from internet
- Root directory: `c:\cygwin` + all users
- Local package directory: use default value
- Select a mirror to download files from
- Select these packages:
- editors > xemacs 21.4.22-1
- net > openssh 6.1-p
@ilium007
ilium007 / archive_backup.sh
Last active December 30, 2016 16:26
archive Tomato backups
#!/bin/sh
logger -t "nvram_archive" "start script"
[ $# -eq 0 ] && { echo "Usage: $0 days_to_keep" ; logger -t "nvram_archive" "end script with error; no arg supplied"; exit 1; }
keep_for_days=$1
echo "removing backups older than $keep_for_days days"
#keep_for_days=${1-14}
logger -t "nvram_archive" "removing backups older than $keep_for_days days"