[toc]
git 简单使用
| # git config --global user.name "Jin.Ren" |
| # git config --global user.emal "renjin@transfereasy.com" |
| 查看本机的密钥,添加至gitlab中 |
| # cat ~/.ssh/id_rsa.pub |
| # cd old-deplay |
| # git remote add origin git@10.180.55.111:Jin.Ren/deplay-test.git |
| # git push -u origin master |
| # mysqldump -uuser -ppasswd -hhost --databases data > /tmp/database.sql |
mongo生产报错总结
- python 记入mongo时会报错 2.x 与 3.x 使用的加密方式不同
ubuntu升级mongo2.x到3.x
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| { user: "<name>", |
| pwd: "<cleartext password>", |
| customData: { <any information> }, |
| roles: [ |
| { role: "<role>", db: "<database>" } | "<role>", |
| ... |
| ] |
| } |
| |
| use products |
| db.createUser( |
| { "user" : "accountAdmin01", |
| "pwd": "cleartext password", |
| "customData" : { employeeId: 12345 }, |
| "roles" : [ { role: "clusterAdmin", db: "admin" }, |
| { role: "readAnyDatabase", db: "admin" }, |
| "readWrite" |
| ] }, |
| { w: "majority" , wtimeout: 5000 } ) |
mac测试环境多版本php添加mongo报错 php.h file not fond
nginx 重写443全局生效的两种方式
在server中新开起一个000-http2https.conf虚拟主机
| server { |
| listen 80; |
| server_name _; |
| return 301 https://$HOST$request_uri; |
| } |
| |
| |
| |
| |
| |
| |
| |
nginx 临时返回一个值或一个地址
| location /rjyy { |
| return 'https://rjyy.ssjinyao.com' ; |
| } |
| location /nene { |
| return 'https://nene.ssjinyao.com' ; |
| } |
| location /sange.html { |
| return 200 '<h1>mei tou nao a</h1>' ; |
| } |
ssh不能key登录
| 查看.ssh 与 authorized_keys的权限 |
| 查看/etc/ssh配置问题 |
| AuthorizedKeysFile %h/.ssh/authorized_keys |
允许HTTP上传文件,并设定大小
| vim /etc/php.ini |
| file_uploads = on; 是否允许通过HTTP上传文件的开关。默认为ON即是开; |
| upload_tmp_dir; 文件上传至服务器上存储临时文件的地方,如果没指定就会用系统默认的临时文件夹; |
| post_max_filesize = 8m; 允许上传文件大小的最大值。默认为2M; |
| post_max_size 8m; 指通过表单POST给PHP的所能接收的最大值,包括表单里的所有值。默认为8M; |
gitlab-ci 持续化发布平台
| |
| |
| |
| |
| http://xxx.xx.xxx.xxx:8080/ci |
| 如果是建立公共runner,则需要以root登录gitlab --> root --> Admin Area --> Ruuners -> 可以查看到变红的koen |
| deploy |
| shell |
| shell |
便可以添加上了
在指定分支中添加.gitlab-ci.yml ,如test分支
| before_script: |
| - cd /xxxxx/xxxx/deploy_ci |
| job: |
| only: |
| - test |
| tags: |
| - inner |
| script: |
| - /usr/bin/fab -f xx-deploy.py xxxxxx:test,0 |
关于python 部署的坑
| # 项目目录 /root/text/ |
| # 需要执行的代码 /root/text/poor/fober.py |
| # config 配置文件 /root/text/config/config.py |
| 共两种解决方式 |
| 1. 添加v.pth 在ENV中 |
| # virtualenv /root/text/ENV |
| # vim /root/text/ENV/lib/python2.7/site-packages/v.pth |
| /root/text |
| 2. 在调用config前,定义好目录 |
| # sys.path.append('/root/text/') |