Skip to content

Instantly share code, notes, and snippets.

View zlinuxboy's full-sized avatar

zlinuxboy

View GitHub Profile
@zlinuxboy
zlinuxboy / meraki-init.sh
Created March 16, 2023 05:02 — forked from lukas2511/meraki-init.sh
Meraki MS220-8P config without cloud bullshit
#!/bin/sh
# This script configures a meraki ms220-8p switch completely from scratch
# See https://leo.leung.xyz/wiki/Meraki_MS220-8P for rooting instructions
# You can keep config and config.local completely empty, but i'd recommend to add a configuration
# which isolates all ports from each other.
# Without that you might have switching loops on bootup (unlikely since STP keeps longer to initialize
# than it takes this script to take over, but it just feels cleaner).
@zlinuxboy
zlinuxboy / nftables-lb-wan.sh
Created October 17, 2022 22:22 — forked from elico/nftables-lb-wan.sh
Dual WAN Flow Base PCC nftables load balancing example script
#!/usr/bin/env bash
DEST_NET="192.168.111.0/24"
NEXT_HOPS="2"
NEXT_HOP_1="192.168.126.202"
NEXT_HOP_2="192.168.126.203"
NEXT_HOP_1_TABLE="202"
@zlinuxboy
zlinuxboy / dbus-cheat-sheet.py
Created September 5, 2022 10:31 — forked from ciiqr/dbus-cheat-sheet.py
Simple dbus python usage
## Cheat Sheet
# Start
import dbus
bus = dbus.SystemBus()
# OR
bus = dbus.SessionBus()
# Bus name
some_bus_name = "com.example.SomeService"
@zlinuxboy
zlinuxboy / cli.py
Created October 28, 2021 00:50 — forked from darKoram/cli.py
pass json dict-as-string commandline args to functions or methods in a files
import os
# based on
# http://code.activestate.com/recipes/577122-transform-command-line-arguments-to-args-and-kwarg/
def _method_info_from_argv(argv=None):
"""Command-line -> method call arg processing.
- positional args:
a b -> method('a', 'b')
@zlinuxboy
zlinuxboy / ReadMe.md
Created October 26, 2021 10:13 — forked from TheBigBear/ReadMe.md
first simple python jinja2 writer to control config files of a bunch of openwrt WL APs

I want to write a simple python 2.7 jinja2 writer that writes out text config files for WL AccessPoints

I have the following structure in my directory ~/Documents/PyCharmProjects:

config-data.csv
mk-wl-ap-configs.py
shadow.jinja
network.jinja
wireless,jinja
@zlinuxboy
zlinuxboy / CUSTOM_rules.inc-pfSense
Created March 1, 2017 16:31 — forked from PiBa-NL/CUSTOM_rules.inc-pfSense
adding custom rules on pfSense not supported by webgui
<?php
// Add this file as: /usr/local/pkg/CUSTOM_rules.inc
// pfSense will automatically add the rules defined here into the rules it loads in pf
require_once("util.inc");
function CUSTOM_rules_generate_rules($type) {
// called by filter.inc when pfSense rules generation happens
$rules = "";