cyl的博客

记录所思

控制台

进入主机详细信息

image-20220210164057366

网页一键登录

image-20220210164754694

设置 root 密码

1
sudo passwd root

切换 root 用户

1
su root

支持 root 用户 密码登录

1
2
3
4
5
6
echo PermitRootLogin yes >> /etc/ssh/sshd_config
echo PasswordAuthentication yes >> /etc/ssh/sshd_config
echo UseDNS no >> /etc/ssh/sshd_config # 优化ssh第一次连接速度
echo ClientAliveInterval 30 >> /etc/ssh/sshd_config # 优化ssh登录后连接检测
echo ClientAliveCountMax 86400 >> /etc/ssh/sshd_config # 优化ssh登录后连接检测
service ssh restart

客户端

使用ssh客户端常规登录

nginx 的 default_server 指令可以定义默认的 server 出处理一些没有成功匹配 server_name 的请求,如果没有显式定义,则会选取第一个定义的 server 作为 default_server。

在了解到如上规则后,我们可以捕获未做绑定的域名访问或直接IP访问,做重定向到403页面等处理。

阅读全文 »

docker中volume的区别

dockerfile

  • 是当前目录下的相对路径,

docker-compose

  • 是主机的任意位置的绝对路径

  • 容器间的共享目录

递归和尾递归

递归

计算结果保存在参数中传递到当前函数中, 运算结束后返回当前函数继续运算.

阅读全文 »

常用软件代理

git

  • ghproxy.com
1
2
3
4
git config --global url."https://ghproxy.com/https://github.com".insteadOf "https://github.com"
git config --global url."https://ghproxy.com/https://raw.githubusercontent.com".insteadOf "https://raw.githubusercontent.com"
git config --global url."https://ghproxy.com/https://gist.github.com".insteadOf "https://gist.github.com"
git config --global url."https://ghproxy.com/https://gist.githubusercontent.com".insteadOf "https://gist.githubusercontent.com"
阅读全文 »

添加 Git Bash 配置

1
2
3
4
5
6
7
{
"commandline": "C:\\Program Files\\Git\\bin\\bash.exe",
"guid": "{eccec369-0465-4947-9230-df05bf070d65}",
"icon": "C:\\Program Files\\Git\\mingw64\\share\\git\\git-for-windows.ico",
"name": "Git Bash",
"startingDirectory": "%USERPROFILE%"
}
阅读全文 »

如果数据的传输过程是不安全的, 如何保证数据传输到目的地时的数据不被篡改, 这就需要非对称加密了

阅读全文 »
0%