Skip to content

Instantly share code, notes, and snippets.

View cizixs's full-sized avatar
:octocat:
cloud native coding...

cizixs cizixs

:octocat:
cloud native coding...
View GitHub Profile
@cizixs
cizixs / simple-exec-with-docker-remote-api.sh
Created October 1, 2018 05:31 — forked from markjlorenz/simple-exec-with-docker-remote-api.sh
Using the exec command with the docker API, and capturing output
#! /usr/bin/env bash
# Create the container with a long running process. If PID1 exists before
# we send the exec commands, they will fail because the container is not running
#
CONTAINER_NAME="TEST-`uuidgen`"
curl --silent --unix-socket /var/run/docker.sock "http:/containers/create?name=${CONTAINER_NAME}" -XPOST \
-H "Content-Type: application/json" \
-d '{
"Image": "ruby:latest",
@cizixs
cizixs / useful_pandas_snippets.py
Created July 25, 2018 13:26 — forked from bsweger/useful_pandas_snippets.md
Useful Pandas Snippets
# List unique values in a DataFrame column
# h/t @makmanalp for the updated syntax!
df['Column Name'].unique()
# Convert Series datatype to numeric (will error if column has non-numeric values)
# h/t @makmanalp
pd.to_numeric(df['Column Name'])
# Convert Series datatype to numeric, changing non-numeric values to NaN
# h/t @makmanalp for the updated syntax!

##分布式系统(Distributed System)资料


#####希望转载的朋友,你可以不用联系我.但是一定要保留原文链接,因为这个项目还在继续也在不定期更新.希望看到文章的朋友能够学到更多.

介绍:这是一篇介绍在动态网络里面实现分布式系统重构的paper.论文的作者(导师)是MIT读博的时候是做分布式系统的研究的,现在在NUS带学生,不仅仅是分布式系统,还有无线网络.如果感兴趣可以去他的主页了解.

@cizixs
cizixs / Netfilter-IPTables-Diagrams.md
Created April 17, 2018 09:35 — forked from nerdalert/Netfilter-IPTables-Diagrams.md
Linux NetFilter, IP Tables and Conntrack Diagrams

Linux NetFilter, IP Tables and Conntrack Diagrams

IPTABLES TABLES and CHAINS

IPTables has the following 4 built-in tables.

1) Filter Table

Filter is default table for iptables. So, if you don’t define you own table, you’ll be using filter table. Iptables’s filter table has the following built-in chains.

@cizixs
cizixs / README.md
Created February 28, 2018 10:41 — forked from magnetikonline/README.md
Bash string manipulation cheatsheet.

Bash string manipulation cheatsheet

Removal
Delete shortest match of needle from front of haystack ${haystack#needle}

What I Wish I'd Known About Equity Before Joining A Unicorn

Disclaimer: This piece is written anonymously. The names of a few particular companies are mentioned, but as common examples only.

This is a short write-up on things that I wish I'd known and considered before joining a private company (aka startup, aka unicorn in some cases). I'm not trying to make the case that you should never join a private company, but the power imbalance between founder and employee is extreme, and that potential candidates would

@cizixs
cizixs / vxlan.sh
Created July 19, 2016 12:27 — forked from chenchun/docker_vxlan.sh
Setup an overlay network on two hosts manually
#!/usr/bin/env bash
function setup_overlay() {
ip netns add overlay
ip netns exec overlay ip li ad dev br0 type bridge
ip li add dev vxlan42 type vxlan id 42 l2miss l3miss proxy learning dstport 4789
ip link set vxlan42 netns overlay
ip netns exec overlay ip li set dev vxlan42 name vxlan1
ip netns exec overlay ip li set dev vxlan1 master br0
ip li add dev vetha1 mtu 1450 type veth peer name vetha2 mtu 1450
@cizixs
cizixs / latency.txt
Created January 4, 2016 07:05 — forked from jboner/latency.txt
Latency Numbers Every Programmer Should Know
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

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname