This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# rsyslogforwarder Starts rsyslogd/rklogd forwarder. | |
# | |
# | |
# chkconfig: 2345 12 88 | |
# description: Syslog is the facility by which many daemons use to log \ | |
# messages to various system log files. It is a good idea to always \ | |
# run rsyslog. | |
### BEGIN INIT INFO |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#rsyslog v3 config file | |
# if you experience problems, check | |
# http://www.rsyslog.com/troubleshoot for assistance | |
#### MODULES #### | |
# Provides UDP syslog reception | |
$ModLoad imudp.so | |
$UDPServerRun 514 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# | |
# graylog2-server: graylog2 message collector | |
# | |
# chkconfig: - 98 02 | |
# description: This daemon listens for syslog and GELF messages and stores them in mongodb | |
# | |
CMD=$1 | |
NOHUP=`which nohup` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/var/log/graylog2.log { | |
daily | |
rotate 90 | |
copytruncate | |
delaycompress | |
compress | |
notifempty | |
missingok | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# graylog2-web-interface: graylog2 web interface | |
# | |
# chkconfig: - 98 02 | |
# description: Starts graylog2-web-interface using passenger-standalone. \ | |
# Uses RVM to use switch to a specific ruby version. | |
# | |
# config |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
require 'mongo' | |
@conn = Mongo::Connection.new | |
@db = @conn['graylog2'] | |
@db.authenticate('grayloguser','grayloguser-mongo-passwd') | |
@coll = @db['blacklists'] | |
@conf_file = '/etc/rsyslog_disgarding.conf' | |
@conf_content = "" | |
@file = File.open(@conf_file,'r') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
LOGFILE=/var/log/nginx/access.log | |
PREFIX=/etc/spiders | |
#日志中大部分蜘蛛都有spider的关键字,但是百度的不能封,所以过滤掉百度 | |
grep 'spider' $LOGFILE |grep -v 'Baidu' |awk '{print $1}' >$PREFIX/ip1.txt | |
# 封掉网易的有道 | |
grep 'YoudaoBot' $LOGFILE | awk '{print $1}' >>$PREFIX/ip1.txt | |
#封掉雅虎 | |
grep 'Yahoo!' $LOGFILE | awk '{print $1}' >>$PREFIX/ip1.txt | |
# 过滤掉信任IP |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server | |
{ | |
listen 80; | |
server_name yoursite.com; | |
location / { | |
proxy_pass http://sourcesite.com/; | |
proxy_redirect default; | |
proxy_set_header X-Real-IP $remote_addr; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# chkconfig: 2345 88 88 | |
# description: starts the nginx web server | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: starts the nginx web server | |
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin | |
DESC="nginx daemon" | |
NAME=nginx |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
type HostReport struct { | |
Download string | |
Upload string | |
Traceroute string | |
} | |
func main(){ | |
reports := make(map[string]HostReport) | |
} |
OlderNewer