Skip to content

Instantly share code, notes, and snippets.

View ilium007's full-sized avatar

ilium007

  • NSW, Australia
View GitHub Profile
@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 / 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 / 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