Git Tutorial

Basic instructions git [command] [--flags] [arguments] git status [-s] git log [--oneline] [-${num of line}] git clone <remote_url> [localprojectname] git remote add <name> <remote_url> git push [-u] [<remote>] [<branch>] git show HEAD~(parent) ~2(parent of parent) ^(first parent) ^2(second parent) git tag <tagname> [<commit>] git push <remote> <tagname> git checkout -b <branch> git branch --all git branch -d <branch> git merge --no-ff <branch> git commit --amend --no-edit Create and make an initial push mkdir machine_1 cd machine_1 git init # initialize git in current directory git status # show changes of the Working Tree # Create hello.py git add . # update changes in the Staging Area/Index git commit -m "Hello World!" # update changes in the Commit Tree git remote add origin https://github.com/Yufeng98/git_tutorial.git git push origin master See details in git_tutorial repositary. ...

August 17, 2020 · 4 min · Yufeng Gu

Tmux Tutorial

Commands Session Management tmux [new -s <session-name> -m <window-name>] tmux detach tmux a[ttach] -t <session-name> tmux switch -t tmux ls tmux kill-session -t <session-name> tmux kill-server # kill all sessions Prefix Commands Ctrl+b Session :new<Enter> create a new session s list all sessions $ rename current session d detach current session Window c create a new window w list all windows , rename current window & close current window Pane % splite the pane vertically " splite the pane horizontally x close current pane Configuration git clone https://github.com/Yufeng98/.tmux.git cp .tmux/.tmux.conf . cp .tmux/.tmux.conf.local .

June 5, 2020 · 1 min · Yufeng Gu

Vim Tutorial

Normal Mode - Navigate the structure of the file Move Cursor h/j/k/l - Move left/up/down/right H/M/L - Move to the top/middle/bottom of the window w/e - Move to the beginning/end of the next word b - Move to the beggining of the previous word 0/$ - Move to the beginning/end of a line (/) - Move to the beggining of the next/previous line {/} - Move to the beginning of the next/previous paragraph ^E/^Y - Scroll the window down/up ^F/^B - Scroll down/up one page gg/G - Go to top/bottom of the file Copy/Paste/Delete y - Copy p - Paste yy/yw/y$ - Copy a line/word/from the cursor to the end of the file #yy - Copy # lines x - Delete a single character d/dd/dw - Delete highlight text/a line/a word D/d0 - Delete from the cursor to the beginning/end of the line dgg/dG - Delete from the cursor to the beginning/end of the file Actions u/u# - Undo the last/last # actions . - Repeate the last action Options a - all i - in t - till f - find forward F - find backard Conbined Commands diw - Delete inside the word caw - Change all the word di) - Delete inside the parentheses dt; - Delete until the semicolon Insert Mode - Edit the file i - enter insert mode Visual Mode - Highlight portions of the file to manipulate v - enter visual mode Ex Mode - Command mode :q - exit :w - save :q! - force to exit

June 3, 2020 · 2 min · Yufeng Gu

Hugo Tutorial

Download Hugo Follow instructions on Hugo. Verify Hugo hugo version Create a new site hugo new site mypage Download a theme cd mypage git init git submodule add https://github.com/budparr/gohugo-theme-ananke.git themes/ananke Try template We can find an example in exampleSite, where static stores images and content stores markdown files. cp -r ./themes/hugo-coder/exampleSite/* ./ Deploy page on local server hugo server -D See it with localhost:1313 on your browser. Deploy page on GitHub Build a repository named ${username}.github.io and build static page configuration. Follow instructions here. ...

June 1, 2020 · 1 min · Yufeng Gu