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
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
namespace myApp | |
{ | |
class Program | |
{ | |
static void Main() | |
{ |
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
find . -type f -printf "%p %s\n" | awk '{if(max<$2){max=$2;fn=$1}}END{print max,fn}' |
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
grep -E "^Nov 2.? " Web*/maillog | \ | |
awk -F: '{gsub(" ","-",$2);print $1,$2}' | \ | |
sort | \ | |
uniq -c | \ | |
awk '{printf("%s %s %10d\n",$2,$3,$1)}' | \ | |
sort -k 1,1 -k 2 | |
# maillogの日付フォーマット | |
# Nov 21 10:59:54 | |
# 入力データ |
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
$ grep -E "^Oct 2.? " Web*/messages | | |
grep "kernel: net.module/1 | | |
memory alloc failed | | |
drivers/common/payload2/payload2.c:165" | | |
awk -F: '{gsub(" ","-",$2);print $1,$2}' | | |
sort | | |
uniq -c | | |
awk '{printf("%s %s %10d\n",$2,$3,$1)}' | | |
sort -k 1,1 -k 2 |
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
$ grep -E "Server " Web*/messages | \ | |
grep "Oct 27" | \ | |
awk -F'[\\\[|\\\]]' '{print $2}' | \ | |
sort | uniq -c | |
# 4 1172 | |
# 1 1187 | |
# 2 1247 | |
# 8 1480 | |
# 4 1553 |
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 | |
Logfile="Web03/messages" | |
Array=( | |
vmpd | |
payload2 | |
dhclient | |
rsyslogd | |
ds_agent | |
kernel | |
ntpd |
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
grep -E "memory alloc failed " messages | | |
awk '{print $1"-"$2"-"substr($3,1,2)}' | | |
sort | | |
uniq -c | | |
awk '{printf("%s %8d\n",$2,$1)}' | |
# Oct-27-09 6302 | |
# Oct-27-10 7891 |
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
$ sar -f sa10 -r | awk '/^[0-9]/{printf("%s %4.1f\%\n",substr($1,1,5),($3-$6+$7)/8178748*100)}' | |
03:10 92.2 | |
03:20 91.9 | |
03:30 91.9 | |
03:40 91.8 | |
03:50 92.4 |
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
運用に影響あると困るので、niceコマンドを使う。 | |
プログラムを実行する優先度(nice値)を -20(優先度高い)〜19(低い)。デフォルトの優先度は、0。 | |
ログに出力するようにしつつshellにくるんで実行する | |
-- | |
#!/bin/sh | |
rsync -avr kudan.eu:/srv/public_http/kudan.eu/public/wp2015 ~/kudan_nssx > ~/hoge.log | |
-- | |
$ nice -n 10 sh hoge.sh & |
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
find . -type d -empty -exec ls -ld {} \; |
NewerOlder