start new:
tmux
start new with session name:
tmux new -s myname
| # when adding values from $FROM to $T0 | |
| # print only those lines which are not found in $TO | |
| # be carefull with partial match | |
| FROM=$1 | |
| TO=$2 | |
| for x in `cat $FROM`;do | |
| grep $x $TO > /dev/null; | |
| ret=$?; | |
| if [ $ret -ne 0 ];then |
| # 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 |
| 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 |
| #!/bin/bash | |
| # json should be any list of dictionaries with | |
| # each item having the same keys | |
| # example: | |
| #[ | |
| # { | |
| # "name": "server1.example.com", | |
| # "online": true, | |
| # }, |
| #!/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 |
| # 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') |
| 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 |
| sudo ln -sf /usr/share/zoneinfo/UTC /etc/localtime |
| # 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 |