Skip to content

Instantly share code, notes, and snippets.

Weird flex but HTTP 200

Charlie Jonas CHTJonas

Weird flex but HTTP 200
View GitHub Profile
set -euo pipefail
rm -f /dev/shm/unbound.cache
trap "rm -f /dev/shm/unbound.cache" EXIT INT TERM HUP QUIT ILL TRAP BUS SEGV
umask 0077
touch /dev/shm/unbound.cache
if [[ $EUID -ne 0 ]]; then
echo "This script should be run as root"
exit 1
# Install build dependencies
apt install -y build-essential libssl-dev libreadline-dev zlib1g-dev libmariadb-dev
CHTJonas / delegation.rb
Created Dec 14, 2019
Full method delegation in Ruby 3
View delegation.rb
def foo(*args, **kwargs, &block)
target(*args, **kwargs, &block)
CHTJonas / UniFi
Last active Apr 26, 2022
Tunnelbroker config for UniFi Security Gateway
View UniFi

UniFi Tunnelbroker Configuration

This GitHub Gist details the manual configuration needed on a UniFi controller to enable IPv6 tunneling with Hurricane Electric's Tunnelbroker service.


This is what works for me personally. Stuff you'll need to do to adapt this to your ends:

  • Replace "local-ip" with your USG's public IPv4 address.
  • Replace "remote-ip" with the address of your Tunnelbroker tunnel server.
  • Replace "address" with the IPv6 address that your are allocated.
CHTJonas / omniauth_csrf_test.rb
Created Jul 24, 2019
Rails tests to verify that CVE-2015-9284 is mitigated.
View omniauth_csrf_test.rb
require 'test_helper'
# Make sure that is mitigated
class OmniauthCsrfTest < ActionDispatch::IntegrationTest
setup do
ActionController::Base.allow_forgery_protection = true
OmniAuth.config.test_mode = false
test "should not accept GET requests to OmniAuth endpoint" do
CHTJonas / regex.txt
Created Jun 19, 2019
Fully RFC822 compliant email regex
View regex.txt
(?:(?:\r\n)?[ \t])*(?:(?:(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t]
)+|\Z|(?=[\["()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)?[ \t]))*"(?:(?:
\r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(
?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)?[
\t]))*"(?:(?:\r\n)?[ \t])*))*@(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\0
31]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\
](?:(?:\r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+
(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:
(?:\r\n)?[ \t])*))*|(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z
|(?=[\["()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)?[ \t]))*"(?:(?:\r\n)
if [[ $EUID -ne 0 ]]; then
echo "This script should be run as root"
exit 1
# Install system utilities to make our lives easier
apt install -y mosh byobu wget curl htop nano vim
apt install -y software-properties-common apt-transport-https
CHTJonas /
Created Feb 9, 2018
oh-my-zsh git plugin aliases
Alias Command
g git
ga git add
gaa git add --all
gapa git add --patch
gua git add --

Keybase proof

I hereby claim:

  • I am chtjonas on github.
  • I am chtjonas ( on keybase.
  • I have a public key ASCVsroYPKaUXGQqyGc3q_33ENOCwjsqOvvg-s1DSF39uAo

To claim this, I am signing this object: