Skip to content

Instantly share code, notes, and snippets.

View tuan3w's full-sized avatar
👋

Tuan Nguyen tuan3w

👋
View GitHub Profile
@tuan3w
tuan3w / active.md
Created January 15, 2014 11:37 — forked from paulmillr/active.md

Most active GitHub users (git.io/top)

The count of contributions (summary of Pull Requests, opened issues and commits) to public repos at GitHub.com from Sun, 13 Jan 2013 21:59:04 GMT till Mon, 13 Jan 2014 21:59:04 GMT.

Only first 1000 GitHub users according to the count of followers are taken. This is because of limitations of GitHub search. Sorting algo in pseudocode:

githubUsers
 .filter((user) -> user.followers > 233)
@tuan3w
tuan3w / latency.txt
Last active August 29, 2015 14:24 — forked from jboner/latency.txt
Latency Comparison Numbers
--------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns
Send 1K bytes over 1 Gbps network 10,000 ns 0.01 ms
Read 4K randomly from SSD* 150,000 ns 0.15 ms
@tuan3w
tuan3w / blas.sh
Created November 9, 2015 04:24 — forked from jarutis/blas.sh
get native blas running with dl4j on centos 6
# install general deps
sudo yum groupinstall "Development Tools"
sudo yum install wget unzip
# install java
cd /opt/
sudo wget --no-cookies --no-check-certificate --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie" "http://download.oracle.com/otn-pub/java/jdk/8u60-b27/jdk-8u60-linux-x64.tar.gz"
sudo tar xzf jdk-8u60-linux-x64.tar.gz
cd /opt/jdk1.8.0_60/
package org.apache.spark.examples
import org.apache.spark.SparkContext
import org.apache.spark.SparkContext._
import org.apache.spark.rdd.RDD
import java.util.Random
import scala.collection.mutable
import org.apache.spark.serializer.KryoRegistrator
import com.esotericsoftware.kryo.Kryo
# eth0 is public network interface
iptables -P INPUT ACCEPT
iptables -P OUTPUT ACCEPT
# Allow connection RELATED,ESTABLISHED on eth0
iptables -t filter -A INPUT -i eth0 -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
# Prevent DOCKER chain
iptables -t nat -I PREROUTING -m addrtype --dst-type LOCAL -j RETURN