2010年11月26日 星期五

Radio Tray 在system tray 播放音樂程式

本來要自己寫一個簡單的radio播放程式,
結果找到這個程式符合我的需求,
正好推薦給大家.
他的好處是可以編輯自己想聽的電台列表

  • 使用gstreamer libraries來播放音樂
  • 支援PLS 格式音樂 (Shoutcast/Icecast)
  • 支援 M3U 格式
  • 支援 ASX, WAX and WVX playlist format(hichannel 應該有支援)
相關程式

2010年11月21日 星期日

.xprofile+fluxbox設定備份

為了設定gcin和fluxbox正常的工作花了一點時間調整,


記錄一下以免下次忘記.我之前是設定gcin在fluxbox的startup底下啟動,結果都要重啟才能打中文.


原來是要設定在.xprofile底下才能正常.


.xprofile 設定

export LC_CTYPE=zh_TW.UTF-8
export XMODIFIERS=@im=gcin
gcin &



.fluxbox/startup



#!/bin/bash
# LANGUAGE SETTING
export LANG=en_US.UTF-8
export LC_MESSAGES=en_US.UTF-8
export LC_CTYPE=zh_TW.UTF-8
gnome-settings-daemon &
gdlinux &
kpowersave &
zhtw conky &
DISPLAY=:0.1 google-chrome &
.dropbox-dist/dropbox &
pidgin &
#msnbot
xset m 7 &
feh --bg-center .fluxbox/backgrounds/bg.jpg &
xterm &
exec fluxbox

2010年11月13日 星期六

Linux 無法自動 mount usb disk的解決方法

之前把gdm換掉改用slim,沒想到好用的auto mount 卻失靈了,
急著copy檔案卻發現usb無法mount,找了以下幾種解決方案,
最後是修改policy kit這個方法才成功的.

解法1 Policy Kit的問題
修改底下檔案

"/usr/share/polkit-1/actions/org.freedesktop.udisks.policy"

把<allow_any>no</allow_any>改成<allow_any>yes</allow_any>


解法2 使用非GDM下執行gnome-session

在 ~/.xinitrc 下執行gnome

exec ck-launch-session gnome-session

解法3 使用users-admin

執行users-admin,把使用者改成administrator,

點進階選項把mount的選項打開


資料來源

[policy kit]

https://bbs.archlinux.org/viewtopic.php?pid=789028

[ck-launch-session]

https://bbs.archlinux.org/viewtopic.php?pid=725983

[users-admin]

http://www.art.ubuntuforums.org/showthread.php?t=1336847&page=2

2010年11月8日 星期一

使用Zoundry Raven 來編輯blog

終於成功的使用Zoundry Raven 這套軟體在Ubuntu上面
來寫blog了,真是不簡單啊.
一開始是無法顯示中文,
搞定了中文顯示之後,卻發現無法輸入中文,再搞了老半天之後,總算把兩者都搞定了.
接下來再研究如何使gcin在English的Wine下輸入中文字
Free Image Hosting at www.ImageShack.us

2010年11月6日 星期六

改變Wine字型小記

在.wine/drive_c/windows/Fonts/ 底下安裝字型,字型名AR PL New Sung

建立一個font.reg,內容如下




REGEDIT4 [HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\FontLink]

"FontLinkControl"=dword:00004000

"FontLinkDefaultChar"=dword:00003000

[HKEY_CURRENT_USER\Software\Wine\X11 Driver]

"ClientSideAntiAliasWithCore"="Y"

"ClientSideAntiAliasWithRender"="Y"

"ClientSideWithRender"="Y"

[HKEY_CURRENT_USER\Control Panel\Desktop]

"FontSmoothing"="2"

[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\FontSubstitutes]

"Arial Baltic,186"="AR PL New Sung,186"

"Arial CE,238"="AR PL New Sung,238"

"Arial CYR,204"="AR PL New Sung,204"

"Arial Greek,161"="AR PL New Sung,161"

"Arial TUR,162"="AR PL New Sung,162"

"Courier New Baltic,186"="AR PL New Sung,186"

"Courier New CE,238"="AR PL New Sung,238"

"Courier New CYR,204"="AR PL New Sung,204"

"Courier New Greek,161"="AR PL New Sung,161"

"Courier New TUR,162"="AR PL New Sung,162"

"Helv"="AR PL New Sung"

"Helvetica"="AR PL New Sung"

"MS Shell Dlg"="AR PL New Sung"

"MS Shell Dlg 2"="AR PL New Sung"

"PMingLiU"="AR PL New Sung"


"新細明體"="AR PL New Sung"


"Tahoma"="AR PL New Sung"


"Times"="AR PL New Sung"


"Times New Roman Baltic,186"="AR PL New Sung,186"


"Times New Roman CE,238"="AR PL New Sung,238"


"Times New Roman CYR,204"="AR PL New Sung,204"


"Times New Roman Greek,161"="AR PL New Sung,161"


