Skip to content

Instantly share code, notes, and snippets.

View mimi1vx's full-sized avatar

Ondřej Súkup mimi1vx

View GitHub Profile
@mimi1vx
mimi1vx / cont.py
Created February 16, 2018 16:46 — forked from rwngwn/cont.py
# please run: mkdir /tmp/img ; docker export $(docker create centos) | tar -C /tmp/img/ -xvf -
# before this script
import os
import ctypes
from multiprocessing import Process
CLONE_NEWUSER = 0x10000000
CLONE_NEWPID = 0x20000000
@mimi1vx
mimi1vx / haskell-prompt-info.zsh
Last active August 29, 2015 14:27 — forked from epsilonhalbe/haskell-prompt-info.zsh
haskell-prompt-info (zsh)
function haskell_info() {
cabal_files=(*.cabal(N))
if [ $#cabal_files -gt 0 ]; then
if [ -f cabal.sandbox.config ]; then
cabal_sandbox_info
elif [ -f stack.yaml ]; then
stack_info
else
echo "%{$fg[red]%}no stack/sandbox%{$reset_color%}"
fi
@mimi1vx
mimi1vx / latency.txt
Last active August 29, 2015 14:10 — 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