最近更新opensuse 11.0 常常出現錯誤
原因為 ftp.twaren.net 的 FTP
最近感覺不是很穩
所以將套件的儲存庫 由ftp 方式改為 http方式
就發現順很多, 一次更新500多MB ~~~ Orz.
星期一, 3月 30, 2009
星期二, 2月 24, 2009
linux cut 指令小筆記
假設檔案名稱 為test.txt
想要取出最後一欄 ( 因為cut 都是指定第幾欄到第幾欄)
linux-wg5u:/tmp/lab # cat test.txt
123:gsfg:fgsg:sagaL:gdgas:20091234
555:dd:eqgha:20091235
66:dads:20091236
1. 利用反轉 rev 來 結合cut 是一種方式
linux-wg5u:/tmp/lab # rev test.txt | cut -d : -f 1 | rev
20091234
20091235
20091236
2. 利用 awk 來列出最後一行也是一種方式
linux-wg5u:/tmp/lab # awk -F: '{print $(NF)}' test.txt
20091234
20091235
20091236
*************************************************
問題2
檔案內容想要以 L: 來當分隔依據
man cut 指令您應該會看到 cut 的分隔字元只能用單一字元
檔案內容如下
linux-wg5u:/tmp/lab # cat test2.txt
123:gsfg:fgsg:saga L:gdgas:20091234
555:dd L:eqgha:20091235
66:dads L:20091236
用cut 來使用兩個字元來當分隔判斷依據應該是不行
所以採用 awk 來處理
linux-wg5u:/tmp/lab # awk -F 'L:' '{print $1}' test2.txt
123:gsfg:fgsg:saga
555:dd
66:dads
想要取出最後一欄 ( 因為cut 都是指定第幾欄到第幾欄)
linux-wg5u:/tmp/lab # cat test.txt
123:gsfg:fgsg:sagaL:gdgas:20091234
555:dd:eqgha:20091235
66:dads:20091236
1. 利用反轉 rev 來 結合cut 是一種方式
linux-wg5u:/tmp/lab # rev test.txt | cut -d : -f 1 | rev
20091234
20091235
20091236
2. 利用 awk 來列出最後一行也是一種方式
linux-wg5u:/tmp/lab # awk -F: '{print $(NF)}' test.txt
20091234
20091235
20091236
*************************************************
問題2
檔案內容想要以 L: 來當分隔依據
man cut 指令您應該會看到 cut 的分隔字元只能用單一字元
檔案內容如下
linux-wg5u:/tmp/lab # cat test2.txt
123:gsfg:fgsg:saga L:gdgas:20091234
555:dd L:eqgha:20091235
66:dads L:20091236
用cut 來使用兩個字元來當分隔判斷依據應該是不行
所以採用 awk 來處理
linux-wg5u:/tmp/lab # awk -F 'L:' '{print $1}' test2.txt
123:gsfg:fgsg:saga
555:dd
66:dads
星期日, 2月 22, 2009
The Eric python IDE on openSUSE
今天聽完 雨蒼的 Python 超超超新手入門
覺得python 算是一個蠻友善有趣的語言
^^
但是想說要有一個好的 IDE 介面, 對之後的開發會比較有幫助
google 了一些 IDE
參考了 python 的網站上的資料
http://wiki.python.org/moin/GuiProgramming
^^
有注意到 像SPE 這樣的IDE, 但是是在Ubuntu 上面
http://pythonide.blogspot.com/
也有注意到 wxPython 這樣的軟體
http://www.wxpython.org/index.php
但是後來試了一下 覺得 Eric python IDE 感覺很直覺很好用
http://eric-ide.python-projects.org/index.html
由於openSUSE 有yast, 所以安裝 eric python 就更簡單了
打開gnome終端機 執行 yast 軟體管理
#yast2 sw_single
輸入關鍵字eric

就可以找到 eric python IDE
--> 點選 install --> Apply
就安裝完成
^^
安裝完成之後
就開啟gnome 終端機 輸入eric 就可以開啟
> eric
或是也可以在Gnome選單的 --> 程式開發
找到eric 的程式來啟動他
啟動完的畫面如下

