Skip to content

Instantly share code, notes, and snippets.

@robinsmidsrod
robinsmidsrod / dhcpd.conf
Last active June 11, 2024 13:10
Trying to chainload iPXE with full feature set from a lesser featured one, whilst still being able to boot non-supported cards with UNDI
ddns-update-style none;
deny bootp; #default
authoritative;
include "/etc/dhcp/ipxe-option-space.conf";
# GREEN (private network)
subnet 10.1.1.0 netmask 255.255.255.0 {
range 10.1.1.100 10.1.1.199;
option subnet-mask 255.255.255.0;
@02strich
02strich / check_mk_twilio.py
Created May 16, 2014 13:48
Twilio Notifications for Check MK
#!/usr/bin/env python
# Send Notifications via SMS (twilio)
import os
import logging
from twilio.rest import TwilioRestClient
ACCOUNT_SID = "<<YOUR SID>>"
AUTH_TOKEN = "<<YOUR TOKEN>>"
@georgy7
georgy7 / extract_mbox_attachments.py
Last active July 26, 2024 12:45
Extract attachments from mbox file.
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Modified.
# Original script source:
# http://blog.marcbelmont.com/2012/10/script-to-extract-email-attachments.html
# https://web.archive.org/web/20150312172727/http://blog.marcbelmont.com/2012/10/script-to-extract-email-attachments.html
# Usage:
# Run the script from a folder with file "all.mbox"
@dmp1ce
dmp1ce / start_transmission_daemon.sh
Created May 3, 2015 12:18
Start transmission-daemon and bind it to VPN IP address
#!/bin/bash
# Kill transmission-daemon if it is running
transmission_da_pid=$(pgrep transmission-da)
if [ $transmission_da_pid ]; then
killall transmission-daemon && echo "Closing existing tranmission-daemon processes ..." && sleep 8
fi
# Get VPN IP to bind to
bind_address=$(ip addr show tun0 | grep inet | awk '{print $2}')
@spali
spali / 10-wancarp
Last active July 25, 2024 07:36
Disable WAN Interface on CARP Backup
#!/usr/local/bin/php
<?php
require_once("config.inc");
require_once("interfaces.inc");
require_once("util.inc");
$subsystem = !empty($argv[1]) ? $argv[1] : '';
$type = !empty($argv[2]) ? $argv[2] : '';
@kronenpj
kronenpj / 10-wancarp
Last active July 28, 2024 15:26
OpnSense 23.1 - Disable WAN + OPT2 Interfaces during CARP Failover
#!/usr/local/bin/php
<?php
require_once("config.inc");
require_once("system.inc");
require_once("interfaces.inc");
require_once("util.inc");
$subsystem = !empty($argv[1]) ? $argv[1] : '';
$type = !empty($argv[2]) ? $argv[2] : '';