Skip to content

Instantly share code, notes, and snippets.

View hsaputra's full-sized avatar

Henry Saputra hsaputra

View GitHub Profile
@hsaputra
hsaputra / gist:79b96136af7bd3be8b6f
Last active May 16, 2018 15:34
Programming interviews resource links
http://pages.cs.wisc.edu/~shuchi/courses/787-F09/scribe-notes/lec3.pdf
https://leetcode.com/tag/dynamic-programming/
http://leetcode.com/2010/09/printing-binary-tree-in-level-order.html
http://en.wikipedia.org/wiki/Knuth%E2%80%93Morris%E2%80%93Pratt_algorithm
http://en.wikipedia.org/wiki/Maximum_subarray_problem
http://en.wikipedia.org/wiki/Fisher%E2%80%93Yates_shuffle
@hsaputra
hsaputra / gist:f3c2438196ae0fb4ab46
Created September 15, 2015 21:35
Implementation of in-memory CDAP BusineessMetadataStore
/*
* Copyright 2015 Cask Data, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@hsaputra
hsaputra / gist:b8e04baf40480db09d9f
Created September 17, 2015 17:44
YARN Container Run out Memory
22:05:18.991 [ApplicationMasterService] INFO o.a.t.i.a.ApplicationMasterService - Container container_1438037484990_0024_01_000002 completed with COMPLETE:Container [pid=17308,containerID=container_1438037484990_0024_01_000002] is running beyond physical memory limits. Current usage: 514.5 MB of 512 MB physical memory used; 1.0 GB of 2.5 GB virtual memory used. Killing container.
Dump of the process-tree for container_1438037484990_0024_01_000002 :
|- PID PPID PGRPID SESSID CMD_NAME USER_MODE_TIME(MILLIS) SYSTEM_TIME(MILLIS) VMEM_USAGE(BYTES) RSSMEM_USAGE(PAGES) FULL_CMD_LINE
|- 17324 17308 17308 17308 (java) 2906 186 1077043200 131445 /usr/lib/jvm/java/bin/java -Djava.io.tmpdir=tmp -Dyarn.container=container_1438037484990_0024_01_000002 -Dtwill.runnable=workflow.default.SparkPageRank.PageRankWorkflow.PageRankWorkflow -cp launcher.jar:/etc/hadoop/conf -Xmx359m -XX:MaxPermSize=128M -verbose:gc -Xloggc:/data/logs/hadoop-yarn/userlogs/application_1438037484990_0024/container_1438037484990_0024_01_000002/gc.lo
@hsaputra
hsaputra / gist:00348783804c7e0b4ad5
Last active October 25, 2016 04:23
Apache Twill Flows
Apache Twill Launch Flow
====================
HelloWorld
TwillRunnerService = new YarnTwillRunnerService
YarnTwillRunnerService.start
YarnTwillRunnerService.watchLiveServices
YarnTwillRunnerService.prepare
YarnTwillPreparer.start
YarnAppClient.createLauncher -> This will be instance of ApplicationMasterProcessLauncher
@hsaputra
hsaputra / gist:fdb28aa17615c46d9ee5
Created January 9, 2016 20:05
Nvidia GPU + CoreOS + TensorFlow + Docker
http://www.emergingstack.com/2016/01/10/Nvidia-GPU-plus-CoreOS-plus-Docker-plus-TensorFlow.html
@hsaputra
hsaputra / gist:eb513675a04ed7ec3fe156c18be400bc
Created April 15, 2016 06:32
BIDMat copy to fix compile with CUDA 7.5 in BIDMach
~/devel/BIDMach$ cp ../BIDMat/lib/libbidmatc libbidmatcpu-linux-x86_64.so libbidmatcuda-linux-x86_64.so
~/devel/BIDMach$ cp ../BIDMat/lib/libbidmatc* lib/
@hsaputra
hsaputra / Bash profile to bashrc
Created July 14, 2016 21:48
bash_profile to redirect to bashrc
if [ -f ~/.bashrc ]; then . ~/.bashrc; fi
You can ssh into the VM by finding the IP (from kubectl config view) and using username "docker" password "tcuser":
ssh [email protected]
@hsaputra
hsaputra / gist:8f874f3e822027a4ff81a6df3dc5ab17
Last active April 20, 2017 02:09
Replace String in git
git grep -lz '0.2.0-SNAPSHOT' | xargs -0 perl -i'' -pE "s/0.2.0-SNAPSHOT/0.3.0-SNAPSHOT/g"
perl -pi -e 's/foo/bar/g' file.txt
hsaputra@hsaputra-desktop:/etc/resolvconf/resolv.conf.d$ ifconfig
docker0 Link encap:Ethernet HWaddr 02:42:24:8b:fb:2a
inet addr:172.18.0.1 Bcast:0.0.0.0 Mask:255.255.0.0
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
eno1 Link encap:Ethernet HWaddr d0:17:c2:ad:2c:8f