Skip to content

Instantly share code, notes, and snippets.


David C kccheung

Block or report user

Report or block kccheung

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
kccheung / autossh-jump-rtunnel.service
Created Oct 25, 2019 — forked from ntrepid8/autossh-jump-rtunnel.service
AutoSSH reverse tunnel service config for systemd
View autossh-jump-rtunnel.service
Description=AutoSSH reverse tunnel service for 100022 -> 22
ExecStart=/usr/bin/autossh -M 0 -o "ExitOnForwardFailure=yes" -o "ServerAliveInterval 30" -o "ServerAliveCountMax 3" -NR 10022: -i /home/root/.ssh/id_rsa
import hashlib
import hmac
import json
import time
import urllib.parse
from threading import Thread
from collections import deque
from requests import Request, Session
from requests.exceptions import HTTPError

Keybase proof

I hereby claim:

  • I am kccheung on github.
  • I am chubao ( on keybase.
  • I have a public key ASCtq2R1gydp_8FoB0Nxec7TW1M__3aeAVd7N2y4dvs2Fwo

To claim this, I am signing this object:

kccheung /
Created May 11, 2018 — forked from ottosch/
A script to help using ymgve's bitcoin_fork_claimer script
#!/usr/bin/env python
# This script is meant to be used with bitcoin_fork_claimer:
# The outputs of this script are the inputs to that script.
# Python 2.x is required
import urllib2
import json
import sys
kccheung /
Created Apr 30, 2018 — forked from n8henrie/
Python script template
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
A simple python script template.
import argparse
kccheung /
Last active Sep 29, 2017
Simple steps detailing how to monitor process within docker container, TL;TR; we will use New Relic's infrastructure service.
  1. install new relic on the instance to be monitored:
  2. after step two of echo "license_key: YOUR_LICENSE_KEY" | sudo tee -a /etc/newrelic-infra.yml:
    • vi /etc/newrelic-infra.yml and add the line strip_command_line: false, this allows the command line filter to include all arguments
  3. restart newlic agent by: sudo systemctl restart newrelic-infra
  4. (optional) update agent, please read:
  5. To create an alert on cron process, please goto INFRASTRUCTURE -> Settings -> Alerts -> Create alert condition, check existing created alert for reference
kccheung / .vimrc
Last active Jul 10, 2017 — forked from simonista/.vimrc
A basic .vimrc file that will serve as a good template on which to build.
View .vimrc
" Don't try to be vi compatible
set nocompatible
" Helps force plugins to load correctly when it is turned back on below
filetype off
" TODO: Load plugins here (pathogen or vundle)
" Turn on syntax highlighting
syntax on
View gist:74ff6d287ee6a32677b188fda593eac0
ACTION = build
ALTERNATE_MODE = u+w,go-w,a+rX
ALTERNATE_OWNER = grantdavis
#!/usr/bin/env bash
if [ "$1" == "" ]; then
echo "Usage: $0 <buildToolsVersion>";
find \
node_modules \
-type f \
-iname 'build.gradle' \
kccheung /
Created Mar 12, 2017
An simple instructions on how to use enum in typescript

In TypeScript 1.8+, you can create a string literal type to define the type and an object with the same name for the list of values. It mimics a string enum's expected behaviour.

Here's an example:

type MyStringEnum = "member1" | "member2";

const MyStringEnum = {
    Member1: "member1" as MyStringEnum,
    Member2: "member2" as MyStringEnum
You can’t perform that action at this time.