Skip to content

Instantly share code, notes, and snippets.

[Interface]
Address = 10.7.0.3/24
DNS = 1.1.1.1, 1.0.0.1
PrivateKey = 4HcgVyormPBqLnyvksp3h7l23943zXj2Xzy4MZsyOV4=
[Peer]
PublicKey = 7Pt/DTAbR731c2Aoqvmb8bXUMTuIW3KCZxI7XBCQVks=
PresharedKey = JrozN1RZ+oA09L42Fn7Ta1SJUOf/b5wHJSOtkHH3YcY=
AllowedIPs = 0.0.0.0/0, ::/0
Endpoint = 38.54.116.242:51820
@khanghh
khanghh / hook.js
Last active December 30, 2021 12:35
ttl
const IL2CPPLIB = 'libil2cpp.so'
const TOLUALIB = 'libtolua.so'
// $ nm --demangle --dynamic libfoo.so | grep "Class::method("
// nm --gD libcocos2djs.so | grep _ZN7cocos2d9FileUtils13decodeGsnDataEPhli
var baseAddress = null
var luaState = ptr(0x7561203378)
var luaL_loadbufferPtr = ptr(0x7557d5092c)
var lua_pcallPtr = ptr(0x7557d46a04)
@khanghh
khanghh / settings.json
Last active August 2, 2023 06:56
My vscode settings
{
//#region Editor
"window.commandCenter": false,
"window.zoomLevel": 1,
"workbench.colorTheme": "Default Dark+",
"explorer.confirmDelete": false,
"explorer.confirmDragAndDrop": false,
"explorer.enableDragAndDrop": false,
"explorer.autoReveal": true,
"editor.tabSize": 2,
@khanghh
khanghh / self-signed-certificate-with-custom-ca.md
Created November 2, 2020 03:07 — forked from fntlnz/self-signed-certificate-with-custom-ca.md
Self Signed Certificate with Custom Root CA

Create Root CA (Done once)

Create Root Key

Attention: this is the key used to sign the certificate requests, anyone holding this can sign certificates on your behalf. So keep it in a safe place!

openssl genrsa -des3 -out rootCA.key 4096
@khanghh
khanghh / repo-rinse.sh
Created May 18, 2020 07:24 — forked from nicktoumpelis/repo-rinse.sh
Cleans and resets a git repo and its submodules
git clean -xfd
git submodule foreach --recursive git clean -xfd
git reset --hard
git submodule foreach --recursive git reset --hard
git submodule update --init --recursive
@khanghh
khanghh / gist:40f760089c1c6178b66d6d3c91b61ba0
Created March 11, 2020 09:14
host only network internet access
iptables -t filter -I FORWARD --in-interface vboxnet0 --out-interface <HOST_INTERFACE_WITH_INTERNET> --source 192.168.56.0/24 -j ACCEPT
iptables -t filter -I FORWARD --in-interface <HOST_INTERFACE_WITH_INTERNET> --out-interface vboxnet0 --destination 192.168.56.0/24 -j ACCEPT
iptables -t nat -I POSTROUTING -o <HOST_INTERFACE_WITH_INTERNET> -j MASQUERADE
@khanghh
khanghh / iptables.sav
Created July 16, 2019 06:08
/etc/iptables.sav
# Generated by iptables-save v1.6.1 on Mon Mar 18 09:14:22 2019
*nat
:PREROUTING ACCEPT [35:2266]
:INPUT ACCEPT [0:0]
:OUTPUT ACCEPT [119:8876]
:POSTROUTING ACCEPT [119:8876]
:DOCKER - [0:0]
-A PREROUTING -m addrtype --dst-type LOCAL -j DOCKER
-A OUTPUT ! -d 127.0.0.0/8 -m addrtype --dst-type LOCAL -j DOCKER
-A POSTROUTING -s 192.168.56.0/24 -j MASQUERADE
@khanghh
khanghh / .vimrc
Created April 24, 2019 08:18
My vim config
" Plugin {{{
call plug#begin('~/.vim/plugged')
Plug 'christoomey/vim-tmux-navigator'
Plug 'scrooloose/nerdtree'
Plug 'jistr/vim-nerdtree-tabs'
Plug 'Xuyuanp/nerdtree-git-plugin'
Plug '/home/linuxbrew/.linuxbrew/opt/fzf'
Plug 'junegunn/fzf.vim'
Plug 'vim-airline/vim-airline'
Plug 'vim-airline/vim-airline-themes'
@khanghh
khanghh / hide_cmdline.vimrc
Last active April 10, 2019 07:55
hide comment line vim
set lines+=1
let s:is_cmdline_open = 0
function! s:cmdline(key)
if a:key ==# ':'
if !s:is_cmdline_open
let &lines-=1
let s:is_cmdline_open = 1
redraw
endif
@khanghh
khanghh / sakura.conf
Created April 5, 2019 13:07
sakura config
[sakura]
colorset1_fore=rgb(211,215,207)
colorset1_back=rgb(30,39,46)
colorset1_curs=rgb(255,255,255)
colorset1_key=F1
colorset2_fore=rgb(211,215,207)
colorset2_back=rgba(38,38,38,0.99)
colorset2_curs=rgb(255,255,255)
colorset2_key=F2
colorset3_fore=rgb(192,192,192)