Skip to content

Instantly share code, notes, and snippets.

Avatar
✈️
keep working

itxx00 itxx00

✈️
keep working
View GitHub Profile
View bash-menu-select.sh
#!/bin/bash
menu_select() {
declare -a menu
local options="$@"
menu=($options)
cur=0
draw_menu() {
for i in "${menu[@]}"; do
View cla.md

1 You must agree that your name will be added to a file named AUTHORS.

View rpmversioncompare.py
#!/usr/bin/env python
import sys
import rpm
def stringToEVR(verstring):
if verstring in (None, ''):
return ('', '', '')
i = verstring.find(':')
if i == -1:
epoch = ''
else:
@itxx00
itxx00 / opentsdb.conf
Created Apr 15, 2019 — forked from kylebrandt/opentsdb.conf
OpenTSDB Configuration
View opentsdb.conf
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
@itxx00
itxx00 / get_nn_stack.sh
Last active Mar 28, 2019
get_nn_stack.sh
View get_nn_stack.sh
$ 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
View set-opentsdb-table-ttl.sh
#!/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
@itxx00
itxx00 / common.sh
Last active Apr 27, 2017
common.sh
View common.sh
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 \
@itxx00
itxx00 / gist:de5178e2566e270c4567daff62094582
Created Jun 24, 2016
network interface interrupts customize
View gist:de5178e2566e270c4567daff62094582
# 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配置参数调大
@itxx00
itxx00 / qcloud_api.sh
Last active Jun 22, 2016
qcloud_api.sh
View qcloud_api.sh
# 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(){
View falcon-named.sh
#!/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
You can’t perform that action at this time.