2008/05/15

Fedora 9最小安裝 minimal install

以文字模式安裝,所有套件全部不選,而且要點到選擇各套件的選項,然後每一個都不勾,
這樣下來預設的最小安裝有403個rpm,也近900多MB;
因不用任何的Xorg相關的東西,也沒有用volume raid等東西,
竟可移除剩302個rpm;敢移除的是因知道確實不會用到而移除,
有些像wireless-tools想移,但又會與其他的rpm綁在一起,所以就沒得去移,
以下是移掉除預設最小安裝外的其他可移的rpm:
alsa-lib-1.0.16-3.fc9.x86_64
avahi-0.6.22-10.fc9.x86_64
avahi-compat-libdns_sd-0.6.22-10.fc9.x86_64
avahi-glib-0.6.22-10.fc9.x86_64
bluez-gnome-0.25-1.fc9.x86_64
bluez-libs-3.30-1.fc9.x86_64
bluez-utils-3.30-2.fc9.x86_64
cairo-1.6.4-1.fc9.x86_64
ccid-1.2.1-4.fc9.x86_64
ConsoleKit-0.2.10-3.fc9.x86_64
coolkey-1.1.0-6.fc9.x86_64
cups-1.3.7-1.fc9.x86_64
cups-libs-1.3.7-1.fc9.x86_64
desktop-file-utils-0.15-1.fc9.x86_64
dhclient-4.0.0-14.fc9.x86_64
dhcpv6-client-1.0.14-1.fc9.x86_64
dump-0.4b41-7.1.fc9.x86_64
GConf2-2.22.0-1.fc9.x86_64
giflib-4.1.3-9.x86_64
gnome-keyring-2.22.1-1.fc9.x86_64
gpm-1.20.1-90.fc9.x86_64
gtk2-2.12.9-5.fc9.x86_64
gvfs-0.2.3-11.fc9.x86_64
hal-0.5.11-0.7.rc2.fc9.x86_64
hal-info-20080317-6.fc9.noarch
hicolor-icon-theme-0.10-4.noarch
ifd-egate-0.05-20.x86_64
irda-utils-0.9.18-4.fc9.x86_64
isdn4k-utils-3.2-58.fc9.x86_64
java-1.5.0-gcj-1.5.0.0-21.fc9.x86_64
java-1.6.0-openjdk-1.6.0.0-0.10.b09.fc9.x86_64
java-1.6.0-openjdk-plugin-1.6.0.0-0.10.b09.fc9.x86_64
java_cup-0.10-0.k.6jpp.2.x86_64
jpackage-utils-1.7.5-1jpp.1.fc9.noarch
libgcj-4.3.0-8.x86_64
libICE-1.0.4-3.fc9.x86_64
libnotify-0.4.4-10.fc9.x86_64
libogg-1.1.3-9.fc9.x86_64
libSM-1.0.2-5.fc9.x86_64
libsmbclient-3.2.0-1.pre3.9.fc9.x86_64
libvorbis-1.2.0-3.fc9.x86_64
libwnck-2.22.1-1.fc9.x86_64
libX11-1.1.4-1.fc9.x86_64
libXau-1.0.3-5.fc9.x86_64
libxcb-1.1-4.fc9.x86_64
libXcomposite-0.4.0-4.fc9.x86_64
libXcursor-1.1.9-2.fc9.x86_64
libXdamage-1.1.1-4.fc9.x86_64
libXdmcp-1.0.2-5.fc9.x86_64
libXext-1.0.4-1.fc9.x86_64
libXfixes-4.0.3-3.fc9.x86_64
libXft-2.1.12-5.fc9.x86_64
libXi-1.1.3-4.fc9.x86_64
libXinerama-1.0.3-1.fc9.x86_64
libXrandr-1.2.2-3.fc9.x86_64
libXrender-0.9.4-3.fc9.x86_64
libXres-1.0.3-4.fc9.x86_64
libXt-1.0.4-5.fc9.x86_64
libXtst-1.0.3-3.fc9.x86_64
libXxf86vm-1.0.1-5.fc9.x86_64
lrzsz-0.12.20-23.fc9.x86_64
mesa-libGL-7.1-0.29.fc9.x86_64
minicom-2.3-2.fc9.x86_64
mozplugger-1.10.1-1.x86_64
nano-2.0.6-4.fc9.x86_64
NetworkManager-0.7.0-0.9.3.svn3623.fc9.x86_64
NetworkManager-glib-0.7.0-0.9.3.svn3623.fc9.x86_64
nfs-utils-1.1.2-2.fc9.x86_64
nfs-utils-lib-1.1.1-3.fc9.x86_64
notification-daemon-0.3.7-9.fc9.x86_64
nscd-2.8-3.x86_64
nss_ldap-259-3.fc9.x86_64
obex-data-server-0.3.1-1.fc9.x86_64
ORBit2-2.14.12-3.fc9.x86_64
pam_smb-1.1.7-8.2.2.x86_64
pango-1.20.1-1.fc9.x86_64
paps-0.6.8-5.fc9.x86_64
paps-libs-0.6.8-5.fc9.x86_64
pcsc-lite-1.4.4-3.fc9.x86_64
pinfo-0.6.9-7.fc9.x86_64
pm-utils-1.1.0-7.fc9.x86_64
ppp-2.4.4-6.fc9.x86_64
radeontool-1.5-3.fc9.x86_64
redhat-lsb-3.1-19.fc8.x86_64
rmt-0.4b41-7.1.fc9.x86_64
rpcbind-0.1.4-14.fc9.x86_64
rp-pppoe-3.8-3.fc9.x86_64
samba-common-3.2.0-1.pre3.9.fc9.x86_64
samba-winbind-3.2.0-1.pre3.9.fc9.x86_64
sinjdoc-0.5-6.fc9.x86_64
smartmontools-5.38-2.fc9.x86_64
smartmontools-config-5.38-2.fc9.x86_64
sox-14.0.1-1.fc9.x86_64
startup-notification-0.9-4.fc9.x86_64
tzdata-java-2008b-1.fc9.noarch
wpa_supplicant-0.6.3-5.fc9.x86_64
wvdial-1.60-5.fc9.x86_64
xdg-utils-1.0.2-4.fc9.noarch
xorg-x11-filesystem-7.3-1.fc9.noarch
ypbind-1.20.4-4.fc9.x86_64
yp-tools-2.9-3.x86_64

