---
tags: Ubuntu Software
---
# Ubuntu Software
[TOC]
## 01-嘸蝦米
### 1-fcitx
```bash
sudo apt-get install fcitx fcitx-m17n -y
sudo apt-get install fcitx-table-boshiamy -y
```
系統設定
先到「系統設定值」,選「語言支援」,在「鍵盤輸入法系統」底下選擇 「fcitx」。
重開機或是重新登入,就可以在系統工具列上看到fcitx的ICON了。
### 2-iBus
1. Download file
```bash
$ git clone https://github.com/wimterdom/boshiamy_siang
$ cd boshiamy_siang
$ sudo make
$ sudo make install
$ sudo apt install -y ibus ibus-table
$ sudo apt-get -y install ibus-chewing
$ sudo reboot
```
2. to Preference → Region&Language → Add Chinese input method
3. to Preference → Keyboard → Add Chinese(Boshiamy)
## 02-右上角顯示CPU、網路效能
1. install
```bash=
sudo add-apt-repository ppa:fossfreedom/indicator-sysmonitor
sudo apt-get update
sudo apt install -y indicator-sysmonitor
```
2. customize
When program startup, the interface will show on the right-up corner.

click the right button of mouse → Prefenences → Advanced
you can set the customized output
```bash=
【cpu: {cpu}】 【mem: {mem}】 【net: {net}】
```
## 03-zsh
1. 前言
对于管理人员和开发人员来说,一个好的终端可以给你带来效率飞速的提升。
你还在用这样的 bash 吗?

或着用这样的 终端?

是时候打造一款属于你自己的终端配置啦!让它兼具美观好看和高效。
今天要介绍的终端美化方案是「zsh」+「oh my zsh」+「powerlevel10k」。你或许在百度上看到过 zsh+oh-my-zsh+powerlevel9k 的终端环境美化方案,它和我的美化方案没什么大不同,只不过将 powerlevel9k 换成了powerlevel10k, 它是 9k 版本的强化版本,更快,性能更好。
接下去将一步步介绍安装部署步骤。
2. 安装 zsh
Linux 环境下的 shell 终端并不知有 bash,常见的还有 ksh,tcsh,zsh,fish等。其中大部分人用的是 bash,估计是因为大部分的 Linux 发行版默认的就是 bash 的缘故。我们来看一下各终端的使用占比

数据来源于:https://opensource.com/business/16/3/top-linux-shells
有些平台默认就有 zsh 终端,只是默认不启用,下面简单介绍各环境下把 zsh 切换成默认的 shell 环境。
macos
macos下默认已经安装了zsh,可以直接使用
终端输入命令,然后输入密码即可将zsh切换成默认shell
$ chsh -s /bin/zsh
redhat/centos
redhat家族默认好像都没有安装zsh,需要安装
查看已有的shell终端
```
$ cat /etc/shells
/bin/sh
/bin/bash
/sbin/nologin
/usr/bin/sh
/usr/bin/bash
/usr/sbin/nologin
/bin/tcsh
/bin/csh
/bin/ksh
/bin/rksh
```
安装zsh
```$ yum install zsh```
终端输入命令,然后输入密码即可将zsh切换成默认shell
```
$ chsh -s /bin/zsh
```
ubuntu
```
# 安装zsh
$ sudo apt-get install -y zsh
# 终端输入命令,然后输入密码即可将zsh切换成默认shell
$ chsh -s /bin/zsh
```
3. 安装 oh my zsh

官网是这样介绍 oh my zsh 的,然后详细的文档可以去 github 网址:https://github.com/robbyrussell/oh-my-zsh
Oh My Zsh is a delightful, open source, community-driven framework for managing your Zsh configuration. It comes bundled with thousands of helpful functions, helpers, plugins, themes, and a few things that make you shout...
Oh My Zsh可以做非常多的定制化功能,比如主题,字体,插件等。
简单介绍如何安装 oh my zsh
使用 curl
```!
sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
```
使用 wget
```!
sh -c "$(wget https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O -)"
```
4. 安装 powerlevel10k
4.1 为什么选择powerlevel10k?
Oh My Zsh有上百个自带主题,以及许许多多的外部主题。目前来看使用量教多的是 powerlevel9k,它的初始效果是这样的。

