GET USED TOCOMMAND LINE INTERFACECREATED BY @JUNHOCHO
1 — © Junho Cho, 2016
HEY, ISN'T GUI
IS ENOUGH?
2 — © Junho Cho, 2016
WELL,
3 — © Junho Cho, 2016
SATISFIED?
4 — © Junho Cho, 2016
CLI( TMUX + VIM )
5 — © Junho Cho, 2016
WHY CLI?PORTABLE. SIMPLE. AUTOMATED. AND COOL
6 — © Junho Cho, 2016
YOU OWN SERVERS
YOU HAVE MAC KAKAOTALK
YOU ARE LAZY
YOU ARE A BLOGGER
YOU ARE A COMPUTER GEEK
7 — © Junho Cho, 2016
THIS PRESENTATION ARE INSPIRED BY @NICKNISI
YOUTUBE LINK
8 — © Junho Cho, 2016
COVERAGE
1. Ubuntu14.04 (The OS)
2. Vim (The editor)
3. Tmux (The workspace)
DOTFILES LINK : https://github.com/junhocho/junhosetting
9 — © Junho Cho, 2016
LET'S START
WITH SSH
10 — © Junho Cho, 2016
SSH : SECURE SHELL
Secure connection to server
HOST(SERVER) IP : 147.46.89.175
USER ID : bctjv-[yourname]
PASSWORD : awesomejunho
11 — © Junho Cho, 2016
LOGIN !LINUX/MACOS : ssh bctjv-[yourname]@147.46.89.175
12 — © Junho Cho, 2016
WINDOWS : USE PUTTY
13 — © Junho Cho, 2016
THIS ACTUALLY NEEDSsudo apt-get install openssh-server
OPENSSH INSTALLED AT YOUR SERVER
14 — © Junho Cho, 2016
AND ACTUALLY YOU DON'T NEED PASSWORD EITHER.
MAKE PASSWORD KEY AND KEEP IT !
REF
15 — © Junho Cho, 2016
UBUNTU14.04 (LINUX)
> One of Linux
> Commonly used in Deep Learning
libraries
> link about Directories : tmp, root,
var, usr, home, bin
16 — © Junho Cho, 2016
SIMPLE COMMANDS
mv , cp , rm , mkdir , rmdir
ls -lh, df -lh, du -sh ./*, whoami
cp *.py /path/to/dest/
rm -rf /다/지워/버리겠다/*.txt
sudo apt-get install tmux
funny commands
17 — © Junho Cho, 2016
TRYcowsay
cmatrix
18 — © Junho Cho, 2016
SOME SIGNALS
# ==== Ex1) ====
$ yes yell!
<C-c> # Control - c. Interrupt!
# ==== Ex2) ====
$ python -c '
c = 0
while True: print c; c= c+1'
<C-z> : stop for the moment and backgorund!
$ fg # back on foreground
# ==== Ex 3) ====
$ python
<C-d> # exit
19 — © Junho Cho, 2016
CONCEPT
> directory and file / permission, ownership
20 — © Junho Cho, 2016
CHANGE PERMSSION : $ chmod 755 hello.py
CHANGE OWNERSHIP : $ chown userid hello.py
sudo command : BORROW SUDO PRIVILEGE AND COMMAND
DO NOT ABUSE SUDO !
21 — © Junho Cho, 2016
SHELL
> Default shell is bash shell
> bash shell made in 1989 which is
pretty uncomfortable.
USE zsh
> http://ohmyz.sh
22 — © Junho Cho, 2016
WHY ZSH?
1. smart autocomplete
2. conivient visualization
3. Git plugin
23 — © Junho Cho, 2016
INSTALL ZSHsudo apt-get install zsh # Already installed in our case
cd # move to home folder
sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)" # install
sudo chsh -s /usr/bin/zsh [your-id] # change your default shell into zsh
EASY?24 — © Junho Cho, 2016
LET'S DO SOME MORE TWEAK!
THEN, GIT CLONE Junhosetting FIRST
cd # move to home folder
git clone https://github.com/junhocho/junhosetting #Star it
cd junhosetting
vi install.txt # peek vim
25 — © Junho Cho, 2016
HEY, VIM USER
VIM : IMPROVED VI.
1 # Zsh setup
2 zsh autojump - https://github.com/wting/autojump.git
3 zsh syntax highlighting - https://github.com/zsh-users/zsh-syntax-highlighting.git
4
5
6 #alias-tips
7 $ cd ${ZSH_CUSTOM1:-$ZSH/custom}/plugins # 커스텀 플러그인 폴더로 이동
8 $ git clone https://github.com/djui/alias-tips.git # 저장소를 로컬로 복사
9 $ $EDITOR ~/.zshrc # 에디터로 파일을 에디터로 불러들임
10 plugins=(git ... alias-tips) 추가
11 ...
26 — © Junho Cho, 2016
LET'S DO SOME MORE TWEAK.
1. ZSH SYNTAX HIGHLIGHT
2. AUTOJUMP
Vim quit? [Alt F4]
:q # vim quit
:wq # save and quit. identical to <shift-ZZ>
27 — © Junho Cho, 2016
ZSH HIGHLIGHTING INSTALL
cd
# get source of zsh-syntax-highlighting
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git
# put codes in .zshrc
echo "source ${(q-)PWD}/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh" >> ${ZDOTDIR:-$HOME}/.zshrc
# activate it now
source ./zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
# this refreshes your .zshrc modofication to your current environment
source ~/.zshrc # dotfiles locate in home folder
IT HIGHLIGHTS IF YOUR COMMAND IS VALID
DO AUTOJUMP BY YOURSELF
28 — © Junho Cho, 2016
SOME MORE USEFUL COMMANDS
ls . | wc -l # how many files in this directory.
du -sh ./* # how big are folders and files in this directory
df -lh # list my Filesystem in human readable format
ln -s [target-folder] [make-link] # make symbolic link
grep -nr --color "keyword-to-find" * # locate "keyword-to-find"
unzip some.zip # unzip
tar -xvf some.tar.gz # untar
echo $CUDA_HOME # print some environment variable
wget https://goo.gl/ka7Yz5 # download file in web
wget http://www.ekn.kr/data/photos/20150938/art_1442387799.jpg # Download jpg image
python print-experiment-output.py 2>&1 | tee experiment.log # Store all print output in experiment.log
which python # useful to locate command
history # my command history
pstree # process tree
htop # system monitoring
nvidia-smi # gpu monitoring
who # which users are online?
29 — © Junho Cho, 2016
ALIAS
> Be more lazy.
YOU DON'T HAVE TIME TO TYPE : grep -nr --color "keyword-to-find" *
> put your alias at the end of .zshrc
cd
cat junhosetting/alias >> ~/.zshrc # Copy paste alias to end of .zshrc
tail ~/.zshrc # print some lines of the end of .zshrc
source ~/.zshrc # refresh this environment
grepn "key-word-to-find" * # Check the alias working
30 — © Junho Cho, 2016
PORT
WELL KNOW PORTS : 22 : SSH / 80 : HTTP / 3389 : Window rdp ...
PORTFORWARD FROM CLIENT TO SERVER : ssh -L localhost:$2:localhost:$2 $1
# Ex) Do this at SERVER.
Jupyter notebook --no-browser --port 8888 # random ports 8888
# Do this at CLIENT
ssh -L localhost:8888:localhost:8888 junho@147.46.89.175
# Open web-browser in CLIENT and connect to `localhost:8888`
VNC (GUI) : Use GUI safely with SSH
31 — © Junho Cho, 2016
WEB-SERVER# Do this at SERVER
python -m SimpleHTTPServer 8888 # Open temporary web-server in 8888
# Open web-browser in CLIENT and connect to 147.46.89.175:8888
32 — © Junho Cho, 2016
SCP: MOVE FILE BETWEEN CLIENT AND SERVER
USE IT IN CLIENT (UNIX) TERMINAL.
BECAUSE CLIENT : 유동 IP / SERVER : 고정 IP
scp /client/A host:~/path/dest/B
# Client의 파일 A를 host의 경로 B로 옮긴다.
scp host:~/path/dest/A /client/B
# Host의 파일 A를 Client의 B로 옮긴다.
scp -r junho@147.46.89.175:~/Downloads/WordCount ~/Workspace/
# -r 은 재귀적으로. 서버의 WordCount 디렉토리와 안의
# 모든 파일을 내 client의 Workspace의 복사
33 — © Junho Cho, 2016
WINDOWS?
WINSCP
34 — © Junho Cho, 2016
imgcat
ONLY FOR MACOS ITERM2
35 — © Junho Cho, 2016
KILLING PROCESS
$ python -c '
c = 0
while True: print c; c= c+1'
<C-z> # go to sleep and background.
$ ps aux | grep python # print process that contains `python`
kill -9 [process-id] : 356 in this case
process killed!
36 — © Junho Cho, 2016
ANY MORE QUESTIONS?
37 — © Junho Cho, 2016
2. VIM
38 — © Junho Cho, 2016
IDE?VISUA STUDIO , ECLIPSE, WEBSTORM, ANDROID STUDIO, PYCHARM, ZEROBANESTUDIO
39 — © Junho Cho, 2016
❤ IDE VIMYOU DON'T HAVE CHOICE BUT TO LOVE VIM IN SSH.
40 — © Junho Cho, 2016
VIM> Vim : improved Vi.
> probably already installed in your
system
> Highly customizable
> setting file : .vimrc
41 — © Junho Cho, 2016
MODAL EDITING
42 — © Junho Cho, 2016
MODAL EDITING> Normal - navigate the structure of the file <esc>
> Insert - editing the file i, o, a, s, ...
> Visual - highlight portions of the file to manipulate at
once v, shift-v, ctrl-v
> Ex - command mode :, /, ?
43 — © Junho Cho, 2016
DON'T USE
MOUSE! !NOW ALL UPPER/LOWER ALPHABET DIFFERS
44 — © Junho Cho, 2016
h j k l
⬅ ⬇ ⬆ ➡45 — © Junho Cho, 2016
12jMOVE DOWN 12 TIEMS, NUMBERS AFFECT46 — © Junho Cho, 2016
> :29 : move to line 29
> :set number : show line numbers
> :set nonumber : no usually the opposite of command
47 — © Junho Cho, 2016
> ^e - scroll the window down
> ^y - scroll the window up
> ^f - scroll down one page
> ^b - scroll up one page
> H - move cursor to the top of the window
> M - move cursor to the middle of the window
> L - move cursor to the bottom of the window
48 — © Junho Cho, 2016
> zz : move window so that my cursor is at center
> u : undo
> ^r : redo
> :w : save
> :q : quit
> :wq : save and quit
49 — © Junho Cho, 2016
> gg - go to top of file
> G - go to bottom of file
TEXT OBJECTS
> w - words
> s - sentences
> p - paragraphs
50 — © Junho Cho, 2016
MOTIONS> a- all
> i - in
> t - 'til
> f - find forward
> F - find backward
51 — © Junho Cho, 2016
COMMANDS> d - delete (also cut)
> c - change (delete, then place in insert mode)
> y - yank (copy)
> v - visually select
52 — © Junho Cho, 2016
{command}{text object or motion}
53 — © Junho Cho, 2016
diwDELETE IN WORD54 — © Junho Cho, 2016
cawCHANGE ALL WORD55 — © Junho Cho, 2016
yi)YANK ALL TEXT INSIDE PARENTHESES56 — © Junho Cho, 2016
va"VISUALLY SELECT ALL INSIDE DOUBLEQUOTES
INCLUDING
DOUBLEQUOTES57 — © Junho Cho, 2016
^v 4j I # <esc>
VISUALLY SELECT COLUMN 4 DOWN LINES AND ENTER INSERT MODE TO WRITE #
COMMENTING MULTIPLE LINES WITH #
58 — © Junho Cho, 2016
REPETITION
THE DOT COMMAND.
59 — © Junho Cho, 2016
REPEAT THE LAST COMMAND
60 — © Junho Cho, 2016
THAT'S IT
61 — © Junho Cho, 2016
BUT IT'S POWERFUL
62 — © Junho Cho, 2016
ADDITIONAL COMMANDS
> dd / yy - delete/yank the current line
> D / C - delete/change until end of line
> ^ / $ - move to the beginning/end of line
> I / A - move to the beginning/end of line and insert
> o / O - insert new line above/below current line and
insert
63 — © Junho Cho, 2016
ADDITIONAL COMMANDS
> J - delete line break. pretty useful
> p - paste
> * on word - find all this words.
> ^a on number - increment
64 — © Junho Cho, 2016
TRY AND MAKE ACTIONS REPEATABLE
PRACTICE IT
65 — © Junho Cho, 2016
NOT EVERYTHING IS REPEATABLE
AT LEAST WITH THE DOT COMMAND
66 — © Junho Cho, 2016
MACROS67 — © Junho Cho, 2016
MACROA SEQUENCE OF COMMANDS RECORDED TO A REGISTER
68 — © Junho Cho, 2016
RECORD A MACRO
> q{register}
> (do the things)
> q
PLAY A MACRO
> @{register}
69 — © Junho Cho, 2016
> mk : mark position at k
`k : move cursor to position k
70 — © Junho Cho, 2016
EX MODE
> /someword : find someword
> :spl / :vspl : split (horizontal or vertical) vim pane
> ^w + w/arrow : move pane in vim
> : vertical split pane
> :e. : file tree
> :%s/foo/bar/g : replace all foo to bar
71 — © Junho Cho, 2016
> :syntax on : syntax on
> :set paste : paste mode. Useful when using vim
indent option
> :set cursor : show cursor with underline
LET'S PUT THOSE USEFUL OPTIONS
AS BASIC SETTING.72 — © Junho Cho, 2016
GET INTO JUNHOSETTING ONCE AGAIN
cp ~/junhosetting/vimrc ~/.vimrc
73 — © Junho Cho, 2016
PLUGINS74 — © Junho Cho, 2016
PLUGINS : INSTALL WHAT YOU NEED
> vundle - plugin manager
> nerdtree - file drawer
> ctrlp - fuzzy file finder
> fugitive - git tool
> syntastic - syntax checker / linter
75 — © Junho Cho, 2016
BUT MY IDE DOES MORE
76 — © Junho Cho, 2016
VIM IS EXTEMELY CUSTOMIZABLE
PLUGINS TAILOR VIM TO YOUR NEEDS
77 — © Junho Cho, 2016
BUT WE CAN STILL DO MORE
78 — © Junho Cho, 2016
NOT AN IDE
IT'S VIM
79 — © Junho Cho, 2016
INSTALL VUNDLE WITH PLUGINS
cd
git clone https://github.com/gmarik/Vundle.vim.git ~/.vim/bundle/Vundle.vim
# clone in ~/.vim/bundle/ and setup your vimrc with plugins
vi # then do :PluginInstall
# Test :NERDTree with <F2> in vim
# Test if autocomplete works
80 — © Junho Cho, 2016
EXECUTABLESWrite on top of script
#!bin/bash if shell script,
#!bin/usr/python if python script.
chmod +x script
THEN THE SCRIPT IS EXECUTABLE AS $ ./script
81 — © Junho Cho, 2016
3. TMUX
TERMINAL MULTIPLEXER
82 — © Junho Cho, 2016
VIM + TMUX
83 — © Junho Cho, 2016
WHY TMUX?> Don't want to stop your SSH session.
1. Experiment session
2. Downloading big file
3. web-server
84 — © Junho Cho, 2016
> Extendable Workspace
> And Maintain your session
> Co-operation
85 — © Junho Cho, 2016
tmux new -s [session-name] # create new session
tmux ls # list existing session
tmux attch -t [session-name] # attach existing session
86 — © Junho Cho, 2016
tmux new -s py-practice
87 — © Junho Cho, 2016
<C-b> : TMUX BINDING-KEY.
> will change it to <C-a> unless you have flexible
finger bone
<C-b> c , bind c : NEW WINDOW
bind d : DETTACH FROM WORKING SESSION
88 — © Junho Cho, 2016
LET'S CONFIGURE TMUX.
> ref1, ref2
> .tmux.conf
cp ~/junhosetting/tmux.conf ~/.tmux.conf # dotfile로 이름바꿔서 복붙
tmux source .tmux.conf # If you have working tmux session
# Now your Tmux looks better and <C-a> is the binding-key
89 — © Junho Cho, 2016
tmux new -s [session-name]
bind c : new window
bind n : Next window
bind p : Previous window
bind % : vertical split pane
bind " : horizontal split pane
bind h(jkl, arrow) : move my cursor pane to pane
bind [ : copy-mode / q : copy-mode exit
exit / <C-d> : quit pane
90 — © Junho Cho, 2016
THERE'S A LOT THAT TMUX CAN DO
91 — © Junho Cho, 2016
SYNCHRONIZE-PANES
92 — © Junho Cho, 2016
CREATE SPLITS ON THE FLY
93 — © Junho Cho, 2016
HAVE FLEXIBLE WORKSPACE
94 — © Junho Cho, 2016
TMUX + VIM = ❤
95 — © Junho Cho, 2016
I ❤ VIMAND I THINK YOU WILL, TOO
96 — © Junho Cho, 2016
LEARN YOUR EDITOR WELL
(EVEN IF IT'S NOT VIM)
97 — © Junho Cho, 2016
DON'T COPY SOMEONE ELSE'S CONFIGURATION
MAKE IT YOUR OWN
98 — © Junho Cho, 2016
BUT SHARE YOUR CONFIGURATION
99 — © Junho Cho, 2016
DOTFILES
> Share your configuration
> Steal ideas from others
> junhocho/dotfiles
OTHERS
> nicknisi/dotfiles
> bryanforbes/dotfiles
> jason0x43/dotfiles
100 — © Junho Cho, 2016
KEEP PRACTICING
101 — © Junho Cho, 2016
❤dotfiles and materials available at @junhocho*
*
Inspired from @nicknisi
102 — © Junho Cho, 2016

Get Used to Command Line Interface

  • 1.
    GET USED TOCOMMANDLINE INTERFACECREATED BY @JUNHOCHO 1 — © Junho Cho, 2016
  • 2.
    HEY, ISN'T GUI ISENOUGH? 2 — © Junho Cho, 2016
  • 3.
    WELL, 3 — ©Junho Cho, 2016
  • 4.
    SATISFIED? 4 — ©Junho Cho, 2016
  • 5.
    CLI( TMUX +VIM ) 5 — © Junho Cho, 2016
  • 6.
    WHY CLI?PORTABLE. SIMPLE.AUTOMATED. AND COOL 6 — © Junho Cho, 2016
  • 7.
    YOU OWN SERVERS YOUHAVE MAC KAKAOTALK YOU ARE LAZY YOU ARE A BLOGGER YOU ARE A COMPUTER GEEK 7 — © Junho Cho, 2016
  • 8.
    THIS PRESENTATION AREINSPIRED BY @NICKNISI YOUTUBE LINK 8 — © Junho Cho, 2016
  • 9.
    COVERAGE 1. Ubuntu14.04 (TheOS) 2. Vim (The editor) 3. Tmux (The workspace) DOTFILES LINK : https://github.com/junhocho/junhosetting 9 — © Junho Cho, 2016
  • 10.
    LET'S START WITH SSH 10— © Junho Cho, 2016
  • 11.
    SSH : SECURESHELL Secure connection to server HOST(SERVER) IP : 147.46.89.175 USER ID : bctjv-[yourname] PASSWORD : awesomejunho 11 — © Junho Cho, 2016
  • 12.
    LOGIN !LINUX/MACOS :ssh bctjv-[yourname]@147.46.89.175 12 — © Junho Cho, 2016
  • 13.
    WINDOWS : USEPUTTY 13 — © Junho Cho, 2016
  • 14.
    THIS ACTUALLY NEEDSsudoapt-get install openssh-server OPENSSH INSTALLED AT YOUR SERVER 14 — © Junho Cho, 2016
  • 15.
    AND ACTUALLY YOUDON'T NEED PASSWORD EITHER. MAKE PASSWORD KEY AND KEEP IT ! REF 15 — © Junho Cho, 2016
  • 16.
    UBUNTU14.04 (LINUX) > Oneof Linux > Commonly used in Deep Learning libraries > link about Directories : tmp, root, var, usr, home, bin 16 — © Junho Cho, 2016
  • 17.
    SIMPLE COMMANDS mv ,cp , rm , mkdir , rmdir ls -lh, df -lh, du -sh ./*, whoami cp *.py /path/to/dest/ rm -rf /다/지워/버리겠다/*.txt sudo apt-get install tmux funny commands 17 — © Junho Cho, 2016
  • 18.
  • 19.
    SOME SIGNALS # ====Ex1) ==== $ yes yell! <C-c> # Control - c. Interrupt! # ==== Ex2) ==== $ python -c ' c = 0 while True: print c; c= c+1' <C-z> : stop for the moment and backgorund! $ fg # back on foreground # ==== Ex 3) ==== $ python <C-d> # exit 19 — © Junho Cho, 2016
  • 20.
    CONCEPT > directory andfile / permission, ownership 20 — © Junho Cho, 2016
  • 21.
    CHANGE PERMSSION :$ chmod 755 hello.py CHANGE OWNERSHIP : $ chown userid hello.py sudo command : BORROW SUDO PRIVILEGE AND COMMAND DO NOT ABUSE SUDO ! 21 — © Junho Cho, 2016
  • 22.
    SHELL > Default shellis bash shell > bash shell made in 1989 which is pretty uncomfortable. USE zsh > http://ohmyz.sh 22 — © Junho Cho, 2016
  • 23.
    WHY ZSH? 1. smartautocomplete 2. conivient visualization 3. Git plugin 23 — © Junho Cho, 2016
  • 24.
    INSTALL ZSHsudo apt-getinstall zsh # Already installed in our case cd # move to home folder sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)" # install sudo chsh -s /usr/bin/zsh [your-id] # change your default shell into zsh EASY?24 — © Junho Cho, 2016
  • 25.
    LET'S DO SOMEMORE TWEAK! THEN, GIT CLONE Junhosetting FIRST cd # move to home folder git clone https://github.com/junhocho/junhosetting #Star it cd junhosetting vi install.txt # peek vim 25 — © Junho Cho, 2016
  • 26.
    HEY, VIM USER VIM: IMPROVED VI. 1 # Zsh setup 2 zsh autojump - https://github.com/wting/autojump.git 3 zsh syntax highlighting - https://github.com/zsh-users/zsh-syntax-highlighting.git 4 5 6 #alias-tips 7 $ cd ${ZSH_CUSTOM1:-$ZSH/custom}/plugins # 커스텀 플러그인 폴더로 이동 8 $ git clone https://github.com/djui/alias-tips.git # 저장소를 로컬로 복사 9 $ $EDITOR ~/.zshrc # 에디터로 파일을 에디터로 불러들임 10 plugins=(git ... alias-tips) 추가 11 ... 26 — © Junho Cho, 2016
  • 27.
    LET'S DO SOMEMORE TWEAK. 1. ZSH SYNTAX HIGHLIGHT 2. AUTOJUMP Vim quit? [Alt F4] :q # vim quit :wq # save and quit. identical to <shift-ZZ> 27 — © Junho Cho, 2016
  • 28.
    ZSH HIGHLIGHTING INSTALL cd #get source of zsh-syntax-highlighting git clone https://github.com/zsh-users/zsh-syntax-highlighting.git # put codes in .zshrc echo "source ${(q-)PWD}/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh" >> ${ZDOTDIR:-$HOME}/.zshrc # activate it now source ./zsh-syntax-highlighting/zsh-syntax-highlighting.zsh # this refreshes your .zshrc modofication to your current environment source ~/.zshrc # dotfiles locate in home folder IT HIGHLIGHTS IF YOUR COMMAND IS VALID DO AUTOJUMP BY YOURSELF 28 — © Junho Cho, 2016
  • 29.
    SOME MORE USEFULCOMMANDS ls . | wc -l # how many files in this directory. du -sh ./* # how big are folders and files in this directory df -lh # list my Filesystem in human readable format ln -s [target-folder] [make-link] # make symbolic link grep -nr --color "keyword-to-find" * # locate "keyword-to-find" unzip some.zip # unzip tar -xvf some.tar.gz # untar echo $CUDA_HOME # print some environment variable wget https://goo.gl/ka7Yz5 # download file in web wget http://www.ekn.kr/data/photos/20150938/art_1442387799.jpg # Download jpg image python print-experiment-output.py 2>&1 | tee experiment.log # Store all print output in experiment.log which python # useful to locate command history # my command history pstree # process tree htop # system monitoring nvidia-smi # gpu monitoring who # which users are online? 29 — © Junho Cho, 2016
  • 30.
    ALIAS > Be morelazy. YOU DON'T HAVE TIME TO TYPE : grep -nr --color "keyword-to-find" * > put your alias at the end of .zshrc cd cat junhosetting/alias >> ~/.zshrc # Copy paste alias to end of .zshrc tail ~/.zshrc # print some lines of the end of .zshrc source ~/.zshrc # refresh this environment grepn "key-word-to-find" * # Check the alias working 30 — © Junho Cho, 2016
  • 31.
    PORT WELL KNOW PORTS: 22 : SSH / 80 : HTTP / 3389 : Window rdp ... PORTFORWARD FROM CLIENT TO SERVER : ssh -L localhost:$2:localhost:$2 $1 # Ex) Do this at SERVER. Jupyter notebook --no-browser --port 8888 # random ports 8888 # Do this at CLIENT ssh -L localhost:8888:localhost:8888 junho@147.46.89.175 # Open web-browser in CLIENT and connect to `localhost:8888` VNC (GUI) : Use GUI safely with SSH 31 — © Junho Cho, 2016
  • 32.
    WEB-SERVER# Do thisat SERVER python -m SimpleHTTPServer 8888 # Open temporary web-server in 8888 # Open web-browser in CLIENT and connect to 147.46.89.175:8888 32 — © Junho Cho, 2016
  • 33.
    SCP: MOVE FILEBETWEEN CLIENT AND SERVER USE IT IN CLIENT (UNIX) TERMINAL. BECAUSE CLIENT : 유동 IP / SERVER : 고정 IP scp /client/A host:~/path/dest/B # Client의 파일 A를 host의 경로 B로 옮긴다. scp host:~/path/dest/A /client/B # Host의 파일 A를 Client의 B로 옮긴다. scp -r junho@147.46.89.175:~/Downloads/WordCount ~/Workspace/ # -r 은 재귀적으로. 서버의 WordCount 디렉토리와 안의 # 모든 파일을 내 client의 Workspace의 복사 33 — © Junho Cho, 2016
  • 34.
  • 35.
    imgcat ONLY FOR MACOSITERM2 35 — © Junho Cho, 2016
  • 36.
    KILLING PROCESS $ python-c ' c = 0 while True: print c; c= c+1' <C-z> # go to sleep and background. $ ps aux | grep python # print process that contains `python` kill -9 [process-id] : 356 in this case process killed! 36 — © Junho Cho, 2016
  • 37.
    ANY MORE QUESTIONS? 37— © Junho Cho, 2016
  • 38.
    2. VIM 38 —© Junho Cho, 2016
  • 39.
    IDE?VISUA STUDIO ,ECLIPSE, WEBSTORM, ANDROID STUDIO, PYCHARM, ZEROBANESTUDIO 39 — © Junho Cho, 2016
  • 40.
    ❤ IDE VIMYOUDON'T HAVE CHOICE BUT TO LOVE VIM IN SSH. 40 — © Junho Cho, 2016
  • 41.
    VIM> Vim :improved Vi. > probably already installed in your system > Highly customizable > setting file : .vimrc 41 — © Junho Cho, 2016
  • 42.
    MODAL EDITING 42 —© Junho Cho, 2016
  • 43.
    MODAL EDITING> Normal- navigate the structure of the file <esc> > Insert - editing the file i, o, a, s, ... > Visual - highlight portions of the file to manipulate at once v, shift-v, ctrl-v > Ex - command mode :, /, ? 43 — © Junho Cho, 2016
  • 44.
    DON'T USE MOUSE! !NOWALL UPPER/LOWER ALPHABET DIFFERS 44 — © Junho Cho, 2016
  • 45.
    h j kl ⬅ ⬇ ⬆ ➡45 — © Junho Cho, 2016
  • 46.
    12jMOVE DOWN 12TIEMS, NUMBERS AFFECT46 — © Junho Cho, 2016
  • 47.
    > :29 :move to line 29 > :set number : show line numbers > :set nonumber : no usually the opposite of command 47 — © Junho Cho, 2016
  • 48.
    > ^e -scroll the window down > ^y - scroll the window up > ^f - scroll down one page > ^b - scroll up one page > H - move cursor to the top of the window > M - move cursor to the middle of the window > L - move cursor to the bottom of the window 48 — © Junho Cho, 2016
  • 49.
    > zz :move window so that my cursor is at center > u : undo > ^r : redo > :w : save > :q : quit > :wq : save and quit 49 — © Junho Cho, 2016
  • 50.
    > gg -go to top of file > G - go to bottom of file TEXT OBJECTS > w - words > s - sentences > p - paragraphs 50 — © Junho Cho, 2016
  • 51.
    MOTIONS> a- all >i - in > t - 'til > f - find forward > F - find backward 51 — © Junho Cho, 2016
  • 52.
    COMMANDS> d -delete (also cut) > c - change (delete, then place in insert mode) > y - yank (copy) > v - visually select 52 — © Junho Cho, 2016
  • 53.
    {command}{text object ormotion} 53 — © Junho Cho, 2016
  • 54.
    diwDELETE IN WORD54— © Junho Cho, 2016
  • 55.
    cawCHANGE ALL WORD55— © Junho Cho, 2016
  • 56.
    yi)YANK ALL TEXTINSIDE PARENTHESES56 — © Junho Cho, 2016
  • 57.
    va"VISUALLY SELECT ALLINSIDE DOUBLEQUOTES INCLUDING DOUBLEQUOTES57 — © Junho Cho, 2016
  • 58.
    ^v 4j I# <esc> VISUALLY SELECT COLUMN 4 DOWN LINES AND ENTER INSERT MODE TO WRITE # COMMENTING MULTIPLE LINES WITH # 58 — © Junho Cho, 2016
  • 59.
    REPETITION THE DOT COMMAND. 59— © Junho Cho, 2016
  • 60.
    REPEAT THE LASTCOMMAND 60 — © Junho Cho, 2016
  • 61.
    THAT'S IT 61 —© Junho Cho, 2016
  • 62.
    BUT IT'S POWERFUL 62— © Junho Cho, 2016
  • 63.
    ADDITIONAL COMMANDS > dd/ yy - delete/yank the current line > D / C - delete/change until end of line > ^ / $ - move to the beginning/end of line > I / A - move to the beginning/end of line and insert > o / O - insert new line above/below current line and insert 63 — © Junho Cho, 2016
  • 64.
    ADDITIONAL COMMANDS > J- delete line break. pretty useful > p - paste > * on word - find all this words. > ^a on number - increment 64 — © Junho Cho, 2016
  • 65.
    TRY AND MAKEACTIONS REPEATABLE PRACTICE IT 65 — © Junho Cho, 2016
  • 66.
    NOT EVERYTHING ISREPEATABLE AT LEAST WITH THE DOT COMMAND 66 — © Junho Cho, 2016
  • 67.
    MACROS67 — ©Junho Cho, 2016
  • 68.
    MACROA SEQUENCE OFCOMMANDS RECORDED TO A REGISTER 68 — © Junho Cho, 2016
  • 69.
    RECORD A MACRO >q{register} > (do the things) > q PLAY A MACRO > @{register} 69 — © Junho Cho, 2016
  • 70.
    > mk :mark position at k `k : move cursor to position k 70 — © Junho Cho, 2016
  • 71.
    EX MODE > /someword: find someword > :spl / :vspl : split (horizontal or vertical) vim pane > ^w + w/arrow : move pane in vim > : vertical split pane > :e. : file tree > :%s/foo/bar/g : replace all foo to bar 71 — © Junho Cho, 2016
  • 72.
    > :syntax on: syntax on > :set paste : paste mode. Useful when using vim indent option > :set cursor : show cursor with underline LET'S PUT THOSE USEFUL OPTIONS AS BASIC SETTING.72 — © Junho Cho, 2016
  • 73.
    GET INTO JUNHOSETTINGONCE AGAIN cp ~/junhosetting/vimrc ~/.vimrc 73 — © Junho Cho, 2016
  • 74.
    PLUGINS74 — ©Junho Cho, 2016
  • 75.
    PLUGINS : INSTALLWHAT YOU NEED > vundle - plugin manager > nerdtree - file drawer > ctrlp - fuzzy file finder > fugitive - git tool > syntastic - syntax checker / linter 75 — © Junho Cho, 2016
  • 76.
    BUT MY IDEDOES MORE 76 — © Junho Cho, 2016
  • 77.
    VIM IS EXTEMELYCUSTOMIZABLE PLUGINS TAILOR VIM TO YOUR NEEDS 77 — © Junho Cho, 2016
  • 78.
    BUT WE CANSTILL DO MORE 78 — © Junho Cho, 2016
  • 79.
    NOT AN IDE IT'SVIM 79 — © Junho Cho, 2016
  • 80.
    INSTALL VUNDLE WITHPLUGINS cd git clone https://github.com/gmarik/Vundle.vim.git ~/.vim/bundle/Vundle.vim # clone in ~/.vim/bundle/ and setup your vimrc with plugins vi # then do :PluginInstall # Test :NERDTree with <F2> in vim # Test if autocomplete works 80 — © Junho Cho, 2016
  • 81.
    EXECUTABLESWrite on topof script #!bin/bash if shell script, #!bin/usr/python if python script. chmod +x script THEN THE SCRIPT IS EXECUTABLE AS $ ./script 81 — © Junho Cho, 2016
  • 82.
    3. TMUX TERMINAL MULTIPLEXER 82— © Junho Cho, 2016
  • 83.
    VIM + TMUX 83— © Junho Cho, 2016
  • 84.
    WHY TMUX?> Don'twant to stop your SSH session. 1. Experiment session 2. Downloading big file 3. web-server 84 — © Junho Cho, 2016
  • 85.
    > Extendable Workspace >And Maintain your session > Co-operation 85 — © Junho Cho, 2016
  • 86.
    tmux new -s[session-name] # create new session tmux ls # list existing session tmux attch -t [session-name] # attach existing session 86 — © Junho Cho, 2016
  • 87.
    tmux new -spy-practice 87 — © Junho Cho, 2016
  • 88.
    <C-b> : TMUXBINDING-KEY. > will change it to <C-a> unless you have flexible finger bone <C-b> c , bind c : NEW WINDOW bind d : DETTACH FROM WORKING SESSION 88 — © Junho Cho, 2016
  • 89.
    LET'S CONFIGURE TMUX. >ref1, ref2 > .tmux.conf cp ~/junhosetting/tmux.conf ~/.tmux.conf # dotfile로 이름바꿔서 복붙 tmux source .tmux.conf # If you have working tmux session # Now your Tmux looks better and <C-a> is the binding-key 89 — © Junho Cho, 2016
  • 90.
    tmux new -s[session-name] bind c : new window bind n : Next window bind p : Previous window bind % : vertical split pane bind " : horizontal split pane bind h(jkl, arrow) : move my cursor pane to pane bind [ : copy-mode / q : copy-mode exit exit / <C-d> : quit pane 90 — © Junho Cho, 2016
  • 91.
    THERE'S A LOTTHAT TMUX CAN DO 91 — © Junho Cho, 2016
  • 92.
  • 93.
    CREATE SPLITS ONTHE FLY 93 — © Junho Cho, 2016
  • 94.
    HAVE FLEXIBLE WORKSPACE 94— © Junho Cho, 2016
  • 95.
    TMUX + VIM= ❤ 95 — © Junho Cho, 2016
  • 96.
    I ❤ VIMANDI THINK YOU WILL, TOO 96 — © Junho Cho, 2016
  • 97.
    LEARN YOUR EDITORWELL (EVEN IF IT'S NOT VIM) 97 — © Junho Cho, 2016
  • 98.
    DON'T COPY SOMEONEELSE'S CONFIGURATION MAKE IT YOUR OWN 98 — © Junho Cho, 2016
  • 99.
    BUT SHARE YOURCONFIGURATION 99 — © Junho Cho, 2016
  • 100.
    DOTFILES > Share yourconfiguration > Steal ideas from others > junhocho/dotfiles OTHERS > nicknisi/dotfiles > bryanforbes/dotfiles > jason0x43/dotfiles 100 — © Junho Cho, 2016
  • 101.
    KEEP PRACTICING 101 —© Junho Cho, 2016
  • 102.
    ❤dotfiles and materialsavailable at @junhocho* * Inspired from @nicknisi 102 — © Junho Cho, 2016