Skip to content

Instantly share code, notes, and snippets.

Tran Viet Hoang hoang-tranviet

  • INGI, UCLouvain
  • Belgium
Block or report user

Report or block hoang-tranviet

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@hoang-tranviet
hoang-tranviet / 200-add-preload.rb
Created Jul 11, 2017
(nghttpx proxy) mruby script to add Link preload header into normal response
View 200-add-preload.rb
# (on nghttpx proxy)
# mruby script to add Link preload header into normal response
# To execute:
# ./src/nghttpx --mruby-file ./200-add-preload.rb --frontend="localhost,3000;no-tls" -L INFO
class App
def on_req(env)
req = env.req
return if req.method != 'GET'
resp = env.resp
View gist:3bded4d89f547899db5a384711e7b55f
# basic pfctl control
# ==
# Related: http://www.OpenBSD.org
# Last update: Tue Dec 28, 2004
# ==
# Note:
# this document is only provided as a basic overview
# for some common pfctl commands and is by no means
# a replacement for the pfctl and pf manual pages.
@hoang-tranviet
hoang-tranviet / purge.sh
Last active Jan 6, 2017 — forked from adrienbrault/purge.sh
Script to reduce VM size before packaging for vagrant
View purge.sh
#!/bin/bash
# Credits to:
# - http://vstone.eu/reducing-vagrant-box-size/
# - https://github.com/mitchellh/vagrant/issues/343
aptitude -y purge ri
aptitude -y purge installation-report landscape-common wireless-tools wpasupplicant ubuntu-serverguide
aptitude -y purge python-dbus libnl1 python-smartpm python-twisted-core libiw30
aptitude -y purge python-twisted-bin libdbus-glib-1-2 python-pexpect python-pycurl python-serial python-gobject python-pam python-openssl libffi5
@hoang-tranviet
hoang-tranviet / latency.markdown
Created Oct 9, 2016 — forked from hellerbarde/latency.markdown
Latency numbers every programmer should know
View latency.markdown

Latency numbers every programmer should know

L1 cache reference ......................... 0.5 ns
Branch mispredict ............................ 5 ns
L2 cache reference ........................... 7 ns
Mutex lock/unlock ........................... 25 ns
Main memory reference ...................... 100 ns             
Compress 1K bytes with Zippy ............. 3,000 ns  =   3 µs
Send 2K bytes over 1 Gbps network ....... 20,000 ns  =  20 µs
SSD random read ........................ 150,000 ns  = 150 µs
Read 1 MB sequentially from memory ..... 250,000 ns  = 250 µs
View NS3 DCE iptables
wget http://www.netfilter.org/projects/iptables/files/iptables-1.4.21.tar.bz2
tar xf iptables-1.4.21.tar.bz2
cd iptables-1.4.21/
./configure LIBS="-pie -rdynamic" CFLAGS="-fPIC -U_FORTIFY_SOURCE" --with-xtlibdir=/lib/xtables --disable-static
make
readelf -h iptables/.libs/xtables-multi | grep Type:
git clone http://github.com/richardwithnell/iptables
cd iptables/
You can’t perform that action at this time.