Posts
I have a adream
Cancel

docker 中创建新用户

Dockerfile FROM ubuntu:18.04 RUN sed -i 's/archive.ubuntu.com/mirrors.aliyun.com/g' /etc/apt/sources.list RUN sed -i 's/security.ubuntu.com/mirrors.aliyun.com/g' /etc/apt/sources.list RUN useradd ...

AWS NAT 实例

创建 VPC vpc 地址范围为 192.168.0.0/16 新建 vpc 详细信息如下 创建两个子网 M0-0 : 192.168.0.0/24 M0-1 : 192.168.1.0/24 子网详细信息 创建互联网网关 选择 Actions -> Attach to VPC 将网关附加到 VPC M0 网关附加到 VPC M0 新建立路...

rebase 合并多个commit

设置编辑器为 vim git config --global core.editor "vim" 当前 commit 日志信息如下: master 目前包含两条 commit : a79fcc1 和 a79fcc1 在 master 分支上切出一个分支 tb tb 包含 3 个 commit : 124b6c7,dd81b51,b44f3c1 * 124b6c7 (HE...

命令行显示 git tree

git log --graph --decorate --pretty=oneline --abbrev-commi 设置别名 tree git config --global alias.tree "log --graph --decorate --pretty=oneline --abbrev-commit" git tree 参考资料 https://stackover...

使用指定的 SSH key 操作 git

Starting from Git 2.3.0 we also have the simple command (no config file needed): GIT_SSH_COMMAND='ssh -i private_key_file -o IdentitiesOnly=yes' git clone user@host:repo.git With git 2.10+ (Q3 2...

iptables-essentials

https://github.com/trimstray/iptables-essentials Table of Contents Table of Contents Tools to help you configure Iptables Manuals/Howtos/Tutorials Useful Kernel Settings (sysctl) Configu...

tar 分卷压缩与解压

https://wangying.sinaapp.com/archives/2574 分卷压缩 将 pulsar.dat 按照 100M 一个文件卷压缩 分卷压缩gz tar zcf - pulsar.dat | split -d -b 100m - pulsar.dat.tar.gz. 生成文件: pulsar.dat.tar.gz.00 、pulsar.dat.tar.gz.01 ...

go 项目的 github action

https://github.com/actions/starter-workflows/blob/main/ci/go.yml name: Go on: push: branches: [ $default-branch ] pull_request: branches: [ $default-branch ] jobs: build: name...

ssh 执行远程命令和端口转发

执行远程命令 查看远程主机是否运行进程httpd ssh user@remote_host 'ps ax | grep httpd' 绑定本地端口 假定我们要让 1081 端口的数据,都通过 SSH 传向远程主机,命令就这样写 ssh -D 1081 user@remote_host SSH 会建立一个 socket,去监听本地的 1081 端口,所有链接本地 1081 端口的数据...

ssh 跳转进入局域网内部电脑

假设局域网内部有两台机器,A和B,其中机器A具有公网ip,机器B只有内网ip,网络信息如下。 机器A 公网IP: 11.23.45.67 公网SSH端口: 17890 内网IP: 192.168.1.30 SSH 用户名: mma 机器B 内网IP: 192.168.1.10 SSH 用户名: mmb SSH 端口: 22 现在机器C上,配置SSH跳转,从C登录A,再从A跳转进入B 在...