Skip to content

Instantly share code, notes, and snippets.

View Superbil's full-sized avatar
:shipit:
Working in Cloud

Superbil Superbil

:shipit:
Working in Cloud
View GitHub Profile
@Superbil
Superbil / verbos-argpary-example.py
Created December 27, 2022 15:11 — forked from ms5/verbos-argpary-example.py
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
Superbil / reflect.py
Created December 27, 2022 09:30 — forked from 1kastner/reflect.py
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
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 ~/keychain-environment-variables.sh
# AWS configuration example, after doing:
# $ set-keychain-environment-variable AWS_ACCESS_KEY_ID
# provide: "AKIAYOURACCESSKEY"
# $ 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
Superbil / update_exts.sh
Last active October 6, 2022 18:25
Update default videos to open by player
#!/usr/bin/env zsh
## Update exts
# Author: Superbil
# website: https://gist.github.com/Superbil/860b906fa3370a55201a73d2b6396dd9
# Use duti to setup player
#
# Usage update_exts.sh <bundle_id>
#
# Check argv
@Superbil
Superbil / git_time_between_commits.sh
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 https://stackoverflow.com/questions/22725469/calculate-time-between-git-commits
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": [
"*.tradedoubler.com",
"out.reddit.com",
@Superbil
Superbil / wordle.md
Created February 4, 2022 16:18 — forked from huytd/wordle.md
Wordle in less than 50 lines of Bash

image

How to use:

./wordle.sh

Or try the unlimit mode:

@Superbil
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
Superbil / chroot-to-pi.sh
Last active September 21, 2020 16:35 — forked from htruong/chroot-to-pi.sh
Chroot to pi sd card
#!/bin/bash
# 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: https://gist.github.com/jkullick/9b02c2061fbdf4a6c4e8a78f1312a689
# 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)