2013年4月20日 星期六

最近把老電腦的硬碟换成CF卡

想說用硬碟太吵,光碟開機太慢(Linux可用光碟跑)
就買了CF轉IDE介面卡
說句實話,挺快的
放上hdparm跑的數據
/dev/sda: Timing cached reads: 288 MB in 2.00 seconds = 143.79 MB/sec Timing buffered disk reads: 82 MB in 3.01 seconds = 27.23 MB/sec 使用的硬體 processor : 0 vendor_id : GenuineIntel cpu family : 6 model : 11 model name : Intel(R) Celeron(TM) CPU 1000MHz 00:00.0 Host bridge: VIA Technologies, Inc. VT82C693A/694x [Apollo PRO133x] (rev c4) 00:01.0 PCI bridge: VIA Technologies, Inc. VT82C598/694x [Apollo MVP3/Pro133x AGP] 00:07.0 ISA bridge: VIA Technologies, Inc. VT82C686 [Apollo Super South] (rev 40) 00:07.1 IDE interface: VIA Technologies, Inc. VT82C586A/B/VT82C686/A/B/VT823x/A/C PIPC Bus Master IDE (rev 06) 00:07.2 USB controller: VIA Technologies, Inc. VT82xxxxx UHCI USB 1.1 Controller (rev 1a) 00:07.4 SMBus: VIA Technologies, Inc. VT82C686 [Apollo Super ACPI] (rev 40) 00:07.5 Multimedia audio controller: VIA Technologies, Inc. VT82C686 AC97 Audio Controller (rev 50) 00:09.0 Ethernet controller: VIA Technologies, Inc. VT6102 [Rhine-II] (rev 43) 00:0b.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL-8169 Gigabit Ethernet (rev 10) 01:00.0 VGA compatible controller: nVidia Corporation NV5M64 [RIVA TNT2 Model 64/Model 64 Pro] (rev 15) ata1.00: CFA: CF CARD, 20100329, max UDMA/133 ata1.00: 31293360 sectors, multi 0: LBA ata1.00: limited to UDMA/33 due to 40-wire cable ata1.00: configured for UDMA/33 scsi 0:0:0:0: Direct-Access ATA CF CARD 2010 PQ: 0 ANSI: 5 sd 0:0:0:0: [sda] 31293360 512-byte logical blocks: (16.0 GB/14.9 GiB) sd 0:0:0:0: [sda] Write Protect is off sd 0:0:0:0: [sda] Mode Sense: 00 3a 00 00 sd 0:0:0:0: [sda] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA
其實跑有關資料的話挺快的,雖然沒真的固態硬碟快
對於老舊的電腦來說確實提高効能了

2013年2月27日 星期三

關於多顯示畫面的xorg.conf設定

主要設定區ServerLayout
Section "ServerLayout"
Identifier "X.org Configured"
Screen 0 "Screen0" 0 0 #主畫面位置
Screen 1 "Screen1" LeftOf "Screen0" #第二畫面位置
InputDevice "Mouse0" "CorePointer"
InputDevice "Keyboard0" "CoreKeyboard"
Option "Xinerama" "on" # Xinerama功能
EndSection

2013年1月26日 星期六

换了ATI的顯卡,重新設定Xwindow

因為换了ATI顯卡所以把kernel重編譯並且修改了xorg.conf
Section "Device"
Identifier "Card0"
Driver "radeon" # 主要把Driver改ㄧ下就可以了
#Option "monitor-VGA" "Monitor0"
BusID "PCI:1:0:0"
EndSection
不過如果裝ATI的驅動程式開雙顯卡會產生x window的錯誤
所以咧,我就没裝

2012年11月23日 星期五

把excel的資料轉到MySQL中

因爲公司的一些資料(excel)要轉到MySQL因此寫了個小小的awk應用

首先要把excel中的資料的欄位跟MySQL中的資料表作好對應

MySQL的欄位有

1.單號

2.品名

.....(N項欄位)

因此Excel中也要對應以上欄位

第一步 對應欄位

第二步 Excel存成CVS檔

第三步 建一個awk用的script,如下所示

{ FS = "," },{ printf("INSERT INTO dbname.tablename /x85單號,品名/x86 VALUE /x85/'%s/',/'%s/'/x86",$1,$2) }

以上用printf的部分可以參考C語言中printf的説明

/x85表( 左括弧

/x86表) 右括弧

/' 表示字元'

第四步 轉換啦

awk -f 剛冩的script檔名 Excel.csv > 要轉的檔名.sql

第五步 匯入MySQL

