Let's look at an example of how to launch a Kubernetes cluster from scratch on DigitalOcean, including kubeadm, an Nginx Ingress controller, and Letsencrypt certificates.
We'll be creating a four-node cluster (k8s-master, k8s-000...k8s-002), load balancer, and ssl certificates.
This is a compiled list of falsehoods programmers tend to believe about working with time.
Don't re-invent a date time library yourself. If you think you understand everything about time, you're probably doing it wrong.
- There are always 24 hours in a day.
- February is always 28 days long.
- Any 24-hour period will always begin and end in the same day (or week, or month).
SAN_CMP := -fno-omit-frame-pointer -fsanitize=address | |
SAN_STAT := -static-libstdc++ -static-libasan | |
BIN_CMP := -std=c++11 -c -I. main.cpp -O -g3 -o main.o | |
LIB_CMP := -std=c++11 my.cpp -o libmy.so -shared -fPIC -g3 | |
RUN := LD_LIBRARY_PATH=. ASAN_OPTIONS=symbolize=1 ASAN_SYMBOLIZER_PATH=$(shell which llvm-symbolizer) | |
PRELOAD := LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libasan.so.1 | |
lib-gcc: |
Skip this:
brew tap homebrew/dupes
brew tap homebrew/versions
As:
Warning: homebrew/dupes was deprecated. This tap is now empty as all its formulae were migrated.
Warning: homebrew/versions was deprecated. This tap is now empty as all its formulae were migrated.
Successful mitmproxy-3.7 setup tested on OS X 10.13.6 and iPhone X running 12.1.4
Enable IP forwarding and disable ICMP redirects to keep the iPad sending traffic to the proxy
sudo sysctl -w net.inet.ip.forwarding=1
sudo sysctl -w net.inet.ip.redirect=0
net.inet.ip.forwarding
Enable IP forwarding between interfaces
If your system is running slowly, perhaps a process is using too much CPU time and won't let other processes run smoothly. To find out which processes are taking up a lot of CPU time, you can use Apple's Activity Monitor.
The CPU pane shows how processes are affecting CPU (processor) activity:
#!/bin/bash | |
# Stop all containers | |
containers=`docker ps -a -q` | |
if [ -n "$containers" ] ; then | |
docker stop $containers | |
fi | |
# Delete all containers | |
containers=`docker ps -a -q` | |
if [ -n "$containers" ]; then | |
docker rm -f -v $containers |
Instructions are kind of sporadic around the internet, so I thought I would gather them all in one place. The following example uses a Flask app as the thing deployed. You should only have to this once, and then you can pass the bin around.
- pypy 2.x (tested)
- uwsgi 1.9.11+ (trunk as of this gist)
Latency Comparison Numbers (~2012) | |
---------------------------------- | |
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 3 us | |
Send 1K bytes over 1 Gbps network 10,000 ns 10 us | |
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD |