Skip to content

Instantly share code, notes, and snippets.

View itxx00's full-sized avatar
✈️
keep working

itxx00 itxx00

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

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

#!/usr/bin/env python
import sys
a_newer = 1
b_newer = -1
a_eq_b = 0
def stringToEVR(verstring):
if verstring in (None, ''):
return ('', '', '')
@itxx00
itxx00 / opentsdb.conf
Created April 15, 2019 08:54 — forked from kylebrandt/opentsdb.conf
OpenTSDB Configuration
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 March 28, 2019 09:54
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
#!/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 April 27, 2017 11:52
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 June 24, 2016 03:14
network interface interrupts customize
# 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 June 22, 2016 06:54
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(){
#!/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