1
[^ ]\{0,50\}:代表非空字串的0~50個字元
example:
a
aa
ww
dddddddd=
"$%^lkkkkkkkkkkkkkkk
123456789
2
^[^ ]\{0,50\}:代表開頭的一組字串
expample:
qq0)" abcd ef =
結果:qq0)"
3.sed技巧:
sed -n "s/\([^ ]\{0,50\} [^ ]\{0,50\}=[^ ]\{0,50\} [^ ]\{0,50\}=[^ ]\{0,50\} [^ ]\{0,50\}=[^ ]\{0,50\} [^ ]\{0,50\}=[^ ]\{0,50\}\)/gggggggg\1/gp" $1|sed -n "s/\(^[^ ]\{0,50\}\)/\1 sssss/gp"|sed -n "s/sssss.*gggggggg//gp"
先把正規找到用\(\)保留起來,用\1取得,再插入一各式別字串,再拿掉不想要的
example
dd gg kk ll opr ldd
->dd gg --- kk ll opr pppp ldd 插入---和***
->dd gg ldd 拿掉---.*pppp
read more...
2009年5月1日 星期五
ubuntu9.04已經正式釋出



















最近ubuntu9.04正式釋出,10月會再釋出9.10,9.04是採用ext4,網路上說跑起來超快地(開機25秒),反正linux出新的我都會裝來玩,我是用linux的bt,下載i386DVD版來玩,安裝linux都大同小異,裝linux其實超簡單的,我裝在我的notebook(msi s270),這台裝有3套作業系統,安裝時不要先接網路,裝完把來源換成官方的(/etc/apt/sources.list),再去接網路,更新,這樣較安全,使用上,ubutu9.04,只能說執行真是太快,驅動幾乎都抓到了,wifi是後來裝上去的,使用上是超好用的作業系統,進步真大,是一流的OS.軟體也都是最新的openoffice3.0,firefox3.0,還有brasero燒錄軟體.........., LINUX才是最強的.
後記:另一台asus w7j所有驅動都抓到了,顯卡驅動從系統添加就可,運行起來更加快速,這台有獨立顯卡.開了3d特效,cad,rm電影,mp3,firefox,synaptc....cpu使用率不到40%
(下圖)在桌面畫圖

爆炸特效(超炫的,要動畫才看的出來)
read more...
2009年4月12日 星期日
今天入手asus VW266H螢幕NT13200



本來是用3隻鳥20吋螢幕,還是覺得太小,在網路看到asus VW266H(26吋)真的覺得這款螢幕真是超值(hdmi、dvi、色差),拿來街數位電視盒當電視或接wii都OK,就下手去光華附近的采河,有現貨,一看老闆就知道是老實做生意的,現場測機(亮暗點),一口價NT13200,我再買了一個壓克力護目鏡NT700,共NT13900,螢幕的speaker其實音質音量還不錯,外型也不錯,圖是用手機拍的有點糊,說真的螢幕真的很大,只能說現在的3C產品真是有購便宜.
read more...
2009年4月10日 星期五
Debian5.0(lenny) 安裝無線網卡




method 1:(it is Error by modprobe ndiswrapper)
1.要用到的套件linux-headers-2.6.26-1-686,gcc,make(install by Synaptic or apt)
apt-get install linux-headers-2.6.26-1-686 gcc make
2.先用Synaptic的deb(search ndiswrapper並安裝)看看,若不行就自己make(下載ndiswrapper-1.54.tar.gz自己編譯make)
3.找windows的驅動程式XXXX.inf(可用介面安裝)
ndiswrapper -i neti2220.inf
4.載入module
modprobe ndiswrapper
假如沒有錯誤訊息,就表示驅動程式現在應該是已經載入了
5到系統 ->管理->網路,應該會看到無線網路
method 2:(it is OK to install wifi)
1.要用到的套件linux-headers-2.6.26-1-686,gcc,make(install by Synaptic or apt)
apt-get install linux-headers-2.6.26-1-686 gcc make
2.下載ndiswrapper-1.54.tar.gz自己編譯make
3.解開ndiswrapper-1.54.tar.gz
tar zxvf ndiswrapper-1.54.tar.gz
4.make ndiswrapper(看INSTALL檔 )
cd ndiswrapper-1.54
make uninstall
make
make install
5.找windows的驅動程式XXXX.inf
ndiswrapper -i neti2220.inf
6.載入module
modprobe ndiswrapper
7.假如沒有錯誤訊息,就表示驅動程式現在應該是已經載入了
我這台筆電MSI(S270)是最早的那版(2005年7月),用了快4年,
只修過1次光碟機,其他都沒壞過,只能說MSI的比電真耐用,
我電腦是不用隨機版作業系統(爛),自己重裝OS最好用.
下面這幾行只是我的筆記和主題無關(用deb的source,編成deb,然後install,/usr/src)
my note:(make a source to deb and install it)
module-assistant prepare
module-assistant build ndiswrapper
module-assistant install ndiswrapper
read more...
2009年4月7日 星期二
桌機今天也改成Debian5.0(lenny).


