This file contains hidden or 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
Name: falcon-agent | |
Version: 0.4 | |
Release: 1%{?dist} | |
Summary: falcon-agent | |
Group: system/daemon | |
License: GPL | |
URL: http://open-falcon.com/ | |
Source0: http://open-falcon.com/download/%{name}-%{version}.tar.gz | |
BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX) |
This file contains hidden or 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
#! /usr/bin/env python | |
# -*- coding: utf-8 -*- | |
import time, os, socket | |
import json | |
metric = ['usr', 'nice', 'sys', 'idle', 'iowait', 'irq', 'soft', 'steal', 'guest'] | |
host = socket.gethostname() | |
def get_cpu_core_stat(num): |
This file contains hidden or 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 | |
# /etc/init.d/jenkins | |
# debian-compatible jenkins startup script. | |
# Amelia A Lewis <[email protected]> | |
# | |
### BEGIN INIT INFO | |
# Provides: jenkins | |
# Required-Start: $remote_fs $syslog $network | |
# Required-Stop: $remote_fs $syslog $network | |
# Default-Start: 2 3 4 5 |
This file contains hidden or 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
virsh pool-define-as default dir - - - - /var/lib/libvirt/images | |
virsh pool-build default | |
virsh pool-start default | |
virsh pool-autostart default | |
virsh pool-list |
This file contains hidden or 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
/etc/nginx/conf.d/git.conf | |
server { | |
listen 443; | |
server_name git.test.net; | |
root /data/web; | |
charset utf-8; | |
index index.html; | |
access_log /var/log/nginx/git_access.log; |
This file contains hidden or 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 | |
usage(){ | |
echo "usage: $0 <addrec> <view> <zone> <domain> <type> <value> <mxpr> <ttl>" | |
echo "usage: $0 <delrec> <view> <zone> <domain> [type] [value] [mxpr] [ttl]" | |
exit 1 | |
} | |
DEBUG() { | |
if [[ $DEBUG = true ]]; then | |
"$@" |
This file contains hidden or 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
#include <assert.h> | |
#include <errno.h> | |
#include <fstab.h> | |
#include <inttypes.h> | |
#include <malloc.h> | |
#include <mntent.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <sys/quota.h> |
This file contains hidden or 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 | |
# A simple script to protect system from DOS attack | |
# create a crontab conf file /etc/cron.d/autoban like this: | |
# * * * * * root /sbin/autoban.sh ban >/dev/null 2>&1 & | |
# */10 * * * * root /sbin/autoban.sh unban - 5 >/dev/null 2>&1 & | |
# 01 * * * * root /sbin/autoban.sh unban 6 20 >/dev/null 2>&1 & | |
# 01 09 * * * root /sbin/autoban.sh unban 21 - >/dev/null 2>&1 & | |
# | |
PATH=/bin:/usr/bin:/usr/sbin:/sbin | |
export PATH |
This file contains hidden or 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 | |
[ -z $1 ] || dig +nocmd +noall +answer +stats $@ | grep 'IN\|Query time' | sed 's/;; Query time://' | sed ';N;s/\n//' |
This file contains hidden or 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 | |
# manage /etc/hosts | |
isIp() { | |
# test variable is an ip address or not | |
# true: return 0 | |
# false: return 1 | |
local ip=$1 | |
local stat=1 | |
if [[ $ip =~ ^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$ ]]; then | |
OIFS=$IFS |