移掉這些後大概700MB左右吧,
在這樣環境下才再裝其他需要的套件。

Labels: , , ,

2008/03/13

install RTeX plugins in Rails

到vender/plugins執行:
svn co http://rtex.rubyforge.org/svn/trunk/

將trunk目錄改名成rtex

Labels: , , ,

2008/01/20

讓Ruby on Rails顯示中文日期

參考幾處文章、互相雜湊測試終於成了!

Localization for Ruby's Time#strftime
http://poocs.net/2005/10/4/localization-for-rubys-time-strftime
(該文內有好幾處相關連結)
知道大概要去改
Date::ABBR_DAYNAMES
Date::DAYNAMES
Date::ABBR_MONTHNAMES
Date::MONTHNAMES
這些值成中文才會顯示出來,但依該文的範例總試不出。

解決的關鍵是看到了好像:
http://b.hatena.ne.jp/entry/2556154
所提供的連結,但找不到該網頁,但從google的cache找到了,
現在又找不大到,但類似是:
http://www.notice.co.jp/2007/11/23-202508
中的範例。
另找到法文的範例:
http://thecaribbeanweblog.com/index.php/2007/03/14/129-rails-dates-en-francais
最後把日文改中文,就是以下的字樣:

Date::ABBR_DAYNAMES.replace %w(日 一 二 三 四 五 六)
Date::DAYNAMES.replace %w(星期日 星期一 星期二 星期三 星期四 星期五 星期六)
Date::ABBR_MONTHNAMES.replace %w(1月 2月 3月 4月 5月 6月 7月 8月 9月 10月 11月 12月)
Date::MONTHNAMES.replace %w(一月 二月 三月 四月 五月 六月 七月 八月 九月 十月 十一月 十二月)

