跳到主要內容

發表文章

目前顯示的是 2010的文章

simple trunc implement

uClibc的libm沒有trunc function的實作, 如果一定要用到的話, 可以加入簡單的實作:

Centos安裝mplayer等第三方套件

Centos除了原本跟RHEL相同的套件之外, 也可以透過第三方的repository來提供. RPMforge EPEL   在安裝完成後,就可以用yum安裝一些centos原本沒有的套件了, 如: htop meld

改變pidgin的佈景主題

最近在XP上安裝了pidgin 2.7.5, 可是外觀是標準的gtk windows theme. 想換換外觀, 在網路上找了一些資料. 這一篇 是我在網路上看到最完整的. 簡單來說, pidgin是跟著gtk來換theme的, gtk用什麼, pidgin就用什麼. 結果我用gtk theme selector上換了theme, selector上的theme是換了, 但 pidgin上沒換.

Install MSYS

就如同官網上所講的, MSYS可以讓Windows有基本的Linux Shell的指令. MSYS is a collection of GNU utilities such as bash, make, gawk and grep to allow building of applications and programs which depend on traditionally UNIX tools to be present. It is intended to supplement MinGW and the deficiencies of the cmd shell. 但由於mingw-get-inst自動安裝程式下載msys的套件安裝還有問題, 所以我改用手動安裝. 官網的安裝說明: http://www.mingw.org/wiki/msys

Add vi keys to eclipse editor

Vrapper is an eclipse plugin which acts as a wrapper for eclipse text editors to provide a Vim-like input scheme for moving around and editing text. To install Vrapper, add the remote site http://vrapper.sourceforge.net/update-site/stable to your Eclipse Update Manager.

MinGW installation

It seems the MinGw main site is broken currently. (2010 Oct 26) The automated MinGW Installer (mingw-get, mingw-get-inst) still can't find some of the packages. I do some googling and find another maintainer of MinGW -- TDM-GCC which has a better installer. Reference: http://wiki.codeblocks.org/index.php?title=MinGW_installation

用remserial來建立一個serial port I/O

首先, 需建立一個輸入端: # nc -l -p 2000 -t 再用remserial 連線到這個port #  remserial -r localhost -p 2000 -l /dev/remserial /dev/ptmx 如此在netcat下輸入的資料, 都會被導向到/dev/remserial這個pseudo serial port去

sendmail使用hibox寄信

在台灣使用sendmail寄信到外部郵件信箱(如gmail, pchome, hinet...), 大概都會遇到smtp需要認證的問題(SMTP AUTH). 為了解決這個問題, 必需要把sendmail的SMART_HOST, confAUTH及MASQUERADE功能打開. 

Office 2003, 2007共存的問題

若您在安裝office時跟我一樣選擇留下舊版的office2003的話, 在使用完2003後再開啓2007, 或者是用完2007再開2003, 可能都會再進入安裝的畫面.

手動複製ubuntu Linux

複製硬碟由小到大簡單, 由大到小比較難, 我就遇到這種問題. 兩家2G的卡片, 就有不同的大小. 這是第一個CF的大小 Disk /dev/sda: 2079 MB, 2079866880 bytes 這是第二個的 Disk /dev/sdb: 2029 MB, 2029805568 bytes 這是partition的layout Device Boot Start End Blocks Id System /dev/sda1 * 2048 3756031 1876992 83 Linux /dev/sda2 3758078 4061183 151553 5 Extended /dev/sda5 3758080 4061183 151552 82 Linux swap / Solaris 在較小的CF卡上, 我決定將後面的swap放棄掉. Linux的partition不變. 1. 我先備份bootloader(Grub) $dd if=/dev/sda of=MBR-backup bs=446 count=1 我不備份到512bytes的原因, 是因為不想備份到partition table. 參考這篇文章: http://embraceubuntu.com/2005/10/20/backing-up-the-mbr/ 2. 按照之前sda所得到的partition table, 用fdisk設定到sdb上, 只有swap的partition變小. 並將之格式化. # mkfs.ext2 /dev/sdb1 swap 因為要設定UUID, 所以待會再做 再把bootloader 還原回去 $ dd if=MBR-backup of=/dev/sdb 3. 將/dev/sdb1 mount 到/mnt上, 用rsync備份根目錄下的資料到/mnt下 # mount /dev/sdb1 /mnt # cd / 因為mnt, proc, sys的目錄都是虛擬的檔案系統, 所以不用copy # rsync -a --exclude=mnt -...

