Skip to content

Instantly share code, notes, and snippets.

@KalleDK
KalleDK / dnacsite.json
Last active November 19, 2023 11:26
DNAC Site Schema
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Generated schema for Root",
"type": "object",
"additionalProperties": false,
"properties": {
"areas": {
"type": "array",
"items": {
"$ref": "#/$defs/area"
{
"$defs": {
"ExtAttrValue": {
"title": "Value",
"type": "string"
},
"ExtAttrEnum": {
"properties": {
"value": {
"$ref": "#/$defs/ExtAttrValue"
@KalleDK
KalleDK / ipmi-updater.py
Created December 31, 2022 10:09 — forked from mcdamo/ipmi-updater.py
Supermicro IPMI certificate updater
#!/usr/bin/env python3
# vim: autoindent tabstop=4 shiftwidth=4 expandtab softtabstop=4 filetype=python
# This file is part of Supermicro IPMI certificate updater.
# Supermicro IPMI certificate updater is free software: you can
# redistribute it and/or modify it under the terms of the GNU General Public
# License as published by the Free Software Foundation, version 2.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
@KalleDK
KalleDK / autossh.service
Last active October 30, 2022 19:34
autossh
[Unit]
Description=AutoSSH
Documentation=man:autossh(1)
After=network-online.target sshd.service
[Service]
EnvironmentFile=/etc/default/autossh
EnvironmentFile=/etc/autossh/autossh.conf
ExecStart=/usr/lib/autossh/autossh -M ${MONITOR_PORT} -nNT -o ServerAliveInterval=60 -o ServerAliveCountMax=3 -o IdentitiesOnly=yes -o StrictHostKeyChecking=no -i ${TUNNEL_KEY_PATH} -R ${TUNNEL_MAPPING} ${TUNNEL_USER}@${TUNNEL_HOST}
ExecReload=kill -SIGUSR1 $MAINPID
{
"devices": [
{"name": "SW1", "id": "123"},
{"name": "SW2", "id": "456"}
]
}
@KalleDK
KalleDK / ferm.conf
Last active May 30, 2022 14:34
Ferm + IPv6 + Docker
# -*- shell-script -*-
#
# Configuration file for ferm(1).
#
domain (ip) {
table nat chain (POSTROUTING PREROUTING OUTPUT INPUT DOCKER) @preserve;
table filter chain (FORWARD DOCKER DOCKER-ISOLATION-STAGE-1 DOCKER-ISOLATION-STAGE-2) @preserve;
}
@KalleDK
KalleDK / p1.patch
Last active December 16, 2020 14:15
Acme Patches
--- /tmp/acme/acme.sh
+++ /usr/local/libexec/acme/acme.sh
@@ -2217,6 +2217,11 @@
_save_conf "$DOMAIN_CONF" "$@"
}
+#key value base64encode
+_savedomainconf_mutable() {
+ _savedomainconf "SAVED_$1" "$2" "$3"
+}
https://github.com/powerline/fonts/blob/master/DejaVuSansMono/DejaVu%20Sans%20Mono%20for%20Powerline.ttf
https://github.com/altercation/solarized/tree/master/putty-colors-solarized
# start-process powershell -argumentlist "-ExecutionPolicy Bypass" -verb runAs
# . { iwr -useb https://boxstarter.org/bootstrapper.ps1 } | iex; Get-Boxstarter -Force
# Install-BoxstarterPackage -PackageName https://gist.github.com/KalleDK/512ddedb2329f657635098acb0deed5d/raw/f78d7ef7751e4e967cd4e4c230bdcc62e3026998/Boxstarter -DisableReboots
Enable-MicrosoftUpdate
Install-WindowsUpdate -Criteria "IsHidden=0 and IsInstalled=0"
Set-WindowsExplorerOptions -EnableShowHiddenFilesFoldersDrives -DisableShowProtectedOSFiles -EnableShowFileExtensions -EnableShowFullPathInTitleBar -EnableOpenFileExplorerToQuickAccess
Set-BoxstarterTaskbarOptions -Size Small -Dock Bottom -Combine Never -AlwaysShowIconsOn
Set-BoxstarterTaskbarOptions -MultiMonitorOn -MultiMonitorMode Open -MultiMonitorCombine Never
Enable-RemoteDesktop
package csvutil_test
import (
"bytes"
"encoding/csv"
"testing"
"io"
"time"
"github.com/jszwec/csvutil"