然後把這些貼到config/environment.rb
最上面,重啟動lighttpd,會出現錯誤,
最上面再補加 require 'date'再啟動就成了。
但發現query month為1時出現是二月
query month 12時反而空,
把月的array補上 nil,
所以貼上以下字樣到 config/environment.rb 就OK了!
--------------------
require 'date'
Date::ABBR_DAYNAMES.replace %w(日 一 二 三 四 五 六)
Date::DAYNAMES.replace %w(星期日 星期一 星期二 星期三 星期四 星期五 星期六)
Date::ABBR_MONTHNAMES.replace %w(nil 1月 2月 3月 4月 5月 6月 7月 8月 9月 10月 11月 12月)
Date::MONTHNAMES.replace %w(nil 一月 二月 三月 四月 五月 六月 七月 八月 九月 十月 十一月 十二月)
---------------------
測試一下結果:
>> Calendar.find(5).date.to_s
=> "2008-01-05"
>> Calendar.find(5).date.strftime('%A')
=> "星期六"
>> Calendar.find(5).date.strftime('%a')
=> "六"
>> Calendar.find(5).date.strftime('%B')
=> "一月"
>> Calendar.find(5).date.strftime('%b')
=> "1月"

至於為什麼要讓日期出現中文呢?
是為了要使calendar_helper以中文出現:
http://wiki.rubyonrails.org/rails/pages/DynamicCalendarHelper
依其範例加一些參數,尤其:abbrev以6..8的值才會出現星期的第三個字。

calendar({:year => @year, :month => @month, :first_day_of_week => 1,
:previous_month_text => '<<', :next_month_text => '>>', :abbrev => (6..8)}) do |d|
cell_text = "#{d.mday}
"

Labels: , , , , , ,

2007/09/23

Fedora 7 上安裝 V-Gear的WebCam: Live TalkCam

前一陣子買了便宜的webcam:
V-Gear TalkCam Live激
V-Gear 拍拍看 Live激
http://v-gear.com.tw/products/intro.asp?CATEGORY1_ID=D01&CATENAME=WebCam+%BA%F4%B8%F4%C4%E1%BCv%BE%F7&PROD_ID=AMVG1-010-063-02-G
http://buy.yahoo.com.tw/gdsale/gdsale.asp?gdid=422433

參考了這篇:
How To Set Up A Debian Linux WebCam Server Using a USB Web Cam
http://www.aboutdebian.com/webcam.htm

想在Fedora 7 上跑webcam,
無法馬上抓到該設備,
參閱網路上的一些說明而OK。

1.
# lsusb
Bus 002 Device 001: ID 0000:0000
Bus 001 Device 001: ID 0000:0000
Bus 001 Device 002: ID 0c45:612c Microdia
得知 USB的ID序號是 0c45:612c

2.
# lsusb -d 0c45:612c -v |less
Bus 001 Device 002: ID 0c45:612c Microdia
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 1.10
bDeviceClass 0 (Defined at Interface level)
bDeviceSubClass 0
bDeviceProtocol 0
bMaxPacketSize0 64
idVendor 0x0c45 Microdia
idProduct 0x612c
bcdDevice 1.01
iManufacturer 0
iProduct 1 USB camera
iSerial 0
bNumConfigurations 1
......

3.
安裝以下兩工具可控制webcam
yum install v4l2-tool xawtv

為了compiling新的driver而要裝kernerl的source
yum install kernel-devel

4.
抓相容許多usb webcam的driver並compiling
wget http://mxhaard.free.fr/spca50x/Download/gspcav1-20070508.tar.gz
tar zxvf gspcav1-20070508.tar.gz
cd gspcav1-20070508
make
make install

5.
modprobe gspca
就可抓到webcam,
然後下指令看到更詳細的資料:
xawtv -hwscan
This is xawtv-3.95, running on Linux/i686 (2.6.22.5-76.fc7)
looking for available devices
/dev/video0: OK [ -device /dev/video0 ]
type : v4l
name : Typhoon Easy Cam 1.3 MPix
flags: capture

