Development common notes

Automatically start xx script at boot

vim  /etc/rc.local
#例如每次开机自动启动nginx和mysql,直接把启动命令扔进来即可
/usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf
/usr/local/php/sbin/php-fpm

How to modify the maximum number of retained history?
The default history is 1000

hisroty -c       #干掉全部history历史
vim /etc/profile #修改HISTSIZE=999999
source /etc/profile  #重新加载配置文件生效

Communication between the host and the virtual host, ssh login sftp login, the easiest way
1. Select a bridge network to ensure that the local machine and the virtual host are in the same network segment
2. Install ssh** (PS is not installed by default) **

ubantu apt-get install ssh
centos yum -y install ssh
ps  -ef|grep ssh 查看是否安装成功,安装成功默认自动启动的

User management https://www.cnblogs.com/xiohao/p/5877256.html
cat /etc/passwd View information such as all users and groups

useradd zhangsan Add Zhang San user
groupadd boys Add boys group
usermod -G boys zhangsan Add Zhang San to boys group
userdel
ssh public key configuration (no password is required when git committing and pulling code):
[root@iZtqas3cjxy7mbZ html ]# ssh-keygen -t rsa -C [email protected]
Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa):
/root/.ssh/id_rsa already exists .Overwrite
(y/n)?
cd /root/.ssh/
[root@iZtqas3cjxy7mbZ .ssh]# ls
id_rsa id_rsa.pub known_hosts
[root@iZtqas3cjxy7mbZ .ssh]# cat id_rsa.pub
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDTOKEnKT4 + lw5fW / kPhXL / wuqc4jxyqba0IkWpaiYO5 / ff4jfIeOfp88ioGtkiI18oxgLjCvtYpkgoJPIw4mg2ewmqCMLHfxy0F6Kd2V + 2UqqBmDExXqnrUR4ZEBHHJDvS01dCboOPPZQxnmyjtYuE6tCj / 0R / cO ++ GzjTa4E / ne + G8FQP7 / p7mf2dqhoMXtxOYGd4oApwAMn55xbwGYnECu5DAtZEmfeLQd / H6rIhKwuAjTAjWGz9GBNwuOw1ozM + SQ3ZpGUM61b3h9hNryUxfBBZiaEQ / dHnW / tY7rd / tdjDH7JhCdabL2POt9nc9eg49q / UNyNx / Bl5fD3y5WVR [email protected]
copied to the public key Code repositories such as gitlab/github/coding
(to be continued...)

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324450998&siteId=291194637
Recommended