• 安装vscode插件SFTP=1.12.9,command + p 输入ext install搜索sftp,点击安装
  • 进入SFTP插件配置,command+shift+p输入sftp config, 回车

问题:
甜筒店里进来10个顾客,每个顾客(customer)购买若干个甜筒(cone),可以假设最少购买1个,最多购买4个。
每一个甜筒都需要一个店员(clerk)去做(假设clerk的数量足够多),店员做完每一个甜筒之后,
需要向经理(manager)申请检测,检测合格后才可以交给顾客。
但是经理每次只能接受一个店员的申请,检测一个甜筒 …

安装工具

apt-get install -y net-tools iputils-ping telnet

设置proxy

tee /etc/apt/apt.conf.d/proxy.conf <<EOF
Acquire::https::Proxy "http://192.168.0.241:23333";
Acquire::http::Proxy "http://192.168.0.241:23333";
EOF

查看发行版

cat /etc/issue

debian 9 strech源

tee  /etc/apt/sources.list <<EOF
deb http://mirrors.163.com/debian/ stretch main non-free contrib
deb http://mirrors.163.com/debian/ stretch-updates main non-free contrib
deb http://mirrors.163.com/debian/ stretch-backports main non-free contrib
deb-src http://mirrors.163.com/debian/ stretch main non-free contrib
deb-src http://mirrors.163.com/debian/ stretch-updates main non-free contrib
deb-src http://mirrors.163.com/debian/ stretch-backports main non-free contrib
deb http://mirrors.163.com/debian-security/ stretch/updates main non-free contrib
deb-src http://mirrors.163.com/debian-security/ stretch/updates main non-free contrib
EOF

debian 8 jessie源

tee  /etc/apt/sources.list <<EOF
deb http://ftp.cn.debian.org/debian jessie main non-free contrib
deb http://ftp.cn.debian.org/debian jessie-proposed-updates main contrib non-free
deb http://ftp.cn.debian.org/debian-security jessie/updates main contrib non-free
deb-src http://ftp.cn.debian.org/debian/ jessie main contrib non-free
EOF

debain 10 buster源

sed -i 's#http://deb.debian.org#http://mirrors.aliyun.com#g' /etc/apt/sources.list

什么是尾调用?

尾调用的概念非常简单,一句话就能说清楚,就是指某个函数的最后一步是调用另一个函数。

A tail call [tail recursion] is a kind of goto dressed as a call. A tail call happens when a function calls another as its last acti …

直接查看文件

less catalina.out

查看文件后,若文件过大,打通过以下命令滚动文件:

j    下一行
k 上一行
f 向下滚动一屏幕
b 向上滚动一屏幕
g 定位到文档头部
G 定位到文档最尾部

退出查看文件

q    退出less模式

带出行号查看文件

日志文件一般有上万行,带行号显示会方便很多

less -N catalina.out

查找内容

查找关键字内容时,常用向下查找、向上查看。如在日志中查找,因日志一般是追加的,从下向上查找更为常用。

/keyword  向下查找
n 向下匹配下一处匹配文本
N 向上匹配下一处匹配文本

?keyword  向上查找
n 向上匹配下一处匹配文本
N 向下匹配下一处匹配文本

实时查看文档变动(实时滚动文档)

进入less模式后,键入F,即实时滚动文档

F        实时滚动文档
Ctrl + c  退出实时滚动模式

类似效果:
tail -f catalina.out

TCP概念

TCP(Transmission Control Protocol,传输控制协议),是一种面向连接的可靠传输协议,提供可靠(无差错、不丢失、不重复、按顺序)的字节流数据传输服务。在传输效率和可靠性之间选择了后者,所以有开销大、传输速度慢的缺点。

  • 面向连接:在使用 TCP 通信之前,需要进行 “三次握手” 建立发收双方连接,通信结束后还要进行 “四次 …
  • 设置环境变量
tee -a ~/.zshrc <<EOF
# go
export GOROOT=\$HOME/go
export GOPATH=\$HOME/gopath
export PATH=\$PATH:\$GOROOT/bin:\$GOPATH/bin
EOF
  • 下载包安装
proxy curl -o ~/go.tar.gz -O https://dl.google.com/go/go1.11.2.linux-amd64.tar.gz && \
tar xvf ~/go.tar.gz -C $HOME && \
rm -rf ~/go.tar.gz
# mac
curl -o ~/go.tar.gz -O https://dl.google.com/go/go1.14.1.darwin-amd64.tar.gz && \
tar xvf ~/go.tar.gz -C $HOME && \
rm -rf ~/go.tar.gz
  • source ~/.zshrc
  • 安装gost
go get -u github.com/ginuerzh/gost/cmd/gost

jupyter for golang

$ go get -u github.com/gopherdata/gophernotes
$ mkdir -p ~/.local/share/jupyter/kernels/gophernotes
$ cp $GOPATH/src/github.com/gopherdata/gophernotes/kernel/* ~/.local/share/jupyter/kernels/gophernotes
  • 修改 ~/.local/share/jupyter/kernels/gophernotes/kernel.json文件,注意/root/gopath/bin/gophernotes为绝对路径
{
"argv": [
"/root/gopath/bin/gophernotes",
"{connection_file}"
],
"display_name": "Go",
"language": "go",
"name": "go"
}

Li Zhang

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store