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 / 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
$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')}
@taxilian
taxilian / README.md
Last active July 25, 2024 07:36
OPNSense: Scripts to run as a cron job to enable or disable wireguard based on the CARP status

DEPRECATED

This is no longer needed; OPNSense now has full CARP support in the wireguard plugin which works much better than these hacks ever did =] I'll leave it here as an example of a thing you can do and 'cause why delete it?

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
@joshhunt
joshhunt / docker-compose.yml
Last active July 26, 2024 17:57
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:
@pohmelie
pohmelie / nginx-openresty reverse proxy ntlm support.md
Last active December 19, 2022 08:31
nginx/openresty reverse proxy ntlm support

nginx/openresty reverse proxy ntlm support

Problem

This code allows you to pass ntlm auth in nginx reverse proxy mode. The problem with plain nginx is that ntlm requires one tcp connection for multiple http requests. Even if browser respect this behaviour, nginx will create/took new connection for each request to ntlm-awared server.

Solution

Implement nginx-like stream proxy, but parse http to understand end of sequence (first request after ntlm auth). We need end of sequence, since browser can reuse opened tcp connection and send another request, which will be passed to ntlm-aware server and this is not you expect.

Installation

Put ntlm.lua to lualib path of openresty.

Linux

You need to install lua-http-parser into openresty lualib path with luarocks.

Windows

@lfdominguez
lfdominguez / rate_to_influx.sh
Last active June 28, 2023 14:15
Send traffics stats by ip from pfsense to influxdb
#!/bin/sh
#
# Author: Luis Felipe Domínguez Vega <ldominguezvega@gmail.com>
#
# Program to use with the rate software to send to InfluxDB the
# rate of each IP on interface
#
# rate_to_influx <influxdb_url> <influxdb_database> <local_network> <interface>
# rate_to_influx http://127.0.0.1:8086 network 192.168.0.0/24 re1
@crawc
crawc / README.md
Created October 3, 2018 01:40 — forked from mrbar42/README.md
bash scripts to create VOD HLS stream with ffmpeg almighty (tested on Linux and OS X)

running:

bash create-vod-hls.sh beach.mkv

will produce:

    beach/
      |- playlist.m3u8
 |- 360p.m3u8
@tavinus
tavinus / cloudsend.sh
Last active September 12, 2024 12:57
Send files to Nextcloud/Owncloud shared folder using curl
#!/usr/bin/env bash
############################################################
# MIGRATED TO REPOSITORY
# https://github.com/tavinus/cloudsend.sh
#
# This gist will NOT be updated anymore
############################################################
############################################################