6.
參考:
http://ubuntuforums.org/archive/index.php/t-38215.html
v4lctl -c /dev/video0 list
看到更詳細的資訊:
attribute | type | current | default | comment
-----------+--------+---------+---------+-------------------------------------
input | choice | (null) | SN9CXXX | SN9CXXX
norm | choice | PAL | PAL | PAL NTSC SECAM AUTO
bright | int | 4144 | 0 | range is 0 => 65535
hue | int | 0 | 0 | range is 0 => 65535
color | int | 32768 | 0 | range is 0 => 65535
contrast | int | 16128 | 0 | range is 0 => 65535

7.
把webcam抓到的畫面放到某web,
透過ftp,就裝vsftpd:
yum install vsftpd

8.
參考:
http://phorum.study-area.org/viewtopic.php?t=20881
設定Virtual User:
http://gentoo-wiki.com/HOWTO_vsftpd#Virtual_Users
編輯/etc/vsftpd/vsftpd.conf

anonymous_enable=NO
local_enable=YES
write_enable=YES
local_umask=022
anon_upload_enable=NO
dirmessage_enable=YES
xferlog_enable=YES
connect_from_port_20=YES
xferlog_std_format=YES
chroot_local_user=YES
listen=YES
pam_service_name=vsftpd
userlist_enable=YES
tcp_wrappers=YES
guest_enable=YES
guest_username=virtual_user_name
anon_upload_enable=YES

9.
在Xwindow上執行:
xawtv
即可看到畫面。

10.
編輯.webcamrc

[grab]
device = /dev/video0
width = 320
height = 240
delay = 0
input = SN9CXXX
norm = pal
quality = 75
trigger = 180

[ftp]
host = localhost
user = virtual_user_name_for_ftp
pass = password_for_login
dir = /where/web/html/directory
file = webcam.jpeg
tmp = uploading.jpeg
local = 1

11.
執行webcam
就會不斷更新webcam.jpeg了!

Labels: , , , , , ,

2007/08/17

How to Install and configure Clamav-milter on Fedora 7

If install clamav-milter by yum,
will install the following rpm packages:

fedora-usermgmt-default-fedora-setup.noarch
fedora-usermgmt-core.noarch
fedora-usermgmt-shadow-utils.noarch
fedora-usermgmt.noarch
clamav-filesystem.i386
clamav-data.i386
clamav-lib.i386
clamav-milter.i386
clamav-milter-sysv.i386
clamav-update.i386

but the installed clamav version is 0.90.3-1.fc7 out of date.

I want to install new 0.91.1 version clamav-milter by rpm,
and finding here:
http://download.fedora.redhat.com/pub/fedora/linux/updates/testing/7/i386/
with some new version 0.91.1 clamav-milter.
and some release or bug information here:
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=248482

the following is installing steps:
1.
remove the mentioned rpm packages.

2.
yum install fedora-usermgmt, because this package is nessary to install clamav-milter.

3.
get these rpm files:
clamav-lib-0.91.1-1.fc7.i386.rpm
clamav-data-0.91.1-1.fc7.i386.rpm
clamav-filesystem-0.91.1-1.fc7.i386.rpm
clamav-milter-0.91.1-1.fc7.i386.rpm
clamav-milter-sysv-0.91.1-1.fc7.i386.rpm
clamav-update-0.91.1-1.fc7.i386.rpm
from:
http://download.fedora.redhat.com/pub/fedora/linux/updates/testing/7/i386/

4.
import rpm gpg key:
rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-test

5.
rpm install up mentioned packages.

6.
edit /etc/freshclam.conf
change following lines to:
#Example
DatabaseDirectory /var/lib/clamav
PidFile /var/run/freshclam.pid
DatabaseOwner clamav

7.
edit /etc/clamd.d/milter.conf
change following lines to:
#Example
LogTime yes
LogSyslog yes
PidFile /var/run/clamav-milter/clamd.pid
TemporaryDirectory /tmp
DatabaseDirectory /var/lib/clamav
#LocalSocket /var/run/clamav.milter/clamd.sock

