Categories
- FFMpeg (5)
- Libav (1)
 
 - Google (3)
 - iBeacon (1)
 - LDAP (3)
 - Me (2)
 - Network (11)
 - OS (149)
 - RTMP (4)
 - SIP (1)
- Kamailio (1)
 
 - SNMP (1)
 - VMware (20)
- VCP考試 (1)
 
 - 伺服器 網站服務 (105)
 - 名詞解釋 (4)
 - 專案管理 (1)
 - 工具軟體 (51)
- Adobe (1)
	
- FMS (1)
 
 - Cloudera (1)
 - Docker (1)
 - Eclipse (4)
 - Intellij (2)
 - OBS (2)
 - Office (10)
	
- Excel (4)
 - PowerPoint (5)
 
 - Postman (2)
 - Splunk (13)
 - Virtualbox (2)
 - Visual Studio (2)
 - 文字編輯器 (10)
	
- Sublime Text 2 (6)
 - Sublime Text 3 (3)
 - Vim (3)
 
 - 連線工具 (1)
	
- Xshell (1)
 
 
 - Adobe (1)
	
 - 程式語言 (81)
- CSS (2)
 - HTML (2)
 - iOS (1)
 - Java (31)
 - JavaScript (5)
 - jQuery (4)
	
- jsTree (2)
 
 - JSP (3)
 - PHP (16)
 - Python (8)
 - Ruby (1)
 - sed (1)
 - Shell Script (8)
 - Windows Bash Script (1)
 - XML (1)
 
 - 資料庫 (38)
 
- FFMpeg (5)
 
Category Archives: OS
Windows 創建當天目錄
if not exist %date:~0,4%-%date:~5,2%-%date:~8,2% (md %date:~0,4%-%date:~5,2%-%date:~8,2%) 假設目錄不存在,則創建目錄 目錄名稱 西元年-月-日 (Ex. 2013-06-18) :~0,4 ==> 類似substr的功用
									
						Posted in Windows					
					
				
				
				Leave a comment
							
		不足位數,補0
常常在使用shell script會用到日期檔名 而這時候通常月份、日期都是兩位數的顯示方式 例如2013/6/4就必須要變成”20130604″ 這時候就可以使用awk來輔助 str=`echo $i|awk ‘{printf “%02d”, $1}’` echo $str; 註:awk後面有空格唷
									
						Posted in Linux					
					
				
				
				Leave a comment
							
		檢查硬碟使用率
# 當發現硬碟使用率大於80%時,通知維護人員 if [ `/bin/df -h | awk ‘NR==4 {print $5}’ | sed ‘s/%//’` -ge 80 ] then ( echo To: cowman.chiang@udngroup.com echo From: Splunk@udnlap01 echo Subject: Splunk Server disk usage > 80% echo ) | /usr/sbin/sendmail -t fi 原本df輸出如下 … Continue reading
SCP一次傳送多個檔案
因為我很懶…. 叫我一次一次輸入帳密= =” #!/bin/bash pass=”{PASS}” export pass for num in $(seq 21 29) do #upload export num expect -c ‘ spawn sudo scp -rv /webmail/log_archive/2013_05/mailerd_2nd.log.1305$env(num)_m2 {USER}@{IP_Address}:/tmp/ expect -re “password:” exp_send — “$env(pass)r” interact ‘ expect -c ‘ spawn sudo scp … Continue reading
									
						Posted in Linux					
					
				
				
				Leave a comment
							
		快速插入 Vim
在編輯script文件的時候 常常會需要用”#”去註解暫時不需要的程式碼 這時候就可以 1. “ctrl+v” 選擇區塊 2. “大寫I” 3. “插入的符號#” 4. “ESC” 如果要把把#刪除掉 這時候可以 1. “ctrl+v” 選擇區塊 2. “小寫s” 3. “ESC” 就ok了~~快很多吧!
									
						Posted in Linux					
					
				
				
				Leave a comment
							
		mail in Cron…..error
之前在處理告警信件都是用一個process一直run、一直run 而這次在處理splunk的時候是每天早上6:00run一次就好,原本想沿用之前的方法 mail -s “Mail Subject” “Mail Recipient” < "Mail Body text file" 在shell下直接測試的時候都沒問題...但是使用cron跑的時候卻會一直收到夾帶檔案"noname"的信件 ( 沒有信件內容 ) 網路上查了一下,發現不少人都有一樣的問題 後來參考了stackoverflow這一篇的說明 將mail改用sendmail取代 ( echo To: Mail Recipient echo From: Mail Sender echo Subject: Mail Subject echo cat Mail Body text file ) … Continue reading
									
						Posted in Linux					
					
				
				
				Leave a comment
							
		Shell script 數學邏輯符號
shell script 不能使用 >、<…. 方式請參考下面 = 等於 -eq = 大於等於 -ge 大於 -gt <= 小於等於 -le < 小於 -lt ≠ 不等於 -ne 迴圈次數 + 1 用 expr 指令去計算 (符合sh結構) i=`expr $i + 1` Source: http://www.ubuntu-tw.org/modules/newbb/viewtopic.php?post_id=63593
									
						Posted in Linux					
					
				
				
				Leave a comment
							
		計算檔案數量
Source: http://phorum.study-area.org/index.php/topic,10994.0.html 第一種: 如果只要一般的檔案, 可以用: find . -type f -print | wc -l 如果是要不含目錄的檔案 (含 b, c 之類), 可以用: find . ! -type d -print | wc -l 第二種: 如果單純 “只” 針對普通檔: ls -lR /path/to/dir | grep ‘^-‘ | wc … Continue reading
									
						Posted in Linux					
					
				
				
				Leave a comment
							
		FTP Download Script
< pre lang=”bash”> !/bin/sh 程式說明:每日將 Mail Log 匯入 Splunk 之 Script 版本時間:2013/05/30 10:40 開發維護:cowman.chiang@udngroup.com 檢查檔案是否存在,存在則移除檔案 避免ftp下載時無法覆蓋檔案以致無法取得新版檔案 function checkfile(){ if test -f “${local_dir}/${1}” then echo “File ${1} exist, remove!” rm “${local_dir}/${1}” else echo “File ${1} not exist” a=1 fi } 設定 … Continue reading
									
						Posted in Linux, Splunk					
					
				
				
				Leave a comment