1. mount nfs目录挂载导致目标服务器宕机

    mount nfs目录挂载导致目标服务器宕机 宕机背景 由于业务规模一般,现业务由两台互相备大容量存储服务器BIG42、BIG43 向 8台WEB服务器提供文件存储服务。 BIG42、BIG43部署情况 BIG42、BIG43采用sersync实现互备(基于rsync互相同步数据,BIG42新增数据会向BIG43同步,BIG43新增数据会向BIG42同步) WEB服务器部署情况 WEB服务器通过mount -t nfs方式向BIG42、BIG43挂载远程目录使用 mount -t nfs xx.xxx.xxx.42:/data/uploads/www...

    2017/06/16 linux

  2. 快速搭建私有git服务

    创建用户 创建一个git用户,用来运行git服务 adduser git 不允许git用户登录shell vim /etc/passwd --------------- git:x:502:503::/home/git:/bin/bash 改为: git:x:502:503::/home/git:/usr/bin/git-shell 创建裸库 使用–bare创建一个git裸库 cd /home/git/ mkdir store cd store git init --bare sample.git chown -R git:git /home/g...

    2017/06/14 linux

  3. Gitolite搭建git仓库实现权限控制

    创建用户 创建一个git用户,用来运行gitolite服务。如果你之前是用git账号来做权限控制的话,记得把/etc/passwd里git用户的shell换回/bin/bash。 # git server adduser git 工作机生成一个rsa密匙,并将公匙拷贝至git服务器下 # 工作机 ssh-keygen scp /root/.ssh/id_rsa.pub root@cp01-matrix-sandbox-03.epc.baidu.com:/home/git/admin.pub 安装gitolite 切换到git用户安装gitolite,...

    2017/06/14 linux

  4. 使用pyinstaller打包python脚本

    在做服务器部署或维护时需要将自己写的python脚本拷贝到目标服务器中执行,但生产环境服务器上python版本、依赖等都不一致。使用pyinstaller能够将python脚本打包成一个可执行文件在没有python环境的机器上运行(还能生成windows环境.exe可执行文件)。 安装 通过pip安装即可,也可以下载源码然后直接执行pyinstaller.py pip install pyinstaller 使用 先创建一个测试文件 test.py #!/user/bin/env python # -*-coding:utf-8-*- from sele...

    2017/06/09 python

  5. phar包创建与使用

    php的版本要大于 5.3 修改php.ini 在php.ini中phar.readonly默认是开启的,将它设为 Off。(若没有则新增) phar.readonly = Off 创建phar包 先创建以下文件 #source/mail.class.php class Mail{ public function send($user_address){ echo "send {$user_address}\n"; } } #source/user.class.php class User{ public function getAddress(...

    2017/06/07 php

  6. selenium(python)基础操作

    使用pip安装selenium 使用pip安装 pip install selenium chrome驱动安装 下载chrome驱动(需要翻墙),记得选择对应的操作系统下载浏览器驱动(uname -a查看系统) http://docs.seleniumhq.org/download/ 或者 https://sites.google.com/a/chromium.org/chromedriver/ 这里选择chromedriver_mac64.zip chromedriver_linux32.zip chromedriver_linux6...

    2017/06/03 selenium

  7. 使用wget检测web服务网络情况

    如何检测站点访问网络情况 ** curl -w ** 新建一个 curl-format.txt 文件,内容如下: \n time_namelookup: %{time_namelookup}\n time_connect: %{time_connect}\n time_appconnect: %{time_appconnect}\n time_pretransfer: %{time_pretransfer}\n time_redirect: %{time_redirect}\n time_starttransfer...

    2017/06/01 linux

  8. nginx代理出现cannot have URI 错误提示

    nginx代理出现cannot have URI 错误提示 “proxy_pass” cannot have URI part in location given by regular expression, or inside named location, or inside “if” statement, or inside “limit_except” block … 错误原因 location / { root /data/wwwroot/test_images; if ( !-e $request_filename) { ...

    2017/06/01 nginx