Skip to content

Instantly share code, notes, and snippets.

View midnight-wonderer's full-sized avatar

Sarun Rattanasiri midnight-wonderer

View GitHub Profile
@midnight-wonderer
midnight-wonderer / .bash_completion.sh
Last active June 27, 2024 18:39
user's applications
# for applications
for bcdir in $(find $HOME/.local/applications -mindepth 2 -maxdepth 2 -type d -name bash-completion.d -print) ; do
for bcfile in $(find "$bcdir" -mindepth 1 -maxdepth 1 -type f -print) ; do
. $bcfile
done
done
# Usage:
# ========
# FirebaseAuth::Auth.verify_id_token(your_id_token)
#
# The method call follows the same API of the Node.js, JAVA and Python SDKs.
# See https://firebase.google.com/docs/auth/admin/verify-id-tokens#verify_id_tokens_using_the_firebase_admin_sdk
# Dependencies:
# ---------------
# gem 'activesupport'
0x6D1AA09da52F0DbA45d4eA3Ab5AD96b1C40577C9
@midnight-wonderer
midnight-wonderer / Makefile
Last active December 3, 2018 04:11
My SDCC Makefile
SHELL=/usr/bin/env bash
SDCC=sdcc
SDCCLIB=sdcclib
SRCDIR=./src
BINDIR=./bin
INCLUDES=\
./vendor/stm8s/inc\
./vendor/button_debounce/inc
CFLAGS=--std-c11 --nolospre $(addprefix -I,$(INCLUDES))
LDFLAGS=--out-fmt-ihx
@midnight-wonderer
midnight-wonderer / nat-instance.Makefile
Last active August 24, 2019 11:35
Creating Linux NAT router
SHELL:=/usr/bin/env bash
DEFAULT_INTERFACE=$(shell /sbin/route | grep default | grep -Eo "[a-z0-9]+$$")
VPC_CIDR=10.0.0.0/16
forward-traffic:
/sbin/iptables -t nat -A POSTROUTING -o $(DEFAULT_INTERFACE) -s $(VPC_CIDR) -j MASQUERADE
@midnight-wonderer
midnight-wonderer / shadowsocks.Makefile
Last active August 24, 2019 15:06
Make script for simple Shadowsocks deployments
SHELL:=/usr/bin/env bash
SOURCE_DIR=$(strip $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST)))))
PSK=$(shell cat $(SOURCE_DIR)/psk | xargs)
SHADOWSOCKS_VERSION=v0.0.11
shadowsocks-download:
URL="https://github.com/shadowsocks/go-shadowsocks2/releases/download/$(SHADOWSOCKS_VERSION)/shadowsocks2-linux.gz" && \
((curl -s -L $$URL | gunzip -q) > $(SOURCE_DIR)/shadowsocks2) && \
chmod +x $(SOURCE_DIR)/shadowsocks2
@midnight-wonderer
midnight-wonderer / sigrok-checklist.md
Last active December 7, 2019 02:08
Sigrok checklist
  • Firmware in place
  • udev rules
@midnight-wonderer
midnight-wonderer / sudoers
Created June 30, 2020 01:01
Allow a user to run privilege commands
# Cmnd alias specification
Cmnd_Alias FIREWALL = /usr/sbin/ufw
# User privilege specification
username ALL=NOPASSWD: FIREWALL