# 實作筆記 * [linux 解壓縮](http://note.drx.tw/2008/04/command.html) * [make file 筆記](http://140.96.101.177:8888/c/makefile/#compile-code-with-makefile:2bf0eb474434398a4f8d2f74cf4b959e) * https://wwssllabcd.github.io/blog/2016/10/03/how-to-write-make-file/ * [佔有linux空間查詢](https://banco.pixnet.net/blog/post/21967119) * `du -B M --max-depth=1 | sort -g` * [Enforce Return After Callback](https://eslint.org/docs/2.0.0/rules/callback-return) * ssh without password * https://xenby.com/b/220-%e6%95%99%e5%ad%b8-%e7%94%a2%e7%94%9fssh-key%e4%b8%a6%e4%b8%94%e9%80%8f%e9%81%8ekey%e9%80%b2%e8%a1%8c%e5%85%8d%e5%af%86%e7%a2%bc%e7%99%bb%e5%85%a5 * https://code.visualstudio.com/docs/remote/troubleshooting * local generate key-->pub key copy to remote host --> chmod dir .ssh to 700 and file authorized_keys to 600(optional chown) * vscode remote development config ![](https://i.imgur.com/pE6O8zC.png) * #防止timeout,每120秒就向server發送keep-alive封包,超過60次無回應斷線 ServerAliveInterval 120 ServerAliveCountMax 60 * [vscode 寫code好用工具](https://larrylu.blog/vscode-tips-fe3320f9032a) * [tmux setting] * shell: `tmux source-file ~/.tmux.conf` ``` # example: /usr/share/doc/tmux/examples/ # {{{ screen-keys.conf # $Id: screen-keys.conf,v 1.7 2010/07/31 11:39:13 nicm Exp $ # # By Nicholas Marriott. Public domain. # # This configuration file binds many of the common GNU screen key bindings to # appropriate tmux key bindings. Note that for some key bindings there is no # tmux analogue and also that this set omits binding some commands available in # tmux but not in screen. # # Note this is only a selection of key bindings and they are in addition to the # normal tmux key bindings. This is intended as an example not as to be used # as-is. # Set the prefix to ^A. unbind C-b set -g prefix ^A bind a send-prefix # Bind appropriate commands similar to screen. # lockscreen ^X x unbind ^X bind ^X lock-server unbind x bind x lock-server # screen ^C c unbind ^C bind ^C new-window # bind c bind c new-window # detach ^D d unbind ^D bind ^D detach # displays * unbind * bind * list-clients # next ^@ ^N sp n unbind ^@ bind ^@ next-window unbind ^N bind ^N next-window unbind " " bind " " next-window unbind n bind n next-window # title A unbind A bind A command-prompt "rename-window %%" # other ^A unbind ^A bind ^A last-window # prev ^H ^P p ^? unbind ^H bind ^H previous-window unbind ^P bind ^P previous-window unbind p bind p previous-window unbind BSpace bind BSpace previous-window # windows ^W w unbind ^W bind ^W list-windows unbind w bind w list-windows # quit \ unbind \ bind \ confirm-before "kill-server" # kill K k unbind K bind K confirm-before "kill-window" unbind k bind k confirm-before "kill-window" # redisplay ^L l unbind ^L bind ^L refresh-client unbind l bind l refresh-client # split -v | unbind | bind | split-window # :kB: focus up unbind Tab bind Tab select-pane -t:.+ unbind BTab bind BTab select-pane -t:.- # " windowlist -b unbind '"' bind '"' choose-window # }}} # {{{ vim-keys.conf # $Id: vim-keys.conf,v 1.2 2010/09/18 09:36:15 nicm Exp $ # # vim-keys.conf, v1.2 2010/09/12 # # By Daniel Thau. Public domain. # # This configuration file binds many vi- and vim-like bindings to the # appropriate tmux key bindings. Note that for many key bindings there is no # tmux analogue. This is intended for tmux 1.3, which handles pane selection # differently from the previous versions # split windows like vim # vim's definition of a horizontal/vertical split is reversed from tmux's bind s split-window -v bind v split-window -h # move around panes with hjkl, as one would in vim after pressing ctrl-w #bind h select-pane -L #bind j select-pane -D #bind k select-pane -U #bind l select-pane -R # resize panes like vim # feel free to change the "1" to however many lines you want to resize by, only # one at a time can be slow bind < resize-pane -L 1 bind > resize-pane -R 1 bind - resize-pane -D 1 bind + resize-pane -U 1 # bind : to command-prompt like vim # this is the default in tmux already bind : command-prompt # vi-style controls for copy mode setw -g mode-keys vi # }}} set -g default-terminal "screen-256color" # + "tmux -2" => 256 color set -g status-justify left set -g status-interval 15 # 15 sec refresh set -g display-time 3000 set -g status-bg black set -g status-fg white set-window-option -g window-status-current-fg blue set-window-option -g window-status-current-bg yellow set-window-option -g window-status-current-attr default # bright set -g status-left-length 15 set -g status-right-length 55 #set -g status-left "#[fg=white,bg=blue] > #I #W < #[default] |" # 0:bash #set -g status-left "#[fg=white,bg=blue] > #S < #[default] |" # session-name set -g status-left "" set -g status-right "#[fg=green]%H:%M #[default]#[fg=magenta,bright]#[default]" ``` * [Saving a read-only file edited in vi / vim](https://www.geekyboy.com/archives/629) * https://blog.niclin.tw/2018/08/19/%E5%B7%A5%E7%A8%8B%E5%B8%AB%E6%87%89%E8%A9%B2%E7%9F%A5%E9%81%93%E7%9A%84-c10k-%E5%95%8F%E9%A1%8C/ * ftp server install -->https://hackmd.io/@uNmR8bp1S62yvV_R6zJQng/SycNmIWG8 * 若無法裝wireshark,可用tcpdump 抓封包,並存成file,再由wireshark打開 ```tcpdump -i eth0 -w test.pcap``` * 更改route `sudo route del -net 0.0.0.0 gw 192.168.178.1 netmask 0.0.0.0 dev eth0` * lib version `dpkg -l | grep libxxx` ![](https://i.imgur.com/oJHz65Y.png) * 比bash好看的shell ``` Ubuntu 安裝 zsh: 前置準備,需要先安裝下列的套件: sudo apt-get install wget curl git Installing Zsh: sudo apt install zsh 修改預設的 shell 為 zsh: chsh -s $(which zsh) 檢查目前使用中的 shell: echo $SHELL Install Oh-my-Zsh: sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)" ``` * debug for memory leak `valgrind --leak-check=full --track-origins=yes --log-file="log"` ###### tags: `linux` `ftp` `tcpdump` `tmux` `vscode note` `javascript` `make file`