"Times New Roman TUR,162"="AR PL New Sung,162"


"Tms Rmn"="AR PL New Sung"






[HKEY_CURRENT_USER\Software\Wine\Fonts\Replacements]


@="AR PL New Sung"


"Arial"="AR PL New Sung"


"Fixedsys"="AR PL New Sung"


"Microsoft Sans Serif"="AR PL New Sung"


"MingLiU"="AR PL New Sung"


"MS UI Gothic"="AR PL New Sung"


"PMingLiU"="AR PL New Sung"


"Simsun"="AR PL New Sung"


"Songti"="AR PL New Sung"


"System"="AR PL New Sung"


"Tahoma"="AR PL New Sung"


"Terminal"="AR PL New Sung"






[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\FontLink\SystemLink]


"Microsoft Sans Serif"="fireflysung.ttf,AR PL New Sung"


"SimSun"="fireflysung.ttf,AR PL New Sung"


"Tahoma"="fireflysung.ttf,AR PL New Sung"


"PMingLiU"="fireflysung.ttf,AR PL New Sung"


"Lucida Sans Unicode"="fireflysung.ttf,AR PL New Sung"


[HKEY_CURRENT_USER\Control Panel\Desktop\WindowMetrics]






"BorderWidth"="1"






"CaptionFont"=hex:f0,ff,ff,ff,00,00,00,00,00,00,00,00,00,00,00,00,bc,02,00,00,00,00,00,88,00,00,00,22,44,00,72,00,6f,00,69,00,64,00,20,00,53,00,61,00,6e,00,73,00,20,00,46,00,61,00,6c,00,6c,00,62,00,61,00,63,00,6b,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00

"CaptionHeight"="18"

"CaptionWidth"="18"

"MenuFont"=hex:f0,ff,ff,ff,00,00,00,00,00,00,00,00,00,00,00,00,bc,02,00,00,00,00,00,88,00,00,00,22,44,00,72,00,6f,00,69,00,64,00,20,00,53,00,61,00,6e,00,73,00,20,00,46,00,61,00,6c,00,6c,00,62,00,61,00,63,00,6b,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00

"MenuHeight"="18"

"MenuWidth"="18"

"MessageFont"=hex:f0,ff,ff,ff,00,00,00,00,00,00,00,00,00,00,00,00,bc,02,00,00,00,00,00,88,00,00,00,22,44,00,72,00,6f,00,69,00,64,00,20,00,53,00,61,00,6e,00,73,00,20,00,46,00,61,00,6c,00,6c,00,62,00,61,00,63,00,6b,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00

"ScrollHeight"="16"

"ScrollWidth"="16"

"Shell Icon Size"="32"

"SmCaptionFont"=hex:f4,ff,ff,ff,00,00,00,00,00,00,00,00,00,00,00,00,90,01,00,00,00,00,00,88,00,00,00,00,4d,00,53,00,20,00,53,00,68,00,65,00,6c,00,6c,00,20,00,44,00,6c,00,67,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00

"SmCaptionHeight"="18"

"SmCaptionWidth"="13"

"StatusFont"=hex:f0,ff,ff,ff,00,00,00,00,00,00,00,00,00,00,00,00,bc,02,00,00,00,00,00,88,00,00,00,22,44,00,72,00,6f,00,69,00,64,00,20,00,53,00,61,00,6e,00,73,00,20,00,46,00,61,00,6c,00,6c,00,62,00,61,00,63,00,6b,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00


開啟regedit,匯入上述reg檔.

下載Displayset程式並安裝,對字型再微調

2010年11月2日 星期二

轉換mp3編碼為UTF-8

安裝相關程式
sudo apt-get install python-mutagen
轉換gbk編碼的mp3
 find . -iname "*.mp3" -execdir mid3iconv -e gbk --remove-v1 {} \;
轉換big5編碼的mp3
 find . -iname "*.mp3" -execdir mid3iconv -e big5 --remove-v1 {} \;

在Firefox 底下使用遠端aMule的方法

這是給遠端連線aMule的方法,
首先建立一個ed2k.sh, 記得要 chmod +x ed2k.sh
檔案內容如下

