Skip to content

Instantly share code, notes, and snippets.

View jthigh's full-sized avatar
😂

ᎫᎢ​​ᎻⅠᏀΗ jthigh

😂
View GitHub Profile
@jthigh
jthigh / cloudflare_dyn_dns.sh
Created September 17, 2023 23:08 — forked from chappy84/cloudflare_dyn_dns.sh
CloudFlare Dynamic DNS Shell Script
#!/bin/sh
#
# CloudFlare Dynamic DNS
#
# Updates CloudFlare records with the current public IP address
#
# Takes the same basic arguments as A/CNAME updates in the CloudFlare v4 API
# https://www.cloudflare.com/docs/client-api.html#s5.2
#
# Use with cron jobs etc.
@jthigh
jthigh / mta-sts.js
Created August 21, 2022 15:58 — forked from Tugzrida/mta-sts.js
MTA-STS Cloudflare worker
// This worker is designed to be able to neatly handle MTA-STS policies for multiple domains.
// Make a new worker with this script and add your domains to the stsPolicies dict like the example.
// Add a DNS AAAA record for mta-sts.yourdomain.com pointing to 100:: and set to proxied,
// then add a workers route for mta-sts.yourdomain.com/* pointing to this worker.
// You'll still need to manually add the appropriate _mta-sts.yourdomain.com TXT record to enable the policy,
// and the _smtp._tls.yourdomain.com TXT record for reporting.
const stsPolicies = {
@jthigh
jthigh / docker-compose.yml
Created February 20, 2022 20:14 — forked from Staubgeborener/docker-compose.yml
docker-compose for nextcloud, proxy, lets encrypt and mariadb
version: '3'
services:
proxy:
image: jwilder/nginx-proxy:alpine
labels:
- "com.github.jrcs.letsencrypt_nginx_proxy_companion.nginx_proxy=true"
container_name: nextcloud-proxy
networks:
@jthigh
jthigh / generate-moduli.sh
Created September 20, 2020 15:23 — forked from ulif/generate-moduli.sh
Generate primes for use with SSH
#!/bin/bash
#
# Create primes for use with ssh.
#
for bitlen in 2048 3072 4096 6144 8192 ;
do
echo Looking for candidates: $bitlen bits. ;
ssh-keygen -G moduli-${bitlen}.candidates -b $bitlen ;
cat moduli-${bitlen}.candidates >> moduli.candidates
rm moduli-${bitlen}.candidates
@jthigh
jthigh / powershell-non-domain-remoting.md
Created August 8, 2020 21:40 — forked from cmcginty/powershell-non-domain-remoting.md
Windows Powershell Remoting into Non-Domain Joined System

Powershell Remoting to a Non-Domain Host

  1. From an admin shell, enable PS remoting on the machine you wish to access:
New-ItemProperty -Name LocalAccountTokenFilterPolicy `
  -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System `
  -PropertyType DWord -Value 1

Enable-PsRemoting -Force
@jthigh
jthigh / RPi3-TCP-BBR.md
Created December 29, 2019 19:51 — forked from carry0987/RPi3-TCP-BBR.md
Raspberry Pi 3B+ Using BBR Congestion Control

Raspberry Pi 3B+ Using BBR Congestion Control

Check Kernel

uname -r

The kernel version should >= 4.9.4, if isn't, please follow the script below to update kernel:

Update Kernel

  1. sudo rpi-update
  2. sudo reboot
@jthigh
jthigh / install-nginx-1.17.4.sh
Created October 3, 2019 21:17 — forked from DSpeckhals/install-nginx-1.17.4.sh
Install nginx-1.17.4 with OpenSSL on Debian (including Raspbian)
#!/usr/bin/env bash
# Run as root or with sudo
# Make script exit if a simple command fails and
# Make script print commands being executed
set -e -x
# Set names of latest versions of each package
export VERSION_PCRE=pcre-8.43
export VERSION_ZLIB=zlib-1.2.11
@jthigh
jthigh / rules-both.iptables
Created September 22, 2019 02:29 — forked from jirutka/rules-both.iptables
Basic iptables template for ordinary servers (both IPv4 and IPv6)
###############################################################################
# The MIT License
#
# Copyright 2012-2014 Jakub Jirutka <jakub@jirutka.cz>.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is

Keybase proof

I hereby claim:

  • I am jthigh on github.
  • I am jthigh (https://keybase.io/jthigh) on keybase.
  • I have a public key ASBHL7eEBmuLeF7jn7fPXwT_fL0S61T-gDB9xjgYYacSlAo

To claim this, I am signing this object:

@jthigh
jthigh / fail2ban-allstatus.sh
Created August 26, 2019 18:31 — forked from kamermans/fail2ban-allstatus.sh
Show status of all fail2ban jails at once
#!/bin/bash
JAILS=`fail2ban-client status | grep "Jail list" | sed -E 's/^[^:]+:[ \t]+//' | sed 's/,//g'`
for JAIL in $JAILS
do
fail2ban-client status $JAIL
done