Skip to content

Instantly share code, notes, and snippets.

@crawc
crawc / harvester_clout_init.md
Created August 5, 2024 00:01 — forked from clemenko/harvester_clout_init.md
A cloud_init example for Harvester and Rocky/Ubuntu
@crawc
crawc / docker-compose.yml
Created July 26, 2024 17:57 — forked from joshhunt/docker-compose.yml
Docker Compose file for grafana/nginx reverse proxy
version: "3"
services:
nginx:
image: nginx:latest
container_name: nginx
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf
ports:
- 8080:80
networks:
@crawc
crawc / mail2fax.sh
Created June 7, 2024 19:46 — forked from stefb69/mail2fax.sh
Mail to Fax gateway script for hylafax
#!/bin/sh
# mail2fax reloaded
# modified version working 100% by stefb (for europe)
# This script allows you to send faxes through your HylaFAX box.
# It uses mpack to strip out email attachments and sendfax to do
# the fax delivery.
### Temporary dir stuff
RANDOMFAX=/tmp/faxtmp.$(dd if=/dev/urandom count=1 2> /dev/null | cksum | cut -f1 -d" ")
#!/bin/bash
# Script to reinstall and configure SSH for password authentication and root login
# Check if the script is run as root
if [ "$(id -u)" -ne 0 ]; then
echo "This script must be run as root. Please use sudo or log in as root."
exit 1
fi
@crawc
crawc / jbt-rules.cf
Created March 26, 2024 23:13 — forked from jult/jbt-rules.cf
SpamAssassin rules
# Put this file under /etc/spamassassin/ and run an sa-update or reload amavis etc.
#
#--------------------------------------------------
# The only RBL I trust, UCEPROTECT1 (single IP, not IP-ranges or entire ISPs) http://uceprotect.net
#--------------------------------------------------
header RCVD_IN_UCEPROTECT1 eval:check_rbl_txt('uceprotect1', 'dnsbl-1.uceprotect.net')
describe RCVD_IN_UCEPROTECT1 Listed in dnsbl-1.uceprotect.net
tflags RCVD_IN_UCEPROTECT1 net
score RCVD_IN_UCEPROTECT1 1.8
@crawc
crawc / README.md
Created April 22, 2023 20:03 — forked from taxilian/README.md
OPNSense: Scripts to run as a cron job to enable or disable wireguard based on the CARP status

Installation

  • Install checkWireguard as /usr/local/opnsense/scripts/OPNsense/Wireguard/checkWireguard
  • Install actions_wireguardCarp.conf as /usr/local/opnsense/service/conf/actions.d/actions_wireguardCarp.conf
  • run service configd restart
  • In the OPNSense UI - add a CRON job in System -> Settings -> Cron to call the script
@crawc
crawc / syslogger.py
Created February 23, 2023 19:04 — forked from haukurk/syslogger.py
Logger that sends to syslog servers.
#!/usr/bin/python
# -*- encoding: iso-8859-1 -*-
"""
Python syslog client.
This code is placed in the public domain by the author.
Written by Christian Stigen Larsen.
This is especially neat for Windows users, who (I think) don't
@crawc
crawc / pysyslog.py
Last active February 12, 2023 18:43 — forked from marcelom/pysyslog.py
Tiny Python Syslog Server
#!/usr/bin/env python
## Tiny Syslog Server in Python.
##
## This is a tiny syslog server that is able to receive UDP based syslog
## entries on a specified port and save them to a file.
## That's it... it does nothing else...
## There are a few configuration parameters.
LOG_FILE = 'youlogfile.log'
$prtguser = "apiuser"
$prtghash = "123456"
$match = "Auto-Discovery *"
$actiontype = "close" # "close" or "resolve"
$message = "auto close"
$hostname = "prtg.yourdomain.com"
$URI = "https://" + $hostname + "/api/table.json?content=tickets&columns=datetime,priority,parentid,message,user,status,name&filter_drel=&username=" + $prtguser + "&passhash=" + $prtghash
$response = Invoke-WebRequest $URI
$jsonObj = $([String]::new($response.Content)) | ConvertFrom-Json | select -expand tickets | select parentid,status_raw,message_raw | Where-Object {($_.message_raw -like $match) -and ($_.status_raw -EQ '1')}