Skip to content

Instantly share code, notes, and snippets.

View chrishuan9's full-sized avatar
🎯
Focusing

Chris Huang chrishuan9

🎯
Focusing
View GitHub Profile
# SCREENSHOT EXAMPLE: http://grab.by/bzg3
##############################
# _
# | |_ _ __ ___ _ ___ __
# | __| '_ ` _ \| | | \ \/ /
# | |_| | | | | | |_| |> <
# \__|_| |_| |_|\__,_/_/\_\
#
#############################
@chrishuan9
chrishuan9 / PieChartLatex
Created January 18, 2014 22:07
This example shows how to draw a basic pie chart. Note that labels are automatically aligned and placed in a smart way. This makes the code more complicated. However, charts can now bee drawn without worrying about overlapping labels. http://www.texample.net/tikz/examples/pie-chart/
% Pie chart
% Author: Robert Vollmert
\documentclass{article}
\usepackage{calc}
\usepackage{ifthen}
\usepackage{tikz}
%%%<
\usepackage{verbatim}
// 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 ([email protected])
# 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 ([email protected])
# The author disclaims copyright to this source code.
import sys
import struct
import socket
import time
import select
@chrishuan9
chrishuan9 / gist:10448851
Created April 11, 2014 08:08
Arduino Yun Server Box
#include <Bridge.h>
#include <YunServer.h>
#include <YunClient.h>
#define PORT 6666
YunServer server(PORT);
void setup() {
Serial.begin(115200);
@chrishuan9
chrishuan9 / gist:11396970
Last active August 29, 2015 14:00
EthernetBonjour
#include <EthernetBonjour.h>
//#include <Dns.h>
#include <Ethernet.h>
//#include <EthernetClient.h>
//#include <EthernetServer.h>
//#include <util.h>
#include <SPI.h>
//Adruino Sketch to test out wifi
@chrishuan9
chrishuan9 / ArduinoSerialPortOSX.scpt
Last active August 29, 2015 14:01
Arduino Serial Port in use on MacOSX Fix
--- Fix the Arduino Serial Port in use Issue on OSX Mavericks (10.9) / tested on 10.9.3
--- based on information from: https://github.com/jantje/arduino-eclipse-plugin/issues/129
(* 5.9 /var/lock : Lock files
5.9.1 Purpose
Lock files should be stored within the /var/lock directory structure.
Lock files for devices and other resources shared by multiple applications, such as the serial device lock files that were originally found in either /usr/spool/locks or /usr/spool/uucp, must now be stored in /var/lock. The naming convention which must be used is "LCK.." followed by the base name of the device. For example, to lock /dev/ttyS0 the file "LCK..ttyS0" would be created.
[footnote 35]