mysql -u root -p < 要轉的檔名.sql

基本上這様是因爲MySQL中有資料,用這樣的方式來増加資料

其實Linux中如果把sed,awk,grep等

弄很熟那處理可真方便

2012年11月6日 星期二

來個雙顯示器跟不同顯示卡設定

顯卡1是Nvidia的620
顯卡2是Intel的HD內建顯示部份

主要更動
檔案xorg.conf
#設定畫面位置
Section "ServerLayout"
   Identifier "X.org Configured"
  Screen 0 "Screen0" 0 0
  #第二劃面於第一畫面的右邊
  Screen 1 "Screen1" RightOf "Screen0"
EndSection

#第ㄧ螢幕設定
Section "Monitor"
  Identifier "Monitor0"
  VendorName "PHILIPS"
  ModelName "170S7FS"
  HorizSync 30-83
  BertRefresh 56-76
EndSection

#第二螢幕設定
Section "Monitor"
  Identifier "Monitor0"
  VendorName "ViewSonic"
  ModelName "VE710S"
  HorizSync 30-80
  BertRefresh 50-85
EndSection

#第ㄧ顯卡設定
Section "Device"
  Identifier "Card0"
  Dricer "nouveau"
  BusID "PCI:1:0:0"
EndSection
#第二顯卡設定
Section "Device"
  Identifier "Card1"
  Dricer "intel"
  BusID "PCI:0:2:0"
EndSection

#設定第一畫面
Section "Screen"
  Identifier "Screen0"
  Device "Card0"
  Monitor "Monitor0"
  DefaultDepth 24
  SubSection "Display"
    Viewport 0 0
    Depth 1
  EndSubSection
  SubSection "Display"
    Viewport 0 0
    Depth 4
  EndSubSection
  SubSection "Display"
    Viewport 0 0
    Depth 8
  EndSubSection
  SubSection "Display"
    Viewport 0 0
    Depth 15
  EndSubSection
  SubSection "Display"
    Viewport 0 0
    Depth 16
   EndSubSection
  SubSection "Display"
    Viewport 0 0
    Depth 24
  EndSubSection
EndSection

#設定第二畫面
Section "Screen"
  Identifier "Screen1"
  Device "Card1"
  Monitor "Monitor1"
  DefaultDepth 24
  SubSection "Display"
    Viewport 0 0
    Depth 1
   EndSubSection
  SubSection "Display"
    Viewport 0 0
    Depth 4
  EndSubSection
  SubSection "Display"
     Viewport 0 0
     Depth 8
  EndSubSection
  SubSection "Display"
    Viewport 0 0
    Depth 15
  EndSubSection
  SubSection "Display"
    Viewport 0 0
    Depth 16
  EndSubSection
  SubSection "Display"
    Viewport 0 0
    Depth 24
  EndSubSection
EndSection


另外有時開機時顯卡互搶第一位置時
利用mkinitrd把要當第一顯卡的modules先放到initrd.gz

2012年11月2日 星期五

更新Slackware到14.0

其實只是換比較新的套件啦
順到把kernel的版本改到3.4.1
這也是有原因的,因爲G620的CPU有顯視的部份
而Slackware14.0附的kernel3.2.29不支援-_-
應該說3.2.xx都沒有支援
所以更新kernel到3.4.1以上就對了

2012年8月29日 星期三

intel G620新主機

前些陣子小弟的主機板掛了,雖然自己很努力的修一下,但還是沒修好(喵的咧,換個小小的電阻也搞不定)
就敗了一下
Intel G620 2.63GHz
技嘉H77M-D3H
技嘉GV-N620D3-1G
Kingston DDR3 4GB x 2
新的電源供應器一台

以上花了快1萬
反正硬碟照舊使用,雖然IDE的硬碟可以收起來了orz
因此決定重灌Slackware 13.36 (64位元)
順便試試速度怎樣
其實狀況看來還可以啦雖然得把核心更新到3.0.x(逐步更新調整中)


其實換了新的CPU+主機板+顯卡+ram
事實上好像還是覺得浪費啊,雖然我已經挑比較低階了,還是覺得浪費啊

經過這次也順道把原本當防火牆的主機從硬碟換成CF卡
把一顆很吵的硬碟換成CF卡後,剩下的就是風扇聲,創造了安靜的環境,也創造速度

過程也挺簡單的,拿片開機光碟然後對CF卡做規劃跟格式化,來個cp 輕輕鬆鬆搞定
再開機一次,從光碟開機然後從CF卡載入root的部分,最後來個lilo -v -v -v,重開後完成