王殊勋的个人博客

只要开始,虽远不迟!

1.减少点击劫持 修改nginx.conf,在http {}内添加: 1 2 3 4 5 http { … add_header X-frame-options SAMEORIGIN; … } 2.隐藏或伪装Nginx的版本及版本相关提示信息 修改nginx.conf,在http {}内添加: 1 2 3 4 5 http { … server_tokens off; … } 3.禁止开启Nginx的目录列表功能 修改nginx.conf,在http {}内添加: 1 2 3 4 5 http { … a
阅读全文 »

程序: 1 2 3 import sys reload(sys) sys.setdefaultencoding(‘utf-8’) 以上是python2的写法,但是在python3中这个需要已经不存在了,这么做也没什么实际意义。 但是python3中仍然可以使用这个方法代替: 1 2 import importlib,sys importlib.reload(sys)
阅读全文 »

解决方法: 修改 epel.repo 文件,把第3行注释去掉,第四行注释掉. 编辑 /etc/yum.repos.d/epel.repo: 1 2 3 4 5 vi /etc/yum.repos.d/epel.repo [epel] name=Extra Packages for Enterprise Linux 6 - $basearch #baseurl=http://download.fedoraproject.org/pub/epel/6/$basearch mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=ep
阅读全文 »

k8s在使用编排(manifest)工具进行yaml文件启动pod时,会遇到官方所给例子中spec.containers.image包含: 1 2 quay.io/coreos/example_ gcr.io/google_containers/example_ 也就是说,从quay.io和gcr.io进行镜像拉取,我们知道,国内访问外网是被屏蔽了的.可以将其替换为: 1 2 quay-mirror.qiniu.com registry.aliyuncs.com 例如: 下拉镜像: 1 quay.io/coreos/flannel:v0.10.0-s390x 如果
阅读全文 »

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102
阅读全文 »

在git应用的hooks目录中,创建post-receive文件,添加内容如下: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 #!/bin/sh DEPLOY_PATH=写Web站点目录 将 master 以zip格式打包到指定文件(裸仓库中执行) echo "git账号的密码" | sudo -S git archive --format zip --output file.zip master 将打包好的剪切到web目录 echo "git账号的密码" | sudo -S mv file.zip $DEPLOY
阅读全文 »

查看redis的版本有两种方式. 第一种: 1 2 redis-server --version redis-server -v 得到的结果是: 1 Redis server v=3.0.504 sha=00000000:0 malloc=jemalloc-3.6.0 bits=64 build=a4f7a6e86f2d60b3 第二种: 1 2 redis-cli --version redis-cli -v 得到的结果是: 1 redis-cli 3.0.504
阅读全文 »

1.环境介绍 CentOS7 2.下载Redis5.0-rc3 1 wget -O redis-5.0-rc3.tar.gz https://github.com/antirez/redis/archive/5.0-rc3.tar.gz 3.解压redis 1 tar -zxvf redis-5.0-rc3.tar.gz -C /usr/local 4.编译并安装 1 2 cd /usr/local/redis-5.0-rc3 make 出现如下即编译成功: 1 2 Hint: It's a good idea to run 'make test' mak
阅读全文 »

安装依赖环境: 1 yum -y install make gcc gcc-c++ kernel-devel m4 ncurses-devel openssl-devel unixODBC-devel 下载erlang源代码包: 1 wget http://www.erlang.org/download/otp_src_R16B03.tar.gz 解压软件包: 1 tar -zxf otp_src_R16B03.tar.gz 进入目录: 1 cd otp_src_R16B03 开始编译: 1 2 ./configure --prefix=/usr/
阅读全文 »
0%