8.
edit /etc/sysconfig/clamav-milter
====================================
CLAMAV_FLAGS=" --config-file=/etc/clamd.d/milter.conf \
--quiet \
--dont-wait \
--noreject \
--force-scan \
--local \
--outgoing \
local:/var/run/clamav-milter/clamav.sock \
"
=======================================
NOTICE:
some directories in these config file are not consistent,
if something wrong when executing,
check these directory name!

9.
edit /etc/sysconfig/freshclam
to make new virus pattern update enable.
add mark this line:
#FRESHCLAM_DELAY=disabled-warn # REMOVE ME

10.
configure the sendmail.cf
go to /usr/share/sendmail-cf/cf
if no these directory
yum install sendmail-cf

edit sendmail.mc
==========================
divert(-1)
#
# Copyright (c) 1998, 1999 Sendmail, Inc. and its suppliers.
# All rights reserved.
# Copyright (c) 1983 Eric P. Allman. All rights reserved.
# Copyright (c) 1988, 1993
# The Regents of the University of California. All rights reserved.
#
# By using this file, you agree to the terms and conditions set
# forth in the LICENSE file which can be found at the top level of
# the sendmail distribution.
#
#

#
# This is a generic configuration file for Linux.
# It has support for local and SMTP mail only. If you want to
# customize it, copy it to a name appropriate for your environment
# and do the modifications there.
#

