Skip to content

Instantly share code, notes, and snippets.

View chihchun's full-sized avatar
🎯
Focusing

Rex Tsai chihchun

🎯
Focusing
View GitHub Profile
@chihchun
chihchun / fimrwares.txt
Created October 3, 2012 06:11
nextvod firmware list
16548dc8b59844ab98a7441f29a0cc47.chk Fri Dec 23 13:00:38 2011
16548dc8b59844ab98a7441f29a0cc47.pkg Fri Dec 23 13:00:44 2011
1a775d01cb9b7cebe769df1fc6251c5e.chk Wed May 23 18:17:24 2012
1a775d01cb9b7cebe769df1fc6251c5e.pkg Wed May 23 18:17:29 2012
1df400f2ecbb88c35692acbf6a960fa4.chk Fri Mar 25 16:14:39 2011
1df400f2ecbb88c35692acbf6a960fa4.pkg Fri Mar 25 16:14:40 2011
211bdc0fe6bc93ef7281c0e843012a05.chk Fri Sep 28 17:17:14 2012
211bdc0fe6bc93ef7281c0e843012a05.pkg Fri Sep 28 17:17:22 2012
22e6a539e4ae77860b85d363a9854753.chk Fri Sep 2 10:41:48 2011
22e6a539e4ae77860b85d363a9854753.pkg Fri Sep 2 10:41:49 2011
@chihchun
chihchun / nhi.py
Created December 17, 2012 06:19
健保卡讀卡程式
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright (c) 陳幸延 <[email protected]>
from smartcard.System import readers
# define the APDUs used in this script
SelectAPDU = [ 0x00, 0xA4, 0x04, 0x00, 0x10, 0xD1, 0x58, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x00 ]
ReadProfileAPDU = [ 0x00, 0xca, 0x11, 0x00, 0x02, 0x00, 0x00 ]
@chihchun
chihchun / gist:5432992
Created April 22, 2013 07:15
Canonical kernel contribution between v3.8..v3.9-rc8
$ git log --graph --pretty=format:"%an <%ae>" --abbrev-commit v3.8..v3.9-rc8 --author=canonical|sort -n|uniq -c|sort -nr
24 * David Henningsson <[email protected]>
20 * Ming Lei <[email protected]>
12 * Tim Gardner <[email protected]>
12 * Maarten Lankhorst <[email protected]>
6 * Seth Forshee <[email protected]>
6 * AceLan Kao <[email protected]>
4 * Colin Ian King <[email protected]>
3 * Tyler Hicks <[email protected]>
2 * Paolo Pisati <[email protected]>
@chihchun
chihchun / gist:5472087
Created April 27, 2013 06:15
Fix Evernote Firefox plugin use Romanian for zh_TW locale.
diff --git a/chrome.manifest b/chrome.manifest
index 07b056f..b00f705 100644
--- a/chrome.manifest
+++ b/chrome.manifest
@@ -60,7 +60,7 @@ locale webclipper3-common zh-CN chrome/locale/zh-CN/
locale webclipper3 zh-TW chrome/locale/zh-TW/
locale webclipper3-common zh-TW chrome/locale/zh-TW/
locale webclipper3 ro-RO chrome/locale/ro-RO/
-locale webclipper3-common zh-TW chrome/locale/ro-RO/
+locale webclipper3-common ro-RO chrome/locale/ro-RO/
#!/bin/sh
# Canonical (C) 2012-2013
# FourDollars
# Rex Tsai
TARGET="$1"
NAME=$(basename $TARGET)
CMD=$2
OUTPUTDIR=${3-`pwd`}
if [ ! -f "$TARGET" ] || [ -z $CMD ] ; then
@chihchun
chihchun / gist:5497885
Created May 1, 2013 19:57
objdump -T ./plugins/libHicos_p11v1.so|grep Base|awk '{ print $7}' |c++filt|sort -u
AddRoundKey(unsigned char (*) [4], unsigned char (*) [4], unsigned char)
AES_decryption_key_schedule(unsigned char*, _DES_SUBKEY*)
AES_encryption_key_schedule(unsigned char*, _DES_SUBKEY*)
bnAdd
bnAdd_16
bnAddQ
bnAddQ_16
bnBegin
bnBits
bnBits_16
@chihchun
chihchun / maps.xml
Last active December 22, 2015 00:49
happyman's 台灣經建三版 config for viking. (~/.viking/maps.xml)
<object class="VikSlippyMapSource">
<property name="label">台灣經建三版</property>
<property name="hostname">rs.happyman.idv.tw</property>
<property name="url">/map/tw25k2001/zxy/%d_%d_%d.png</property>
<property name="id">21</property>
</object>
@chihchun
chihchun / diffkerconfig.py
Created October 1, 2013 07:52
Script for diff two kernel defconfig files.
#!/usr/bin/python3
# Rex Tsai <[email protected]>
# Script for diff two kernel defconfig files.
import os
import sys
def parse_config(in_file):
for line in in_file:
if(line.startswith("#") or line.startswith("\n")):
@chihchun
chihchun / flash.sh
Last active December 29, 2015 07:39
A script to flash system.img to the Ubuntu Touch. by @janimo
#!/bin/bash
IMG=system.img
DEVICE=adb
if [ "$1" != "" ];then
IMG=$1
fi
file $IMG | grep ": data" >/dev/null && simg2img $IMG $IMG.tmp && resize2fs -M $IMG.tmp && mv $IMG.tmp $IMG
@chihchun
chihchun / sudo.java
Last active December 30, 2015 05:59
test program.
try {
Process cmd = new ProcessBuilder("su", "-c", "id").redirectErrorStream(true).start();
BufferedReader in = new BufferedReader(new InputStreamReader(cmd.getInputStream()));
cmd.waitFor();
((TextView) findViewById(R.id.textView1)).setText(String.format("su: %s (%d)", in.readLine(), cmd.exitValue()));
} catch (IOException e) {
((TextView) findViewById(R.id.textView1)).setText(e.toString());