有一般熟悉的IDE介面及相關功能
^^
找時間來好好研究
覺得python 算是一個蠻友善有趣的語言
^^
但是想說要有一個好的 IDE 介面, 對之後的開發會比較有幫助
google 了一些 IDE
參考了 python 的網站上的資料
http://wiki.python.org/moin/GuiProgramming
^^
有注意到 像SPE 這樣的IDE, 但是是在Ubuntu 上面
http://pythonide.blogspot.com/
也有注意到 wxPython 這樣的軟體
http://www.wxpython.org/index.php
但是後來試了一下 覺得 Eric python IDE 感覺很直覺很好用
http://eric-ide.python-projects.org/index.html
由於openSUSE 有yast, 所以安裝 eric python 就更簡單了
打開gnome終端機 執行 yast 軟體管理
#yast2 sw_single
輸入關鍵字eric

就可以找到 eric python IDE
--> 點選 install --> Apply
就安裝完成
^^
安裝完成之後
就開啟gnome 終端機 輸入eric 就可以開啟
> eric
或是也可以在Gnome選單的 --> 程式開發
找到eric 的程式來啟動他
啟動完的畫面如下

有一般熟悉的IDE介面及相關功能
^^
找時間來好好研究
星期一, 1月 12, 2009
在Windows putty 使用 DSA Private Key
有時候在外面沒有攜帶 Linux or USB Linux
但是要連線SSH, 但是針對有些伺服器要使用Key來驗證
putty 預設不可以直接使用 RSA or DSA的 Private Key 來進行驗證
所以要透過 Putty Key Generator 這個程式來做轉換
參考這個網頁
http://www.electrictoolbox.com/putty-rsa-dsa-keys/
下載 Putty Key Generator 把Key 匯進來
另存為Putty 的Private Key就可以使用了
^__^
星期四, 1月 08, 2009
VMWareDnD in Windows
在ines的PC上面裝了VMWare
但是今天要從VMWare內的Guest OS 複製檔案出來的時候
確發現磁碟空間不夠
查看了一下, C磁碟果然只剩下 446MB
心想奇怪, C的大小有 79GB, 為何會剩下這麼少的空間
使用檔案總管看一下
突然發現 C:\Documents and Settings\ines\Local Settings\Temp\VMwareDnD
竟然佔了 44GB 的空間
Google了一下 VMWareDnD
才知道如果從Guest OS 複製貼上檔案的時候
暫存檔是那個目錄
而且不會清空
所以就在 C:\Documents and Settings\ines\「開始」功能表\程式集\啟動 的資料夾內
寫了一個 rmvmwarednd.bat 讓使用者登入的時候自動刪除那個目錄
內容如下
rd /s /q "C:\Documents and Settings\ines\Local Settings\Temp\VMwareDnD"
這樣就可以解決 VMWare 暫存檔的問題了
^__^
但是今天要從VMWare內的Guest OS 複製檔案出來的時候
確發現磁碟空間不夠
查看了一下, C磁碟果然只剩下 446MB
心想奇怪, C的大小有 79GB, 為何會剩下這麼少的空間
使用檔案總管看一下
突然發現 C:\Documents and Settings\ines\Local Settings\Temp\VMwareDnD
竟然佔了 44GB 的空間
Google了一下 VMWareDnD
才知道如果從Guest OS 複製貼上檔案的時候
暫存檔是那個目錄
而且不會清空
所以就在 C:\Documents and Settings\ines\「開始」功能表\程式集\啟動 的資料夾內
寫了一個 rmvmwarednd.bat 讓使用者登入的時候自動刪除那個目錄
內容如下
rd /s /q "C:\Documents and Settings\ines\Local Settings\Temp\VMwareDnD"
這樣就可以解決 VMWare 暫存檔的問題了
^__^
星期三, 1月 07, 2009
OpenSuSE 11.0 Live CD 安裝小記
之前的環境都是使用DVD安裝
使用 Live CD 安裝的次數比較少
但是因為 Live CD 的大小比較小
不像DVD要下載很久, 所以有些時候就使用Live CD來安裝
首先會碰到如果是使用root 登入, 更新套件就會有問題
但是如果是用一般使用者登入, 再去更新(輸入root密碼) 就不會有這個問題 @@
接下來是沒有中文輸入法的問題
這個透過安裝 scim就可以解決
但是未完整的中文環境還是讓人覺得不高興
之前去修改 /etc/sysconfig/language
沒看到成效
但是奇怪的是
使用控制中心 --> 系統 --> 語言
選取繁體中文 (我本來就是選繁體中文 ㄚ @@)
然後選取確定, 系統就會從網路下載 Gnome的相關中文套件
解決這個問題(我有先安裝了社群套件庫)
接下來把 xdm 重新啟動
就看到全部都是可愛的中文啦
先把他記下來
^__^
使用 Live CD 安裝的次數比較少
但是因為 Live CD 的大小比較小
不像DVD要下載很久, 所以有些時候就使用Live CD來安裝
首先會碰到如果是使用root 登入, 更新套件就會有問題
但是如果是用一般使用者登入, 再去更新(輸入root密碼) 就不會有這個問題 @@
接下來是沒有中文輸入法的問題
這個透過安裝 scim就可以解決
但是未完整的中文環境還是讓人覺得不高興
之前去修改 /etc/sysconfig/language
沒看到成效
但是奇怪的是
使用控制中心 --> 系統 --> 語言
選取繁體中文 (我本來就是選繁體中文 ㄚ @@)
然後選取確定, 系統就會從網路下載 Gnome的相關中文套件
解決這個問題(我有先安裝了社群套件庫)
接下來把 xdm 重新啟動
就看到全部都是可愛的中文啦
先把他記下來
^__^
星期六, 12月 27, 2008
利用chntpw重新設定Windows 密碼
明天有一場研討會
要講綠色軟體 or Wireshark
就把之前的4GB USB Flash disk又拿出來
想說要用隨身碟來簡報
就想說要有多一些功能
前陣子有注意到有個套件
是用offline的方式來變更Windows管理帳號的密碼
但是是使用 Live CD or floppy的方式
自己沒有很喜歡, 也沒有花時間
所以今天就花一下時間看看他
順便安裝到我的OpenSuSE Flash Disk上面
套件的官網
chntpw
http://home.eunet.no/pnordahl/ntpasswd/
本來上去rpmfind.net
但是上面都是Fedora的RPM
想說就自己下載source code來玩好了
下載source code (假設下載到/root/Desktop)
http://home.eunet.no/pnordahl/ntpasswd/chntpw-source-080526.zip
#cd /root/Desktop
#unzip chntpw-source-080526.zip
#cd /root/Desktop/chntpw-080526
編譯
#make
︿︿
簡單就搞定
開始作實驗
#suse-usb:~ # fdisk -l
Disk /dev/sda: 4108 MB, 4108320768 bytes
255 heads, 63 sectors/track, 499 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x04030201
Device Boot Start End Blocks Id System
/dev/sda1 1 53 425691 82 Linux swap / Solaris
/dev/sda2 * 54 499 3582495 83 Linux
Disk /dev/sdb: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x1fb51fb4
Device Boot Start End Blocks Id System
/dev/sdb1 * 1 9807 78774696 7 HPFS/NTFS
/dev/sdb2 9808 60801 409609305 7 HPFS/NTFS
看到我的Windows 磁碟機在 /dev/sdb1
建立掛載目錄
#mkdir /mnt/usb
掛載起來
#mount -t ntfs-3g /dev/sdb1 /mnt/usb/
使用 chntpw -l 列出系統內的帳號資料
一般來說 SAM資料庫會在 WINDOWS/system32/config 內
# /root/Desktop/chntpw-080526/chntpw -l /mnt/usb/WINDOWS/system32/config/SAM
chntpw version 0.99.6 080526 (sixtyfour), (c) Petter N Hagen
Hive name (from header): <\SystemRoot\System32\Config\SAM>
ROOT KEY at offset: 0x001020 * Subkey indexing type is: 666c
Page at 0x7000 is not 'hbin', assuming file contains garbage at end
File size 262144 [40000] bytes, containing 6 pages (+ 1 headerpage)
Used for data: 295/21536 blocks/bytes, unused: 10/2848 blocks/bytes.
* SAM policy limits:
Failed logins before lockout is: 0
Minimum password length : 0
Password history count : 0
| RID -|---------- Username ------------| Admin? |- Lock? --|
| 01f4 | Administrator | ADMIN | |
| 01f5 | Guest | | *BLANK* |
| 03e8 | HelpAssistant | | dis/lock |
| 03f2 | ines | ADMIN | *BLANK* |
| 03ec | Max | ADMIN | |
| 03f8 | root | | *BLANK* |
| 03ea | SUPPORT_388945a0 | | dis/lock |
| 03f6 | __vmware_user__ | | |
發現Max是ADMIN權限但是有密碼
root一般使用者 密碼為空白
移除Max的密碼
#/root/Desktop/chntpw-080526/chntpw -u Max /mnt/usb/WINDOWS/system32/config/SAM
chntpw version 0.99.6 080526 (sixtyfour), (c) Petter N Hagen
Hive name (from header): <\SystemRoot\System32\Config\SAM>
ROOT KEY at offset: 0x001020 * Subkey indexing type is: 666c
Page at 0x7000 is not 'hbin', assuming file contains garbage at end
File size 262144 [40000] bytes, containing 6 pages (+ 1 headerpage)
Used for data: 295/21536 blocks/bytes, unused: 10/2848 blocks/bytes.
* SAM policy limits:
Failed logins before lockout is: 0
Minimum password length : 0
Password history count : 0
| RID -|---------- Username ------------| Admin? |- Lock? --|
| 01f4 | Administrator | ADMIN | |
| 01f5 | Guest | | *BLANK* |
| 03e8 | HelpAssistant | | dis/lock |
| 03f2 | ines | ADMIN | *BLANK* |
| 03ec | Max | ADMIN | |
| 03f8 | root | | *BLANK* |
| 03ea | SUPPORT_388945a0 | | dis/lock |
| 03f6 | __vmware_user__ | | |
---------------------> SYSKEY CHECK <-----------------------
SYSTEM SecureBoot : -1 -> Not Set (not installed, good!)
SAM Account\F : 1 -> key-in-registry
SECURITY PolSecretEncryptionKey: -1 -> Not Set (OK if this is NT4)
***************** SYSKEY IS ENABLED! **************
This installation very likely has the syskey passwordhash-obfuscator installed
It's currently in mode = -1, Unknown-mode
SYSTEM (and possibly SECURITY) hives not loaded, unable to disable syskey!
Please start the program with at least SAM & SYSTEM-hive filenames as arguments!
RID : 1004 [03ec]
Username: Max
fullname: Max
comment :
homedir :
User is member of 3 groups:
00000221 = Users (which has 5 members)
00000220 = Administrators (which has 3 members)
0000022b = Remote Desktop Users (which has 1 members)
Account bits: 0x0210 =
[ ] Disabled | [ ] Homedir req. | [ ] Passwd not req. |
[ ] Temp. duplicate | [X] Normal account | [ ] NMS account |
[ ] Domain trust ac | [ ] Wks trust act. | [ ] Srv trust act |
[X] Pwd don't expir | [ ] Auto lockout | [ ] (unknown 0x08) |
[ ] (unknown 0x10) | [ ] (unknown 0x20) | [ ] (unknown 0x40) |
Failed login count: 0, while max tries is: 0
Total login count: 48
- - - - User Edit Menu:
1 - Clear (blank) user password
2 - Edit (set new) user password (careful with this on XP or Vista)
3 - Promote user (make user an administrator)
(4 - Unlock and enable user account) [seems unlocked already]
q - Quit editing user, back to user select
Select: [q] > 1 詢問如何處理,輸入1清空密碼
接下來
Password cleared!
Hives that have changed:
# Name
0
Write hive files? (y/n) [n] : y 詢問如何處理,輸入y寫入
使用指令查詢Max的密碼是否有被清空 chntpw -l SAM
#/root/Desktop/chntpw-080526/chntpw -l /mnt/usb/WINDOWS/system32/config/SAM
chntpw version 0.99.6 080526 (sixtyfour), (c) Petter N Hagen
Hive name (from header): <\SystemRoot\System32\Config\SAM>
ROOT KEY at offset: 0x001020 * Subkey indexing type is: 666c
Page at 0x7000 is not 'hbin', assuming file contains garbage at end
File size 262144 [40000] bytes, containing 6 pages (+ 1 headerpage)
Used for data: 295/21536 blocks/bytes, unused: 10/2848 blocks/bytes.
* SAM policy limits:
Failed logins before lockout is: 0
Minimum password length : 0
Password history count : 0
| RID -|---------- Username ------------| Admin? |- Lock? --|
| 01f4 | Administrator | ADMIN | |
| 01f5 | Guest | | *BLANK* |
| 03e8 | HelpAssistant | | dis/lock |
| 03f2 | ines | ADMIN | *BLANK* |
| 03ec | Max | ADMIN | *BLANK* |
| 03f8 | root | | *BLANK* |
| 03ea | SUPPORT_388945a0 | | dis/lock |
| 03f6 | __vmware_user__ | | |
Okay~~
enjoy it
要講綠色軟體 or Wireshark
就把之前的4GB USB Flash disk又拿出來
想說要用隨身碟來簡報
就想說要有多一些功能
前陣子有注意到有個套件
是用offline的方式來變更Windows管理帳號的密碼
但是是使用 Live CD or floppy的方式
自己沒有很喜歡, 也沒有花時間
所以今天就花一下時間看看他
順便安裝到我的OpenSuSE Flash Disk上面
套件的官網
chntpw
http://home.eunet.no/pnordahl/ntpasswd/
本來上去rpmfind.net
但是上面都是Fedora的RPM
想說就自己下載source code來玩好了
下載source code (假設下載到/root/Desktop)
http://home.eunet.no/pnordahl/ntpasswd/chntpw-source-080526.zip
#cd /root/Desktop
#unzip chntpw-source-080526.zip
#cd /root/Desktop/chntpw-080526
編譯
#make
︿︿
簡單就搞定
開始作實驗
#suse-usb:~ # fdisk -l
Disk /dev/sda: 4108 MB, 4108320768 bytes
255 heads, 63 sectors/track, 499 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x04030201
Device Boot Start End Blocks Id System
/dev/sda1 1 53 425691 82 Linux swap / Solaris
/dev/sda2 * 54 499 3582495 83 Linux
Disk /dev/sdb: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x1fb51fb4
Device Boot Start End Blocks Id System
/dev/sdb1 * 1 9807 78774696 7 HPFS/NTFS
/dev/sdb2 9808 60801 409609305 7 HPFS/NTFS
看到我的Windows 磁碟機在 /dev/sdb1
建立掛載目錄
#mkdir /mnt/usb
掛載起來
#mount -t ntfs-3g /dev/sdb1 /mnt/usb/
使用 chntpw -l 列出系統內的帳號資料
一般來說 SAM資料庫會在 WINDOWS/system32/config 內
# /root/Desktop/chntpw-080526/chntpw -l /mnt/usb/WINDOWS/system32/config/SAM
chntpw version 0.99.6 080526 (sixtyfour), (c) Petter N Hagen
Hive name (from header): <\SystemRoot\System32\Config\SAM>
ROOT KEY at offset: 0x001020 * Subkey indexing type is: 666c
Page at 0x7000 is not 'hbin', assuming file contains garbage at end
File size 262144 [40000] bytes, containing 6 pages (+ 1 headerpage)
Used for data: 295/21536 blocks/bytes, unused: 10/2848 blocks/bytes.
* SAM policy limits:
Failed logins before lockout is: 0
Minimum password length : 0
Password history count : 0
| RID -|---------- Username ------------| Admin? |- Lock? --|
| 01f4 | Administrator | ADMIN | |
| 01f5 | Guest | | *BLANK* |
| 03e8 | HelpAssistant | | dis/lock |
| 03f2 | ines | ADMIN | *BLANK* |
| 03ec | Max | ADMIN | |
| 03f8 | root | | *BLANK* |
| 03ea | SUPPORT_388945a0 | | dis/lock |
| 03f6 | __vmware_user__ | | |
發現Max是ADMIN權限但是有密碼
root一般使用者 密碼為空白
移除Max的密碼
#/root/Desktop/chntpw-080526/chntpw -u Max /mnt/usb/WINDOWS/system32/config/SAM
chntpw version 0.99.6 080526 (sixtyfour), (c) Petter N Hagen
Hive name (from header): <\SystemRoot\System32\Config\SAM>
ROOT KEY at offset: 0x001020 * Subkey indexing type is: 666c
Page at 0x7000 is not 'hbin', assuming file contains garbage at end
File size 262144 [40000] bytes, containing 6 pages (+ 1 headerpage)
Used for data: 295/21536 blocks/bytes, unused: 10/2848 blocks/bytes.
* SAM policy limits:
Failed logins before lockout is: 0
Minimum password length : 0
Password history count : 0
| RID -|---------- Username ------------| Admin? |- Lock? --|
| 01f4 | Administrator | ADMIN | |
| 01f5 | Guest | | *BLANK* |
| 03e8 | HelpAssistant | | dis/lock |
| 03f2 | ines | ADMIN | *BLANK* |
| 03ec | Max | ADMIN | |
| 03f8 | root | | *BLANK* |
| 03ea | SUPPORT_388945a0 | | dis/lock |
| 03f6 | __vmware_user__ | | |
---------------------> SYSKEY CHECK <-----------------------
SYSTEM SecureBoot : -1 -> Not Set (not installed, good!)
SAM Account\F : 1 -> key-in-registry
SECURITY PolSecretEncryptionKey: -1 -> Not Set (OK if this is NT4)
***************** SYSKEY IS ENABLED! **************
This installation very likely has the syskey passwordhash-obfuscator installed
It's currently in mode = -1, Unknown-mode
SYSTEM (and possibly SECURITY) hives not loaded, unable to disable syskey!
Please start the program with at least SAM & SYSTEM-hive filenames as arguments!
RID : 1004 [03ec]
Username: Max
fullname: Max
comment :
homedir :
User is member of 3 groups:
00000221 = Users (which has 5 members)
00000220 = Administrators (which has 3 members)
0000022b = Remote Desktop Users (which has 1 members)
Account bits: 0x0210 =
[ ] Disabled | [ ] Homedir req. | [ ] Passwd not req. |
[ ] Temp. duplicate | [X] Normal account | [ ] NMS account |
[ ] Domain trust ac | [ ] Wks trust act. | [ ] Srv trust act |
[X] Pwd don't expir | [ ] Auto lockout | [ ] (unknown 0x08) |
[ ] (unknown 0x10) | [ ] (unknown 0x20) | [ ] (unknown 0x40) |
Failed login count: 0, while max tries is: 0
Total login count: 48
- - - - User Edit Menu:
1 - Clear (blank) user password
2 - Edit (set new) user password (careful with this on XP or Vista)
3 - Promote user (make user an administrator)
(4 - Unlock and enable user account) [seems unlocked already]
q - Quit editing user, back to user select
Select: [q] > 1 詢問如何處理,輸入1清空密碼
接下來
Password cleared!
Hives that have changed:
# Name
0
Write hive files? (y/n) [n] : y 詢問如何處理,輸入y寫入
使用指令查詢Max的密碼是否有被清空 chntpw -l SAM
#/root/Desktop/chntpw-080526/chntpw -l /mnt/usb/WINDOWS/system32/config/SAM
chntpw version 0.99.6 080526 (sixtyfour), (c) Petter N Hagen
Hive name (from header): <\SystemRoot\System32\Config\SAM>
ROOT KEY at offset: 0x001020 * Subkey indexing type is: 666c
Page at 0x7000 is not 'hbin', assuming file contains garbage at end
File size 262144 [40000] bytes, containing 6 pages (+ 1 headerpage)
Used for data: 295/21536 blocks/bytes, unused: 10/2848 blocks/bytes.
* SAM policy limits:
Failed logins before lockout is: 0
Minimum password length : 0
Password history count : 0
| RID -|---------- Username ------------| Admin? |- Lock? --|
| 01f4 | Administrator | ADMIN | |
| 01f5 | Guest | | *BLANK* |
| 03e8 | HelpAssistant | | dis/lock |
| 03f2 | ines | ADMIN | *BLANK* |
| 03ec | Max | ADMIN | *BLANK* |
| 03f8 | root | | *BLANK* |
| 03ea | SUPPORT_388945a0 | | dis/lock |
| 03f6 | __vmware_user__ | | |
Okay~~
enjoy it
星期日, 12月 21, 2008
在Linux 下轉換 WAV格式 為 MP3
今天去購買 創見的MP3
型號 T.sonic 630
錄音效果很好
功能也很多 ^^ ~~ 覺得這個錢花的有價值
錄音出來的格式為 WAV
在Open SuSE 下預設的Banshee 似乎不能播放 WAV檔
再來是 WAV檔案的格式也比 MP3來的大
所以就想說找一下 在Linux 內轉換音樂格式的軟體
後來找到 lame這個套件
使用man文件找到的範例
linux-wg5u:/home/max/Desktop # lame -h 1221m001.wav 1221m003.mp3
LAME 3.98.2 32bits (http://www.mp3dev.org/)
CPU features: MMX (ASM used), SSE (ASM used), SSE2
Using polyphase lowpass filter, transition band: 16538 Hz - 17071 Hz
Encoding 1221m001.wav to 1221m003.mp3
Encoding as 44.1 kHz single-ch MPEG-1 Layer III (11x) 64 kbps qval=2
Frame | CPU time/estim | REAL time/estim | play/CPU | ETA
1344/1344 (100%)| 0:02/ 0:02| 0:02/ 0:02| 12.813x| 0:00
---------------------------------------------------------------------------------------------------
kbps mono % long switch short %
64.0 100.0 98.3 1.0 0.8
Writing LAME Tag...done
ReplayGain: +13.3dB
就順利的轉換為MP3 格式啦
^__^
man 內的範例如下
**************************************************************
EXAMPLES
Fixed bit rate jstereo 128kbs encoding:
lame sample.wav sample.mp3
Fixed bit rate jstereo 128 kbps encoding, highest quality (recom‐
mended):
lame -h sample.wav sample.mp3
Fixed bit rate jstereo 112 kbps encoding:
lame -b 112 sample.wav sample.mp3
To disable joint stereo encoding (slightly faster, but less quality at
bitrates <= 128 kbps):
lame -m s sample.wav sample.mp3
**************************************************************
型號 T.sonic 630
錄音效果很好
功能也很多 ^^ ~~ 覺得這個錢花的有價值
錄音出來的格式為 WAV
在Open SuSE 下預設的Banshee 似乎不能播放 WAV檔
再來是 WAV檔案的格式也比 MP3來的大
所以就想說找一下 在Linux 內轉換音樂格式的軟體
後來找到 lame這個套件
使用man文件找到的範例
linux-wg5u:/home/max/Desktop # lame -h 1221m001.wav 1221m003.mp3
LAME 3.98.2 32bits (http://www.mp3dev.org/)
CPU features: MMX (ASM used), SSE (ASM used), SSE2
Using polyphase lowpass filter, transition band: 16538 Hz - 17071 Hz
Encoding 1221m001.wav to 1221m003.mp3
Encoding as 44.1 kHz single-ch MPEG-1 Layer III (11x) 64 kbps qval=2
Frame | CPU time/estim | REAL time/estim | play/CPU | ETA
1344/1344 (100%)| 0:02/ 0:02| 0:02/ 0:02| 12.813x| 0:00
---------------------------------------------------------------------------------------------------
kbps mono % long switch short %
64.0 100.0 98.3 1.0 0.8
Writing LAME Tag...done
ReplayGain: +13.3dB
就順利的轉換為MP3 格式啦
^__^
man 內的範例如下
**************************************************************
EXAMPLES
Fixed bit rate jstereo 128kbs encoding:
lame sample.wav sample.mp3
Fixed bit rate jstereo 128 kbps encoding, highest quality (recom‐
mended):
lame -h sample.wav sample.mp3
Fixed bit rate jstereo 112 kbps encoding:
lame -b 112 sample.wav sample.mp3
To disable joint stereo encoding (slightly faster, but less quality at
bitrates <= 128 kbps):
lame -m s sample.wav sample.mp3
**************************************************************
星期四, 12月 18, 2008
Sendmail 的 dsn: host unknown 問題解決
之前sendmail 在寄信的時候出現這樣的錯誤訊息
dsn: host unknown
奇怪的是
#host -t mx 網域名稱
#host 郵件伺服器的FQDN
也都沒有問題
試了很久~~~我想也有可能是很久沒睡了
找到這篇
http://www.webmasterworld.com/forum40/767.htm
在/etc/hosts 下面把相關的 IP 及 FQDN寫進去
然後重新啟動 sendmail
就回復正常了
dsn: host unknown
奇怪的是
#host -t mx 網域名稱
#host 郵件伺服器的FQDN
也都沒有問題
試了很久~~~我想也有可能是很久沒睡了
找到這篇
http://www.webmasterworld.com/forum40/767.htm
在/etc/hosts 下面把相關的 IP 及 FQDN寫進去
然後重新啟動 sendmail
就回復正常了
星期一, 12月 15, 2008
Wireshark 的 IO Graphs 功能
之前在使用Wireshark的時候, 大部分都是看封包的內容
比較少去對封包做一些分析的動作
最近在看一些Wireshark的一些影片, 所以就動手寫有關於 Wireshark的一些功能
讓自己記憶一下
以下是Wireshark 的 IO Graphs的圖片( 在statistcs --> IO Graphs) (就是把流量繪製成圖片)
使用這個功能的時候, 預設是針對所有的流量, 並繪製成黑色的線條
倘若我想比較同樣一個檔案, 但是針對兩台不同的Server 來觀察他們彼此的流量
那又該如何做呢?
在這邊我以下載 OpenSuSE 11.0 的DVD iso 來當例子
下載頁面
http://download.opensuse.org/distribution/11.0/iso/dvd/openSUSE-11.0-DVD-i386.iso?mirrorlist
在這個頁面, 我選取兩個不同的網站
一個在台灣, 一個在日本 來做測試
首先為了獲得相關資訊
我在Wireshark的 display filter 內使用 dns 的過濾條件, 來觀察台灣及日本的站台 IP位置

台灣的伺服器 IP 為 140.128.9.18
日本的伺服器 IP 為 134.160.38.1
接下來使用 IO Graphs 功能( 在statistcs --> IO Graphs)
先點選 Graph 1 將所有封包所繪製而成的黑線條 "取消"
--> 接下來 在 Graph 2 的Filter 欄位條件上 輸入 ip.addr==140.128.9.18
--> 點選 Graph 2 使其出現紅色線條(顯示台灣站台的流量)
--> 接下來 在 Graph 3 的Filter 欄位條件上 輸入 ip.addr==134.160.38.1
--> 點選 Graph 3 使其出現綠色線條(顯示日本站台的流量)
結果如下圖
接下來要調整相關的資訊, 來讓這個分析更好閱讀
在左下角的 X Axis區域內(也就是X軸)
我調整了
這樣以後就可以將不同的標的IP 來繪製不同的分析圖
另外可以藉由 儲存 功能, 將這個結果儲存成圖片格式
相當的方便
比較少去對封包做一些分析的動作
最近在看一些Wireshark的一些影片, 所以就動手寫有關於 Wireshark的一些功能
讓自己記憶一下
以下是Wireshark 的 IO Graphs的圖片( 在statistcs --> IO Graphs) (就是把流量繪製成圖片)
使用這個功能的時候, 預設是針對所有的流量, 並繪製成黑色的線條
那又該如何做呢?
在這邊我以下載 OpenSuSE 11.0 的DVD iso 來當例子
下載頁面
http://download.opensuse.org/distribution/11.0/iso/dvd/openSUSE-11.0-DVD-i386.iso?mirrorlist
在這個頁面, 我選取兩個不同的網站
- http://ftp.cs.pu.edu.tw/Linux/OpenSuse/distribution/11.0/iso/dvd/openSUSE-11.0-DVD-i386.iso
- http://ftp.riken.jp/Linux/opensuse/distribution/11.0/iso/dvd/openSUSE-11.0-DVD-i386.iso
一個在台灣, 一個在日本 來做測試
首先為了獲得相關資訊
我在Wireshark的 display filter 內使用 dns 的過濾條件, 來觀察台灣及日本的站台 IP位置

台灣的伺服器 IP 為 140.128.9.18
日本的伺服器 IP 為 134.160.38.1
接下來使用 IO Graphs 功能( 在statistcs --> IO Graphs)
先點選 Graph 1 將所有封包所繪製而成的黑線條 "取消"
--> 接下來 在 Graph 2 的Filter 欄位條件上 輸入 ip.addr==140.128.9.18
--> 點選 Graph 2 使其出現紅色線條(顯示台灣站台的流量)
--> 接下來 在 Graph 3 的Filter 欄位條件上 輸入 ip.addr==134.160.38.1
--> 點選 Graph 3 使其出現綠色線條(顯示日本站台的流量)
結果如下圖
接下來要調整相關的資訊, 來讓這個分析更好閱讀在左下角的 X Axis區域內(也就是X軸)
我調整了
- Tick interval: 為 10 sec ( 就是間隔為 10秒)
- Pixels per tick 10 (每個點要有10圖點pixel)
- 勾選 View as time of the day ( 顯示時間)
這樣以後就可以將不同的標的IP 來繪製不同的分析圖另外可以藉由 儲存 功能, 將這個結果儲存成圖片格式
相當的方便
星期日, 12月 07, 2008
在Windows 背景顯示系統資訊
訂閱:
文章 (Atom)