Skip to content

Instantly share code, notes, and snippets.

View zoonderkins's full-sized avatar
🏠
Working 👍

Quack~ zoonderkins

🏠
Working 👍
View GitHub Profile
@zoonderkins
zoonderkins / mac-mojave-10-14-protection.md
Created April 14, 2019 08:05
Turn off all Mac Mojave 10.14 Proctection

SIP Disable

Need to disable on Recovery mode, CMD + R

csrutil status

csrutil disable

Disable Gatekeeper

@zoonderkins
zoonderkins / Debian9-sid-install-haproxy-1.9.md
Created March 20, 2019 02:26
Haproxy install on Debian9 sid 1.9.5 #linux

Debian/Ubuntu install HAProxy 1.9 by using sid

https://haproxy.debian.net/#?distribution=Debian&release=sid&version=1.9

You need to enable the experimental repository:

echo deb http://httpredir.debian.org/debian experimental main | \

tee /etc/apt/sources.list.d/experimental.list

@zoonderkins
zoonderkins / use-ipset-block-ip-linux.md
Last active March 17, 2019 17:57
IPset to block IP on Linux #linux

Env: Debian9 or Ubuntu

Installation

apt install ipset

Setup Ipv4, IPv6

@zoonderkins
zoonderkins / temp-dns-iptables.md
Last active March 16, 2019 14:27
temp-dns-iptables.md
*filter
:INPUT DROP [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
:f2b-sshd - [0:0]
:f2b-SSH - [0:0]
:RATE-LIMIT - [0:0]

-A INPUT -i lo -j ACCEPT
@zoonderkins
zoonderkins / awesome-ublock-rules.md
Last active March 12, 2019 12:37
Awesome-uBlock-rules #adblock

Edited: 2018-03-12

News

Washingtonpost.com

||washingtonpost.com/*/adblocker-feature^$xhr

Bostonglobe.com

Script block

@zoonderkins
zoonderkins / linux-change-keyboard-layout-to-us.md
Created February 21, 2019 11:27
Linux change keyboard layout to US #linux

hetzner cloud vps

By default, it comes with DE keyboard. It kinda a pain in the ass...

So easy way to change to US keyboard layout, follow this few steps

// not recommend this
dpkg-reconfigure keyboard-configuration
@zoonderkins
zoonderkins / require-js.js
Last active February 20, 2019 15:43
require-js #javascript
// License belongs to @serapath
// https://gistcdn.githack.com/ookangzheng/98af01a88a0ab8937d24e12f0c5d307e/raw/afb42195ba4f1542d2dffe634179458a79de9c11/require-js.js
// CDN: https://yerl.org/nLBxY
window.require = (function (modules) {
function init (name, _module) {
var se = document.createElement('script')
var module = JSON.parse(_module)[name]
se.text = module.bundle
document.head.appendChild(se)
// JavaScript 字符串编码使用 UTF-16
"💩".length === 2;
"💩" === "\u{1F4A9}"; // es6
"💩" === "\uD83D\uDCA9"; // es5
// 同一个编码可能使用不同的码位
"ò" === "ò"; // ❎
"ò" === "\xF2"; // ✅
"ò" === "o\u0300"; // ✅
"o\u0300".normalize("NFC") === "\xF2"; // ✅ es6 提供了 normalize 函数
@zoonderkins
zoonderkins / dig-edns-client-subnet.md
Created February 16, 2019 13:52
Dig EDNS client subnet #linux

Cmd

dig +subnet=108.61.201.119 @80.80.80.80 o-o.myaddr.test.l.google.com txt +short
dig @::1 -p 52 icnerd-1e5f.kxcdn.com +subnet=108.61.201.0/24
@zoonderkins
zoonderkins / reroute-local-dns-to-ur-custom-dns.md
Last active February 16, 2019 13:53
Reroute local DNS to your custom DNS #linux
iptables -t nat -A PREROUTING -i eth0 -p udp ! --source 192.168.2.196 ! --destination 192.168.2.196 --dport 53 -j DNAT --to 192.168.2.196

iptables -t nat -A PREROUTING -i eth0 -p tcp ! --source 192.168.2.196 ! --destination 192.168.2.196 --dport 53 -j DNAT --to 192.168.2.196

or 

iptables -t nat -I PREROUTING -i br-lan -p tcp --dport 53 -j DNAT --to 192.168.2.4:53
iptables -t nat -I PREROUTING -i br-lan -p udp --dport 53 -j DNAT --to 192.168.2.4:53