Skip to content

Instantly share code, notes, and snippets.

Article updates everything below
https://sigmonsays.github.io/2017/11/why-use-the-go-programming-language/
newer 2019 reasons
https://yourbasic.org/golang/advantages-over-java-python/
- easy to learn
- compiled language checks a lot of errors for me
- statically compiled (single binary deployment!)
- strictly typed language
video
-------------------------------
https://www.youtube.com/watch?v=PivpCKEiQOQ
transcript
-------------------------------
we pushed the images to dockerhub, then used docker-compose to deploy to the cluster
@sigmonsays
sigmonsays / tmux-cheatsheet.markdown
Created February 17, 2016 18:16 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname

Keybase proof

I hereby claim:

  • I am sigmonsays on github.
  • I am sigmonsays (https://keybase.io/sigmonsays) on keybase.
  • I have a public key whose fingerprint is DA4C 82DC C4B0 3E93 1EF2 86BE CB3A F88F E1E3 28BA

To claim this, I am signing this object:

@sigmonsays
sigmonsays / reload_iptables.sh
Created December 2, 2015 01:19 — forked from eqhmcow/reload_iptables.sh
unload the iptables modules and then reload them and apply the firewall rules stored at /etc/iptables.conf - adapted from RHEL 5's iptables services script
IPTABLES=iptables
IPV=${IPTABLES%tables} # ip for ipv4 | ip6 for ipv6
PROC_IPTABLES_NAMES=/proc/net/${IPV}_tables_names
/sbin/modprobe --version 2>&1 | grep -q module-init-tools \
&& NEW_MODUTILS=1 \
|| NEW_MODUTILS=0
# Do not stop if iptables module is not loaded.
[ -e "$PROC_IPTABLES_NAMES" ] || exit 1
@sigmonsays
sigmonsays / lama
Last active August 29, 2015 14:10 — forked from tech6/lama
NNNNNNNNNNNNNNNNNNNNNDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDNNNNNNNNNNNNNNNNNNNNNN
NNNNNNNNNNNNNNNNNNDDDNDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDNNNNNNNNNNNNNNNNNN
NNNNNNNNNNNNNNNNNDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDNNNNNNNNNNNNNNN
NNNNNNNNNNNNNNNDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDZ?NDDDDDDDDDDDDDDDDDDDNNNNNNNNNNNNN
NNNNNNNNNNNNNDDDDDDDDDDDDDDDDDDD?:$DDDDD8+DDD:=,DDDDDDDDDDDDDDDDDDDDDNNNNNNNNNNN
NNNNNNNNNNNDDDDDDDDDDDDDDDDDDDDO?O:DD8DZ+$DDN:D=+DDDDDDDDDDDDDDDDDDDDDDDNNNNNNNN
NNNNNNNNDDDDDDDDDDDDDDDDDDDDDD8:88~D8D?+++78O:8Z:DDDDDDDDDDDDDDDDDDDDDDDDDNNNNNN
NNNNNNDDDDDDDDDDDDDDDDDDDDDDDD8+8D=+DI?Z8+?D+:8$:DDDDDDDDDDDDDDDDDDDDDDDDDDNNNNN
NNNNNDDDDDDDDDDDDDDDDDDDDDDDDDD+D8?~=?$=8=7Z::8I:D8DDDDDDDDDDDDDDDDDDDDDDDDNNNNN
NNNDDDDDDDDDDDDDDDDDDDDDDDDDD8D+IOIZ$7ZDD7+$:~O=~D8DDDDDDDDDDDDDDDDDDDDDDDDDNNNN
@sigmonsays
sigmonsays / gist:f6a0fef97930c31db195
Created November 12, 2014 18:10
convert time python utility
class ConvertTimeUtil:
"""
convert time tool expected to be used in interactive cli
everything is stored in nanoseconds internally
then converted to the appropriate format on output in the ConvertTimeTo class
>>> ConvertTime.nanoseconds(6606999).to_seconds()
0.006606999
"""

Latency numbers every programmer should know

L1 cache reference ......................... 0.5 ns
Branch mispredict ............................ 5 ns                     on recent CPU
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 µ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 4X memory

@sigmonsays
sigmonsays / lama
Last active August 29, 2015 14:07 — forked from tech6/lama
NNNNNNNNNNNNNNNNNNNNNDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDNNNNNNNNNNNNNNNNNNNNNN
NNNNNNNNNNNNNNNNNNDDDNDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDNNNNNNNNNNNNNNNNNN
NNNNNNNNNNNNNNNNNDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDNNNNNNNNNNNNNNN
NNNNNNNNNNNNNNNDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDZ?NDDDDDDDDDDDDDDDDDDDNNNNNNNNNNNNN
NNNNNNNNNNNNNDDDDDDDDDDDDDDDDDDD?:$DDDDD8+DDD:=,DDDDDDDDDDDDDDDDDDDDDNNNNNNNNNNN
NNNNNNNNNNNDDDDDDDDDDDDDDDDDDDDO?O:DD8DZ+$DDN:D=+DDDDDDDDDDDDDDDDDDDDDDDNNNNNNNN
NNNNNNNNDDDDDDDDDDDDDDDDDDDDDD8:88~D8D?+++78O:8Z:DDDDDDDDDDDDDDDDDDDDDDDDDNNNNNN
NNNNNNDDDDDDDDDDDDDDDDDDDDDDDD8+8D=+DI?Z8+?D+:8$:DDDDDDDDDDDDDDDDDDDDDDDDDDNNNNN
NNNNNDDDDDDDDDDDDDDDDDDDDDDDDDD+D8?~=?$=8=7Z::8I:D8DDDDDDDDDDDDDDDDDDDDDDDDNNNNN
NNNDDDDDDDDDDDDDDDDDDDDDDDDDD8D+IOIZ$7ZDD7+$:~O=~D8DDDDDDDDDDDDDDDDDDDDDDDDDNNNN