Tool Box for Flash Members
pip install flashtool
For every print function, we print a copy to file without changing the whole file. Similar to tee
Example:
from flashtool import Logger
import sys
sys.stdout = Logger("path/to/log/file/log.txt")
# Example
from flashtool import send_email
send_email(receiver_email="[email protected]", subject="Hi", message="first email")
Send a email when job (pid) is done.
# Example
from flashtool import trackpid
trackpid(12345,5,"[email protected]")
trackpid([1357,2468],5,"[email protected]")
It contains setup configs for tmux
, zsh
, vim
, anaconda
.
Usage
mkdir toolkits
cd toolkits
wget https://hmjianggatech.github.io/files/atom_vim_zsh_tmux_configs.zip
unzip atom_vim_zsh_tmux_configs.zip
sh depoly_on_server.sh
cheat sheet: https://vim.rtorr.com/
i
: insertv
: visualV
: visual, line modeesc
: quit mode:q
: quit:wq
: save+quit:w
: savespace + enter
: search (n
for next,N
for previous):%s/string1/string2/gc
: replace string1 by string2 (normal mode)y
: copyp
: paste in normal modeshift + mouse right
: paste from outsideCtrl + r``0
: paste in insert moded
: cutdd
: cut lineshift + up/down
: move the lineshift + ,/.
: tab, indentu
: undo (normal mode)Ctrl + r
: redo (normal mode), + nn
: open/close NERD-treeCtrl + v
enter block visual mode --> select block -->shfit + i
enter insert mode --> insert#
-->esc
: comment
In NERD-tree:
?
: show helpshift + i
: show hidden files.t
: open in new tabenter
: open in current tab
tmux
: open new sessiontmux a
: attach the last session
In tmux (Session > Windows(Tabs) > Panes)
Ctrl+b
d
: detachCtrl+b
m
: turn on/off mouse modeCtrl+b
s
: switch sessionCtrl+b
$
: rename sessionCtrl+b
:new -s xxx
: new session with name 'xxx'Ctrl+b
c
: new windowCtrl+b
&
: close window (all panes)Ctrl+b
"
: Split pane horizontallyCtrl+b
%
: Split pane verticallyCtrl+b
o
: Switch paneCtrl+b
x
: close pane
# set up break points
import ipdb; ipdb.set_trace()
PDB Cheat Sheet: link
q
: quit
c
: continue
n
: next line
CUDA_VISIBLE_DEVICES=3 python run.py
nvidia-smi
htop
ls
cd
touch
chmod u+x file.sh
: To allow./file.sh
permission
file processing
>
cat
head
head -n 5
tail
tail -n 5
|tee
grep