1 You must agree that your name will be added to a file named AUTHORS.
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
#!/usr/bin/env python | |
import sys | |
a_newer = 1 | |
b_newer = -1 | |
a_eq_b = 0 | |
def stringToEVR(verstring): | |
if verstring in (None, ''): | |
return ('', '', '') |
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
tsd.core.auto_create_metrics=true | |
tsd.core.meta.enable_realtime_ts=false | |
tsd.core.meta.enable_realtime_uid=false | |
tsd.core.meta.enable_tsuid_incrementing=false | |
tsd.core.meta.enable_tracking=false | |
tsd.core.plugin_path= | |
tsd.core.tree.enable_processing=false | |
tsd.http.cachedir=/tmp/tsd | |
tsd.http.request.cors_domains=* | |
tsd.http.request.enable_chunked=true |
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
$ cat get_nn_stack.sh | |
#!/bin/bash | |
pid=$(ps ax|grep namenode.NameNode|grep -v grep|awk '{print $1}') | |
topinfo=$(top -H -p $pid -b -n 3|grep -A1 'PID USER'|tail -1|awk '{print $1,$9}') | |
thread=$(echo $topinfo|awk '{print $1}') | |
cpu=$(echo $topinfo|awk '{print $2}') | |
echo $cpu | |
if [[ $(python -c "print $cpu > 70") = True ]]; then |
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 | |
#!/bin/sh | |
# this script sets the TTL(in seconds) value on the tsdb column family in HBase. | |
TTL=$1 | |
if ! [[ $TTL =~ ^[1-9][0-9]*$ ]] ; then | |
echo "Invalid TTL value (expecting a postive integer)" 1>&2 | |
exit 1 | |
fi |
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
function is_ip() { | |
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 | |
IFS='.' | |
ip=($ip) | |
IFS=$OIFS | |
[[ ${ip[0]} -le 255 && ${ip[1]} -le 255 \ |
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
# 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配置参数调大 |
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
# 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 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 |
NewerOlder