Skip to content

Instantly share code, notes, and snippets.

View Superbil's full-sized avatar
Working in Cloud

Superbil Superbil

Working in Cloud
View GitHub Profile
Superbil /
Created December 27, 2022 15:11 — forked from ms5/
manipulating log level with python argparse
import argparse
import logging
parser = argparse.ArgumentParser()
parser.add_argument('--verbose', '-v', action='count', default=1)
args = parser.parse_args()
args.verbose = 40 - (10 * args.verbose) if args.verbose > 0 else 0
logging.basicConfig(level=args.verbose, format='%(asctime)s %(levelname)s: %(message)s',
Superbil /
Created December 27, 2022 09:30 — forked from 1kastner/
A simple echo server to inspect http web requests
#!/usr/bin/env python
# Reflects the requests from HTTP methods GET, POST, PUT, and DELETE
# Written by Nathan Hamiel (2010)
from http.server import HTTPServer, BaseHTTPRequestHandler
from optparse import OptionParser
class RequestHandler(BaseHTTPRequestHandler):
def do_GET(self):
Superbil / .zshrc
Created November 30, 2022 16:11 — forked from bmhatfield/.zshrc
OSX Keychain Environment Variables
# If you use bash, this technique isn't really zsh specific. Adapt as needed.
source ~/
# AWS configuration example, after doing:
# $ set-keychain-environment-variable AWS_ACCESS_KEY_ID
# $ set-keychain-environment-variable AWS_SECRET_ACCESS_KEY
# provide: "j1/yoursupersecret/password"
export AWS_ACCESS_KEY_ID=$(keychain-environment-variable AWS_ACCESS_KEY_ID);
export AWS_SECRET_ACCESS_KEY=$(keychain-environment-variable AWS_SECRET_ACCESS_KEY);
Superbil /
Last active October 6, 2022 18:25
Update default videos to open by player
#!/usr/bin/env zsh
## Update exts
# Author: Superbil
# website:
# Use duti to setup player
# Usage <bundle_id>
# Check argv
Superbil /
Last active September 12, 2022 08:21
Calculate time between git commits
# Calculate time between git commits
# Update rev-list target to your range or branch
# ref
for ix in `git rev-list @`; do
# get committer date, UNIX timestamp (%ct)
thists=`git log $ix -n 1 --format=%ct`;
prevts=`git log $ix~1 -n 1 --format=%ct 2>/dev/null`;
if [ ! -z "$prevts" ] ; then
delta=$(( $thists - $prevts ));
# get substring of hash (#ix)
"uuid": "3baa759b-9afc-41ef-b770-c60e1d9383d2",
"description": "Filter%20rule%20to%20skip%20and%20prevent%20redirection%20tracking%20on%20multiple%20hosts.",
"tag": "filter-multiple",
"pattern": {
"scheme": "*",
"host": [
Superbil /
Created February 4, 2022 16:18 — forked from huytd/
Wordle in less than 50 lines of Bash


How to use:


Or try the unlimit mode:

Superbil / Kernel_Debug_Kit_11.0_build_20A5374i_README
Last active July 8, 2022 10:48
Kernel Debug Kit 11.0 build 20A5374i
Kernel Debug Kit for macOS - Read Me
Use the Kernel Debug Kit (KDK) to debug kernel-level code, such as kernel extensions you create.
Performing Two-Machine Debugging
The KDK supports the debugging of kernel-level code, such as kernel extensions, from a second Mac.
- The target device is the Mac that runs the code you want to debug.
- The host device is the Mac that runs the debugger.
Identify the Device Compatibility
Superbil /
Last active September 21, 2020 16:35 — forked from htruong/
Chroot to pi sd card
# This script allows you to chroot ("work on")
# the raspbian sd card as if it's the raspberry pi
# on your Ubuntu desktop/laptop
# just much faster and more convenient
# credits:
# make sure you have issued
> LANG=en_US.UTF-8 git
usage: git [--version] [--help] [-C <path>] [-c <name>=<value>]
[--exec-path[=<path>]] [--html-path] [--man-path] [--info-path]
[-p | --paginate | -P | --no-pager] [--no-replace-objects] [--bare]
[--git-dir=<path>] [--work-tree=<path>] [--namespace=<name>]
<command> [<args>]
These are common Git commands used in various situations:
start a working area (see also: git help tutorial)