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
d@AirBox:~/FX.tmp$ time (printf "Date Time,Try,Succ\n";awk 'BEGIN{OFS=",";SUBSEP=","} | |
$7 == 17018 {try[$1,substr($2,1,5)]++ ; D[$1,substr($2,1,5)]++} | |
$7 == 17030 {suc[$1,substr($2,1,5)]++ ; D[$1,substr($2,1,5)]++} | |
END{ | |
for (X in D) print X,try[X],suc[X] | |
}' manager.log|sort -M)|head | |
Date Time,Try,Succ | |
07/31/13,20:00,207,192 | |
07/31/13,20:01,218,215 | |
07/31/13,20:02,166,163 |
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
"Turn on line numbering | |
set number | |
"Enable syntax highlighting | |
syntax enable | |
"Start scrolling 14 lines from edge | |
set so=14 | |
" Control character highlighting. | |
"Inserts ↵ at EOL and denotes hard tabs with ⇥⇥ | |
set list listchars=tab:⇥⇥,eol:↵ | |
" Tab settings. |
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
#Notes in response to http://bit.ly/1fFMKIx (really cool blog) | |
output=$(fgrep -c CRON /var/log/messages) #grave accent notation is depreciated | |
##no reason for 2 pipes when 0 will do | |
#if you're not using regex, use fgrep | |
if [[ -n ${output} ]];then #we can avoid the `local` issue by just checking the existence | |
echo "Found ${output}..." #of output | |
#exit 0 #you can set your exit status explicitly, but not a big deal | |
else | |
echo "No instances of..." |
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
[root@proxy01 tmp]# wc -l lix.tp | |
157317 lix.tp | |
[root@proxy01 tmp]# head -5 lix.tp | |
10/25/13 20:00.01 Info Public Queue Size for A_COMP is 0 | |
10/25/13 20:00.01 Info Private Queue Size for A_COMP is 15061 | |
10/25/13 20:00.01 Warning Combined Threadpool size for A_COMP has exceeded 10000 | |
10/25/13 20:00.01 Info Public Queue Size for PRO-POOL is 0 | |
10/25/13 20:00.01 Info Private Queue Size for PRO-POOL is 0 | |
[root@proxy01 tmp]# time awk '{SUBSEP=" ";OFS=",";H=substr($2,0,2);T=$(NF-2)} | |
H > 19 && H < 24 && /Info/ && T == "HELLO" && $4 == "Public" {t[$1,$2]++;HPUB[$1,$2]=$NF} |
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
[root@mgmt01 logs]# time zfgrep -vw CM manager.log.7.gz|awk --profile 'BEGIN{print "Date,Time,FX SessID,USRM SessID,Home,Asset";OFS=","};$7 == 17018{split($NF,HA,"[$_]"); A[$8] = HA[3];H[$8] = HA[4]} $7 == 17031 && $0 ~ /available/ || $0 ~ /unusable/ {dec=substr($8,14);ses=substr($8,2,12);dec_ses[$8]=ses"/"strtonum("0x"dec); print $1,$2,$8,dec_ses[$8],H[$8],A[$8];home[H[$8]]++};END{print "home,# of errors";K = asorti(home,n);for (i=1;i<=K;i++) print n[i],home[n[i]]} ' | |
Date,Time,FX SessID,USRM SessID,Home,Asset | |
12/02/13,18:44:16.636,@00223A25759201250256,00223A257592/19202646,35674934,65019706 | |
12/02/13,19:13:21.379,@001AC3FDF72C04530C7A,001AC3FDF72C/72551546,36959215,64824121 | |
12/02/13,19:38:54.079,@ECE09B07960105E4B090,ECE09B079601/98873488,43795953,65057265 | |
12/02/13,19:47:34.777,@001AC3FDF72C04530C7E,001AC3FDF72C/72551550,36959215,64824121 | |
home,# of errors | |
35674934,1 | |
36959215,2 | |
43795953,1 |
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 awk | |
function calPer(n, d) | |
{ | |
if (n == 0) { | |
return n | |
} else { | |
return substr(n / d * 100, 0, 5) | |
} | |
} |
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/awk | |
#before processing lines, check if "src" variable has been passed | |
#If so, print it out, if not just print "origin" | |
#Set the field separator to be '(' or ')' | |
BEGIN { | |
if (src) { | |
printf "%s -> ", src | |
} else { | |
printf "%s -> ", "origin" | |
} |
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/local/bin/gawk -f | |
BEGIN{max_word_count=0} | |
{ | |
i = 1 | |
while (i <= NF) { | |
word[$i]++ | |
if (word[$i] > max_word_count) { | |
max_word_count=word[$i] | |
max_word=$i | |
} |
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
BEGIN { | |
SUBSEP=" " | |
FS="," | |
while (getline < FILE ) | |
{ | |
desired_ids[$0]++ | |
} | |
} | |
{ | |
if ($3 in desired_ids) { |
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
AirBoxOmega:~ d$ pbpaste |fgrep title=|grep -i duration|awk -F"[<>]" '{print $5}'|head -23 | |
Ghosts - Sniper Wolf | |
Mekon feat 'Mad' Frankie Fraser Revenge Of The Mekon | |
Junior Murvin - Police & Thieves (HQ) | |
E-Z Rollers - Walk this Land | |
Oasis - Fuckin' in the bushes (Snatch) | |
Birdy - 1901 [Official Music Video] | |
The Cure - Close To Me | |
The Chemical Brothers - Star Guitar | |
Shinichi Osawa - Star Guitar |
OlderNewer