Skip to content

Instantly share code, notes, and snippets.

cybertk /
Created Jun 20, 2016 — forked from willurd/
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
cybertk / rake-update-version-android-manifest.rb
Last active Mar 4, 2016
Update version in AndroidManifest.xml
View rake-update-version-android-manifest.rb
task :update_build_number do'AndroidManifest.xml', 'r+') do |f|
manifest =
# Update version
manifest = manifest.gsub(
/android:versionCode=".*"/, "android:versionCode=\"#{build}\"")
# Write back
cybertk /
Created Feb 29, 2016
Convert avi to mp4
videos=$(find ./videos -iname "*.avi")
for f in $videos; do
o="$O/$(basename ${f%%.avi}).mp4"
if [[ ! -f "$o" ]]; then
cmd="HandBrakeCLI -i "$f" -o "$O/$(basename ${f%%.avi}).mp4""
cybertk / stuns
Created Feb 22, 2016 — forked from yetithefoot/stuns
STUN+TURN servers list
View stuns
cybertk / jumpToAppStore.swift
Last active Aug 29, 2015
Jump to App's main page in App Store
View jumpToAppStore.swift
// See
func jumpToAppStore(appID: String) {
let url = "itms-apps://\(appID)"
UIApplication.sharedApplication().openURL(NSURL(string: url)!)
cybertk / NSData+HexString.swift
Created Aug 13, 2015
Print NSData into Hex format
View NSData+HexString.swift
// NSData+HexString.swift
// Cybertk
// Created by Quanlong He on 8/14/15.
// Copyright © 2015 Quanlong He. All rights reserved.
import Foundation
cybertk / gist:9d81d746a4b6600c85ee
Created May 28, 2015
Update docker registry in boot2docker
View gist:9d81d746a4b6600c85ee
boot2docker ssh "echo $'EXTRA_ARGS=\"--registry-mirror=<DOCKER_REGISTRY>\"' | sudo tee -a /var/lib/boot2docker/profile && sudo /etc/init.d/docker restart"
cybertk / git-copy
Last active Aug 29, 2015
Copy a remote git repo to another remote destination
View git-copy
# Copy a remote git repo to another remote destination
# Copyright (C) 2015 Quanlong <>
set -e
# Options validation
View gist:fab6f469924d3bbfd9fb
namespace :apns do
task :verify do
openssl s_client -connect -cert server_certificates_bundle_sandbox.pem -key server_certificates_bundle_sandbox.pem
openssl s_client -connect -cert pnpush.pem -key pnpush.pem
task :p12topem do
openssl pkcs12 -in apns.p12 -out apns.pem -nodes -clcerts
View flynn-conf
description "Flynn layer 0"
#start on (started libvirt-bin and started networking)
respawn limit 1000 60
IP_ADDR=$(/sbin/ifconfig eth1 | grep 'inet addr:' | cut -d: -f2 | awk '{print $1}')
flynn-host daemon --manifest /etc/flynn/host-manifest.json --external $IP_ADDR --state /tmp/flynn-host-state.json