代码改变世界

随笔档案-2014年03月

curl获得http响应码 302 和绑定host

2014-03-28 09:52 by cmsd, 2099 阅读, 收藏, 编辑
摘要: shell curl 取得HTTP返回的状态码 curl -I -m 10 -o /dev/null -s -w %{http_code} www.baidu.com 阅读全文

mysql-proxy之奇虎360 Atlas 安装实现mysql读写分离

2014-03-22 18:27 by cmsd, 2689 阅读, 收藏, 编辑
摘要: 官方git https://github.com/Qihoo360/Atlas 参照:http://blog.qixingzhong.com/2013/09/centos-install-atlas.html 1. 安装必要的依赖包 yum install pkg-config libevent* glib lua 2. 升级安装autoconf,编译安装automake需要 阅读全文

startssl 申请证书,并在Nginx, apache, Tomcat上使用

2014-03-21 13:19 by cmsd, 712 阅读, 收藏, 编辑
摘要: tomcat: http://blog.csdn.net/buyaore_wo/article/details/5771470 apache: http://blog.mowd.tw/index.php?pl=950 Nginx: http://blog.nicky1605.com/the-free-ssl-configuration-startssl-on-nginx.html 简要: apache: SSLCertificateFile /etc/pki/tls/certs/ssl.crt SSLCertificateKeyFile /etc/pki/tls/private/ssl.key SSLCertificateChainFile /etc/pki/tls/sub.class1.server.ca.pem SSLCACertificateFile /etc/pki/tls /ca.pem tomcat: 选Create PFX file。。。。。。。。。 输入之前保存的两个密文信息及密码 阅读全文

linux查看公网地址

2014-03-20 10:33 by cmsd, 300 阅读, 收藏, 编辑
摘要: curl http://members.3322.org/dyndns/getip 阅读全文

Apache, Nginx获得nginx代理后的真实用户Ip

2014-03-11 18:11 by cmsd, 452 阅读, 收藏, 编辑
摘要: Nginx 的反向代理设置proxy_set_header X-Real-IP $remote_addr;apache可以设置日志格式将 %h替换为%{X-Real-Ip}i 如:LogFormat "%{X-Real-Ip}i %l %u %t \"%mhttp://%v%U%q\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" - %h" combinednginx可以设置$http_x_real_ip变量。 如log_format main '$http_x 阅读全文

linux gitlab nginx 安装 配置

2014-03-11 13:52 by cmsd, 5481 阅读, 收藏, 编辑
摘要: 更新: 用官方rpm包装很方便 rpm下载地址: https://www.gitlab.com/downloads/ 教程地址:https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/README.md 安装: sudo yum install openssh-server sudo yum install postfix # sendmail or exim is also OK sudo rpm -i gitlab-x.y.z.rpm sudo gitlab-ctl reconfigure 阅读全文

cacti批量添加主机脚本

2014-03-11 11:22 by cmsd, 1082 阅读, 收藏, 编辑
摘要: #!/bin/bash ##cacti批量脚本位置 device=/var/www/html/cacti/cli/add_device.php graphs=/var/www/html/cacti/cli/add_graphs.php tree=/var/www/html/cacti/cli/add_tree.php ##需要添加的host ip在ip.txt中 host_ips=`cat ip.txt` ##开始循环遍历 for host_ip in $host_ips; do 阅读全文

磁盘io负载查看

2014-03-10 10:33 by cmsd, 986 阅读, 收藏, 编辑
摘要: 转自:http://blog.csdn.net/i_am_jojo/article/details/7698458 为了方便各位和自己今后遇到此类问题能尽快解决,我这里将查看linux服务器硬盘IO访问负荷的方法同大家一起分享:首先 、用top命令查看top - 16:15:05 up 6 days, 6:25, 2 users, load average: 1.45, 1.77, 2.14Tasks: 147 total, 1 running, 146 sleeping, 0 stopped, 0 zombieCpu(s): 0.2% us, 0.2% sy, 0.0% ni, 86.... 阅读全文

建立自己的Yum源

2014-03-07 14:41 by cmsd, 1061 阅读, 收藏, 编辑
摘要: 转自http://kicklinux.com/setup-yum-repos-server/ 命令 reposync 可以直接同步yum源 如/etc/yum.repos.d/cloudera-cdh4.repo 合适的目录下 reposync cloudera-cdh4 就ok了 阅读全文

误卸载python2.4导致yum不能用后的修复

2014-03-04 22:55 by cmsd, 627 阅读, 收藏, 编辑
摘要: 去http://mirrors.ustc.edu.cn/centos/或者镜像下载如下包,版本不一定非常一致python-2.4.3-56.el5.x86_64.rpmpython-devel-2.4.3-56.el5.i386.rpmpython-devel-2.4.3-56.el5.x86_64.rpmpython-iniparse-0.2.3-6.el5.noarch.rpmpython-libs-2.4.3-56.el5.x86_64.rpmpython-pycurl-7.15.5.1-8.el5.x86_64.rpmpython-setuptools-0.6c5-2.el5.noar 阅读全文

网卡流量查看软件bmon

2014-03-04 22:32 by cmsd, 280 阅读, 收藏, 编辑
摘要: bmon 时 linux下最常用的查看网络带宽的工具,debian下直接进行安装即可apt-getinstallbmonredhat下可以在这里寻找到合适版本的rpm包,安装完毕后执行bmon,结果如图RX代表网卡的接收速率,TX代表发送速率。同时它还提供一个图形显示,可以比较直观的看到实时的带宽变... 阅读全文
点击右上角即可分享
微信分享提示