70.docker汇总

发表于 linux 分类,标签:
--------------------------------------------------------------------------------------------------1#备份imagesdocker save 98d8bb571885 > /root/rancher.tar--------------------------------------------------------------------------------------------------2#导入imagesdocker load -i /root/rancher.tar------------------------------------------------------...

69.python3替换python2

发表于 linux 分类,标签:
注意:需要root权限。查找python位置whereispython删除软链接rm/usr/bin/python查看环境变量echo$PATH  生成python3的软链接到环境变量ln-s/usr/bin/python3.6/usr/bin/python...

68.go环境配置

发表于 linux 分类,标签:
https://blog.csdn.net/bulucc/article/details/135611426go的安装及配置1、找到对应的版本包下载,例如wget https://golang.google.cn/dl/go1.21.6.linux-amd64.tar.gz2、下载完成后配置解压Go源码包tar -zxf go1.21.6.linux-amd64.tar.gz3、将解压的文件移动到安装目标路径sudo mv go /usr/local4. 配置Go的环境变量,可以通过编辑 ~/.profile 文件(或者 ~/.bashrc 文件)来实现#vim ~/.profilevim /etc/pro...

67.nginx动态跨域

发表于 linux 分类,标签:
#nginx屏蔽版本号server_tokens  off;#Cookie设置成HttpOnlyadd_header Set-Cookie "Path=/; HttpOnly; Secure";#防止XSS,下面3行add_header X-Frame-Options "SAMEORIGIN";add_header X-XSS-Protection "1; mode=block";add_header X-Content-Type-Options "nosniff";add_header Strict-Transport-Security&n...

66.gitlab配置

发表于 linux 分类,标签:
1.下载官方包:https://packages.gitlab.com/gitlab/gitlab-ce清华包:https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/2.rpm安装:rpm -ivh gitlab-ce-13.6.1-ce.0.el7.x86_64.rpmyum install -y gitlab-ce-13.6.1-ce.0.el7.x86_64.rpm配置yam源方式安装:在/etc/yum.repos.d/下新建gitlab-ce.repo,写入如下内容:[gitlab-ce]name=gitlab-cebaseurl= Repo_gpgcheck=0Enabled=1Gpgkey=https://packages.gitl...

65.http转https

发表于 linux 分类,标签:
推荐使用方法:if($ssl_protocol=""){return301https://$host$request_uri;}Nginx环境下强制http转https设置方法:方法一:下面代码照搬过去就行。无需做任何修改。春哥技术博客推荐此种方法,非常简单,改完以后实时生效,不用重启服务器。if($scheme=http){return301https://$host$request_uri;}方法二:下面代码照搬过去就行。无需做任何修改。if($server_port=80){return301https://$host$request_uri;}方法三:下列代码中请注意把域名修改成自己域名。if($ssl_protocol=""){return301https://$server_nam...

64.nginx_waf

发表于 linux 分类,标签:
配置如下:##如果我是阿里的WAF,ALB,SLB后面,因为阿里已经弄好了$http_x_forwarded_for的第一个ip为客户端iplocation / {access_by_lua_file "/opt/verynginx/openresty/nginx/conf/lua/whiteKeykz18.lua";proxy_set_header xrequestid $xrequestid;proxy_headers_hash_max_size 51200;proxy_headers_hash_bucket_size 6400;proxy_set_header Host       $host...

63.sslscan工具

发表于 linux 分类,标签:
一、sslscan工具安装步骤1.下载源码gitclonehttps://github.com/rbsec/sslscan2.进入目录cdsslscan3.编译安装makestatic4.如果报错就安装一下依赖环境sudoapt-getinstallrubysudoapt-getinstallzlib1gsudoapt-getinstallzlib1g.dev5.查看是否编译成功./sslscan--version6.使用./sslscan--tlsallxxx.xxx.com:443二、忘记root密码如何修改1.启动KaliLinux,在看到蓝色的引导界面时按键盘e进入编辑模式2.在界面"linux/boot/vmlinuz-5.14.0-kali-adm64root=UUID=02f7b3bc-5dd1-4ef0-8ce0-e2...

62.google谷歌翻译

发表于 linux 分类,标签:
香港ip142.250.4.90translate.googleapis.com如果这个香港ip失效了,那就把ip替换下面这些备用的吧,速度稍慢,但是也能用。142.250.110.90 translate.googleapis.com172.217.214.90 translate.googleapis.com108.177.122.90 translate.googleapis.com172.253.114.90 translate.googleapis.com172.217.203.90 translate.googleapis.com172.253.112.90 translate.googleapis.com...

60.crontab配置

发表于 linux 分类,标签:
crontab每分钟定时执行:*/1****servicemysqldrestart//每隔1分钟执行一次*/10****servicemysqldrestart//每隔10分钟执行一次crontab每小时定时执行:0*/1***servicemysqldrestart//每1小时执行一次0*/2***servicemysqldrestart//每2小时执行一次crontab每天定时执行:010***servicemysqldrestart//每天10点执行3019***servicemysqldrestart//每天19点30分执行crontab每周定时执行:010**1servicemysqldrestart//每周一10点执行3017**5serv...