Author Archives: cowman.chiang

Splunk 取得License使用量

假設是要取得目前使用量 index=internal source=*metrics.log group=per_index_thruput NOT (series=* OR series=*summary) starttime=02/07/2013:00:00:00 | timechart span=1d sum(eval(kb/1024)) AS “MB indexed” by series 基本上就是限制starttime的起始為當日的00:00:00 (starttime format為 %m/%d/%Y:%H:%M:%S) 如果是要取得最近幾天的License Usage index=_internal source=*license_usage.log type=RolloverSummary earliest=-7d | eval GB = b/1024/1024/1024 | eval _time = _time – 43200 … Continue reading

Posted in Splunk | Leave a comment

Ping 前面加上時間戳記

其實寫程式或是架Smokeping就好了,不過就是懶… 以下是網路上搜尋到的寫法 (來源) Dim args, flag, unsuccOut args=”” otherout=”” flag=0 If WScript.Arguments.count = 0 Then WScript.Echo “Usage: cscript tping.vbs [-t] [-a] [-n count] [-l size] [-f] [-i TTL] [-v TOS]” WScript.Echo ” [-s count] [[-j host-list] | [-k host-list]]” WScript.Echo … Continue reading

Posted in Windows | Leave a comment

PowerPoint巨集,將物件移到最前面

查詢物件名稱 Sub Who_AM_I() With ActiveWindow.Selection.ShapeRange(1) MsgBox .Name End With End Sub 將物件移到最前面 Sub Bringtofront() ActivePresentation.Slides(第幾張投影片).Shapes(“物件名稱”).ZOrder msoBringToFront End Sub

Posted in Office, PowerPoint | Leave a comment

MySQL Process

秀出 Process list show processlist 刪除 PID kill 秀出目前版本 SELECT VERSION()G

Posted in MySQL | Leave a comment

Splunk Mail2000 Log Source Type

vim /opt/splunk/etc/system/local/props.conf [mail2000_access] NO_BINARY_CHECK = 1 pulldown_type = 1 [mail2000_imap] NO_BINARY_CHECK = 1 pulldown_type = 1 [mail2000_imss] NO_BINARY_CHECK = 1 pulldown_type = 1 [mail2000_login] NO_BINARY_CHECK = 1 pulldown_type = 1 [mail2000_mailer] NO_BINARY_CHECK = 1 pulldown_type = 1 [mail2000_pop3] NO_BINARY_CHECK = … Continue reading

Posted in Linux, Splunk | 1 Comment

Linux 自動設定 +1 天的日期

Linux 自動設定 +1 天的日期 date $(date -d’1 day’ +”%m%d%H%M%Y”)

Posted in Linux | Leave a comment

split 切割檔案

使用方法: split [OPTION] [INPUT [PREFIX]] -a, –suffix-length=N use suffixes of length N (default 2) -b, –bytes=SIZE put SIZE bytes per output file -C, –line-bytes=SIZE put at most SIZE bytes of lines per output file -d, –numeric-suffixes use numeric suffixes instead … Continue reading

Posted in Linux | Leave a comment

[Splunk] 修改Google MAP模組圖示的Height值

vim /opt/splunk/etc/apps/maps/default/data/ui/views/maps.xml 搜尋 ( 在module name=”GoogleMaps” 階層內) 預設值為 500px 可以視需要修改

Posted in Linux, Splunk | Leave a comment

[筆記] rsync

rsync的密碼檔權限必須是 600…… 因為這一個miss….一個同步卡了一個多月都沒成功XD

Posted in Linux | Leave a comment

搜尋內文

為了要尋找Redmine的語系檔案…爬了一下網路 除了老妖怪說的locate尋找檔名(必須先updatedb)外 尚可以使用grep進行 grep -Rs ‘搜尋文字’ -R => 搜尋路經包含子目錄 -s => 遇到錯誤、檔案不存在時不秀出資訊

Posted in Linux | Leave a comment