start new:
tmux
start new with session name:
tmux new -s myname
#!/usr/bin/env python | |
""" | |
convert json to a flattened list of key/values | |
example: data = { | |
"a": [ | |
{ | |
"key1": 1 | |
}, | |
{ | |
"key2": 2 |
# for screen-like experience | |
set -g prefix C-j | |
# to use ctrl+a+a as in screen | |
bind-key C-j last-window | |
# modify pane splitting bindings | |
unbind % | |
bind | split-window -h | |
bind - split-window -v |
sudo ln -sf /usr/share/zoneinfo/UTC /etc/localtime |
tmux_conf_uri="https://gist.githubusercontent.com/rpetrenko/e209a2216b0a7a74ad0b0468b5bd51ff/raw/66f7d6e8706595304dfcc4a02727e231f5ec39a2/.tmux.conf" | |
if [ ! -f ~/.tmux.conf ]; then | |
curl $tmux_conf_uri > ~/.tmux.conf | |
fi | |
ruby -v | |
git --version | |
brew -v |
# set width of cells to browser width | |
from IPython.core.display import display, HTML | |
display(HTML("<style>.container { width:100% !important; }</style>")) | |
# for drawing inline | |
import matplotlib.pyplot as plt | |
%matplotlib inline | |
from matplotlib import style | |
style.use('fivethirtyeight') |
#!/bin/bash | |
if [ "$#" -ne 3 ]; then | |
echo "Arguments: <email> <subject> <fname.html>" | |
exit 1 | |
fi | |
mail --content-type=text/html --attach="$3" --subject "$2" $1 < /dev/null |
#!/bin/bash | |
# json should be any list of dictionaries with | |
# each item having the same keys | |
# example: | |
#[ | |
# { | |
# "name": "server1.example.com", | |
# "online": true, | |
# }, |
day | people_details | Pop | Sick | Dead | Healthy | Immune | p_sick | |
---|---|---|---|---|---|---|---|---|
1 | +0000000000000000000 | 20 | 1 | 0 | 19 | 0 | 0.0500 | |
2 | +00+000+0+0000000+00 | 20 | 5 | 0 | 15 | 0 | 0.2500 | |
3 | +0+++0++0++0++0+0+++ | 20 | 14 | 0 | 6 | 0 | 0.7000 | |
4 | ++++++++0+++++++++++ | 20 | 19 | 0 | 1 | 0 | 0.9500 | |
5 | ++++++++++++++++++++ | 20 | 20 | 0 | 0 | 0 | 1.0000 | |
6 | +++x++++++++++++++++ | 19 | 19 | 1 | 0 | 0 | 1.0000 | |
7 | +++x++++++++++++++++ | 19 | 19 | 1 | 0 | 0 | 1.0000 | |
8 | +++x++++++++++++x+++ | 18 | 18 | 2 | 0 | 0 | 1.0000 | |
9 | +++x++++++++++++x+++ | 18 | 18 | 2 | 0 | 0 | 1.0000 |
# number of ssh connections | |
netstat -tnpa | grep 'ESTABLISHED.*sshd' | |
# network interfaces with their max speed | |
for i in $(netstat -i|cut -f1 -d" "|tail -n+3);do echo "$i: $(ethtool "$i"|grep Speed|sed 's/Speed://g')";done |