divert(0)dnl
VERSIONID(`$Id: generic-linux.mc,v 8.1 1999/09/24 22:48:05 gshapiro Exp $')
OSTYPE(linux)dnl
DOMAIN(generic)dnl
undefine(`UUCP_RELAY')dnl
undefine(`BITNET_RELAY')dnl
MASQUERADE_AS(XXX.xxx.com)dnl
define(`confBAD_RCPT_THROTTLE', `3')dnl
define(`confTO_IDENT',`0s')dnl
define(`confMILTER_LOG_LEVEL',`1')dnl
define(`confPRIVACY_FLAGS', `authwarnings,novrfy,noexpn,restrictqrun')dnl
define(`PROCMAIL_MAILER_PATH',`/usr/bin/procmail')dnl
FEATURE(local_procmail)dnl
INPUT_MAIL_FILTER(`clamav', `S=local:/var/run/clamav-milter/clamav.sock, F=, T=S:4m;R:4m')dnl
define(`confINPUT_MAIL_FILTERS', `clamav')dnl
define(`SMART_HOST',`XXXhost')dnl
define(`STATUS_FILE',`/etc/mail/statistics')dnl
FEATURE(`smrsh',`/usr/sbin/smrsh')dnl
FEATURE(redirect)dnl
FEATURE(always_add_domain)dnl
FEATURE(`virtusertable',`hash -o /etc/mail/virtusertable')dnl
FEATURE(`access_db', `hash -T -o /etc/mail/access')dnl
FEATURE(`mailertable',`hash -o /etc/mail/mailertable')dnl
FEATURE(`blacklist_recipients')dnl
MAILER(smtp)dnl
MAILER(procmail)dnl
=========================
Notice:
make sure the socket string is same as /etc/sysconfig/clamav-milter

./Build sendmail.cf
cp sendmail.cf /etc/mail/sendmail.cf

11.
cd /etc/init.d/
chkconfig clamav-milter on
./clamav-milter start
./sendmail start

Labels: , , , , , ,

2007/06/12

20+ hidden XP applications..

To run any of these apps go to Start > Run and type the executable name:

1) Character Map = charmap.exe (very useful for finding unusual characters)

2) Disk Cleanup = cleanmgr.exe

3) Clipboard Viewer = clipbrd.exe (views contents of Windows clipboard)

4) Dr Watson = drwtsn32.exe (Troubleshooting tool)

5) DirectX diagnosis = dxdiag.exe (Diagnose & test DirectX, video & sound cards)

6) Private character editor = eudcedit.exe (allows creation or modification of characters)

7) IExpress Wizard = iexpress.exe (Create self-extracting / self-installing package)

8) Microsoft Synchronization Manager = mobsync.exe (appears to allow synchronization of files on the network for when working offline. Apparently undocumented).

9) Windows Media Player 5.1 = mplay32.exe (Retro version of Media Player, very basic).

10) ODBC Data Source Administrator = odbcad32.exe (something to do with databases)

11) Object Packager = packager.exe (to do with packaging objects for insertion in files, appears to have comprehensive help files).

12) System Monitor = perfmon.exe (very useful, highly configurable tool, tells you everything you ever wanted to know about any aspect of PC performance, for uber-geeks only )

13) Program Manager = progman.exe (Legacy Windows 3.x desktop shell).

14) Remote Access phone book = rasphone.exe (documentation is virtually non-existant).

15) Registry Editor = regedt32.exe [also regedit.exe] (for hacking the Windows Registry).

16) Network shared folder wizard = shrpubw.exe (creates shared folders on network).

17) File siganture verification tool = sigverif.exe

18) Volume Control = sndvol32.exe (I've included this for those people that lose it from the System Notification area).

19) System Configuration Editor = sysedit.exe (modify System.ini & Win.ini just like in Win98! ).

20) Syskey = syskey.exe (Secures XP Account database - use with care, it's virtually undocumented but it appears to encrypt all passwords, I'm not sure of the full implications).

21) Microsoft Telnet Client = telnet.exe

22) Driver Verifier Manager = verifier.exe (seems to be a utility for monitoring the actions of drivers, might be useful for people having driver problems. Undocumented).

23) Windows for Workgroups Chat = winchat.exe (appears to be an old NT utility to allow chat sessions over a LAN, help files available).

Labels:

2006/12/16

WinPE(Xp SP2版)中文版

微軟開放了winpe 2004,這是基於xp sp2的winpe,裡麵包含了微軟的winpe自定義製作工具mkimg.cmd,大家能夠自由地從微軟下載

繁體中文下載地址:http://oem.microsoft.com/downloads/worldwide/OPK_XPSP2/xpsp2_2180_cht_x86fre_opk.zip

簡體中文下載地址:
http://oem.microsoft.com/downloads/worldwide/OPK_XPSP2/xpsp2_2180_chs_x86fre_opk.zip

英文下載地址:http://oem.microsoft.com/downloads/worldwide/OPK_XPSP2/xpsp2_2180_usa_x86fre_opk.zip

繁體中文下載地址:
http://oem.microsoft.com/downloads/worldwide/OPK_XPSP2/xpsp2_2180_cht_x86fre_opk.zip

簡體中文下載地址:
http://oem.microsoft.com/downloads/worldwide/OPK_XPSP2/xpsp2_2180_chs_x86fre_opk.zip

英文下載地址:
http://oem.microsoft.com/downloads/worldwide/OPK_XPSP2/xpsp2_2180_usa_x86fre_opk.zip

[官方說明]
http://www.microsoft.com/taiwan/whdc/system/winpreinst/WindowsPE_over.mspx
[詳細說明,白皮書]
http://download.microsoft.com/download/5/b/5/5b5bec17-ea71-4653-9539-204a672f11cf/WindowsPE_tech.doc
----------------------------------
1. 請下載
http://www.jus.uio.no/it/om_sit/odder/usb_boot_filer/HPbootpinne/
網頁中的HPUSBFW.EXE

2. 將隨身碟插入您的電腦,配合HPUSBFW.EXE以及您的開機磁片
( http://www.etplanet.com/) =>開機片下載處 左邊選單Book Disk
選98SE OEM 最多人下載的那一個。

3. 將"Creat a DOS startup disk"打勾,然後底下的指定系統開機檔案,將路徑指向(開機磁片)即可

-------------------------
免費的系統移植軟體..XXClone 0.52.0a 輕鬆把Windows複製到另一顆硬碟上
【軟體名稱】XXClone
【軟體版本】V 0.52.0a
【軟體語言】英文
【軟體分類】檔案救援
【檔案大小】536 KB
【檔案格式】RAR 自解壓縮檔
【作業系統】Windows 2000/XP/2003
【軟體介紹】