今天一直在try jw player的caption的功能
後來發現改6版後這個功能好像還沒好
又查到html 5
才知道html 5 video這個tag現在已經支援 track的功能了
語法如下
<video id="mainvideo" controls autoplay loop>
<source src="a.mp4">
<track src="a.vtt" srclang="en" label="English" kind="caption" default>
</track>
</video>
vtt的格式如下
WEBVTT
00:00:10.000 --> 00:00:12.500
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
00:00:13.200 --> 00:00:16.900
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb.
方便
2013/04/17
今天在找能方便stream video或 audio的方法
找到以下這個軟体,看來相當方便
http://www.subsonic.org/pages/index.jsp
各平台都有
教學如下
http://santakcool.pixnet.net/blog/post/34611263-subsonic%E9%9B%B2%E7%AB%AF%E9%9F%B3%E6%A8%82%E4%BC%BA%E6%9C%8D%E5%99%A8
以下是解決30天試用的方法
https://gist.github.com/andycandet/1611509
windows的host在 windows/system32/drive/etc下
原生不支援rm 以下是解決方法
http://howto.kouwua.net/2012/03/how-to-make-subsonic-support-rm-and.html
外掛字幕還沒找到方法處理
找到以下這個軟体,看來相當方便
http://www.subsonic.org/pages/index.jsp
各平台都有
教學如下
http://santakcool.pixnet.net/blog/post/34611263-subsonic%E9%9B%B2%E7%AB%AF%E9%9F%B3%E6%A8%82%E4%BC%BA%E6%9C%8D%E5%99%A8
以下是解決30天試用的方法
https://gist.github.com/andycandet/1611509
windows的host在 windows/system32/drive/etc下
原生不支援rm 以下是解決方法
http://howto.kouwua.net/2012/03/how-to-make-subsonic-support-rm-and.html
外掛字幕還沒找到方法處理
2013/04/09
2013/04/08
2013/04/03
2013/04/01
qm shutdown windows時會出現無法shutdown的問題
必須修改windows 的設定
必須修改windows 的設定
- Start / Run / gpedit.msc
- Drill into Computer Configuration / Windows Settings / Security Settings / Local Policies / Security Options. Find the entry named "Shutdown: Allow system to be shut down without having to log on". Double click on it, change it to "Enabled".
- Drill into Computer Configuration / Administrative Templates / System. Find the entry named "Display Shutdown Event Tracker". Double click on it, change it to "Disabled".
linux則需安裝acpid
2013/03/31
2013/03/30
以下這個範例是每五秒鐘reload一次iframe 而不重load整個頁面的方法
<iframe id="frame1" width="640" height="360" src="http://www.youtube.com/embed/8TeeJvcBdLA?rel=0&autoplay=1" frameborder="0" allowfullscreen></iframe>
<script type="text/javascript">
function refreshiframe()
{
parent.frame1.location.href="http://www.youtube.com/embed/8TeeJvcBdLA?rel=0&autoplay=1"
setTimeout("refreshiframe()",5000);
}
</script>
<body onload="refreshiframe();">
2013/03/28
應該是有一顆ap壞了
要更換之前新ap設定如下
1. 準備一條SOE線, 並連好PC RS232 與 AP EtherNet PORT
2. 超級終端機 設定為9600,N,8,1
3.插入AP 電源後, 連按ENTER鍵 以進入 apboot mode
4. 設定指令如下:
print \\先看現有設定
setenv name AP-XXX \\設定AP名稱
setenv group aruba-group \\設定群組
setenv master x.x.x.x \\設定Conterller IP
setenv serverip x.x.x.x \\設定Conterller IP
setenv ipaddr x.x.x.x \\設定AP IP
setenv netmask 255.255.255.x \\ 設定AP netmask
setenv gatewayip x.x.x.x \\ 設定AP Gateway
save
5. 若是想設成DHCP則是 不加參數
setenv ipaddr
setenv netmask
setenv gatewayip
http://blog.jpps.tc.edu.tw/lifetype/post/2/1812
後記
早上花了一個早上的時間測試
switch的灯號有亮
但就是沒有poe的供電
最後使用dsp 4300測試後發現線路是fail
懷疑是outlet壞了
換一顆後目前正常
觀察中
要更換之前新ap設定如下
1. 準備一條SOE線, 並連好PC RS232 與 AP EtherNet PORT
2. 超級終端機 設定為9600,N,8,1
3.插入AP 電源後, 連按ENTER鍵 以進入 apboot mode
4. 設定指令如下:
print \\先看現有設定
setenv name AP-XXX \\設定AP名稱
setenv group aruba-group \\設定群組
setenv master x.x.x.x \\設定Conterller IP
setenv serverip x.x.x.x \\設定Conterller IP
setenv ipaddr x.x.x.x \\設定AP IP
setenv netmask 255.255.255.x \\ 設定AP netmask
setenv gatewayip x.x.x.x \\ 設定AP Gateway
save
5. 若是想設成DHCP則是 不加參數
setenv ipaddr
setenv netmask
setenv gatewayip
http://blog.jpps.tc.edu.tw/lifetype/post/2/1812
後記
早上花了一個早上的時間測試
switch的灯號有亮
但就是沒有poe的供電
最後使用dsp 4300測試後發現線路是fail
懷疑是outlet壞了
換一顆後目前正常
觀察中
2013/03/27
一直有user抱怨連不上ap
怪的是同一個ap上其他的机器連線都沒問題
查看了一下controller
發現這些机器的retry都很高
找了半天有沒有可以在client顯示連線狀態的工具
最後發現直接使用wireshark可能比較快
filter使用的參數如下連結
http://www.wireshark.org/docs/dfref/w/wlan.html
問題是retry太高到底是網卡有問題還是driver要更新
也有人建議把nb的blue tooth關掉會好一點
反正目前看起來最大的可能性就是aruba跟某些廠牌的網卡就是不合
XD
怪的是同一個ap上其他的机器連線都沒問題
查看了一下controller
發現這些机器的retry都很高
找了半天有沒有可以在client顯示連線狀態的工具
最後發現直接使用wireshark可能比較快
filter使用的參數如下連結
http://www.wireshark.org/docs/dfref/w/wlan.html
問題是retry太高到底是網卡有問題還是driver要更新
也有人建議把nb的blue tooth關掉會好一點
反正目前看起來最大的可能性就是aruba跟某些廠牌的網卡就是不合
XD
2013/03/25
2013/03/23
2013/03/21
如何處理office365密碼複雜度的方法如下
首先,修改密碼的 PowerShell 命令為:
Set-MsolUserPassword -UserPrincipalName test@miniasp.com -NewPassword SimplePW123
但若密碼太過簡單,就會出現以下錯誤訊息:
Set-MsolUserPassword : You must choose a strong password that contains 9 to 16 characters, a combination of letters, and at least one number or symbol. Choose another password and try again.
如果要暫時解除使用者的密碼複雜度要求,可以執行以下 PowerShell 命令完成:
Set-MsolUser -UserPrincipalName test@miniasp.com -StrongPasswordRequired $False
而當我設定密碼後,會再將此設定調回來,確保使用者自行密碼重設時,可以設定一組夠強的密碼。
Set-MsolUser -UserPrincipalName test@miniasp.com -StrongPasswordRequired $True
重整一下需求:
客戶提供帳號清單,包含預設密碼
建立帳號時,須設定使用者可用預設密碼登入
使用者首次登入必須被要求變更預設密碼
使用者變更密碼時必須強迫套用 Office 365 預設的密碼複雜度要求
最後,完成一位使用者的 PowerShell 指令碼如下:
Set-MsolUser -UserPrincipalName a@a.com -StrongPasswordRequired $False
Set-MsolUserPassword -UserPrincipalName a@a.com -NewPassword 123 -ForceChangePassword $True
Set-MsolUser -UserPrincipalName a@a.com -StrongPasswordRequired $True
http://blog.miniasp.com/post/2013/03/20/Office-365-Administration-How-to-turn-off-user-password-complexity-requirement.aspx
2013/03/20
2013/03/18
某個廠商為了要解決process一直當掉的問題而要使用
http://fsl.sytes.net/watchdog.html
但是這個送到vt有11家認為有問題
送回avira的回應也是malware
我也不想設為排外
天知道有沒有問題
找到了以下的解決方案
http://www.knas.se/Applications/Restarter/Download.aspx
叫那個廠商試看看
http://fsl.sytes.net/watchdog.html
但是這個送到vt有11家認為有問題
送回avira的回應也是malware
我也不想設為排外
天知道有沒有問題
找到了以下的解決方案
http://www.knas.se/Applications/Restarter/Download.aspx
叫那個廠商試看看
2013/03/16
2013/03/14
2013/02/19
2013/02/18
2013/02/12
這段時間一直發生某些guest network down的問題
os本身還活著,但network就是down
從os看network沒有什麼問題,但就是不會通
一定要關机再開机才能恢復正常
重開机是沒有用的
感覺上好像是host os 上bridge的nic不知怎麼的而出問題
guest必須要關机再開机才能再取到一個新的bridge nic
linux win 都有發生
使用的都是rtl 8139
linux改用 intel e1000後目前看來是正常
但為什麼不是所有的guest都會發生?
上forum看了一下 好像也有人有這個問題
解決的方法都是改用e1000或是virtio
看來也只能先這樣處理了
2013/02/11
2013/01/31
2013/01/18
2013/01/17
昨天參加研討會才知道windows server 2012已經內建dedupe的功能
設定方式如下連結
http://www.dotblogs.com.tw/swater111/archive/2012/10/25/78905.aspx
opensource的解決方案
http://opendedup.org/
設定方式如下連結
http://www.dotblogs.com.tw/swater111/archive/2012/10/25/78905.aspx
opensource的解決方案
http://opendedup.org/
2013/01/15
之前本來是一直用awstats來分析maillog
但好久沒去看了
因為今天看maillog有異常
要去看的時候發現完全沒有資料
手動執行也沒有資料
找了一下資料
發現mailmgr設定簡單方便
以後就用這個了
安裝設定如下
1.下載 mailmgr-1.2.3.tar.tar
2.解壓所 tar zxvf mailmgr-1.2.3.tar.tar
3. 切換到解壓所出來的目錄
4. 執行 ./configure
5. 執行 make
要使用的檔案只有二個
mailmgr
/usr/local/etc/mailmgr.conf(這個一定要放在這個目錄下 否則就用ln)
設定
vi /usr/local/etc/mailmgr.conf
logfile /var/log/maillog # maillog檔所在
temporary_dir /tmp # 暫存檔
output_dir /var/www/html/mailmgr # 網頁輸出目錄
local-host-names /etc/mail/local-host-names # local-host-names
lastlog 0 # lastlog 預設值
overwrite_report no # 是否覆蓋舊的檔案
email_domain x.x.x.x# 設定mail domain
use_sendmail_cw yes # 是否使用sendmail
# TAG: title "text"
# Reports title.
#
title "MS70 MAILMGR - Sendmail Manager" # 設定輸出網頁的title
3. 建立html輸出目錄:mkdir /var/www/html/mailmgr
chmod 755 /var/www/html/mailmgr
記得目錄要加密碼才能開 應該不能讓所有人看到
4. 加入排程
crontab -e
*/10 * * * * mailmgr
每10分鐘由執行mailmgr程式
http://tw.myblog.yahoo.com/user-ji32k71j4xji4ek6/article?mid=3132&next=3079&l=f&fid=31
一直出現 Segmentation fault 先暫停了 再找原因
但好久沒去看了
因為今天看maillog有異常
要去看的時候發現完全沒有資料
手動執行也沒有資料
找了一下資料
發現mailmgr設定簡單方便
以後就用這個了
安裝設定如下
1.下載 mailmgr-1.2.3.tar.tar
2.解壓所 tar zxvf mailmgr-1.2.3.tar.tar
3. 切換到解壓所出來的目錄
4. 執行 ./configure
5. 執行 make
要使用的檔案只有二個
mailmgr
/usr/local/etc/mailmgr.conf(這個一定要放在這個目錄下 否則就用ln)
設定
vi /usr/local/etc/mailmgr.conf
logfile /var/log/maillog # maillog檔所在
temporary_dir /tmp # 暫存檔
output_dir /var/www/html/mailmgr # 網頁輸出目錄
local-host-names /etc/mail/local-host-names # local-host-names
lastlog 0 # lastlog 預設值
overwrite_report no # 是否覆蓋舊的檔案
email_domain x.x.x.x# 設定mail domain
use_sendmail_cw yes # 是否使用sendmail
# TAG: title "text"
# Reports title.
#
title "MS70 MAILMGR - Sendmail Manager" # 設定輸出網頁的title
3. 建立html輸出目錄:mkdir /var/www/html/mailmgr
chmod 755 /var/www/html/mailmgr
記得目錄要加密碼才能開 應該不能讓所有人看到
4. 加入排程
crontab -e
*/10 * * * * mailmgr
每10分鐘由執行mailmgr程式
一直出現 Segmentation fault 先暫停了 再找原因
2013/01/10
在base的報表上還是會一直出現以下圖的畫面 無法解到sid的名字
一直都是使用snort提供的 sid-msg.map 還是有這個問題
原來是snort的rule update並不會去update sid-msg.map這個檔
所以只好手動了
onikmaster 提供了 create-sidmap.pl 這個程式 下載直接解壓就可以用了
用法如下
create-sidmap.pl /etc/snort/rule/rules > /tmp/sid-msg.map
2013/01/09
免工具
直接在chrome上輸入
chrome://net-internals/
就可以捉封包了
http://blog.longwin.com.tw/2010/11/browser-chrome-sniffer-2010/
直接在chrome上輸入
chrome://net-internals/
就可以捉封包了
http://blog.longwin.com.tw/2010/11/browser-chrome-sniffer-2010/
2013/01/07
2013/01/05
原來放在adsl用來測試用的xp 壞了
一直在重開机
由於還有另一台也是放在adsl當proxy用
打算只用一台來取代
拿了一台來灌ubuntu 12.04 desktop
順便把squid也起在上面
然後裝virtual box跑win7
這樣在非ie不可的測試環境才不會有問題
在之前的proxy並沒有做認証
因此想在這次的移机順便加上ldap認証
找了一下相關資料
發現還不困難
在squid.conf中加上以下的資料
重啟就ok了
auth_param basic program /usr/lib/squid3/squid_ldap_auth -b "dc=yourcompany,dc=com"
-D "uid=some-user,ou=People,dc=yourcompany,dc=com" -w "password" -f uid=%s -h ldapserver
###squid_ldap_auth基本設定######################
auth_param basic children 5 #認證程式數量
auth_param basic realm Web-Proxy #Authentication realm
auth_param basic credentialsttl 1 minute #Authentication cache time
###讓Proxy使用LDAP認証######################
acl ldap-auth proxy_auth REQUIRED
http_access allow ldap-auth
http://tw.myblog.yahoo.com/vcd025/article?mid=525
如果要測試參數有沒有問題
可以直接執行
/usr/lib/squid3/squid_ldap_auth -b "dc=yourcompany,dc=com"
-D "uid=some-user,ou=People,dc=yourcompany,dc=com" -w "password" -f uid=%s -h ldapserver
游標會在下一行閃
此時輸入
username passwd
如果出現ok
就表示成功了
順便提一下
在squid2.x的版本中設定
cache_dir null /tmp是不使用cache
可是在3.x的版本這個參數已經不能用了
必須使用
cache deny all
來達成
一直在重開机
由於還有另一台也是放在adsl當proxy用
打算只用一台來取代
拿了一台來灌ubuntu 12.04 desktop
順便把squid也起在上面
然後裝virtual box跑win7
這樣在非ie不可的測試環境才不會有問題
在之前的proxy並沒有做認証
因此想在這次的移机順便加上ldap認証
找了一下相關資料
發現還不困難
在squid.conf中加上以下的資料
重啟就ok了
auth_param basic program /usr/lib/squid3/squid_ldap_auth -b "dc=yourcompany,dc=com"
-D "uid=some-user,ou=People,dc=yourcompany,dc=com" -w "password" -f uid=%s -h ldapserver
###squid_ldap_auth基本設定######################
auth_param basic children 5 #認證程式數量
auth_param basic realm Web-Proxy #Authentication realm
auth_param basic credentialsttl 1 minute #Authentication cache time
###讓Proxy使用LDAP認証######################
acl ldap-auth proxy_auth REQUIRED
http_access allow ldap-auth
http://tw.myblog.yahoo.com/vcd025/article?mid=525
如果要測試參數有沒有問題
可以直接執行
/usr/lib/squid3/squid_ldap_auth -b "dc=yourcompany,dc=com"
-D "uid=some-user,ou=People,dc=yourcompany,dc=com" -w "password" -f uid=%s -h ldapserver
游標會在下一行閃
此時輸入
username passwd
如果出現ok
就表示成功了
順便提一下
在squid2.x的版本中設定
cache_dir null /tmp是不使用cache
可是在3.x的版本這個參數已經不能用了
必須使用
cache deny all
來達成
2013/01/04
今天在ubuntu 12.04中使用lftp時出現
Certificate verification: Not trusted 的錯誤
找了一下資料
必須在user的home目錄下設定
~/.lftp/rc
set ssl:verify-certificate no
http://anils-tips.blogspot.tw/2011/05/lftp-fatal-error-certificate.html
Certificate verification: Not trusted 的錯誤
找了一下資料
必須在user的home目錄下設定
~/.lftp/rc
set ssl:verify-certificate no
http://anils-tips.blogspot.tw/2011/05/lftp-fatal-error-certificate.html
2012/12/25
2012/12/23
2012/12/22
2012/12/21
2012/12/20
今年長官有提到要買firewall的需求
找了一下封包產生的軟体預計拿來測throuthput
1. packet builder
http://www.colasoft.com/download/products/download_packet_builder.php
2. iperf
http://35g.tw/blog/2009/08/17/%E7%B6%B2%E8%B7%AF%E6%95%88%E8%83%BD%E6%B8%AC%E8%A9%A6%E5%B7%A5%E5%85%B7-iperf/
iperf的圖形版
http://code.google.com/p/xjperf/
目前看來iperf簡單易用
iperf –c 1.1.1.1 –w 100M –t 120 –i 10
主要是改變w的值
通常在小的值的表現會比較不好
而大的值表現會比較好
但都會有一個極限
如下圖
找了一下封包產生的軟体預計拿來測throuthput
1. packet builder
http://www.colasoft.com/download/products/download_packet_builder.php
2. iperf
http://35g.tw/blog/2009/08/17/%E7%B6%B2%E8%B7%AF%E6%95%88%E8%83%BD%E6%B8%AC%E8%A9%A6%E5%B7%A5%E5%85%B7-iperf/
iperf的圖形版
http://code.google.com/p/xjperf/
目前看來iperf簡單易用
iperf –c 1.1.1.1 –w 100M –t 120 –i 10
主要是改變w的值
通常在小的值的表現會比較不好
而大的值表現會比較好
但都會有一個極限
如下圖
2012/12/16
2012/12/13
2012/12/11
今天在找如何快速清除snort database的資料
相當方便 只要改天數就好了
DELETE FROM event WHERE timestamp < DATE_SUB(NOW(),INTERVAL 200 DAY);
DELETE FROM data USING data LEFT OUTER JOIN event USING (sid,cid) WHERE event.sid IS NULL;
DELETE FROM iphdr USING iphdr LEFT OUTER JOIN event USING (sid,cid) WHERE event.sid IS NULL;
DELETE FROM icmphdr USING icmphdr LEFT OUTER JOIN event USING (sid,cid) WHERE event.sid IS NULL;
DELETE FROM tcphdr USING tcphdr LEFT OUTER JOIN event USING (sid,cid) WHERE event.sid IS NULL;
DELETE FROM udphdr USING udphdr LEFT OUTER JOIN event USING (sid,cid) WHERE event.sid IS NULL;
DELETE FROM opt USING opt LEFT OUTER JOIN event USING (sid,cid) WHERE event.sid IS NULL;
DELETE FROM acid_event USING acid_event LEFT OUTER JOIN event USING (sid,cid) WHERE event.sid IS NULL;
DELETE FROM ag USING acid_ag_alert AS ag LEFT OUTER JOIN event AS e ON ag.ag_sid=e.sid AND ag.ag_cid=e.cid WHERE e.sid IS NULL;
OPTIMIZE TABLE event, data, iphdr, icmphdr, tcphdr, udphdr, opt, acid_event, acid_ag_alert;
http://blog.terryburton.co.uk/2007/09/deleting-old-snort-and-base-event-data.html
相當方便 只要改天數就好了
DELETE FROM event WHERE timestamp < DATE_SUB(NOW(),INTERVAL 200 DAY);
DELETE FROM data USING data LEFT OUTER JOIN event USING (sid,cid) WHERE event.sid IS NULL;
DELETE FROM iphdr USING iphdr LEFT OUTER JOIN event USING (sid,cid) WHERE event.sid IS NULL;
DELETE FROM icmphdr USING icmphdr LEFT OUTER JOIN event USING (sid,cid) WHERE event.sid IS NULL;
DELETE FROM tcphdr USING tcphdr LEFT OUTER JOIN event USING (sid,cid) WHERE event.sid IS NULL;
DELETE FROM udphdr USING udphdr LEFT OUTER JOIN event USING (sid,cid) WHERE event.sid IS NULL;
DELETE FROM opt USING opt LEFT OUTER JOIN event USING (sid,cid) WHERE event.sid IS NULL;
DELETE FROM acid_event USING acid_event LEFT OUTER JOIN event USING (sid,cid) WHERE event.sid IS NULL;
DELETE FROM ag USING acid_ag_alert AS ag LEFT OUTER JOIN event AS e ON ag.ag_sid=e.sid AND ag.ag_cid=e.cid WHERE e.sid IS NULL;
OPTIMIZE TABLE event, data, iphdr, icmphdr, tcphdr, udphdr, opt, acid_event, acid_ag_alert;
http://blog.terryburton.co.uk/2007/09/deleting-old-snort-and-base-event-data.html
2012/12/10
2012/12/11後記
升到 barnyard2-1.11 後在base又出現跟之前相同的情況
看不到特徵值的名稱
改了好多東西都沒辦法
而且目前找不到相關文件
改回之前的版本就正常barnyard2-1.9
算了 先改回來
另外
snort 2.9.4-1 一定要把 $SO_RULE_PATH打開
之前的版本預設都不用開
不然事件會都無法偵測且記錄
===========================================
自從12/6升到snort 2.9.4-1的版本後
資料庫的資料就異常的少
剛好今天在snort的blog發現
barnyard2有更新版本(新官網)
看來這個blog的訊息還滿多的(已訂rss)
所以來升級一下看看狀況會不會改善
先備份 /usr/bin/barnyard2及 /etc/barnyard2/barnyard2.conf
升級步驟如下
解壓source後進到目錄
autogen.sh
./configure --bindir=/usr/bin --sysconfdir=/etc/barnyard2 --with-mysql
make && make install
再依照原本的barnyard2.conf改一下
========barnyard2.conf===============
#
# Barnyard2 example configuration file
#
#
# This file contains a sample barnyard2 configuration.
# You can take the following steps to create your own custom configuration:
#
# 1) Configure the variable declarations
# 2) Setup the input plugins
# 3) Setup the output plugins
#
#
# Step 1: configure the variable declarations
#
# in order to keep from having a commandline that uses every letter in the
# alphabet most configuration options are set here.
# use UTC for timestamps
#
#config utc
# set the appropriate paths to the file(s) your Snort process is using.
#
config reference_file: /etc/snort/rule/etc/reference.config
config classification_file: /etc/snort/rule/etc/classification.config
config gen_file: /etc/snort/rule/etc/gen-msg.map
config sid_file: /etc/snort/rule/etc/sid-msg.map
# Set the event cache size to defined max value before recycling of event occur.
#
#
#config event_cache_size: 4096
# define dedicated references similar to that of snort.
#
#config reference: mybugs http://www.mybugs.com/?s=
# define explicit classifications similar to that of snort.
#
#config classification: shortname, short description, priority
# set the directory for any output logging
#
#config logdir: /tmp
# to ensure that any plugins requiring some level of uniqueness in their output
# the alert_with_interface_name, interface and hostname directives are provided.
# An example of usage would be to configure them to the values of the associated
# snort process whose unified files you are reading.
#
# Example:
# For a snort process as follows:
# snort -i eth0 -c /etc/snort.conf
#
# Typical options would be:
# config hostname: thor
# config interface: eth0
# config alert_with_interface_name
#
#config hostname: thor
#config interface: eth0
config hostname: localhost
config interface: eth1
# enable printing of the interface name when alerting.
#
#config alert_with_interface_name
# at times snort will alert on a packet within a stream and dump that stream to
# the unified output. barnyard2 can generate output on each packet of that
# stream or the first packet only.
#
#config alert_on_each_packet_in_stream
# enable daemon mode
#
#config daemon
# make barnyard2 process chroot to directory after initialisation.
#
#config chroot: /var/spool/barnyard2
# specifiy the group or GID for barnyard2 to run as after initialisation.
#
#config set_gid: 999
# specifiy the user or UID for barnyard2 to run as after initialisation.
#
#config set_uid: 999
# specify the directory for the barnyard2 PID file.
#
#config pidpath: /var/run/by2.pid
# enable decoding of the data link (or second level headers).
#
#config decode_data_link
# dump the application data
#
#config dump_payload
# dump the application data as chars only
#
#config dump_chars_only
# enable verbose dumping of payload information in log style output plugins.
#
#config dump_payload_verbose
# enable obfuscation of logged IP addresses.
#
#config obfuscate
# enable the year being shown in timestamps
#
#config show_year
# set the umask for all files created by the barnyard2 process (eg. log files).
#
#config umask: 066
# enable verbose logging
#
#config verbose
# quiet down some of the output
#
#config quiet
# define the full waldo filepath.
#
#config waldo_file: /tmp/waldo
# specificy the maximum length of the MPLS label chain
#
#config max_mpls_labelchain_len: 64
# specify the protocol (ie ipv4, ipv6, ethernet) that is encapsulated by MPLS.
#
#config mpls_payload_type: ipv4
# set the reference network or homenet which is predominantly used by the
# log_ascii plugin.
#
#config reference_net: 192.168.0.0/24
#
# CONTINOUS MODE
#
# set the archive directory for use with continous mode
#
#config archivedir: /tmp
# when in operating in continous mode, only process new records and ignore any
# existing unified files
#
#config process_new_records_only
#
# Step 2: setup the input plugins
#
# this is not hard, only unified2 is supported ;)
input unified2
#
# Step 3: setup the output plugins
#
# alert_cef
# ----------------------------------------------------------------------------
#
# Purpose:
# This output module provides the abilty to output alert information to a
# remote network host as well as the local host using the open standard
# Common Event Format (CEF).
#
# Arguments: host=hostname[:port], severity facility
# arguments should be comma delimited.
# host - specify a remote hostname or IP with optional port number
# this is only specific to WIN32 (and is not yet fully supported)
# severity - as defined in RFC 3164 (eg. LOG_WARN, LOG_INFO)
# facility - as defined in RFC 3164 (eg. LOG_AUTH, LOG_LOCAL0)
#
# Examples:
# output alert_cef
# output alert_cef: host=192.168.10.1
# output alert_cef: host=sysserver.com:1001
# output alert_cef: LOG_AUTH LOG_INFO
#
# alert_bro
# ----------------------------------------------------------------------------
#
# Purpose: Send alerts to a Bro-IDS instance.
#
# Arguments: hostname:port
#
# Examples:
# output alert_bro: 127.0.0.1:47757
# alert_fast
# ----------------------------------------------------------------------------
# Purpose: Converts data to an approximation of Snort's "fast alert" mode.
#
# Arguments: file <file>, stdout
# arguments should be comma delimited.
# file - specifiy alert file
# stdout - no alert file, just print to screen
#
# Examples:
# output alert_fast
# output alert_fast: stdout
#
output alert_fast: stdout
# prelude: log to the Prelude Hybrid IDS system
# ----------------------------------------------------------------------------
#
# Purpose:
# This output module provides logging to the Prelude Hybrid IDS system
#
# Arguments: profile=snort-profile
# snort-profile - name of the Prelude profile to use (default is snort).
#
# Snort priority to IDMEF severity mappings:
# high < medium < low < info
#
# These are the default mapped from classification.config:
# info = 4
# low = 3
# medium = 2
# high = anything below medium
#
# Examples:
# output alert_prelude
# output alert_prelude: profile=snort-profile-name
#
# alert_syslog
# ----------------------------------------------------------------------------
#
# Purpose:
# This output module provides the abilty to output alert information to local syslog
#
# severity - as defined in RFC 3164 (eg. LOG_WARN, LOG_INFO)
# facility - as defined in RFC 3164 (eg. LOG_AUTH, LOG_LOCAL0)
#
# Examples:
# output alert_syslog
# output alert_syslog: LOG_AUTH LOG_INFO
#
# syslog_full
#-------------------------------
# Available as both a log and alert output plugin. Used to output data via TCP/UDP or LOCAL ie(syslog())
# Arguments:
# sensor_name $sensor_name - unique sensor name
# server $server - server the device will report to
# local - if defined, ignore all remote information and use syslog() to send message.
# protocol $protocol - protocol device will report over (tcp/udp)
# port $port - destination port device will report to (default: 514)
# delimiters $delimiters - define a character that will delimit message sections ex: "|", will use | as message section delimiters. (default: |)
# separators $separators - define field separator included in each message ex: " " , will use space as field separator. (default: [:space:])
# operation_mode $operaion_mode - default | complete : default mode is compatible with default snort syslog message, complete prints more information such as the raw packet (hexed)
# log_priority $log_priority - used by local option for syslog priority call. (man syslog(3) for supported options) (default: LOG_INFO)
# log_facility $log_facility - used by local option for syslog facility call. (man syslog(3) for supported options) (default: LOG_USER)
# Usage Examples:
# output alert_syslog_full: sensor_name snortIds1-eth2, server xxx.xxx.xxx.xxx, protocol udp, port 514, operation_mode default
# output alert_syslog_full: sensor_name snortIds1-eth2, server xxx.xxx.xxx.xxx, protocol udp, port 514, operation_mode complete
# output log_syslog_full: sensor_name snortIds1-eth2, server xxx.xxx.xxx.xxx, protocol udp, port 514, operation_mode default
# output log_syslog_full: sensor_name snortIds1-eth2, server xxx.xxx.xxx.xxx, protocol udp, port 514, operation_mode complete
# output alert_syslog_full: sensor_name snortIds1-eth2, server xxx.xxx.xxx.xxx, protocol udp, port 514
# output log_syslog_full: sensor_name snortIds1-eth2, server xxx.xxx.xxx.xxx, protocol udp, port 514
# output alert_syslog_full: sensor_name snortIds1-eth2, local
# output log_syslog_full: sensor_name snortIds1-eth2, local, log_priority LOG_CRIT,log_facility LOG_CRON
# log_ascii
# ----------------------------------------------------------------------------
#
# Purpose: This output module provides the default packet logging funtionality
#
# Arguments: None.
#
# Examples:
# output log_ascii
#
# log_tcpdump
# ----------------------------------------------------------------------------
#
# Purpose
# This output module logs packets in binary tcpdump format
#
# Arguments:
# The only argument is the output file name.
#
# Examples:
# output log_tcpdump: tcpdump.log
#
# sguil
# ----------------------------------------------------------------------------
#
# Purpose: This output module provides logging ability for the sguil interface
# See doc/README.sguil
#
# Arguments: agent_port <port>, sensor_name <name>
# arguments should be comma delimited.
# agent_port - explicitly set the sguil agent listening port
# (default: 7736)
# sensor_name - explicitly set the sensor name
# (default: machine hostname)
#
# Examples:
# output sguil
# output sguil: agent_port=7000
# output sguil: sensor_name=argyle
# output sguil: agent_port=7000, sensor_name=argyle
#
# database: log to a variety of databases
# ----------------------------------------------------------------------------
#
# Purpose: This output module provides logging ability to a variety of databases
# See doc/README.database for additional information.
#
# Examples:
# output database: log, mysql, user=root password=test dbname=db host=localhost
# output database: alert, postgresql, user=snort dbname=snort
# output database: log, odbc, user=snort dbname=snort
# output database: log, mssql, dbname=snort user=snort password=test
# output database: log, oracle, dbname=snort user=snort password=test
#
output database: alert, mysql, user=aaa password=bbb dbname=snort host=127.0.0.1
# alert_fwsam: allow blocking of IP's through remote services
# ----------------------------------------------------------------------------
# output alert_fwsam: <SnortSam Station>:<port>/<key>
#
# <FW Mgmt Station>: IP address or host name of the host running SnortSam.
# <port>: Port the remote SnortSam service listens on (default 898).
# <key>: Key used for authentication (encryption really)
# of the communication to the remote service.
#
# Examples:
#
# output alert_fwsam: snortsambox/idspassword
# output alert_fwsam: fw1.domain.tld:898/mykey
# output alert_fwsam: 192.168.0.1/borderfw 192.168.1.254/wanfw
#
#
升到 barnyard2-1.11 後在base又出現跟之前相同的情況
看不到特徵值的名稱
改了好多東西都沒辦法
而且目前找不到相關文件
改回之前的版本就正常barnyard2-1.9
算了 先改回來
另外
snort 2.9.4-1 一定要把 $SO_RULE_PATH打開
之前的版本預設都不用開
不然事件會都無法偵測且記錄
===========================================
自從12/6升到snort 2.9.4-1的版本後
資料庫的資料就異常的少
剛好今天在snort的blog發現
barnyard2有更新版本(新官網)
看來這個blog的訊息還滿多的(已訂rss)
所以來升級一下看看狀況會不會改善
先備份 /usr/bin/barnyard2及 /etc/barnyard2/barnyard2.conf
升級步驟如下
解壓source後進到目錄
autogen.sh
./configure --bindir=/usr/bin --sysconfdir=/etc/barnyard2 --with-mysql
make && make install
再依照原本的barnyard2.conf改一下
========barnyard2.conf===============
#
# Barnyard2 example configuration file
#
#
# This file contains a sample barnyard2 configuration.
# You can take the following steps to create your own custom configuration:
#
# 1) Configure the variable declarations
# 2) Setup the input plugins
# 3) Setup the output plugins
#
#
# Step 1: configure the variable declarations
#
# in order to keep from having a commandline that uses every letter in the
# alphabet most configuration options are set here.
# use UTC for timestamps
#
#config utc
# set the appropriate paths to the file(s) your Snort process is using.
#
config reference_file: /etc/snort/rule/etc/reference.config
config classification_file: /etc/snort/rule/etc/classification.config
config gen_file: /etc/snort/rule/etc/gen-msg.map
config sid_file: /etc/snort/rule/etc/sid-msg.map
# Set the event cache size to defined max value before recycling of event occur.
#
#
#config event_cache_size: 4096
# define dedicated references similar to that of snort.
#
#config reference: mybugs http://www.mybugs.com/?s=
# define explicit classifications similar to that of snort.
#
#config classification: shortname, short description, priority
# set the directory for any output logging
#
#config logdir: /tmp
# to ensure that any plugins requiring some level of uniqueness in their output
# the alert_with_interface_name, interface and hostname directives are provided.
# An example of usage would be to configure them to the values of the associated
# snort process whose unified files you are reading.
#
# Example:
# For a snort process as follows:
# snort -i eth0 -c /etc/snort.conf
#
# Typical options would be:
# config hostname: thor
# config interface: eth0
# config alert_with_interface_name
#
#config hostname: thor
#config interface: eth0
config hostname: localhost
config interface: eth1
# enable printing of the interface name when alerting.
#
#config alert_with_interface_name
# at times snort will alert on a packet within a stream and dump that stream to
# the unified output. barnyard2 can generate output on each packet of that
# stream or the first packet only.
#
#config alert_on_each_packet_in_stream
# enable daemon mode
#
#config daemon
# make barnyard2 process chroot to directory after initialisation.
#
#config chroot: /var/spool/barnyard2
# specifiy the group or GID for barnyard2 to run as after initialisation.
#
#config set_gid: 999
# specifiy the user or UID for barnyard2 to run as after initialisation.
#
#config set_uid: 999
# specify the directory for the barnyard2 PID file.
#
#config pidpath: /var/run/by2.pid
# enable decoding of the data link (or second level headers).
#
#config decode_data_link
# dump the application data
#
#config dump_payload
# dump the application data as chars only
#
#config dump_chars_only
# enable verbose dumping of payload information in log style output plugins.
#
#config dump_payload_verbose
# enable obfuscation of logged IP addresses.
#
#config obfuscate
# enable the year being shown in timestamps
#
#config show_year
# set the umask for all files created by the barnyard2 process (eg. log files).
#
#config umask: 066
# enable verbose logging
#
#config verbose
# quiet down some of the output
#
#config quiet
# define the full waldo filepath.
#
#config waldo_file: /tmp/waldo
# specificy the maximum length of the MPLS label chain
#
#config max_mpls_labelchain_len: 64
# specify the protocol (ie ipv4, ipv6, ethernet) that is encapsulated by MPLS.
#
#config mpls_payload_type: ipv4
# set the reference network or homenet which is predominantly used by the
# log_ascii plugin.
#
#config reference_net: 192.168.0.0/24
#
# CONTINOUS MODE
#
# set the archive directory for use with continous mode
#
#config archivedir: /tmp
# when in operating in continous mode, only process new records and ignore any
# existing unified files
#
#config process_new_records_only
#
# Step 2: setup the input plugins
#
# this is not hard, only unified2 is supported ;)
input unified2
#
# Step 3: setup the output plugins
#
# alert_cef
# ----------------------------------------------------------------------------
#
# Purpose:
# This output module provides the abilty to output alert information to a
# remote network host as well as the local host using the open standard
# Common Event Format (CEF).
#
# Arguments: host=hostname[:port], severity facility
# arguments should be comma delimited.
# host - specify a remote hostname or IP with optional port number
# this is only specific to WIN32 (and is not yet fully supported)
# severity - as defined in RFC 3164 (eg. LOG_WARN, LOG_INFO)
# facility - as defined in RFC 3164 (eg. LOG_AUTH, LOG_LOCAL0)
#
# Examples:
# output alert_cef
# output alert_cef: host=192.168.10.1
# output alert_cef: host=sysserver.com:1001
# output alert_cef: LOG_AUTH LOG_INFO
#
# alert_bro
# ----------------------------------------------------------------------------
#
# Purpose: Send alerts to a Bro-IDS instance.
#
# Arguments: hostname:port
#
# Examples:
# output alert_bro: 127.0.0.1:47757
# alert_fast
# ----------------------------------------------------------------------------
# Purpose: Converts data to an approximation of Snort's "fast alert" mode.
#
# Arguments: file <file>, stdout
# arguments should be comma delimited.
# file - specifiy alert file
# stdout - no alert file, just print to screen
#
# Examples:
# output alert_fast
# output alert_fast: stdout
#
output alert_fast: stdout
# prelude: log to the Prelude Hybrid IDS system
# ----------------------------------------------------------------------------
#
# Purpose:
# This output module provides logging to the Prelude Hybrid IDS system
#
# Arguments: profile=snort-profile
# snort-profile - name of the Prelude profile to use (default is snort).
#
# Snort priority to IDMEF severity mappings:
# high < medium < low < info
#
# These are the default mapped from classification.config:
# info = 4
# low = 3
# medium = 2
# high = anything below medium
#
# Examples:
# output alert_prelude
# output alert_prelude: profile=snort-profile-name
#
# alert_syslog
# ----------------------------------------------------------------------------
#
# Purpose:
# This output module provides the abilty to output alert information to local syslog
#
# severity - as defined in RFC 3164 (eg. LOG_WARN, LOG_INFO)
# facility - as defined in RFC 3164 (eg. LOG_AUTH, LOG_LOCAL0)
#
# Examples:
# output alert_syslog
# output alert_syslog: LOG_AUTH LOG_INFO
#
# syslog_full
#-------------------------------
# Available as both a log and alert output plugin. Used to output data via TCP/UDP or LOCAL ie(syslog())
# Arguments:
# sensor_name $sensor_name - unique sensor name
# server $server - server the device will report to
# local - if defined, ignore all remote information and use syslog() to send message.
# protocol $protocol - protocol device will report over (tcp/udp)
# port $port - destination port device will report to (default: 514)
# delimiters $delimiters - define a character that will delimit message sections ex: "|", will use | as message section delimiters. (default: |)
# separators $separators - define field separator included in each message ex: " " , will use space as field separator. (default: [:space:])
# operation_mode $operaion_mode - default | complete : default mode is compatible with default snort syslog message, complete prints more information such as the raw packet (hexed)
# log_priority $log_priority - used by local option for syslog priority call. (man syslog(3) for supported options) (default: LOG_INFO)
# log_facility $log_facility - used by local option for syslog facility call. (man syslog(3) for supported options) (default: LOG_USER)
# Usage Examples:
# output alert_syslog_full: sensor_name snortIds1-eth2, server xxx.xxx.xxx.xxx, protocol udp, port 514, operation_mode default
# output alert_syslog_full: sensor_name snortIds1-eth2, server xxx.xxx.xxx.xxx, protocol udp, port 514, operation_mode complete
# output log_syslog_full: sensor_name snortIds1-eth2, server xxx.xxx.xxx.xxx, protocol udp, port 514, operation_mode default
# output log_syslog_full: sensor_name snortIds1-eth2, server xxx.xxx.xxx.xxx, protocol udp, port 514, operation_mode complete
# output alert_syslog_full: sensor_name snortIds1-eth2, server xxx.xxx.xxx.xxx, protocol udp, port 514
# output log_syslog_full: sensor_name snortIds1-eth2, server xxx.xxx.xxx.xxx, protocol udp, port 514
# output alert_syslog_full: sensor_name snortIds1-eth2, local
# output log_syslog_full: sensor_name snortIds1-eth2, local, log_priority LOG_CRIT,log_facility LOG_CRON
# log_ascii
# ----------------------------------------------------------------------------
#
# Purpose: This output module provides the default packet logging funtionality
#
# Arguments: None.
#
# Examples:
# output log_ascii
#
# log_tcpdump
# ----------------------------------------------------------------------------
#
# Purpose
# This output module logs packets in binary tcpdump format
#
# Arguments:
# The only argument is the output file name.
#
# Examples:
# output log_tcpdump: tcpdump.log
#
# sguil
# ----------------------------------------------------------------------------
#
# Purpose: This output module provides logging ability for the sguil interface
# See doc/README.sguil
#
# Arguments: agent_port <port>, sensor_name <name>
# arguments should be comma delimited.
# agent_port - explicitly set the sguil agent listening port
# (default: 7736)
# sensor_name - explicitly set the sensor name
# (default: machine hostname)
#
# Examples:
# output sguil
# output sguil: agent_port=7000
# output sguil: sensor_name=argyle
# output sguil: agent_port=7000, sensor_name=argyle
#
# database: log to a variety of databases
# ----------------------------------------------------------------------------
#
# Purpose: This output module provides logging ability to a variety of databases
# See doc/README.database for additional information.
#
# Examples:
# output database: log, mysql, user=root password=test dbname=db host=localhost
# output database: alert, postgresql, user=snort dbname=snort
# output database: log, odbc, user=snort dbname=snort
# output database: log, mssql, dbname=snort user=snort password=test
# output database: log, oracle, dbname=snort user=snort password=test
#
output database: alert, mysql, user=aaa password=bbb dbname=snort host=127.0.0.1
# alert_fwsam: allow blocking of IP's through remote services
# ----------------------------------------------------------------------------
# output alert_fwsam: <SnortSam Station>:<port>/<key>
#
# <FW Mgmt Station>: IP address or host name of the host running SnortSam.
# <port>: Port the remote SnortSam service listens on (default 898).
# <key>: Key used for authentication (encryption really)
# of the communication to the remote service.
#
# Examples:
#
# output alert_fwsam: snortsambox/idspassword
# output alert_fwsam: fw1.domain.tld:898/mykey
# output alert_fwsam: 192.168.0.1/borderfw 192.168.1.254/wanfw
#
#
2012/12/08
今天在寫完新的網路支援頁面之後
進到http://www.google.com/intl/zh-TW/analytics/要註冊使用時
發現使用
https://sites.google.com/site/wangluzhiyuan/
竟然無法註冊
必須再加上home(如下)
https://sites.google.com/site/wangluzhiyuan/home
才能註冊成功
留一下記錄
進到http://www.google.com/intl/zh-TW/analytics/要註冊使用時
發現使用
https://sites.google.com/site/wangluzhiyuan/
竟然無法註冊
必須再加上home(如下)
https://sites.google.com/site/wangluzhiyuan/home
才能註冊成功
留一下記錄
2012/12/05
今天廠商介紹的二套好用的wireless 軟体
http://www.ekahau.com/products/heatmapper/overview.html
http://www.metageek.net/products/inssider/
http://phorum.study-area.org/index.php?topic=60793.0
12/8後記
http://www.metageek.net/docs/wireless-networking-tools/
http://www.meraki.com/products/wireless/wifi-mapper
http://www.netspotapp.com/
http://www.wolfwifi.com/index.html
(AIRMAGNET)
http://www.airmagnet.com
(EKAHAU SITE SURVEY)
http://www.ekahau.com/
(VISIWAVE SITE SURVEY)
http://www.visiwave.com
(MERITECH WIFI NETWORK SURVEY AND DESIGN)
http://www.meritechsolutions.com/
http://www.metageek.net/forums/showthread.php?3412-Top-Wireless-WiFi-Site-Survey-Software
http://www.ekahau.com/products/heatmapper/overview.html
http://www.metageek.net/products/inssider/
http://phorum.study-area.org/index.php?topic=60793.0
12/8後記
http://www.metageek.net/docs/wireless-networking-tools/
http://www.meraki.com/products/wireless/wifi-mapper
http://www.netspotapp.com/
http://www.wolfwifi.com/index.html
(AIRMAGNET)
http://www.airmagnet.com
(EKAHAU SITE SURVEY)
http://www.ekahau.com/
(VISIWAVE SITE SURVEY)
http://www.visiwave.com
(MERITECH WIFI NETWORK SURVEY AND DESIGN)
http://www.meritechsolutions.com/
http://www.metageek.net/forums/showthread.php?3412-Top-Wireless-WiFi-Site-Survey-Software
2012/12/04
MySQL 語法匯整
1. 基礎語法
操作功能 SQL 語法
說明
建立資料庫 create database 資料庫名稱;
列出所有資料庫 show databases;
刪除資料庫 drop database 資料庫名稱;
使用資料庫 use 資料庫名稱;
建立資料表 create table 資料表名稱(
sn integer auto_increment primary key,
name char(20),
mail char(50),
home char(50),
messages char(50)
); 常用資料庫資料型態
1. INT (整數)
2. CHAR (1~255字元字串)
3. VARCHAR (不超過255字元不定長度字串)
4. TEXT (不定長度字串最多65535字元)
列出資料表欄位資訊 describe 資料表名稱;
修改資料表欄位 alter table 資料表名稱
charange column 原來欄位名稱
新欄位名稱資料型態;
新增資料表欄位 alter table 資料表名稱 add column 欄位名稱 資料型態;
刪除資料表欄位 alter table 資料表名稱 drop column 欄位名稱;
刪除資料表 drop 資料表名稱;
插入欄位資料 insert into 資料表名稱(欄位1,欄位2,欄位3,欄位4, ...... 欄位N)
values('值1','值2','值3','值4', ...... '值N');
更新修改欄位資料 update 資料表名稱 set 欄位1='值1',欄位2='值2',欄位3='值3',... 欄位N='值N'
where 條件式 (例如 sn='5' 或 name='塔司尼' );
查詢單一欄位資料 select 欄位名 from 資料表名稱;
查詢多個欄位資料 select 欄位名, 欄位名, 欄位名 from 資料表名稱;
查詢欄位資料的唯一值 select distinct 欄位名 from 資料表名稱; 重複值只列一次
查詢所有欄位資料 select * from 資料表名稱;
條件式查詢 select * from 資料表名稱 where 條件式 (例如 sn='5'); (=, <, >, !=)
條件式查詢 and select * from 資料表名稱 where 條件式1 and 條件式2;
條件式查詢 or select * from 資料表名稱 where 條件式1 or 條件式2;
查詢某一範圍 between select * from 資料表名稱 where 欄位名 between 值1 and 值2 值為數字
查詢空值欄位的資料 select * from 資料表名稱 where 欄位名 is null not null
查詢特定筆數資料 select * from 資料表名稱 limit 8, 10; 第9筆開始選取10筆
查詢結果遞增排序 select * from 資料表名稱 order by 欄位名;
查詢結果遞減排序 select * from 資料表名稱 order by 欄位名 desc ;
查詢比對字串列出單一欄位 select 欄位名 from 資料表名稱 where 欄位名 like '%字串%';
查詢比對字串列出所有欄位 select * from 資料表名稱 where 欄位名 like '%字串%';
刪除條件值資料 delete from 資料表名稱 where 條件式 (例如 sn='5' 或 id='91001' );
刪除條件值資料 delete from 資料表名稱 where 條件式1
and 條件式2;
刪除條件值資料 delete from 資料表名稱 where 條件式1 or 條件式2;
比對刪除條件值資料 delete from 資料表名稱 where 欄位名 like '%字串%';
2. 進階語法
操作功能 SQL 語法
說明
列出正在執行的行程。 show processlist;
轉貼自 http://note.drx.tw/2012/12/mysql-syntax.html
2012/11/23
2012/11/21
2012/11/18
昨天逛書局看書的時候看到一個不錯的p2v的軟体
winimage
http://www.winimage.com/download.htm
檔案很小
可以直接把硬碟轉成VHD或VMDK的格式
速度很快
PS 這個工具只能轉整個硬碟 而不能針對分割區來轉 有點不方便
20121129後記
這個看起來也不錯 改天來測測
http://technet.microsoft.com/en-us/sysinternals/ee656415.aspx
再用qemu-img轉成raw
qemu-img convert source.vhd -O raw destination.raw
winimage
http://www.winimage.com/download.htm
檔案很小
可以直接把硬碟轉成VHD或VMDK的格式
速度很快
PS 這個工具只能轉整個硬碟 而不能針對分割區來轉 有點不方便
20121129後記
這個看起來也不錯 改天來測測
http://technet.microsoft.com/en-us/sysinternals/ee656415.aspx
再用qemu-img轉成raw
qemu-img convert source.vhd -O raw destination.raw
2012/11/06
今天的需求是希望在rsyslog的server上以不同的來源ip來分別存放不同的file
在/etc/rsyslog.conf裡加上以下
:fromhost-ip,isequal,"X.X.X.X" /var/log/isg2000/isg_log
注意logrotate也要加
http://slv922.pixnet.net/blog/post/34655421-centos-5.6-%E4%BD%BF%E7%94%A8rsyslog%E6%8E%A5%E6%94%B6%E5%A4%96%E9%83%A8%E8%A8%AD%E5%82%99%E7%9A%84%E9%80%A3%E7%B7%9Alog
在/etc/rsyslog.conf裡加上以下
:fromhost-ip,isequal,"X.X.X.X" /var/log/isg2000/isg_log
注意logrotate也要加
http://slv922.pixnet.net/blog/post/34655421-centos-5.6-%E4%BD%BF%E7%94%A8rsyslog%E6%8E%A5%E6%94%B6%E5%A4%96%E9%83%A8%E8%A8%AD%E5%82%99%E7%9A%84%E9%80%A3%E7%B7%9Alog
2012/11/04
2012/10/26
昨天升級完proxmox 2.2後
有一台机器reboot後所有的guest os都沒起來
到官網問了一下
沒什麼答案
不過有人回應
/etc/init.d/cman restart
/etc/init.d/pve-cluster restart
如果下次重開再沒起來再來試試
http://forum.proxmox.com/threads/11584-guest-os-no-boot-after-host-reboot
有一台机器reboot後所有的guest os都沒起來
到官網問了一下
沒什麼答案
不過有人回應
/etc/init.d/cman restart
/etc/init.d/pve-cluster restart
如果下次重開再沒起來再來試試
http://forum.proxmox.com/threads/11584-guest-os-no-boot-after-host-reboot
2012/10/19
2012/10/12
剛check了一下snort的版本
snort 2.9.3.1
並且發現官方已經不再提供 snort-mysql的rpm了
google了一下 snort以後也不會再對mysql支援
所以必須自己想辦法
必須利用
barnyard2
http://www.securixlive.com/barnyard2/index.php
來把snort 的log再轉入mysql
正在try
http://gsxbinary.blogspot.tw/2010/07/snort-barnyard2-mysql-base-intro.html
2012/10/15 補充
安裝 snort-2.9.3.1-1 這個版本有一個特別要注意的地方就是
white_list.rules 及 black_list.rules 一定要touch二個空檔出來
否則preprocesser會自動停掉 導致之後的rule都不能跑 切記
另外要注意的地方就是在產生unified2 log file的地方在config裡一定要這樣下
output unified2: filename snort.u2, limit 128
開机啟動的script放在/etc/rc.local如下
/usr/sbin/snort -c /etc/snort/snort.conf -i eth1 -l /var/log/snort -D
/usr/bin/barnyard2 -c /etc/barnyard2/barnyard2.conf -d /var/log/snort -f snort.u2 -w /etc/barnyard2/barnyard2.waldo -D
2012/10/17 補充
升級後在BASE的畫面中看到的特徵就只有snort alert 如下
爬了一下文
發現是/etc/barnyard2/barnyard2.conf裡沒設好
要改成如下(路徑要設對)
config reference_file: /etc/snort/rule/etc/reference.config
config classification_file: /etc/snort/rule/etc/classification.config
config gen_file: /etc/snort/rule/etc/gen-msg.map
config sid_file: /etc/snort/rule/etc/sid-msg.map
重開机後就正常了
snort 2.9.3.1
並且發現官方已經不再提供 snort-mysql的rpm了
google了一下 snort以後也不會再對mysql支援
所以必須自己想辦法
必須利用
barnyard2
http://www.securixlive.com/barnyard2/index.php
來把snort 的log再轉入mysql
正在try
http://gsxbinary.blogspot.tw/2010/07/snort-barnyard2-mysql-base-intro.html
2012/10/15 補充
安裝 snort-2.9.3.1-1 這個版本有一個特別要注意的地方就是
white_list.rules 及 black_list.rules 一定要touch二個空檔出來
否則preprocesser會自動停掉 導致之後的rule都不能跑 切記
另外要注意的地方就是在產生unified2 log file的地方在config裡一定要這樣下
output unified2: filename snort.u2, limit 128
開机啟動的script放在/etc/rc.local如下
/usr/sbin/snort -c /etc/snort/snort.conf -i eth1 -l /var/log/snort -D
/usr/bin/barnyard2 -c /etc/barnyard2/barnyard2.conf -d /var/log/snort -f snort.u2 -w /etc/barnyard2/barnyard2.waldo -D
升級後在BASE的畫面中看到的特徵就只有snort alert 如下
爬了一下文
發現是/etc/barnyard2/barnyard2.conf裡沒設好
要改成如下(路徑要設對)
config reference_file: /etc/snort/rule/etc/reference.config
config classification_file: /etc/snort/rule/etc/classification.config
config gen_file: /etc/snort/rule/etc/gen-msg.map
config sid_file: /etc/snort/rule/etc/sid-msg.map
重開机後就正常了
2012/10/07
2012/10/01
2012/09/23
netman 針對移机使用LVM的影片
http://www.youtube.com/watch?v=2CIjpyG0S-4
http://www.youtube.com/watch?v=OQF75Li4r6k
http://www.youtube.com/watch?v=9HVbOJ870_w
http://www.youtube.com/watch?v=b9A-pyfhnZw
http://www.youtube.com/watch?v=JyUNTY63nFA
http://www.youtube.com/watch?v=f3EssshB_cM
http://www.youtube.com/watch?v=oi5x9EI_NFI
http://www.youtube.com/watch?v=Girrsy2UJks
http://www.youtube.com/watch?v=QKTdikMU6QQ
http://www.youtube.com/watch?v=2CIjpyG0S-4
http://www.youtube.com/watch?v=OQF75Li4r6k
http://www.youtube.com/watch?v=9HVbOJ870_w
http://www.youtube.com/watch?v=b9A-pyfhnZw
http://www.youtube.com/watch?v=JyUNTY63nFA
http://www.youtube.com/watch?v=f3EssshB_cM
http://www.youtube.com/watch?v=oi5x9EI_NFI
http://www.youtube.com/watch?v=Girrsy2UJks
http://www.youtube.com/watch?v=QKTdikMU6QQ
2012/09/20
2012/09/12
最近新買了一hp dl380 g8 要做web server的備援机
要考慮的就是資料同步的問題了
不考慮HA即時同步 只在一台出問題時 另一台改完ip後能暫時運作
所以預計每天晚上同步資料一次
檔案資料可以用rsync
但db就要考慮lock的問題了
查了一下資料
mysql可以用mysqldump來備份執行中的db而不用shutdown 但當量大時時間過久而且restore更久 不考慮
另外就是mysqlhotcopy(mysql自帶工具)
這個是直接copy mysql的資料檔案,所以復原時直接copy檔案就可以了 速度快又方便 但只能備份myisam的資料庫 無法在innodb上使用
語法如下
mysqlhotcopy -u root -p password --addtodest dbname /backup/path
若要備份全部db 語法如下
mysqlhotcopy -u root -p password --addtodest --regex . /backup/path
若要備份innodb(也可以備份myisam)
可以使用http://www.percona.com/doc/percona-xtrabackup/
操作方法可參考
http://blog.chinaunix.net/uid-20728886-id-138116.html
http://ezerg.iteye.com/blog/1029826
要考慮的就是資料同步的問題了
不考慮HA即時同步 只在一台出問題時 另一台改完ip後能暫時運作
所以預計每天晚上同步資料一次
檔案資料可以用rsync
但db就要考慮lock的問題了
查了一下資料
mysql可以用mysqldump來備份執行中的db而不用shutdown 但當量大時時間過久而且restore更久 不考慮
另外就是mysqlhotcopy(mysql自帶工具)
這個是直接copy mysql的資料檔案,所以復原時直接copy檔案就可以了 速度快又方便 但只能備份myisam的資料庫 無法在innodb上使用
語法如下
mysqlhotcopy -u root -p password --addtodest dbname /backup/path
若要備份全部db 語法如下
mysqlhotcopy -u root -p password --addtodest --regex . /backup/path
若要備份innodb(也可以備份myisam)
可以使用http://www.percona.com/doc/percona-xtrabackup/
操作方法可參考
http://blog.chinaunix.net/uid-20728886-id-138116.html
http://ezerg.iteye.com/blog/1029826
2012/09/02
最近被java搞的很頭痛
因為在ubuntu 12.04上使用proxmox來開guest時需要使用到java
但用openjdk 7及icedtea不是無法開就是打開後browser就當了
google了一下才知道ubuntu從10.04後就沒再買java的授權了
應該是因為sun被oracle買走後的關係
而使用openjdk
但有很多程式無法使用openjdk來跑
後來找到這個
https://sites.google.com/site/easylinuxtipsproject/java
目前看來是ok
因為在ubuntu 12.04上使用proxmox來開guest時需要使用到java
但用openjdk 7及icedtea不是無法開就是打開後browser就當了
google了一下才知道ubuntu從10.04後就沒再買java的授權了
應該是因為sun被oracle買走後的關係
而使用openjdk
但有很多程式無法使用openjdk來跑
後來找到這個
https://sites.google.com/site/easylinuxtipsproject/java
目前看來是ok
2012/08/31
最近發生一個問題
就是有一台proxmox的backup都要做十多個小時才能完成
這會影響到正常工作
host os一直都會有 2% - 5% 的 i/o wait
不知道是不是這個影响的
再去看有二台win 2k3 guest的 i/o一直都很高 降不下來
用工作管理員找了一下
發現除了avguard外另外就是cisvc.exe這個process i/o使用夭壽的高
google了一下
http://blog.xuite.net/coke750101/coketech/30863137
發現cisvc是win用來index用的
建議可以關掉
關了後 guest的cpu使用馬上下降
再觀察看看有沒有什麼影响
所以win 的 guest os
請務必在服務中把"Indexing Service"(索引服務)右鍵單擊,選取“停止”
就是有一台proxmox的backup都要做十多個小時才能完成
這會影響到正常工作
host os一直都會有 2% - 5% 的 i/o wait
不知道是不是這個影响的
再去看有二台win 2k3 guest的 i/o一直都很高 降不下來
用工作管理員找了一下
發現除了avguard外另外就是cisvc.exe這個process i/o使用夭壽的高
google了一下
http://blog.xuite.net/coke750101/coketech/30863137
發現cisvc是win用來index用的
建議可以關掉
關了後 guest的cpu使用馬上下降
再觀察看看有沒有什麼影响
所以win 的 guest os
請務必在服務中把"Indexing Service"(索引服務)右鍵單擊,選取“停止”
2012/08/30
2012/08/29
使用ubuntu預設的file roller時會有亂碼
找了一下
File Roller中文亂碼
Ubuntu 中預設安裝的壓縮管理員程式是File Roller
完全移除rar或unrar
sudo apt-get remove rar
sudo apt-get remove unrar
安裝p7zip和p7zip-rar
sudo apt-get install p7zip
sudo apt-get install p7zip-rar
http://pcm543.blogspot.tw/2010/09/file-roller.html
找了一下
File Roller中文亂碼
Ubuntu 中預設安裝的壓縮管理員程式是File Roller
完全移除rar或unrar
sudo apt-get remove rar
sudo apt-get remove unrar
安裝p7zip和p7zip-rar
sudo apt-get install p7zip
sudo apt-get install p7zip-rar
http://pcm543.blogspot.tw/2010/09/file-roller.html
2012/08/27
2012/08/24
2012/08/15
2012/08/08
之前測linux的bond
在L2 8 ports小型的switch上直接接都沒問題
可是接到 cisco 3750上都會有不定時斷線的狀況
放著好久沒再試
今天再去查了一下
才知道cisco 3750上要再下指令才能正常
cisco-3750(config)#interface range GigabitEthernet 1/0/1, GigabitEthernet 1/0/2
cisco-3750(config-if-range)#channel-group 1 mode active
http://www.geego.com.tw/tech_support/techdocs_easy-to-increase-network-bandwidth
http://backdrift.org/howtonetworkbonding
http://blog.webdir.bg/ubuntu-linux-and-cisco-switch-link-aggregation-load-balancing-bonding/
在L2 8 ports小型的switch上直接接都沒問題
可是接到 cisco 3750上都會有不定時斷線的狀況
放著好久沒再試
今天再去查了一下
才知道cisco 3750上要再下指令才能正常
cisco-3750(config)#interface range GigabitEthernet 1/0/1, GigabitEthernet 1/0/2
cisco-3750(config-if-range)#channel-group 1 mode active
http://www.geego.com.tw/tech_support/techdocs_easy-to-increase-network-bandwidth
http://backdrift.org/howtonetworkbonding
http://blog.webdir.bg/ubuntu-linux-and-cisco-switch-link-aggregation-load-balancing-bonding/
2012/08/01
最近在測gfs
http://www.howtoforge.com/high-availability-storage-with-glusterfs-3.2.x-on-ubuntu-12.04-automatic-file-replication-across-two-storage-servers
架設簡單快速又方便
而且二台server做HA的空間也不一定要一樣大
還滿好用的
而且client端還可以再把mount進來的檔案用nfs share出去
好物一個
20121111後記
昨天在看document的時侯發現glusterfs3以後原生就支援nfs了
http://gluster.org/community/documentation/index.php/Gluster_3.2:_Manually_Mounting_Volumes_Using_NFS
要注意的就是在server上必須要把rpcbind或portmap這個daemon起起來
完全不需掛載後再來分享
真是太方便了
20121110後記
今天把gfs client直接起在一台gfs server上
再把gfs share的目錄mount進來
之後再把mount進來的目錄使用nfs export出去
完全沒問題
/etc/exports要記得把fsid=0加上去 否則client mount不上
http://www.howtoforge.com/high-availability-storage-with-glusterfs-3.2.x-on-ubuntu-12.04-automatic-file-replication-across-two-storage-servers
架設簡單快速又方便
而且二台server做HA的空間也不一定要一樣大
還滿好用的
而且client端還可以再把mount進來的檔案用nfs share出去
好物一個
20121111後記
昨天在看document的時侯發現glusterfs3以後原生就支援nfs了
http://gluster.org/community/documentation/index.php/Gluster_3.2:_Manually_Mounting_Volumes_Using_NFS
要注意的就是在server上必須要把rpcbind或portmap這個daemon起起來
完全不需掛載後再來分享
真是太方便了
20121110後記
今天把gfs client直接起在一台gfs server上
再把gfs share的目錄mount進來
之後再把mount進來的目錄使用nfs export出去
完全沒問題
/etc/exports要記得把fsid=0加上去 否則client mount不上
2012/07/28
2012/07/22
2012/07/21
2012/07/17
2012/07/06
2012/07/03
為了brocade lldp的功能無法在fluke linkrunner AT上使用花了好久的時間
今天在工程師回的mail中提到fws624也支援cdp
找了一下文件
只要下cdp 就可以
但下完後
還是沒看到訊息 而且連cisco 7609的訊息都擋掉了
再查了一下
還必須把fdp打開
fdp run
這樣就可以在linkrunner AT看到硬体訊息了
總結二個指令
cdp run
fdp run
缺一個都不行
預設所有的port都會開
http://community.brocade.com/thread/5072?start=0&tstart=0
PS.繼續等待brocade對lldp的回應
今天在工程師回的mail中提到fws624也支援cdp
找了一下文件
只要下cdp 就可以
但下完後
還是沒看到訊息 而且連cisco 7609的訊息都擋掉了
再查了一下
還必須把fdp打開
fdp run
這樣就可以在linkrunner AT看到硬体訊息了
總結二個指令
cdp run
fdp run
缺一個都不行
預設所有的port都會開
http://community.brocade.com/thread/5072?start=0&tstart=0
PS.繼續等待brocade對lldp的回應
2012/07/01
最近在使用mldonkey時一直出現 to many open file的問題
查了一下
# ulimit -a
core file size (blocks, -c) 0
data seg size (kbytes, -d) unlimited
scheduling priority (-e) 0
file size (blocks, -f) unlimited
pending signals (-i) 147456
max locked memory (kbytes, -l) 32
max memory size (kbytes, -m) unlimited
open files (-n) 1024
pipe size (512 bytes, -p) 8
POSIX message queues (bytes, -q) 819200
real-time priority (-r) 0
stack size (kbytes, -s) 10240
cpu time (seconds, -t) unlimited
max user processes (-u) 147456
virtual memory (kbytes, -v) unlimited
file locks (-x) unlimited
然後把open file改為10240
ulimit -n 10240
再觀察看看
2012/06/30
最近把所有pc上的vm全部轉到 HP DL380 G7 上
而guest os全部放在server的肚子裡 這樣就可以方便用 snapshot來進行backup 而不用停機
(建議使用外接的storage跑iscsi 這樣也可以用snapshot備份)
但最近發現備份總是備不完
原因是卡在其中的一個guest
找了好久 發現應該是snapshot滿了
因為vzdump預設只會開1G的snapshot 而當snapshot滿了後 整個備份就會停住 卡在當時備份的guest 這時就要把這個process kill掉才能再接下去 而kill 掉的這個備份也就不會成功
早上又發生了
用lvs看了一下
proxmox#lvs
LV VG Attr LSize Pool Origin Data% Move Log Copy% Convert
data pve owi-aos- 1.25t
root pve -wi-ao-- 40.00g
swap pve -wi-ao-- 70.00g
vzsnap-proxmox78-0 pve swi-aos- 1.00g data 100
果然是滿了
再到forum找找如何增加sanpshot的size
Re: Backup vzdump hanging at vmtar
its only 1 gb, increase to 2 gb (see below).
as you did not answer to my question regarding vzdump.conf I assume you do not have any settings there.
just create the file and enter:
Code:
nano /etc/vzdump.conf
Code:
size: 2048
為了省麻煩
這裡直接加到10G
再觀察看看囉
而guest os全部放在server的肚子裡 這樣就可以方便用 snapshot來進行backup 而不用停機
(建議使用外接的storage跑iscsi 這樣也可以用snapshot備份)
但最近發現備份總是備不完
原因是卡在其中的一個guest
找了好久 發現應該是snapshot滿了
因為vzdump預設只會開1G的snapshot 而當snapshot滿了後 整個備份就會停住 卡在當時備份的guest 這時就要把這個process kill掉才能再接下去 而kill 掉的這個備份也就不會成功
早上又發生了
用lvs看了一下
proxmox#lvs
LV VG Attr LSize Pool Origin Data% Move Log Copy% Convert
data pve owi-aos- 1.25t
root pve -wi-ao-- 40.00g
swap pve -wi-ao-- 70.00g
vzsnap-proxmox78-0 pve swi-aos- 1.00g data 100
果然是滿了
再到forum找找如何增加sanpshot的size
Re: Backup vzdump hanging at vmtar
its only 1 gb, increase to 2 gb (see below).
as you did not answer to my question regarding vzdump.conf I assume you do not have any settings there.
just create the file and enter:
Code:
nano /etc/vzdump.conf
Code:
size: 2048
為了省麻煩
這裡直接加到10G
再觀察看看囉
2012/06/25
今天在找利用python 來傳gtalk訊息的方法
並不困難
程式碼如下
import xmpp
login = 'abcde' # @gmail.com
pwd = '123456'
cnx = xmpp.Client('gmail.com')
cnx.connect( server=('talk.google.com',5222) )
cnx.auth(login,pwd, 'botty')
cnx.send( xmpp.Message( "defghi@gmail.com" ,"Hello World from abcde!!!" ) )
==========================================================
加上測port變成一個監控机器人
import xmpp
import socket
address='1.1.1.1'
port = int(80)
p = str(port)
mes=address+' port '+p+' ok'
s = socket.socket()
try:
s.connect((address,port))
print s
login = 'abcde' # @gmail.com
pwd = '123456'
cnx = xmpp.Client('gmail.com')
cnx.connect( server=('talk.google.com',5222) )
cnx.auth(login,pwd, 'botty')
cnx.send( xmpp.Message( "defghi@gmail.com" ,mes ) )
except:
print "fail"
2012/06/24
最近有一個需求是想把小主機放在螢幕後
取代原電子看板
os使用ubuntu 12.04
這樣只要固定開特定網頁就可以了
但只要把keyboard mouse拆下來再重開後
過不了多久螢幕還是會進入保護模式而變黑
測了好久
發現是xwindows的問題
就算在設定上都把螢幕保護及電源管理關了
還是會發生
最後找到下列的指令
加到預設登入user的.profile後
就沒再發生了
export DISPLAY=:0.0 && /usr/bin/xset -dpms
export DISPLAY=:0.0 && /usr/bin/xset s 0 0
export DISPLAY=:0.0 && /usr/bin/xset s noblank
export DISPLAY=:0.0 && /usr/bin/xset s noexpose
要看所有設定的話用
xset -q
2012/06/23
之前用openfiler來測iscsi給proxmox用
測完把openfiler拿掉後
proxmox的機器上就一直出現
/dev/sdh: read failed after 0 of 4096 at 0: Input/output error
/dev/sdh: read failed after 0 of 4096 at 10234036224: Input/output error
/dev/sdh: read failed after 0 of 4096 at 10234093568: Input/output error
/dev/sdh: read failed after 0 of 4096 at 4096: Input/output error
這樣的error
應該是雖然iscsi拿掉
但os捉到的disk卻還掛著
本來是想不理他
等下次升級kernel再reboot應該就會解決了
但最近的排程backup一直出問題
不知道是不是因為這個原因
所以查了一下資料
要怎麼在不reboot的情況下把disk拿掉
只要一行指令
echo offline > /sys/block/sdh/device/state
雖然在/proc/scsi/scsi還是有看到
Host: scsi9 Channel: 00 Id: 00 Lun: 00
Vendor: OPNFILER Model: VIRTUAL-DISK Rev: 0
Type: Direct-Access ANSI SCSI revision: 04
Host: scsi10 Channel: 00 Id: 00 Lun: 00
Vendor: OPNFILER Model: VIRTUAL-DISK Rev: 0
Type: Direct-Access
但i/o error的訊息不會再跑出來了
測完把openfiler拿掉後
proxmox的機器上就一直出現
/dev/sdh: read failed after 0 of 4096 at 0: Input/output error
/dev/sdh: read failed after 0 of 4096 at 10234036224: Input/output error
/dev/sdh: read failed after 0 of 4096 at 10234093568: Input/output error
/dev/sdh: read failed after 0 of 4096 at 4096: Input/output error
這樣的error
應該是雖然iscsi拿掉
但os捉到的disk卻還掛著
本來是想不理他
等下次升級kernel再reboot應該就會解決了
但最近的排程backup一直出問題
不知道是不是因為這個原因
所以查了一下資料
要怎麼在不reboot的情況下把disk拿掉
只要一行指令
echo offline > /sys/block/sdh/device/state
雖然在/proc/scsi/scsi還是有看到
Host: scsi9 Channel: 00 Id: 00 Lun: 00
Vendor: OPNFILER Model: VIRTUAL-DISK Rev: 0
Type: Direct-Access ANSI SCSI revision: 04
Host: scsi10 Channel: 00 Id: 00 Lun: 00
Vendor: OPNFILER Model: VIRTUAL-DISK Rev: 0
Type: Direct-Access
但i/o error的訊息不會再跑出來了
2012/06/13
2012/06/09
今天一直在找串流的解決方案
目前比較方便的方法是直接使用html5的video tag
再把檔案轉成webm 或 mp4放上去
以下是可以轉檔,合併,裁切的軟体
還不用
http://www.freemake.com/tw/
目前比較方便的方法是直接使用html5的video tag
再把檔案轉成webm 或 mp4放上去
以下是可以轉檔,合併,裁切的軟体
還不用
http://www.freemake.com/tw/
訂閱:
文章 (Atom)
.jpg)


