Skip to content

Instantly share code, notes, and snippets.

View morph027's full-sized avatar

morph027

View GitHub Profile
#!/bin/bash
nc_secret="$(openssl rand -hex 16)"
janus_api_key="$(openssl rand -base64 16)"
cat > /tmp/script.conf << EOF
[http]
listen = 127.0.0.1:8081
[app]
debug = false
@morph027
morph027 / Caddyfile
Created May 17, 2020 19:16
caddy2 ip filter
intranet.example.com {
@ipfilter {
not remote_ip 192.168.0.0/16
}
route @ipfilter {
# redirect
redir https://example.com/
# or respond
# respond "Access denied" 403 {
# close
#!/usr/bin/env python3
# pip install sanic
import codecs
import hashlib
import hmac
import os
import sys
from sanic import Sanic
@morph027
morph027 / minio.jinja2
Created October 23, 2017 05:37
Ansible Jinja2 template for generating Minio cluster systemd control script
MINIO_VOLUMES={% for minio_node in minio_nodes -%}
https://{{ minio_node }}/home/minio/volume
{%- if not loop.last %} {% endif -%}
{%- endfor %}
{% if minio_access_key %}
MINIO_ACCESS_KEY={{ minio_access_key }}
{% endif %}
{% if minio_secret_key %}
MINIO_SECRET_KEY={{ minio_secret_key }}
@morph027
morph027 / keybase.md
Created March 20, 2017 18:14
keybase.md

Keybase proof

I hereby claim:

  • I am morph027 on github.
  • I am morph027 (https://keybase.io/morph027) on keybase.
  • I have a public key ASA4xgwnXwGa66luxWJNa-0n3MhfX7_jT-O_Xnvhd-LUOAo

To claim this, I am signing this object:

@morph027
morph027 / check_mk_agent_ash
Created August 11, 2016 10:27
check_mg_agent for ash (e.g. OpenWRT)
#!/bin/ash
# +------------------------------------------------------------------+
# | ____ _ _ __ __ _ __ |
# | / ___| |__ ___ ___| | __ | \/ | |/ / |
# | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / |
# | | |___| | | | __/ (__| < | | | | . \ |
# | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ |
# | |
# | Copyright Mathias Kettner 2014 mk@mathias-kettner.de |
# +------------------------------------------------------------------+
@morph027
morph027 / cloudns_update
Last active September 6, 2020 15:15
update cloudns ddns from plain OpenWRT
#!/bin/ash
CURRENT_IP=$(wget -q http://whatismyip.akamai.com/ -O -)
CLOUDNS_HANDLE="example.com" # <<<--- YOUR DNS NAME
CLOUDNS_SERVER=109.201.133.194 # DNS SERVER
echo "current IP: $CURRENT_IP"
DNS_IP=$(nslookup $CLOUDNS_HANDLE $CLOUDNS_SERVER | awk '/guest-wan.pw.cloudns.pro/,/Address/' | grep -Eo '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}')
echo "DNS IP: $DNS_IP"
@morph027
morph027 / scrub-all.sh
Last active March 2, 2022 13:44
scrub all zfs on linux pools sequentially (with option to exclude pools)
#!/bin/bash
##
## --exclude takes one pool or a comma seperated list of pools
##
## Example: scrub-all.sh --exclude rpool
## Example: scrub-all.sh --exclude rpool,tank-foo,tank-bar
##
EMAIL_RECIPIENT="foo@bar.com"