桌機是AM2,裝幾次終於搞定了lenny,安裝時網路一彪到超過200k/s就會斷線要一直開關ADSL,找一個比較慢的映射站台就OK,裝完開LAKER劃layout很慢,會頓,gnome中文字型會破碎,想到要裝顯卡驅動程式,我的是asus 7300gs,就用google找lenny裝nvidia驅動方法,試好幾次,開機都沒nvidia的log,最後終於還是跑出了nvidia的logo,安裝顯卡驅動成功,在開一次LAKER試劃LAYOUT看看,哇太滿意了,超快,嘿嘿.
一貫作風,用再生龍,將整顆硬碟映像檔備份到第2顆硬碟
/etc/X11/xorg.conf
# nvidia-xconfig: X configuration file generated by nvidia-xconfig
# nvidia-xconfig: version 1.0 (buildd@ninsei) Fri Sep 5 22:23:08 UTC 2008
Section "ServerLayout"
Identifier "Layout0"
Screen 0 "Screen0"
InputDevice "Keyboard0" "CoreKeyboard"
InputDevice "Mouse0" "CorePointer"
EndSection
Section "Files"
RgbPath "/usr/X11R6/lib/X11/rgb"
EndSection
Section "Module"
Load "dbe"
Load "extmod"
Load "type1"
Load "freetype"
Load "glx"
EndSection
Section "InputDevice"
# generated from default
Identifier "Mouse0"
Driver "mouse"
Option "Protocol" "auto"
Option "Device" "/dev/psaux"
Option "Emulate3Buttons" "no"
Option "ZAxisMapping" "4 5"
EndSection
Section "InputDevice"
# generated from default
Identifier "Keyboard0"
Driver "kbd"
EndSection
Section "Monitor"
Identifier "Monitor0"
VendorName "Unknown"
ModelName "Unknown"
HorizSync 30.0 - 110.0
VertRefresh 50.0 - 150.0
Option "DPMS"
EndSection
Section "Device"
Identifier "Device0"
Driver "nvidia"
VendorName "NVIDIA Corporation"
EndSection
Section "Screen"
Identifier "Screen0"
Device "Device0"
Monitor "Monitor0"
DefaultDepth 24
SubSection "Display"
Depth 24
EndSubSection
EndSection
read more...
2009年4月5日 星期日
LAKER 和 TCL
環境變數
取得環境變數:$env(環境變數)
example :
puts $env(PATH)
加上layout window選單
我希望我寫的TCL放在一固定目錄,任何目錄下開LAKER就會去source它,先給一各環境變數
譬如我在.bashrc加上export TCL_PATH="~/......./TCL"
laker.rc加上
[SourceTcl]
Source1 = $env(TCL_PATH)/demo.tcl
當開啟LAKER就會去找到正確的位置,這樣很方便
加上選單時我也用$env(TCL_PATH)/demo.menu去取得了選單menu
gtAppendBannerMenu -windowType leoDsgWnd -file $env(TCL_PATH)/demo.menu
掛上選單還有一個方法,修改install_laker/etc/leoDsgWnd.menu,在Top這項加上一個選單
Menu Top
{
...................
...................
"LAYTOOLS" _X f.menu "LAYTOOLS"
}
Menu LAYTOOLS
{
"Bmp File to Layout LOGO" _B f.tcl "bitmap" "source bitmap.tcl"
"Creat Layout Cell from source" _C f.tcl "bitmap" "puts $env(TCL_PATH)"
"Gen Layout Device from source" _G f.tcl "bitmap" "source menu.tcl"
"Auto Creat Via" _V f.tcl "Via " "source creatvia.tcl"
}
這樣也可以
注意f.menu和f.tcl是指選單或是要跑tcl,f.separator則是分隔線
全域變數(::雙冒號)
set ::tclpath $env(PATH)
取得全域變數(一樣用$)
puts $::tclpath
source $::tclpath/test.tcl
指定net(MCELL transistor)
lakerAttribute -index 1 -netName kk -glueNo 3
lakerAttribute -index 1 -netName kk -glueNo 2
lakerAttribute -index 1 -netName kk -glueNo 1
3,2,1代表S,G.D
取得滑鼠座標
lakerGetCurPos
read more...
取得環境變數:$env(環境變數)
example :
puts $env(PATH)
加上layout window選單
我希望我寫的TCL放在一固定目錄,任何目錄下開LAKER就會去source它,先給一各環境變數
譬如我在.bashrc加上export TCL_PATH="~/......./TCL"
laker.rc加上
[SourceTcl]
Source1 = $env(TCL_PATH)/demo.tcl
當開啟LAKER就會去找到正確的位置,這樣很方便
加上選單時我也用$env(TCL_PATH)/demo.menu去取得了選單menu
gtAppendBannerMenu -windowType leoDsgWnd -file $env(TCL_PATH)/demo.menu
掛上選單還有一個方法,修改install_laker/etc/leoDsgWnd.menu,在Top這項加上一個選單
Menu Top
{
...................
...................
"LAYTOOLS" _X f.menu "LAYTOOLS"
}
Menu LAYTOOLS
{
"Bmp File to Layout LOGO" _B f.tcl "bitmap" "source bitmap.tcl"
"Creat Layout Cell from source" _C f.tcl "bitmap" "puts $env(TCL_PATH)"
"Gen Layout Device from source" _G f.tcl "bitmap" "source menu.tcl"
"Auto Creat Via" _V f.tcl "Via " "source creatvia.tcl"
}
這樣也可以
注意f.menu和f.tcl是指選單或是要跑tcl,f.separator則是分隔線
全域變數(::雙冒號)
set ::tclpath $env(PATH)
取得全域變數(一樣用$)
puts $::tclpath
source $::tclpath/test.tcl
指定net(MCELL transistor)
lakerAttribute -index 1 -netName kk -glueNo 3
lakerAttribute -index 1 -netName kk -glueNo 2
lakerAttribute -index 1 -netName kk -glueNo 1
3,2,1代表S,G.D
取得滑鼠座標
lakerGetCurPos
read more...
2009年4月4日 星期六
訂閱:
文章 (Atom)