Skip to content

Instantly share code, notes, and snippets.

View ilium007's full-sized avatar

ilium007

  • NSW, Australia
View GitHub Profile
@ilium007
ilium007 / alpine_password.sh
Created November 17, 2024 04:55 — forked from kennwhite/alpine_password.sh
Non-interactive user create & password change for Alpine Linux
#! /usr/bin/env sh
# Create unprivileged Alpine linux user. Run this script as root/sudo
# Don't prompt for password and make group same as username, default path & shell
adduser -D -g appuser appuser
# Set a decent random password (aiming for a 256 bit security level, but better than "monkey")
PW=$(head -c 32 /dev/urandom | base64) && echo -e "$PW\n$PW" | passwd appuser && unset PW
@ilium007
ilium007 / starship.toml
Last active November 9, 2024 07:17 — forked from 3ayazaya/starship.toml
My Starship terminal configuration file
# Get editor completions based on the config schema
"$schema" = 'https://starship.rs/config-schema.json'
# Inserts a blank line between shell prompts
add_newline = true
#format = """
#[╭─user───❯](bold blue) $username
#[┣─system─❯](bold yellow) $hostname
#[┣─project❯](bold red) $directory$rust$git_branch$git_status$package$golang$terraform$docker_context$python$docker_context$nodejs
@ilium007
ilium007 / GROW.md
Created September 10, 2024 09:19 — forked from jornane/GROW.md
How to grow a partition in Linux

How to grow a partition in Linux

This guide will walk you through the steps required to grow a partition in Linux. You will have to reboot through this guide.

  1. If possible, make a snapshot.

Often, you will want to grow the partition table because you made your virtual hard disk too small, and you tried to extend it in your hypervisor, only to find out that your partition is still the same size as it was before.

@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 / 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!