这个主题我也用了挺长一段时间,用上它的感觉就是「妈的,虽然好用,但是响应速度让我很不爽,明明没有加载很多插件还是慢」。这个感觉直到我逛主题市场发现 powerlevel10k 后就再也不复存在了。
它的介绍是这样的,注意关键字:兼容 Powerlevel9k,10-100倍的性能提升!
Powerlevel10k is a backward-compatible reimplementation of the popular Powerlevel9k theme (see above) with 10-100 times better performance. If you like the looks of Powerlevel9k but feeling frustrated by its slow prompt, simply replace your powerlevel9k theme with powerlevel10k and enjoy responsive shell like it's 80's again! Powerlevel10k uses the same configuration options as Powerlevel9k and produces the same results. It's simply faster.
简单介绍如何安装 powerlevel10k,详细的教程自己去看:https://github.com/romkatv/powerlevel10k。
Oh My Zsh
由于我们使用的是Oh My Zsh,所以只需要将 github 上的 repo 下载到 Oh My Zsh 的目录下然后配置即可。
```
git clone https://github.com/romkatv/powerlevel10k.git $ZSH_CUSTOM/themes/powerlevel10k
```
然后设置 .zshrc 中的变量 ZSH_THEME
```
Set ZSH_THEME=powerlevel10k/powerlevel10k in your ~/.zshrc.
```
5. 安装字体
安装完 powerlevel10k 后你可能会发现有乱码,这是因为你终端字体不支持那么多的字符,这就需要使用扩展字体了。
字体的安装,我们可以参考 powerlevel9k 的官方介绍:https://github.com/bhilburn/powerlevel9k/wiki/Install-Instructions#step-2-install-a-powerline-font
安装 powerline 字体有四种方式:
Option 1: Install Powerline Fonts
不介绍,请看官方文档
Option 2: Use a Programmer Font
不介绍,请看官方文档
Option 3: Install Awesome-Powerline Fonts
不介绍,请看官方文档
Option 4: Install Nerd-Fonts
Nerd 字体应该是支持字形最多的,所以不用多想,安装它就好了!
github 上也有详细的安装介绍文档:https://github.com/ryanoasis/nerd-fonts#font-installation
其中最简单的应该是用 Homebrew,但是Homebrew在国内的访问速度实在恶心,所以还是选择手工安装吧
直接上 nerdfonts 官网,找到Downloads,直接下载 Hack 字体,别问我为什么,如果是mac,直接双击安装下载的字体即可,然后修改 oh my zsh 的变量文件 ~/.zshrc,修改变量 POWERLEVEL9K_MODE='nerdfont-complete', 如果不是MacOS,先自行查找如何配置 powerline 字体吧。

6. 常用插件
环境配置好了,我们还需要加上一些插件让终端更好用,介绍我用的几个插件,效率杠杠的
autojump
Github地址:https://github.com/wting/autojump
只要你在终端上使用 cd 访问过的目录,它都会记录下来,然后下次可以在任何工作目录下使用只需要用 j + 目录名 就可以直接进入,比如

Zsh-autosuggestions
有了它,执行过的命令,就不需要重复的输入啦,比如我输入 source en,它自动会提示曾今执行过的命令是 source env/bin/activate ,这时候只需要点击方向键的右健就可以直接填充命令,爽到爆有没有。

7. 完整zshrc配置
实际效果