#!/bin/bash 
lnk=$1 
let idx=`expr index $lnk "%" 
if [ $idx -gt 0 ]; then
    lnk=`printf ${lnk//\%/\\\\x}` 
fi 
/usr/bin/amulecmd -h HOST -P PASS -c "Add $lnk" 

註: HOST為aMule 所在主機,PASS 為連線密碼

安裝FireMule外掛 , 開一頁有ed2k連結的網頁,
在網頁點一下右鍵選擇FireMule->Download All By FireMule後會出現以下的視窗
把Firefox的應用程式選項ed2k設定成ed2k.sh


這樣就可以用Firefox來抓emule資源囉


參考來源:

http://wiki.amule.org/index.php/Ed2k_links_handling#Linux

http://eidolon.javaeye.com/blog/432083

2010年10月31日 星期日

美人時計的各種版本一次看個夠

香港版


巴黎版


仙台版


香川版


韓國版


賽道Racing Queen版



更多不同的美人時計版本,
http://www.bijint.com.hk/tokei.html

NordicVPS.com 便宜的VPS主機,年費15塊美金 128 RAM 15 G 空間

NordicVPS

我在NordicVPS訂了一年15塊美金的VPS(LEB特惠方案),規格為
  • 128MB guaranteed/256MB burstable memory
  • 15GB storage
  • 600GB/month data transfer
  • OpenVZ/SolusVM
  • Choice of Linux distributions
  • 主機位址: Falkenstein, Germany
  • 申請連結 (OVZ128-LEB order link
  • 可選擇安裝的OS CentOS, Fedora Core, Debian, Gentoo, Slackware and Ubuntu
連線會先連到美國再連到德國,ping速度大約300ms.
主機本身還算穩定.還沒有當機或是無法連線的問題


DD測試結果:
root@vps:~$ dd if=/dev/zero of=100MBtEST.BiN bs=100M count=1
1+0 records in
1+0 records out
104857600 bytes (105 MB) copied, 0.176389 s, 594 MB/s

VPS上面可以架Transmission,Amule, FTP,可惜的是OpenVZ 的VPS 無法架Samba Server 要不然使用上會更加方便,15GB的空間用起來也算是小空間,有更大需求者可以購買更好的方案


這家主機商共有美國,英國,德國的主機可以選擇.


XEN512 每月$9.95美金
  • 512 MB RAM / 512 MB SWAP
  • 15 GB Disk Space
  • 1 TB Bandwidth
  • 1 IP Address 
  • Choice of Linux distributions
  • XEN Environment
  • Location: 德國
XEN1024 每月$9.95美金
  • 1 GB RAM / 1 GB SWAP
  • 30 GB Disk Space
  • 1 TB Bandwidth
  • 1 IP Address 
  • Choice of Linux distributions
  • XEN Environment
  • Location: 德國

詳細方案請上 NordicVPS 比較看看


建立 SSH Tunnel

常用的功能,拿SSH 來做跳板


  • $ ssh -N -f -L 9000:hostB.narahuang.com:21 user@hostB.narahuang.com
  • -N 參數的用途是"不建立shell"
  • -f 參數的用途是"連線後執行於背景"
  • 輸入完密碼後即會回到原來的shell,建立Tunnel之後的操作就跟前面差不多了。


SSH Tunnel | Tsung's Blog
SSH, The Secure Shell: The Definitive Guide

2010年10月22日 星期五

Ubuntu 10.04 字型優化


  1. sudo sed -i '/DejaVu/d ; /Bitstream Vera/d ; /WenQuanYi Bitmap Song/d' /etc/fonts/conf.avail/69-language-selector-*
  2. sudo gedit /etc/fonts/conf.avail/69-language-selector-zh-tw.conf
  3. 字型改成 <string>Microsoft JhengHeii</string>   //微軟正黑體
  4. Application fonts 設定文泉微米黑,12
  5. Monospace fonts 設定文泉微米黑mono,13

    資料來源:

    2010年10月18日 星期一

    重建Ubuntu menu

    選單突然整個消失了,只好重建一個

    step 1
    sudo rm -r /home/username/.config/menus

    Step 2
    Restart gnome-panel
    killall gnome-panel

    重新啟動gnome-panel
    選單又正常了.

    初音未來(初音ミク) 甩蔥歌 | 伊娃的波尔卡





    用QQ Music 聽到的一首歌,實在相當的有趣.
    查了一下資料才知道這是電子合成的歌曲.
    這裡聽不一樣的版本

    參考資料
    Wikipedia 初音未來

    Dropbox 教育版容量大增500mb

    Dropbox 教育版大放送,
    除了原本免費申請的2GB 空間之外,
    只要你是學生申請新帳號,或者到以下的網址認證你的edu帳號
    https://www.dropbox.com/edu
    每推薦一位朋友加入Dropbox可增加 500MB,上限也提高至 18.3GB!
    如果你還沒用過Dropbox這好用的雲端硬碟
    可以用以下連結加入,
    馬上就可以增加250MB的空間哦
    http://bit.ly/cs5Ld1

    Dropbox的說明影片



    Dropbox 分享教學

    2010年10月12日 星期二

    免費註冊.tk頂級網域 Get a free tk domain for your blog

    要為自己的blog取個好的網域名稱嗎?
    趕快上dot.tk 去看,
    取一個 yourname.tk 網域.
    註冊是不用錢的.
    免費註冊.tk頂級網域 http://bit.ly/9WvuyB

    如果看不懂英文可以選擇中文介面來進行註冊.
    http://www.dot.tk/zu/index.html




    免費註冊.tk頂級網域 http://bit.ly/9WvuyB