Skip to content

Instantly share code, notes, and snippets.

View aahung's full-sized avatar
🔨

_sam aahung

🔨
View GitHub Profile
@aahung
aahung / big_data.md
Last active December 7, 2015 04:32
Review of Cloud Computer (EE4221)

Definition

Volume, Variety, and Velocity

Unstructed

Analytic life cycle

  1. Discovery
  2. Data preparation
@aahung
aahung / personal_goal.md
Last active December 7, 2015 03:38
Personal Goal

Personal Goal

  • Write simple HTTP server in various languages
  • Learn Lisp
  • Learn LLVM
@aahung
aahung / RECEIPT.java
Created December 14, 2015 18:55
SECTION A - 1
class RECEIPT {
// a)
int receiptInt;
String tableStr;
// b)
private ArrayList<Item> orderedItemList;
public getItemList() { return orderedItemList; }
public setItemList(ArrayList<Item> list) { orderedItemList = list; }
@aahung
aahung / swap.code
Created December 14, 2015 20:58
Describe how the Swap() instruction can be used to provide mutual exclusion that satisfies the bounded-waiting requirement.
do {
waiting[i] = true;
key = true;
while (waiting[i] && key) Swap(&key, &lock);
// critical tasks
j = (i + 1) % n;
while (i != j && !waiting[j]) j = (i + 1) % n;
@aahung
aahung / mk_report.sh
Created March 18, 2016 11:26
create public_html/report under each user and assign the right permissions
# this should be ran in the /home directory
# create "public_html/report" folder under their home dir if not exists
for u in *;
do mkdir -p "$u""/public_html";
mkdir -p "$u""/public_html/report";
chown -R $u:combo "$u""/public_html";
chmod -R u+wrx,go+rx "$u""/public_html";
done;
@aahung
aahung / NSDateFormatter cheat sheet
Last active May 25, 2016 15:25 — forked from romaonthego/NSDateFormatter cheat sheet
Date Formats for NSDateFormatter
a: AM/PM
A: 0~86399999 (Millisecond of Day)
c/cc: 1~7 (Day of Week)
ccc: Sun/Mon/Tue/Wed/Thu/Fri/Sat
cccc: Sunday/Monday/Tuesday/Wednesday/Thursday/Friday/Saturday
d: 1~31 (0 padded Day of Month)
D: 1~366 (0 padded Day of Year)
@aahung
aahung / reset-touch-bar.sh
Created December 6, 2016 12:59
Reset Macbook Pro's Touch Bar
killall ControlStrip
@aahung
aahung / gist:b4813232c5524c598223a90191ee08b3
Created December 7, 2016 17:21
Comvert to MP4 using ffmpeg
ffmpeg -i ?.mkv -vcodec copy -acodec copy ?.mp4
@aahung
aahung / copy necessary
Last active June 6, 2017 02:55
Copy from remote server include files with some pattern only
export REMOTE_PATH=/data/xinhong/pd/run_makeup_cr0.02
rsync -a --include="*o/" --include="*.out" --exclude="*" [email protected]:$REMOTE_PATH . --progress
rsync -a --include="*/" --include="*eff*.out" --exclude="*" [email protected]:$REMOTE_PATH . --progress
rsync -a --include="*/" --include="*1460000*.out" --exclude="*" [email protected]:$REMOTE_PATH . --progress
rsync -a --include="*/" --include="*1460000*" --exclude="*" [email protected]:$REMOTE_PATH . --progress
rsync -a --include="*/" --include="*10600000*" --exclude="*" [email protected]:$REMOTE_PATH . --progress
rsync -a --include="*/" --include="*507200*" --exclude="*" [email protected]:$REMOTE_PATH . --progress
rsync -a --include="*/" --include="*6600000*" --exclude="*" [email protected]:$REMOTE_PATH . --progress
qsub j1.pbs
qsub j2-1.pbs
qsub j2-2.pbs
qsub j2-3.pbs
qsub j2-4.pbs
qsub j2-5.pbs
qsub j2-6.pbs
qsub j2-7.pbs
qsub j2-8.pbs
qsub j3.pbs