update
This commit is contained in:
commit
277de36f1e
35
database/postgres/docker-compose.yml
Normal file
35
database/postgres/docker-compose.yml
Normal file
@ -0,0 +1,35 @@
|
||||
services:
|
||||
postgres:
|
||||
container_name: postgres_container
|
||||
image: postgres
|
||||
environment:
|
||||
POSTGRES_USER: ${POSTGRES_USER:-root}
|
||||
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-123456}
|
||||
PGDATA: /data/postgres
|
||||
volumes:
|
||||
- postgres:/data/postgres
|
||||
ports:
|
||||
- "5432:5432"
|
||||
networks:
|
||||
- postgres
|
||||
restart: unless-stopped
|
||||
|
||||
pgadmin:
|
||||
container_name: pgadmin_container
|
||||
image: dpage/pgadmin4
|
||||
environment:
|
||||
PGADMIN_DEFAULT_EMAIL: ${PGADMIN_DEFAULT_EMAIL:-root@test.com}
|
||||
PGADMIN_DEFAULT_PASSWORD: ${PGADMIN_DEFAULT_PASSWORD:-123456}
|
||||
PGADMIN_CONFIG_SERVER_MODE: "False"
|
||||
ports:
|
||||
- "${PGADMIN_PORT:-8091}:80"
|
||||
networks:
|
||||
- postgres
|
||||
restart: unless-stopped
|
||||
|
||||
networks:
|
||||
postgres:
|
||||
driver: bridge
|
||||
|
||||
volumes:
|
||||
postgres:
|
||||
13
go/gocode.md
13
go/gocode.md
@ -4,3 +4,16 @@
|
||||
# 退出gocode 服务
|
||||
gocode exit
|
||||
```
|
||||
|
||||
## error
|
||||
|
||||
slice append 会引用到原slice
|
||||
|
||||
```golang
|
||||
a := make([]any, 0, 20)
|
||||
a = append(a, 1, 2, 3)
|
||||
b := append(a, 4)
|
||||
c := append(a, 5)
|
||||
b[0] = 0
|
||||
logv.Warn().Msgf("%v %v %v", a, b, c)
|
||||
```
|
||||
|
||||
@ -2,6 +2,8 @@
|
||||
|
||||
## caddyfile
|
||||
|
||||
docker run -d -p 80:80 --name caddy -v ~/.config/www:/data -v ~/.config/caddy:/etc/caddy caddy
|
||||
|
||||
```bash
|
||||
*.nps.veypi.com:80 {
|
||||
reverse_proxy 127.0.0.1:800
|
||||
|
||||
27
linux/ssh.md
27
linux/ssh.md
@ -8,4 +8,31 @@ ssh -R 8022:localhost:2017 user@ip -N
|
||||
|
||||
# 将远程服务器的 8022 端口映射到本地的 2017 端口
|
||||
ssh -L 2017:localhost:8022 user@ip -N
|
||||
|
||||
|
||||
|
||||
```
|
||||
|
||||
# auto ssh proxy
|
||||
|
||||
ssh -C -N -R remote_port:localhost:local_port username@remote_server
|
||||
|
||||
vim /etc/systemd/system/vautossh.service
|
||||
|
||||
```
|
||||
[Unit]
|
||||
Description=AutoSSH tunnel service for reverse port forwarding
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
Environment="AUTOSSH_GATETIME=0"
|
||||
ExecStart=/usr/bin/ssh -o ServerAliveInterval=60 -o ServerAliveCountMax=3 -C -N -R remote_port:localhost:local_port username@remote_server
|
||||
Restart=always
|
||||
User=your_username
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
```
|
||||
|
||||
systemctl daemon-reload
|
||||
systemctl enable vautossh.service
|
||||
|
||||
@ -33,7 +33,6 @@ tmux attach -t $1
|
||||
```
|
||||
|
||||
## .tmux.conf
|
||||
|
||||
```bash
|
||||
# ln -s $(pwd)/tmux.conf ~/.tmux.conf
|
||||
|
||||
@ -47,20 +46,14 @@ bind r source-file ~/.tmux.conf \; display-message "Config reloaded.."
|
||||
# 打开鼠标 调整面板 切换面板
|
||||
set-option -g mouse on
|
||||
|
||||
|
||||
|
||||
set -g base-index 1 # 设置窗口的起始下标为1
|
||||
set -g pane-base-index 1 # 设置面板的起始下标为1
|
||||
|
||||
|
||||
unbind '"'
|
||||
bind - splitw -v -c '#{pane_current_path}' # 垂直方向新增面板,默认进入当前目录
|
||||
unbind %
|
||||
bind = splitw -h -c '#{pane_current_path}' # 水平方向新增面板,默认进入当前目录
|
||||
|
||||
|
||||
|
||||
|
||||
set -g status-interval 1 # 状态栏刷新时间
|
||||
set -g status-justify left # 状态栏列表左对齐
|
||||
setw -g monitor-activity on # 非当前窗口有内容更新时在状态栏通知
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user