徒涉春冰

导航

2013年1月27日 #

logstash

摘要: nginx accesslog 格式定义如下'{"ip":"$remote_addr", "user":"$remote_user", "time":"$time_local", "url":"$request", "status":"$status", "bytes":"$body_bytes_sent", "refer":&q 阅读全文

posted @ 2013-01-27 20:57 徒涉春冰 阅读(875) 评论(0) 推荐(0) 编辑

抄的一段笔记:用Plack实现git web访问

摘要: Plack::App::GitSmartHttpplackup -s Starman -p 500 git.psgi -D#!/usr/bin/perluse strict;use Plack::App::GitSmartHttp; Plack::App::GitSmartHttp->new( root => '/data/git', upload_pack => 1, # clone received_pack => 1, # push)->to_app;#!/usr/bin/perluse strict;use Plack::Builde... 阅读全文

posted @ 2013-01-27 11:42 徒涉春冰 阅读(345) 评论(0) 推荐(0) 编辑

抄一段ssh vsftpd防暴力破解脚本

摘要: #!/bin/bash#Denyhosts For vsftpd and sshd#2012-12-04awk '{for(i=1;i<=NF;i++){if($i ~ /rhost/)print substr($i,7)}}' /var/log/secure | grep -v "centos1" | sort | uniq -c >/root/black.txtDEFINE="100"cat /root/black.txt | while read LINEdo NUM=`echo $LINE |awk '{pri 阅读全文

posted @ 2013-01-27 11:37 徒涉春冰 阅读(168) 评论(0) 推荐(0) 编辑

抄了一段nginx安全配置

摘要: location = /robots.txt { access_log off; log_not_found off; } location = /favicon.ico { access_log off; log_not_found off; } location ~ /\. { access_log off; log_not_found off; deny all; } location ~ ~$ { access_log off; log_not_found off; deny all; } location ~ .*\.(gif|jpg|jpeg|png|bmp|sw... 阅读全文

posted @ 2013-01-27 11:30 徒涉春冰 阅读(362) 评论(0) 推荐(0) 编辑

用Net::Stomp连接RabbitMQ STOMP Adapter

摘要: RabbitMQ的perlbinding有点问题,我在fc18上make test时就爆出memory leak,可能是rabbitmq c库的问题,这让我不太放心,还好The STOMP plugin adds support for the STOMP protocol to RabbitMQ. The adapter supports STOMP 1.0, STOMP 1.1 and STOMP 1.2. with some extensions and restrictions。STOMP是极其简单的文本协议,应该是比较稳定的。废话不多说,看代码。The STOMP adapter i 阅读全文

posted @ 2013-01-27 11:25 徒涉春冰 阅读(1973) 评论(0) 推荐(0) 编辑

rabbitmq的坑

摘要: 刚接触rabbitmq,今天早上发现一个发布消息的进程僵死了,最后发现是rabbitmq默认的磁盘占用是80%,超过就僵死了。搜了一下,可以删除vhost,再重新建立vhost,这样才能释放空间。反正要停止服务几分钟,还不如添加一个硬盘大点的节点,平衡之后将现在这个节点成为成为内存节点。废话不多说,看代码。在新节点上设置env,如下echo >/etc/rabbitmq/rabbitmq-env.conf <<EOFRABBITMQ_MNESIA_BASE=/pool/rabbitmq/dataRABBITMQ_LOG_BASE=/pool/rabbitmq/logEOFRa 阅读全文

posted @ 2013-01-27 11:04 徒涉春冰 阅读(9633) 评论(0) 推荐(0) 编辑