Skip to content

Instantly share code, notes, and snippets.

@bluewalk
bluewalk / EnvironmentVariableLoggingLevelSwitch.cs
Last active April 19, 2021 05:26
Serilog-EnvironmentVariableLoggingLevelSwitch
public class EnvironmentVariableLoggingLevelSwitch : LoggingLevelSwitch
{
public EnvironmentVariableLoggingLevelSwitch(string environmentVariable,
LogEventLevel defaultLevel = LogEventLevel.Information)
{
MinimumLevel =
Enum.TryParse<LogEventLevel>(Environment.GetEnvironmentVariable(environmentVariable), true,
out var level)
? level
: defaultLevel;
@bluewalk
bluewalk / vpn.sh
Created January 2, 2022 19:40
VPN.SH script to tunnel specific VLAN through a WireGuard tunnel on an UDM Pro
#!/bin/sh
INTERFACE="vpn0"
MARK=100
TABLE="vpn"
SCRIPT_NAME="/etc/wireguard/scripts/vpn.sh"
# set this to the interface(s) on which you want WAN traffic to
# be routed through vpn. separate interfaces with spaces.
# e.g. "br0" or "br0 br1" etc.
@bluewalk
bluewalk / Disable-Ubuntu-pro-ads.md
Created February 8, 2023 12:49
DIsable Ubuntu pro ads

How to disable cloud-init in Ubuntu

apt-get  --assume-yes  --purge  remove  ubuntu-advantage-tools
@bluewalk
bluewalk / Remove-Ubuntu-Pro-BS.md
Created March 27, 2024 07:08
Remove Ubuntu Pro BS

Remove Ubuntu Pro BS

sudo apt remove --purge ubuntu-advantage* -y
sudo apt autoremove -y