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 | |
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
/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
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
#!/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
#! /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
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
#!/bin/bash | |
# send named metrics to falcon-agent | |
RNDC_BIN=/usr/sbin/rndc | |
STATS='/var/named/data/named_stats.txt' | |
rm -f $STATS | |
if ! $RNDC_BIN stats; then | |
exit 1 |
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
# Before you can use the tool, | |
# you need to install following software. | |
# curl openssl gawk | |
if [ "$mode_qcloud_api" ];then | |
return | |
fi | |
export mode_qcloud_api=1 | |
function urlencode(){ |
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
# https://www.qcloud.com/doc/product/215/2238 | |
3. 配置优化 | |
公网网关主机会默认配置iptables的nat规则,以及打开kernel的ip_forward,基本的公网网关功能已经完全具备。建议经过下述配置,以达到更好的性能。 | |
1) 通过以下命令将net.ipv4.ip_forward配置写到/etc/sysctl.conf文件中 | |
echo "net.ipv4.ip_forward = 1" >> /etc/sysctl.conf | |
2) 通过以下命令将nf_conntrack配置参数调大 |