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
function dmesg_time() { | |
time=$1; shift; | |
date -d "1970-01-01 UTC `echo "$(date +%s)-$(cat /proc/uptime | cut -f 1 -d' ')+${time}" | bc ` seconds" | |
} | |
# usage: dmesg_time 27036930.869716 | |
# output: Tue Mar 5 19:15:28 CST 2019 |
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 | |
BUILD_NUM="" | |
if [[ ! -f buildNumber ]]; then | |
touch buildNumber | |
BUILD_NUM="b-0" | |
echo 0 > buildNumber | |
else | |
num=$(cat buildNumber | grep -E '^[0-9]+$' 2>/dev/null) |
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 | |
for score_file in `ls /proc/*/oom_score 2>/dev/null`; | |
do | |
score=$(cat $score_file 2>/dev/null); | |
if [[ x$score != 'x' ]]; then | |
if [[ $score > 100 ]]; then | |
pid=$(echo $score_file 2>/dev/null | awk -F'/' '{print $3}') | |
if [[ x$pid != 'x' ]]; 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
#!/bin/bash | |
cc=$(grep -c processor /proc/cpuinfo) | |
uptime=$(cat /proc/uptime | awk '{print $1}') | |
idletime=$(cat /proc/uptime | awk '{print $2}') | |
idle_ratio=$(echo $cc $uptime $idletime | perl -ne '{my @input = split(/\s+/, $_); my $idle = $input[2] / ($input[0] * $input[1]); print $idle, "\n";}') | |
idle_ratio=$(printf "%.04s" $idle_ratio) | |
echo -e "\t\t\t\t\t\e[1;31m开机以来空闲率:$idle_ratio\e[0m\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/sh | |
# | |
# rabbitmq-server RabbitMQ broker | |
# | |
# chkconfig: - 80 05 | |
# description: Enable AMQP service provided by RabbitMQ | |
# | |
### BEGIN INIT INFO | |
# Provides: rabbitmq-server |
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/perl -w | |
############################################################################## | |
## sendEmail | |
## Written by: Brandon Zehm <[email protected]> | |
## | |
## License: | |
## sendEmail (hereafter referred to as "program") is free software; | |
## you can redistribute it and/or modify it under the terms of the GNU General | |
## Public License as published by the Free Software Foundation; either version | |
## 2 of the License, or (at your option) any later version. |
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://github.com/square/kochiku |
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://metacpan.org/favorite/leaderboard | |
https://github.com/reyjrar/es-utils | |
https://github.com/jprante/Elasticsearch-Dancer-App | |
Log::Dispatch::Message::Passing | |
Elasticsearch | |
App::ElasticSearch::Utilitie |
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
rvm --create use ruby-1.9.3@pisa-op |
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
sub is_robot { | |
my ($agent) = @_; | |
return 1 if is_site_robot($agent); | |
return 1 if is_program_robot($agent); | |
return; | |
} | |
sub is_site_robot { |
NewerOlder