Cisco也有GPL code可以下載

Cisco也有GPL code可以下載喔... http://homesupport.cisco.com/ en-us/gplcodecenter?referrer= www.linksysbycisco.com 原因在這篇文章中 http://www.openfoundry.org/en/worldwide-news/1930

YAML

我覺得YAML可以用在比較複雜的設定檔上, 它有提供各種語言的parser, 也比XML來得簡單. Google App engine也用這種語言來做設定檔的語法.   下載網站: http://www.yaml.org/ 以下為wikipidia的介紹: YAML (IPA: /ˈjæməl/,尾音類似 camel 駱駝)是一個可讀性高, 用來表達資料序列的程式語言。 YAML參考了其他多種語言,包括: XML 、 C語言 、 Pytho n 、 Perl 以及電子郵件格式 RFC 2822 。Clark Evans在 2001年 在 首次發表了這種語言 [1]   ,另外Ingy döt Net與Oren Ben-Kiki也是這語言的共同設計者。 目前已經有數種程式語言或腳本語言支援(或著說解析)這種語言。 YAML 是"YAML Ain't a Markup Language"(YAML不是一種 置標語言 )的 遞歸縮寫 。 在開發的這種語言時, YAML   的意思其實是:"Yet Another Markup Language"(仍是一種 置標語言 ), 但為了強調這種語言以數據做為中心,而不是以置標語言為重點,而用 返璞詞 重新命名。 http://zh.wikipedia.org/zh-tw/ YAML

CVS指令找改過的檔案

CVS版本管理系統雖然古老但是還是很多人在用, 至少我之前的公司就是 cvs status雖然可以找到變更的檔案有時卻又太多 這兩個指令可以找到有變更的檔名, 出處我已經忘了. # Show new files in current project "cvs status | grep ?" # Show status of all *not* Up-to-date files "cvs status | grep Status | grep -v Up"

你的Editor用什麼字型呢??

我開始用Bitstream Vera Sans Mono 是因為我發現Gnome的字型很好看, 後來研究後發現這種字型很像Linux上用的 ... 看了下面這篇文章後發現原來大家的感覺差不多 ... 另外一個字型Consolas 是Vista才有的(但可以下載), 看起來也很不錯喔 ... 唯一缺點是從MS下載回來的安裝程式, 會檢查你有沒有安裝 Visual Stdio http://www.sitepoint.com/blogs/2009/05/01/top-10-programming-fonts/

xming 改變字型大小

Xming   是一個在   Microsoft Windows   作業系統上運行   X Window System   的   自 由軟件 。 安裝方式可參考 http://www.cs.nctu.edu.tw/ help/xming.html 使用Xming開啓gnome-terminal時, dpi 100時字會太小, 可以用Ctrl Shift + 來放大, 或者可以修改啓動檔.xlaunch來指定解析度. RemoteUser="jim" Display="5" Clipboard="true" ExtraParams="-dpi 95"/>

Use mutt receive email

如果要用mutt內建的pop/imap收信功能, 首先要檢查是否compile時有enable # mutt -v +USE_POP  +USE_IMAP 1. 執行mutt 2. 假設要連線到pop3 server:www.hibox.hinet.net 3. 按c 改變mail box 路徑 4. 輸入: pop://email-account@www.hibox.hinet.net  5. 若要使用imap, 則改變pop成imap即可imap ://email-account@www.hibox.hinet.net

Install mplayer on Fedora 9

Fedora 9 所帶的yum repository 是不包含mplayer的, 所以要透過安裝第三方的repository才可以找到. 但是2010年還在maintainFC9的server也不多了, Google了一陣子終於找到可以用的.

Xming裡使用中文輸入法

使用Xming來遠端執行Linux程式已經很久了, 但是一直沒有方式可以輸入中文, 後來看了 這篇文章 後才成功的. 首先輸入法應該改用gcin, 因為其它輸入法不支援遠端client. 還要改變輸入視窗開啟的方式, 以免與Windows Ctrl+Space相沖, 以及選擇遠端client支援.

在firefox中完全移除ask.com toolbar

在灌KMPlyaer時不小心灌了ask.com的toolbar, 導至在firefox及ie6預設的search engine都被改了. 刪除的方法, 在 firefox中, 除了用工具->附加元件 去移除之外, 另外還得要在網址列打"about:config" 進入偏好設定去刪除其它的部份 參考下圖

