Skip to content

Instantly share code, notes, and snippets.

Buried in Codes

Tim Zhang ttimasdf

Buried in Codes
View GitHub Profile
koenbollen /
Created Jul 5, 2010
Proof of Concept: UDP Hole Punching
#!/usr/bin/env python
# Proof of Concept: UDP Hole Punching
# Two client connect to a server and get redirected to each other.
# This is the client.
# Koen Bollen <meneer koenbollen nl>
# 2010 GPL
saetia / gist:1623487
Last active May 5, 2021
Clean Install – OS X 10.11 El Capitan
View gist:1623487

OS X Preferences

most of these require logout/restart to take effect

# Enable character repeat on keydown
defaults write -g ApplePressAndHoldEnabled -bool false

# Set a shorter Delay until key repeat
View 0001-remove-NX_NUMPROCS-case.patch
From 24b77f1f639727cb02cd0ef5b594aec94daeebfc Mon Sep 17 00:00:00 2001
From: Eduardo Habkost <>
Date: Tue, 19 Jun 2012 19:46:52 -0300
Subject: [PATCH 1/3] remove NX_NUMPROCS case
1) NX_NUMPROCS isn't supposed to be an event number, but just the number of
2) NX_NUMPROCS is > NX_LASTEVENT, so the "default:" branch already
handles it (and shows a warning)
brandonb927 /
Last active May 9, 2021
OSX for Hackers: Yosemite/El Capitan Edition. This script tries not to be *too* opinionated and any major changes to your system require a prompt. You've been warned.
# SOME COMMANDS WILL NOT WORK ON macOS (Sierra or newer)
# For Sierra or newer, see
# Alot of these configs have been taken from the various places
# on the web, most from here
UniIsland /
Created Aug 14, 2012
Simple Python Http Server with Upload
#!/usr/bin/env python
"""Simple HTTP Server With Upload.
This module builds on BaseHTTPServer by implementing the standard GET
and HEAD requests in a fairly straightforward manner.
ttscoff / rtftomarkdown.rb
Created Oct 9, 2012
Convert RTF/DOC files to Markdown via Textutil
View rtftomarkdown.rb
Usage: rtftomarkdown.rb FILENAME.rtf
Uses textutil, available on Mac only (installed by default)
Outputs to STDOUT
Links are replaced with Markdown references (duplicate links combined).
Weptun /
Last active Sep 28, 2020 — forked from mediabounds/
Now fix when no entitlements are present.
# !/bin/bash
# Copyright (c) 2011 Float Mobile Learning
# Extension Copyright (c) 2013 Weptun Gmbh
# Extended by Ronan O Ciosoig January 2012
# Extended by Patrick Blitz, April 2013
eric-hu / Open iterm tab here
Last active Sep 10, 2020
Apple script to open an iterm2 tab from right-clicking on a file or folder in Finder. To use: (1) Open Automator (2) Create a new service (3) Change "Service receives selected" drop downs to "Files or folders" in "Finder" (4) Select "Run applescript" from the sidebar, then paste this script in and save
View Open iterm tab here
-- Adapted from these sources:
-- Modified to work with files as well, cd-ing to their container folder
on run {input, parameters}
tell application "Finder"
set my_file to first item of input
set filetype to (kind of (info for my_file))
-- Treats OS X applications as files. To treat them as folders, integrate this SO answer:
Takhion / build.gradle
Last active Dec 20, 2017 — forked from gabrielemariotti/build.gradle
Store APK signing credentials in an external file using Gradle
View build.gradle
android {
signingConfigs {
buildTypes {
release {
signingConfig signingConfigs.release
thomasfr / autossh.service
Last active Apr 15, 2021
Systemd service for autossh
View autossh.service
Description=Keeps a tunnel to '' open
# -p [PORT]
# -l [user]
# -M 0 --> no monitoring
# -N Just open the connection and do nothing (not interactive)