Skip to content

Instantly share code, notes, and snippets.

View chrishuan9's full-sized avatar
🎯
Focusing

Chris Huang chrishuan9

🎯
Focusing
  • Basel, Switzerland
View GitHub Profile
# SCREENSHOT EXAMPLE: http://grab.by/bzg3
##############################
# _
# | |_ _ __ ___ _ ___ __
# | __| '_ ` _ \| | | \ \/ /
# | |_| | | | | | |_| |> <
# \__|_| |_| |_|\__,_/_/\_\
#
#############################
// references internal ContentObserver class
SettingsObserver observer = new SettingsObserver(new Handler());
// start watching for changes
observer.observe();
// where we do our work
updateSettings();
// Anonymous inner class to handle watching Uris
class SettingsObserver extends ContentObserver {
SettingsObserver(Handler handler) {
@chrishuan9
chrishuan9 / gist:8606991
Last active January 4, 2016 10:09 — forked from davidbalbert/gist:6815258
How to install custom SSL certificates on an ASUS RT-N66U running asuswrt-merlin
# First, enable SSH in the Administration->System tab.
# Then log in to the device.
# Verify that https_crt_save is off
admin@RT-N66U:/tmp/home/root# nvram get https_crt_save
0
# Enable https_crt_save and verify that it was set correctly
admin@RT-N66U:/tmp/home/root# nvram set https_crt_save=1
admin@RT-N66U:/tmp/home/root# nvram get https_crt_save
@chrishuan9
chrishuan9 / tmux_cheatsheet.markdown
Last active January 8, 2022 09:35 — forked from henrik/tmux_cheatsheet.markdown
tmux cheat sheet

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

#!/usr/bin/env python2
# Quick and dirty demonstration of CVE-2014-0160 by Jared Stafford (jspenguin@jspenguin.org)
# The author disclaims copyright to this source code.
import sys
import struct
import socket
import time
import select
#!/usr/bin/env python2
# Quick and dirty demonstration of CVE-2014-0160 by Jared Stafford (jspenguin@jspenguin.org)
# The author disclaims copyright to this source code.
import sys
import struct
import socket
import time
import select
#!/usr/bin/python
# -*- coding: utf-8 -*-
import os
import re
from lxml import etree
import StringIO
import sys
reload(sys)

Sample service script for debianoids

Look at LSB init scripts for more information.

Usage

Copy to /etc/init.d:

# replace "$YOUR_SERVICE_NAME" with your service's name (whenever it's not enough obvious)
@chrishuan9
chrishuan9 / webm.md
Last active August 29, 2015 14:13 — forked from ndarville/webm.md
converting gifs to web

Grab ffmpeg from https://www.ffmpeg.org/download.html

OSX Users: Install ffmpeg using homebrew:

brew install ffmpeg --with-libvpx

respectively, if you already have ffmpeg installed without libvpx encoder

brew reinstall ffmpeg --with-libvpx
@chrishuan9
chrishuan9 / gist:29f91cde8c09e97a8a5a1ef90c6186ff
Created May 18, 2016 11:59 — forked from jayjanssen/gist:5697813
Testing multicast with iperf
this is a sample of output:
root@percona-db-2:~# iperf -s -u -B 226.94.1.1 -i 1
------------------------------------------------------------
Server listening on UDP port 5001
Binding to local address 226.94.1.1
Joining multicast group 226.94.1.1
Receiving 1470 byte datagrams
UDP buffer size: 122 KByte (default)
------------------------------------------------------------