連線到Samba整個桌面hang住

最近不知道灌了什麼軟體, 在連線到Samba時, 檔案列表出現後, 整個系統就hang住不動, 調整過Samba的設定值也沒用, 問過同事後發現別人並沒有我的狀況, 應該是我的Windows XP的問題. Google了一下發現WebClient這個Service最有可能, 把它停用後就正常了.

Extract file from Tarball

下載下來的kernel source tarball不想整個解開, 只要解開某個目錄時, 可以用下面的指令 tar -xvf tarball.tar.gz {path/to/dir} For example, only usb driver directory: # tar -xf linux-2.6.24.tar.gz linux-2.6.24/drivers/usb/

將Bing翻譯加到Microsoft office中

微軟出的線上翻譯 Bing翻譯 http://www.microsofttranslator.com/Default.aspx 原本Microsoft Office 2003 & 2007 的翻譯為WorldLingo 下載 Microsoft Translator installer for Microsoft Office 安裝好後就會改用Bing翻譯了

Listen to online radio

First, install mplayer, gnome-mplayer http://www.ubuntugeek.com/install-mplayer-and-multimedia-codecs-libdvdcss2w32codecsw64codecs-in-ubuntu-904-jaunty.html gecko-mediaplayer . A Mozilla browser plug-in to handle media on websites, using gnome-mplayer sudo apt-get install gecko-mediaplayer Open firefox->Tools->Manage Content Plug-ins, Change Windows Media video content handler to Gecko Media Player

Setup Viewvc on Fedora9

yum install viewvc Edit /etc/viewvc/viewvc.conf, modify cvs_roots to your current CVSROOT Edit /etc/httpd/conf.d/viewvc.conf

blogger舊帳號轉google帳號的問題

我有一個舊的blogger帳號及網址很久沒用了,在轉換成google帳號之後, 發現在blogger 資訊主頁 上並不會出現,  在討論區爬了一些文之後, 找到了解決方式 http://groups.google.com/group/blogger-help-troubleshoot/browse_thread/thread/b6d0944608e0def3/7c335565e95a3355?lnk=gst&q=old+blogger#7c335565e95a3355 只要到下面的網址 http://blogger.com/forgot.g 登入之後會再收到一封含有登入指示的電子郵件, 再照指示去做, 舊的網址就會出現了

a small and nice ini parser -- iniParser

Today I finished cross-compiling wvdial package. After I cross-compiling it, I found that it has some problem to load the wvdial.conf. And I also know that passing arguments to the wvdial is still working. Finally, I decide to modify the wvdial program to load the wvdial.conf by my own. I load the config file with iniParser and pass it to the cfg object. Now it works perfectly !! wvdial -- a utility that helps in making modem-based connections to the Internet wvdial site wvdial wiki iniParser home wvdial introduction  

compiling wvstreams lib on Ubuntu

Install pre-requests: sudo apt-get install  build - essential libssl - dev libreadline5 - dev zlib1g - dev wget http : / /wvstreams . googlecode . com/files/wvstreams - 4 . 6 . 1 . tar . gz tar zxvf wvstreams- 4 . 6 . 1 . tar . gz . /configure make

cvsync: 好用的cvs同步工具

cvsync 網址 http://www.cvsync.org/ 預設設定檔位址 /usr/local/etc/ 設定檔範例在samples目錄 cvsync.conf是給client用 cvsyncd.conf是給server用 如果在compile的時候出現下面訊息, 則是沒有指定HASH_TYPE WARNING! Please specify the HASH_TYPE.   libgcrypt   mhash   native (default)   openssl make[1]: *** [hash-error] Error 1 直接在make後面指定就可以了 make HASH_TYPE=openssl

ubuntu上mount lvm partition

ubuntu 9.10灌好後, 最先就是把之前灌fedora那個硬碟的資料copy回來. 由於fedora 9預設是用lvm的partition, 因此要安裝lvm2套件, 剩下的, 就是把lvm mount起來 # sudo apt-get install lvm2 # sudo vgscan # sudo vgchange -ay VolGroup00 # sudo lvs # sudo mount /dev/VolGroup00/LogVol00 /mnt Reference: http://www.linux-sxs.org/storage/fedora2ubuntu.html