### .zshrc文件完整版
```bash=
# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc.
# Initialization code that may require console input (password prompts, [y/n]
# confirmations, etc.) must go above this block; everything else may go below.
if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then
source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
fi
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
# Path to your oh-my-zsh installation.
export ZSH="$HOME/.oh-my-zsh"
# Set name of the theme to load --- if set to "random", it will
# load a random theme each time oh-my-zsh is loaded, in which case,
# to know which specific one was loaded, run: echo $RANDOM_THEME
# See https://github.com/ohmyzsh/ohmyzsh/wiki/Themes
ZSH_THEME="powerlevel10k/powerlevel10k"
POWERLEVEL9K_MODE='nerdfont-complete'
# Set list of themes to pick from when loading at random
# Setting this variable when ZSH_THEME=random will cause zsh to load
# a theme from this variable instead of looking in $ZSH/themes/
# If set to an empty array, this variable will have no effect.
# ZSH_THEME_RANDOM_CANDIDATES=( "robbyrussell" "agnoster" )
# Uncomment the following line to use case-sensitive completion.
# CASE_SENSITIVE="true"
# Uncomment the following line to use hyphen-insensitive completion.
# Case-sensitive completion must be off. _ and - will be interchangeable.
# HYPHEN_INSENSITIVE="true"
# Uncomment one of the following lines to change the auto-update behavior
# zstyle ':omz:update' mode disabled # disable automatic updates
# zstyle ':omz:update' mode auto # update automatically without asking
# zstyle ':omz:update' mode reminder # just remind me to update when it's time
# Uncomment the following line to change how often to auto-update (in days).
# zstyle ':omz:update' frequency 13
# Uncomment the following line if pasting URLs and other text is messed up.
# DISABLE_MAGIC_FUNCTIONS="true"
# Uncomment the following line to disable colors in ls.
# DISABLE_LS_COLORS="true"
# Uncomment the following line to disable auto-setting terminal title.
# DISABLE_AUTO_TITLE="true"
# Uncomment the following line to enable command auto-correction.
# ENABLE_CORRECTION="true"
# Uncomment the following line to display red dots whilst waiting for completion.
# You can also set it to another string to have that shown instead of the default red dots.
# e.g. COMPLETION_WAITING_DOTS="%F{yellow}waiting...%f"
# Caution: this setting can cause issues with multiline prompts in zsh < 5.7.1 (see #5765)
# COMPLETION_WAITING_DOTS="true"
# Uncomment the following line if you want to disable marking untracked files
# under VCS as dirty. This makes repository status check for large repositories
# much, much faster.
# DISABLE_UNTRACKED_FILES_DIRTY="true"
# Uncomment the following line if you want to change the command execution time
# stamp shown in the history command output.
# You can set one of the optional three formats:
# "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd"
# or set a custom format using the strftime function format specifications,
# see 'man strftime' for details.
# HIST_STAMPS="mm/dd/yyyy"
# Would you like to use another custom folder than $ZSH/custom?
# ZSH_CUSTOM=/path/to/new-custom-folder
# Which plugins would you like to load?
# Standard plugins can be found in $ZSH/plugins/
# Custom plugins may be added to $ZSH_CUSTOM/plugins/
# Example format: plugins=(rails git textmate ruby lighthouse)
# Add wisely, as too many plugins slow down shell startup.
plugins=(
git
extract
zsh-autosuggestions
zsh-syntax-highlighting
)
source $ZSH/oh-my-zsh.sh
# User configuration
# export MANPATH="/usr/local/man:$MANPATH"
# You may need to manually set your language environment
# export LANG=en_US.UTF-8
# Preferred editor for local and remote sessions
# if [[ -n $SSH_CONNECTION ]]; then
# export EDITOR='vim'
# else
# export EDITOR='mvim'
# fi
# Compilation flags
# export ARCHFLAGS="-arch x86_64"
# Set personal aliases, overriding those provided by oh-my-zsh libs,
# plugins, and themes. Aliases can be placed here, though oh-my-zsh
# users are encouraged to define aliases within the ZSH_CUSTOM folder.
# For a full list of active aliases, run `alias`.
#
# Example aliases
# alias zshconfig="mate ~/.zshrc"
# alias ohmyzsh="mate ~/.oh-my-zsh"
source /home/siang/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh.
[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh
alias ll="ls -Alh"
alias ls="lsd --group-dirs first"
alias cat="batcat"
alias cop="cp -rf"
alias del="rm -rf"
alias mov="mv -f"
alias open="nautilus"
alias gotop="gotop-cjbassi"
alias cls="clear"
```
### .zshrc文件配置(orginal)
```
# Prompts
POWERLEVEL9K_LEFT_SEGMENT_SEPARATOR='\uE0C0'
#POWERLEVEL9K_LEFT_SUBSEGMENT_SEPARATOR='\uE0C0'
POWERLEVEL9K_RIGHT_SEGMENT_SEPARATOR='\uE0C2'
#POWERLEVEL9K_RIGHT_SUBSEGMENT_SEPARATOR='\uE0C2'
POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(dir dir_writable vcs virtualenv)
POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(status background_jobs command_execution_time ip)
POWERLEVEL9K_SHORTEN_DIR_LENGTH=2
POWERLEVEL9K_SHORTEN_DELIMITER=..
POWERLEVEL9K_PROMPT_ON_NEWLINE=true
POWERLEVEL9K_MULTILINE_FIRST_PROMPT_PREFIX=$'\n'
POWERLEVEL9K_MULTILINE_LAST_PROMPT_PREFIX="\uF460%F{073}\uF460%F{109}\uF460%f "
export ZSH="/Users/john/.oh-my-zsh"
POWERLEVEL9K_MODE='nerdfont-complete'
ZSH_THEME="powerlevel10k/powerlevel10k"
export UPDATE_ZSH_DAYS=13
HIST_STAMPS="yyyy/mm/dd"
plugins=(
git
colored-man-pages
colorize
github
brew
osx
docker
docker-compose
autojump
zsh-autosuggestions
zsh-syntax-highlighting
autopep8
python
)
source $ZSH/oh-my-zsh.sh
alias zshconfig="vim ~/.zshrc"
alias vimconfig="vim ~/.vimrc"
alias ansibleconfig="vim ~/.ansible/ansible.cfg"
alias grep='grep --color=auto'
```
一些常用的插件
zsh-autosuggestions
下载插件
```
git clone https://github.com/zsh-users/zsh-autosuggestions $ZSH_CUSTOM/plugins/zsh-autosuggestions
```
1
编辑 ~/.zshrc ,设置plugins
```plugins=(zsh-autosuggestions git)```
1
使插件生效
```source ~/.zshrc```
1
上次敲过的命令 ,会自动提示,按右方向键➡️确认填充上次的命令
zsh-syntax-highlighting
下载插件
```
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git $ZSH_CUSTOM/plugins/zsh-syntax-highlighting
```
1
写入到配置
```
echo "source $ZSH_CUSTOM/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh" >> ${ZDOTDIR:-$HOME}/.zshrc
```
1
使插件生效
```source ~/.zshrc```
1
命令会自动高亮显示
**Nerd Fonts Install**
1.) Download a [Nerd Font](http://nerdfonts.com/)
2.) Unzip and copy to ```~/.fonts``` or```~/.local/share/fonts```
3.) Run the command ```fc-cache -fv``` to manually rebuild the font cache
[詳細設定內容1](https://juejin.cn/post/6844904178075058189)
[詳細設定內容2](https://github.com/romkatv/powerlevel10k#batteries-included)
## 04-螢幕解析度調整
步驟:
使用 Ctrl + Alt + T 開啟終端並貼上以下命令
```
sudo xrandr --newmode "1920x1080_60.00" 173.00 1920 2048 2248 2576 1080 1083 1088 1120 -hsync +vsync
```
回車後繼續執行下一行命令
```
sudo xrandr --addmode Virtual1 "1920x1080_60.00"
```
此時系統設定裡已經有 1920*1080 的解析度選項了, 按照下面步驟執行來讓每次開機都自動設定這個解析度.
開啟開機啟動配置
```sudo vi /etc/profile```
按鍵 i 進入編輯模式, 按箭頭下鍵把游標移動到檔案最底部新增下面的內容.
```!
xrandr --newmode "1920x1080_60.00" 173.00 1920 2048 2248 2576 1080 1083 1088 1120 -hsync +vsync
xrandr --addmode Virtual1 "1920x1080_60.00"
```
按鍵 Esc 然後輸入 :wq 回車, 意為儲存退出.
輸入 ```sudo reboot ```重啟. 測試結果成功.
## 05-Setup an L2TP/IPsec VPN Client on Linux
To add an L2TP/IPsec option to the NetworkManager, you need to install the NetworkManager-l2tp VPN plugin which supports NetworkManager 1.8 and later. It provides support for L2TP and L2TP/IPsec.
To install the L2TP module on Ubuntu and Ubuntu-based Linux distributions, use the following PPA.
```
$ sudo add-apt-repository ppa:nm-l2tp/network-manager-l2tp
$ sudo apt-get update
$ sudo apt-get install network-manager-l2tp network-manager-l2tp-gnome
```
On RHEL/CentOS and Fedora Linux, use the following dnf command to install L2TP module.
```
# dnf install xl2tpd
# dnf install NetworkManager-l2tp
# dnf install NetworkManager-l2tp-gnome
OR
# yum install xl2tpd
# yum install NetworkManager-l2tp
# yum install NetworkManager-l2tp-gnome
```
Once the package installation is complete, click on your Network Manager icon, then go to Network Settings.

Next, add a new VPN connection by clicking on the (+) sign.

Then select Layer 2 Tunneling Protocol (L2TP) option from the pop-up window.

Next, enter the VPN connection details (gateway IP address or hostname, username and password) you received from the system administrator, in the following window.

Next, click IPsec Settings to enter the pre-shared key for the connection. Then enable IPsec tunnel to L2TP host, enter (or copy and paste the) the Pre-shared key and click Ok.

After that, click Add. Now your new VPN connection should be added.

Next, turn on the VPN connection to start using it. If the connection details are correct, the connection should be established successfully.


Last but not least, test if the VPN is working fine. You can check your computer’s public IP address to confirm this from a web browser: it should now point to the IP of the gateway.

That’s the end of this article. If you have any queries or thoughts to share, reach us via the feedback form below.
## 06-SOCAT 用法
### 01-install
-透過源碼
```!=
$ wget http://www.dest-unreach.org/socat/download/socat-1.7.3.2.tar.gz
$ tar zxf socat-1.7.3.2.tar.gz
$ cd socat-1.7.3.2
$ ./configure
$ make
$ make install
```
- 安裝包
Debian/Ubuntu
```
$ apt-get install -y socat
```
macOS
```
$ brew install socat
```
### 02-基本語法
```
socat [options] <address> <address>
```
其中这 2 个 address 就是关键了,address 类似于一个文件描述符,Socat 所做的工作就是在 2 个 address 指定的描述符间建立一个 pipe 用于发送和接收数据。几个常用的 address 描述方式如下:
-,STDIN,STDOUT 表示标准输入输出,可以就用一个横杠代替。
/var/log/syslog 打开一个文件作为数据流,可以是任意路径。
TCP:: 建立一个 TCP 连接作为数据流,TCP 也可以替换为 UDP 。
TCP-LISTEN: 建立 一个 TCP 监听端口,TCP 也可以替换为 UDP。
EXEC: 执行一个程序作为数据流。
以上规则中前面的 TCP 等都可以小写,在这些描述后可以附加一些选项,用逗号隔开。如 fork,reuseaddr,stdin,stdout,ctty 等。
### 03-使用實例
#### 掛載py檔,使其在server運行,user可用NC連線執行
```!
socat TCP-LISTEN:30002,fork EXEC:./server.py
```
#### 文件操作
通过 Socat 读取文件
```!
# 从绝对路径读取
$ socat - /var/www/html/flag.php
# 从相对路径读取
$ socat - ./flag.php
```
注:这里的路径一般是绝对路径,如果要使用相对路径记得要加上 ./ 。
写入文件
```
$ echo "This is Test" | socat - /tmp/hello.html
```
#### 网络管理
连接远程端口
```
$ socat - TCP:192.168.1.252:3306
```
监听一个新端口
```
$ socat TCP-LISTEN:7000 -
```
#### 端口转发
在实际生产中我们经常会遇到到一个场景就是,用一台机器作为转发服务器,连接 AB 两个网段,将转发服务器的某个端口上的流量转发到 B 网段的某台机器的某个端口,这样 A 网段的服务器就可以通过访问转发服务器上的端口访问到 B 网段的服务器端口。
这样的场景一般在和客户建立专线的连接时候经常用到,一般也可以采用 iptables 做转发,但是比较复杂。Socat 可以很轻松的完成这个功能,但是 Socat 不支持端口段转发,只适用于单端口或者少量端口。
转发 TCP
监听 192.168.1.252 网卡的 15672 端口,并将请求转发至 172.17.0.15 的 15672 端口。
```!
$ socat -d -d -lf /var/log/socat.log TCP4-LISTEN:15672,bind=192.168.1.252,reuseaddr,fork TCP4:172.17.0.15:15672
```
参数说明:
```!
1. -d -d 前面两个连续的 -d -d 代表调试信息的输出级别。
2. -lf /var/log/socat.log 指定输出信息的文件保存位置。
3. TCP4-LISTEN:15672 在本地建立一个 TCP IPv4 协议的监听端口,也就是转发端口。这里是 15672,请根据实际情况改成你自己需要转发的端口。
4. bind 指定监听绑定的 IP 地址,不绑定的话将监听服务器上可用的全部 IP。
5. reuseaddr 绑定一个本地端口。
6. fork TCP4:172.17.0.15:15672 指的是要转发到的服务器 IP 和端口,这里是 172.17.0.15 的 15672 端口。
```
转发 UDP
转发 UDP 和 TCP 类似,只要把 TCP4 改成 UDP4 就行了。
```
$ socat -d -d -lf /var/log/socat.log UDP4-LISTEN:123,bind=192.168.1.252,reuseaddr,fork UDP4:172.17.0.15:123
```
NAT 映射
在一个 NAT 网络环境中,也是可以通过 Socat 将内部机器端口映射到公网上的。
在外部公网机器上执行
```
$ socat tcp-listen:1234 tcp-listen:3389
```
在内部私网机器上执行
```
$ socat tcp:outerhost:1234 tcp:192.168.1.34:3389
```
这样,你外部机器上的 3389 就映射在内网 192.168.1.34 的 3389 端口上了。不过这样场景下更推荐内网穿透神器 FRP,如果你不会使用,可参考「推荐一款很好用的内网穿透工具–FRP」一文。
#### 文件传递
文件传送
将文件 demo.tar.gz 使用 2000 端口从 192.168.1.252 传到 192.168.1.253,文件传输完毕后会自动退出。
在 192.168.1.252 上执行
```
$ socat -u open:demo.tar.gz tcp-listen:2000,reuseaddr
```
在 192.168.1.253 上执行
```
$ socat -u tcp:192.168.1.252:2000 open:demo.tar.gz,create
```
-u 表示数据传输模式为单向,从左面参数到右面参数。
-U 表示数据传输模式为单向,从右面参数到左面参数。
读写分流功能
Socat 具有一个独特的读写分流功能,比如:可以实现一个假的 Web Server,客户端连过来之后就把 read.html 里面的内容传过去,同时把客户端的数据保存到 write.txt 里面。
```
$ socat open:read.html\!\!open:write.txt,create,append tcp-listen:8000,reuseaddr,fork
```
:::danger
補充:用**ncat**也可以達到相同的效果,以bof檔案為例。
在bash輸入:
`ncat -ve ./bof -kl 8888`
:::
## 07-Bash→powerline
1. 輸入以下指令安裝 powerline
```bash=
sudo apt install powerline -y
```

2. 編輯 .bashrc 加入以下內容
```bash=
if [ -f `which powerline-daemon` ]; then
powerline-daemon -q
POWERLINE_BASH_CONTINUATION=1
POWERLINE_BASH_SELECT=1
. /usr/share/powerline/bindings/bash/powerline.sh
fi
```

3. 更新環境變數
```bash=
source .bashrc
```

4. 選擇字形

5. 設定不分大小寫自動完成
- 在家目錄創建.inputrc
```bash=
$ cd
$ touch .inputrc
```
- 在文件上輸入以下內容
```bash=
$ vim .inputrc
$ set completion-ignore-case on
```
- 保存文件後,重啟terminal
## ncat/nc
### method 1
#### 架server
```bash=
ncat -vc $binary -kl $ip $port
```
#### nc
```bash=
nc $ip $port
```
### method 2
#### server
```bash=
nc -N <client ip> <client port> <file path>
```
#### client
```bash=
nc -vl 44444 > <filename.format>
```
### 發送和接收目錄
#### client
```bash=
nc -vl <port> | tar zxv
```
#### server
```bash=
tar czp <folder path> | nc -N <client ip> <client port>
```