Debian linux 新增用户
user add [username]:[usergroup]
passwd [username]
cp -r /etc/skel /home/[username]
chown username:[usergroup] -R /home/[username]
user add [username]:[usergroup]
passwd [username]
cp -r /etc/skel /home/[username]
chown username:[usergroup] -R /home/[username]
portainer
docker volume create portainer_data
docker run --name portainer \
--restart=always \
-p 8000:8000 -p 9000:9000 \
-v /var/run/docker.sock:/var/run/docker.sock \
-v portainer_data:/data \
-d portainer/portainer:latest
postgresql
docker volume create postgresql-v12_data
docker run --name postgres-v12 \
--restart=always \
-p 5432:5432 \
-e POSTGRES_PASSWORD=password \
-v postgresql-v12_data:/var/lib/postgresql/data \
-d postgres:12
pgadmin4
docker run -p 80:80 \
--restart=always \
--name pgadmin4 \
-e "PGADMIN_DEFAULT_EMAIL=user@domain.com" \
-e "PGADMIN_DEFAULT_PASSWORD=SuperSecret" \
-d dpage/pgadmin4:latest
redis
docker volume create redis_data
docker run --restart=always \
--name redis \
-p 6739:6739 \
-v /myredis/conf/redis.conf:/usr/local/etc/redis/redis.conf \
-v redis_data:/data \
-d redis:latest
gogs
docker volume create gogs_data
docker run --name gogs \
--restart=always \
-p 3000:3000 \
-v gogs_data:/data \
-d gogs/gogs:latest
softethervpn
docker run --name=softether\
--cap-add NET_ADMIN \
--restart=always \
-p 500:500/udp \
-p 4500:4500/udp \
-p 1701:1701/udp \
-p 1194:1194/udp \
-p 5555:5555/tcp \
-e SPW=ServerManagementPassword \
-e HPW=HubManagementPassword \
-v /<path>/softether/vpn_server.config:/usr/vpnserver/vpn_server.config \
siomiz/softethervpn:latest
emqx
docker run --restart=always \
--name emqx \
-p 18083:18083 \
-p 8083:8083 \
-p 1883:1883 \
-d emqx/emqx:latest
docker run --restart=always \
--name emqx-edge \
-p 18084:18083 \
-p 8883:8083 \
-p 18833:1883 \
-d emqx/emqx-edge:latest
haproxy
docker run --restart=always \
--name haproxy \
-p 2018:2018 \
-p 2019:2019 \
-v /[user path]/haproxy:/usr/local/etc/haproxy \
-d haproxy:latest
haproxy.cfg
frontend secure #自定义一个frontend,也可以放在listen或者backend中
mode http
bind 0.0.0.0:8901 #监听的ip端口号
stats enable #开关
stats uri / #访问的uri ip:8888/admin?admin
stats hide-version #隐藏HAProxy的版本号
stats admin if TRUE #管理界面,如果认证成功了,可通过webui管理节点
stats refresh 30s #统计页面自动刷新时间
timeout client 120000
listen test1
bind 0.0.0.0:2018
mode tcp
option tcplog
timeout connect 5000
timeout client 120000
timeout server 120000
#maxconn 4086
#log 127.0.0.1 local0 debug
server s1 127.0.0.1:2018
caddy
docker run --restart=always \
--name caddy\
-p 2015:2015\
-v /srv/www:/<path>/caddy/www \
-d abiosoft/caddy:latest
apache-php7.4
docker run --name apache-php7.4 \
--restart=always \
-p 80:80 -p 443:443 \
-v /<path>/www:/app \
-d webdevops/php-apache:7.4
apache-php8.2
docker run --name apache-php8.2 \
--restart=always \
-p 80:80 -p 443:443 \
-v /<path>/www:/app \
-d webdevops/php-apache:8.2
nodejs/PM2
允许root用户远程登录
修改ssh服务配置文件
sudo vi /etc/ssh/sshd_config
调整 PermitRootLogin 参数值为 yes,如下图:
允许无密码登录
同上,修改ssh服务配置文件,两种情况:
1) 将PermitEmptyPasswords yes前面的#号去掉
2) 将PermitEmptyPasswords 参数值修改为yes
阿里云 TortoiseGit 拉取代码报错
git.exe pull --progress -v --no-rebase "origin"
fatal: protocol error: bad line length character: Welc
git did not exit cleanly (exit code 1)
修改 TortoiseGit 设置 >> 网络,默认的 SSH 客户端:
"C:\Program Files\TortoiseGit\bin\TortoiseGitPlink.exe"
改成win下git默认的
"C:\Program Files\Git\usr\bin\ssh.exe"
https://github.com/git-for-windows/git/wiki/Symbolic-Links
Symbolic Links
Clemens Buchacher edited this page on 26 Jul · 20 revisions
Short version: there is no exact equivalent for POSIX symlinks on Windows, and the closest thing is unavailable for non-admins by default. Therefore, symlink emulation support is switched off by default and needs to be configured by you, the user, via the core.symlinks=true config setting.
Background
Starting with Windows Vista, there is support for symbolic links. These are not your grandfather's Unix symbolic links; They differ in quite a few ways:
Symbolic links are only available on Windows Vista and later, most notably not on XP
You need the SeCreateSymbolicLinkPrivilege privilege, which is by default assigned only to Administrators and guarded by UAC, but can be assigned to other users or user groups (see below).
Symbolic links on remote filesystems are disabled by default (call fsutil behavior query SymlinkEvaluation to find out)
Symbolic links will only work on NTFS, not on FAT nor exFAT
Windows' symbolic links are typed: they need to know whether they point to a directory or to a file (for this reason, Git will update the type when it finds that it is wrong)
Many programs do not understand symbolic links
For those reasons, Git for Windows disables support for symbolic links by default (it will still read them when it encounters them). You can enable support via the core.symlinks config variable, e.g. when cloning:
git clone -c core.symlinks=true
Creating symbolic links
By default, the ln -s command in Git Bash does not create symbolic links. Instead, it creates copies.
To create symbolic links (provided your account has permission to do so), use the built-in mklink command, like so:
mklink /d this-link-points-to c:\that-directory
mklink this-link-points-to c:\that-file
Allowing non-administrators to create symbolic links
The privilege of Create symbolic links can be assigned using local policy editors (or via policies from Active Directory in case of domain accounts). Home Editions of Windows do not have these policy editors, but the freely available Polsedit can be used on these editions.
Local Group Policy Editor: Launch gpedit.msc, navigate to Computer Configuration - Windows Settings - Security Settings - Local Policies - User Rights Assignment and add the account(s) to the list named Create symbolic links.
Local Security Policy: Launch secpol.msc, navigate to Local Policies - User Rights Assignment and add the account(s) to the list named Create symbolic links.
Polsedit: Launch polseditx32.exe or polseditx64.exe (depending on your Windows version), navigate to Security Settings - User Rights Assignment and add the account(s) to the list named Create symbolic links.
Note that regardless of privilege assignment, members of the Administrators group will also require UAC elevation (see the full details in the Access Token Changes section in this document on UAC). Since Windows 10 version 1703 (Creators Update), enabling Developer Mode will disable this restriction and allow creating symlinks without UAC elevation (although Git for Windows still requires UAC elevation up to and including v2.13.0).
Creating directory junctions
Directory junctions can be created by non-administrator users by default. Therefore, they are a popular alternative to symbolic links. To create a directory junction, use the mklink command with the /j option:
mklink /j this-link-points-to c:\that-directory