Skip to content

Instantly share code, notes, and snippets.

Avatar

morph027

View GitHub Profile
@morph027
morph027 / scrub-all.sh
Last active Jul 1, 2016
scrub all zfs on linux pools sequentially (with option to exclude pools)
View scrub-all.sh
#!/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"
@morph027
morph027 / cloudns_update
Last active Sep 6, 2020
update cloudns ddns from plain OpenWRT
View cloudns_update
#!/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 / check_mk_agent_ash
Created Aug 11, 2016
check_mg_agent for ash (e.g. OpenWRT)
View check_mk_agent_ash
#!/bin/ash
# +------------------------------------------------------------------+
# | ____ _ _ __ __ _ __ |
# | / ___| |__ ___ ___| | __ | \/ | |/ / |
# | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / |
# | | |___| | | | __/ (__| < | | | | . \ |
# | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ |
# | |
# | Copyright Mathias Kettner 2014 mk@mathias-kettner.de |
# +------------------------------------------------------------------+
View 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 / minio.jinja2
Created Oct 23, 2017
Ansible Jinja2 template for generating Minio cluster systemd control script
View minio.jinja2
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 }}
View newreleases-hook.py
#!/usr/bin/env python3
# pip install sanic
import codecs
import hashlib
import hmac
import os
import sys
from sanic import Sanic
@morph027
morph027 / Caddyfile
Created May 17, 2020
caddy2 ip filter
View Caddyfile
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
View talk-bootstrap.sh
#!/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