Skip to content

Instantly share code, notes, and snippets.

@curtkim
curtkim / gist:528efe1f1f7bf81ec525
Created November 9, 2014 02:05
network namespace
from http://ko.sdndev.net/2
----------------------------
ip netns add netns1
ip netns exec netns1 ip link list
ip netns exec netns1 ping 127.0.0.1
ip netns exec netns1 ip link set dev lo up
ip link add veth0 type veth peer name veth1
docker run -t -i ubuntu:14.04 /bin/bash
docker inspect -f '{{.State.Pid}}' a8658e32e8fd
docker pull training/sinatra
docker run -t -i training/sinatra /bin/bash
gem install json
docker commit -m="Added json gem" -a="Kate Smith" 0b2616b0e5a8 ouruser/sinatra:v2
docker history iamteri/sinatra:v2
[run groovy script by java command]
java -cp lib/groovy-all-1.8.0.jar groovy.ui.GroovyMain test.groovy
nohup java -Duser.timezone=Asia/Seoul -cp lib/*: groovy.ui.GroovyMain script/findBadGps.groovy >> system.log 2>> error.log &
[String Interpolation]
value = 6
println "The value is $value."
@curtkim
curtkim / ubuntu install
Last active November 5, 2023 03:21
linux
[x]
docker run -ti --rm \
-e DISPLAY=$DISPLAY \
-v /tmp/.X11-unix:/tmp/.X11-unix \
firefox
[watch]
watch -n 1 docker ps
[script]
############################################
# [Stream PassThrough TrafficMeter]
util = require 'util'
PassThrough = require('stream').PassThrough
clientTraffic = {}

TCP Demultiplexing

TCP Demultiplexing

IP header

IP header

'protocol field'

  • 1 : ICMP
  • 2 : IGMP
  • 6 : TCP
vboxmanage hostonlyif remove vboxnet0
Ctrl+Tab : swtich 'vertex select', 'edge select', 'face select'
High level consumer : I just want to use Kafka as extermely fast persistent FIFO buffer and not worry much about details.
Low level consumer : I want to have a custom partition data consuming logic, e.g. start reading data from newly created topics without a need of consumer reconnection to brokers.
db.path.aggregate(
[
{
$group : {
_id : "$hour",
count: { $sum: 1 }
}
}
]
)