2009年9月25日 星期五

「手把手」jaunty 核心升級到2.6.30含小測心得

今天看到ubuntu 9.04可以簡單改用2.6.30核心忍不住又給他升級一下了,前陣子我也有試過,那時要使用compiz的功能及3D還有音效通通掛點,我的顯示卡是Ati 4670要在2.6.30上使用還要打補丁,笨笨的我打上去也不行用。



還有想要穩定使用Ext4的機會也沒有(嘆氣),我核心是2.6.29使用時一直當(冒似人品不好),別人就能穩定使用(唉)。



剛升級之後除了Ext4還沒試驗外(給我勇氣吧!),其它使用都還蠻正常的,有興趣可以試試看嚕,不穩定在把核心K掉就好了。







安裝2.6.30 版核心

Step1、增加套件來源,更新套件庫,安裝新核心

OSVER=`lsb_release -cs`

echo "deb http://ppa.launchpad.net/xorg-edgers/ppa/ubuntu $OSVER main"|sudo tee -a /etc/apt/sources.list

sudo aptitude update

sudo aptitude install linux-headers-2.6.30-10-generic linux-image-2.6.30-10-generic




小測試

Step1、3D加速支援

glxinfo| grep "direct rendering"

direct rendering: Yes



Step2、目前ATI驅動程式版本

fglrxinfo

display: :0.0 screen: 0

OpenGL vendor string: ATI Technologies Inc.

OpenGL renderer string: ATI Radeon HD 4600 Series

OpenGL version string: 2.1.8918







VirtualBox的DKMS安裝

Step1、不知為啥VirtualBox為啥沒順便更新,開啟時出現錯誤,更新一下就好了。

sudo /etc/init.d/vboxdrv setup

* Stopping VirtualBox kernel module * done.

* Recompiling VirtualBox kernel module * done.

* Starting VirtualBox kernel module * done.








我ATI驅動程式用「perfect」自動安裝ATI Driver for jaunty i386●ATI_Driver安裝的,自產自銷一下嘿嘿。



參考資料:

ubuntu 9.04可以簡單改用2.6.30核心

2009年9月17日 星期四

「親愛的」搞定ttf-mscorefonts-installer安裝時出現的錯誤

不管是安裝ubuntu-restricted-extras或kbuntu-restricted-extras還是單獨安裝ttf-mscorefonts-installer都會碰到錯誤,原因是安裝時有的檔案下載不來。



這幾天有研究一下deb包的原始碼,發現sourceforge.net可能有改變檔案存放位置,而原始碼還是舊的網址,造成檔案找不到,檔案也就安裝錯誤了。



只要下載原始碼修改一下並編譯成deb檔,安裝就不會出現錯誤了。



10.21.2009 更新 下載並修改原始碼 部份,應該先刪除搜尋

10.26.2009 安裝3.0版是正常的不用此方法修改了。

11.01.2009 Carl反應少了 build-essential 無法編譯以補上了。







下載並修改原始碼



Step1、下載最新版的原始碼

需要svn沒有的請安裝

sudo aptitude install subversion

svn co https://svn.kinkhorst.nl/svn/debian/msttcorefonts/trunk



Step2、修改原始碼

cd trunk && gedit update-ms-fonts



搜尋並刪除

http://downloads.sourceforge.net/corefonts/



搜尋

/corefonts/

取代

/project/corefonts/the%20fonts/final/



存檔並關閉



編譯並安裝deb

Step1、編譯

需要fakeroot 、 build-essential 套件沒有的請安裝

sudo aptitude install fakeroot build-essential

dpkg-buildpackage -rfakeroot -uc -b



Step2、安裝

sudo dpkg -i ../ttf-mscorefonts-installer*

deb會放在trunk的上一層目錄下次可以直接裝修改好的deb檔。

2009年9月15日 星期二

「perfect_stardict_dic」打包星際譯王8本漢英、英漢字典成deb檔

常安裝StarDict (星際譯王)的字典檔是蠻煩鎖鎖的一件事,要先到stardict dictionaries下載所需要的字典檔,在解壓縮移動到指定的目錄裡,並不是每個人都知道要存放在那,在Ubuntu正體中文站常常都有人尋問如何裝。



現在使用perfect_stardict_dic腳本,能夠直接下載8本英漢、漢英字典,並且解壓縮打包成deb檔,這樣不管是要直接安裝,還是下次要重新安裝都相當的方便。



8本字典不一定要全部都安裝,看你的喜歡裝幾個就裝幾個哦!

2010.04.27 由於星際譯王字典檔只能到論壇下載,目前此腳本無法使用了。





下載、打包、安裝字典檔



Setp1、建立perfect_stardict_dic檔後,複制貼上程式碼[1]內容。

gedit perfect_stardict_dic





程式碼[1]



#!/bin/bash

# by hepha

# http://playubuntu.blogspot.com/

# GPL or CC-BY-NA-SA

# 版號1 (16-09-09)

Tmp=/tmp

Dic_Dir=$Tmp/dic

Uri="http://kent.dl.sourceforge.net/project/stardict/stardict-dictionaries-zh_TW/2.4.2"

All_Dic=$Dic_Dir/all_dic

linktest=`ping -c 3 168.95.1.1 2>/dev/null| grep "time="`

if [ "$linktest" = "" ]; then

echo "現在網路是斷線的,無法使用本程式"

echo "ByeBye"

exit 1

fi

File_Test (){

echo "沒有下載成功任一辭典"

exit 0

}

getArg ()

{

echo "請決定「$1」"

path=$2

yn=n

while [ $yn != "y" ]

do

echo "目前設定為:「$path」"

read -p "您的確定要設為這樣嗎? (Y/N)" -n1 yn

echo ""

if [ $yn = "n" ];

then

read -p "那麼請您重新輸入「$1」:" path

fi

done

}

sourcePath=$HOME

getArg "存放路徑" $sourcePath

mkdir -p $Dic_Dir

echo > $All_Dic

echo 歡迎使用

echo welcome to perfect_stardict_dic ver 1

echo

echo 打包星際譯王8本漢英、英漢字典成deb檔

read -p "打包deb檔後要直接安裝嗎?(Y/N)" -n1 yn

if [[ $yn = "y" || $yn = "Y" ]]; then

Stardict=`aptitude search ^stardict$ | awk '{print $1}'`

if [ $Stardict != "ii" ]; then

echo

read -p "如要立即安裝需要主程式「stardict」你是否要一併安裝?(Y/N)" -n1 yn

if [[ $yn = "y" || $yn = "Y" ]]; then

Install_Stardict=1

else

Deb_Install=1

fi

fi

fi

echo

echo 你可以選要使用的即可,不用全部都選擇

Dic0=21世紀英漢漢英雙向詞典

echo

read -p "你要使用「$Dic0」嗎?(Y/N)" -n1 yn

if [[ $yn = "y" || $yn = Y ]]; then

dic0=1

echo $Dic0 >>$All_Dic

fi

Dic1=21世紀雙語科技詞典

echo

read -p "你要使用「$Dic1」嗎?(Y/N)" -n1 yn

if [[ $yn = "y" || $yn = Y ]]; then

dic1=1

echo $Dic1 >>$All_Dic

fi

Dic2=xdict英漢字典

echo

read -p "你要使用「$Dic2」嗎?(Y/N)" -n1 yn

if [[ $yn = "y" || $yn = Y ]]; then

dic2=1

echo $Dic2 >>$All_Dic

fi

Dic3=xdict漢英字典

echo

read -p "你要使用「$Dic3」嗎?(Y/N)" -n1 yn

if [[ $yn = "y" || $yn = Y ]]; then

dic3=1

echo $Dic3 >>$All_Dic

fi

Dic4=牛津現代英漢雙解詞典

echo

read -p "你要使用「$Dic4」嗎?(Y/N)" -n1 yn

if [[ $yn = "y" || $yn = Y ]]; then

dic4=1

echo $Dic4 >>$All_Dic

fi

Dic5=朗道英漢字典

echo

read -p "你要使用「$Dic5」嗎?(Y/N)" -n1 yn

if [[ $yn = "y" || $yn = Y ]]; then

dic5=1

echo $Dic5 >>$All_Dic

fi

Dic6=朗道漢英字典

echo

read -p "你要使用「$Dic6」嗎?(Y/N)" -n1 yn

if [[ $yn = "y" || $yn = Y ]]; then

dic6=1

echo $Dic6 >>$All_Dic

fi

Dic7=cdict-big5英漢字典

echo

read -p "你要使用「$Dic7」嗎?(Y/N)" -n1 yn

if [[ $yn = "y" || $yn = Y ]]; then

dic7=1

echo $Dic7 >>$All_Dic

fi

echo

echo

Deb_Dic=`cat $All_Dic | tr "\n" "," | sed 's/^,//g ; s/.$//g'`

echo 開始下載「$Deb_Dic」中請稍後

echo

echo

if [ $dic0 -eq 1 ]; then

wget -c "$Uri/stardict-21shijishuangxiangcidian-big5-2.4.2.tar.bz2" -P $Dic_Dir

fi

if [ $dic1 -eq 1 ]; then

wget -c "$Uri/stardict-21shijishuangyukejicidian-big5-2.4.2.tar.bz2" -P $Dic_Dir

fi

if [ $dic2 -eq 1 ]; then

wget -c "$Uri/stardict-xdict-ec-big5-2.4.2.tar.bz2" -P $Dic_Dir

fi

if [ $dic3 -eq 1 ]; then

wget -c "$Uri/stardict-xdict-ce-big5-2.4.2.tar.bz2" -P $Dic_Dir

fi

if [ $dic4 -eq 1 ]; then

wget -c "$Uri/stardict-oxford-big5-2.4.2.tar.bz2" -P $Dic_Dir

fi

if [ $dic5 -eq 1 ]; then

wget -c "$Uri/stardict-langdao-ec-big5-2.4.2.tar.bz2" -P $Dic_Dir

fi

if [ $dic6 -eq 1 ]; then

wget -c "$Uri/stardict-langdao-ce-big5-2.4.2.tar.bz2" -P $Dic_Dir

fi

if [ $dic7 -eq 1 ]; then

wget -c "$Uri/stardict-cdict-big5-2.4.2.tar.bz2" -P $Dic_Dir

fi

Stardict_Dir=$Tmp/stardict

Stardict_Dic_Dir=$Stardict_Dir/usr/share/stardict/dic

mkdir -p $Stardict_Dic_Dir

for var in $Dic_Dir/stardict-*.tar.bz2

do

test -e $var || File_Test

echo 解壓縮$var

tar jxf $var -C $Stardict_Dic_Dir

done

echo

echo 開始打包「$Deb_Dic」中請稍後

echo

Size=`du --max-depth=0 -k $Stardict_Dic_Dir | awk '{print $1}'`

mkdir -p $Stardict_Dir/DEBIAN

echo "Package: stardict-dic

Version: 1

Section: universe/utils

Priority: optional

Architecture: all

Depends: stardict

Installed-Size: $Size

Maintainer: $USER

Description: $Deb_Dic

">$Stardict_Dir/DEBIAN/control

dpkg -b $Stardict_Dir $sourcePath/stardict-dic_1.0.all.deb

echo

echo 檔案打包完成存放在「$sourcePath/stardict-dic_1.0.all.deb」

echo

if [ $Install_Stardict -eq 1 ]; then

sudo apt-get install stardict stardict-common --force-yes -y

echo 開始安裝「$sourcePath/stardict-dic_1.0.all.deb」請稍後

sudo dpkg -i $sourcePath/stardict-dic_1.0.all.deb

elif [ $Deb_Install -eq ]; then

echo 開始安裝「$sourcePath/stardict-dic_1.0.all.deb」請稍後

sudo dpkg -i $sourcePath/stardict-dic_1.0.all.deb

else

echo

fi
Setp2、給予執行權限並執行perfect_stardict_dic

chmod +x perfect_stardict_dic && ./perfect_stardict_dic



安裝畫面(略過下載字典檔)









2009年9月9日 星期三

「快閃600秒」一分鐘設定讓Wine安裝的程式所產生的desktop檔發揮效用

別的活動有快閃,Ubuntu也要有,這是一定要的^^Y



「快閃600秒」可以當作小秘訣或小常識來看,大都會收錄十分鐘就能搞定的事,可能,是我所看到的或我所會的,收集起來分享給大家。



希望,大家都能喜歡,如果是你已經會的簡單的,也可以在我的噗浪分享給我,我整理後會註明分享者的ID,貼到我的部落格,讓大家也能學會你的「快閃」決技。



時間是以我執行時間為準…不爽?咬我XD







讓wine安裝程式產生的desktop發揮作用



說來很簡單,只要讓他有執行權限就好了,以前不太明白都把他刪掉;當然,刪掉也無所謂在它也會產生在應用程式WinePrograms裡。



以安裝winrar 為例,安裝後會在桌面產生一個WinRAR.desktop,點選他按右鍵→屬性→權限→允許檔案作為程式執行打勾關閉→變成WinRAR的圖示副檔名desktop不見了,按兩下就可以執行哩他也會副帶產生一個lnk檔,按兩下也可以執行,但醜醜的沒有圖示可以把他刪掉。





「快閃600秒」

我們下次見。

2009年9月6日 星期日

「perfect_ATI_Driver」自動安裝ATI Driver for jaunty i386

使用腳本自動安裝ATI官方最新版驅動程式,只能用在9.04的i386版,安裝過程中看一下,是否顯示卡不能使用Catalyst 9-4版後驅動程式,有問題請回報。

我從Catalyst 9-4 到 Catalyst 9-8都有用腳本安裝。



2009.9.15

腳本更新,現在有新版本可以直接安裝了,版號小於9-3的一樣無法在jaunty上使用,目前最新出到9-9了我以安裝完成。








下載並安裝驅動程式



Step1、建立一個檔案perfect_ATI_Driver

gedit perfect_ATI_Driver

copy and pass



#!/bin/bash

OSVER=`lsb_release -cs`

BIT=`getconf LONG_BIT`

echo welcome to perfect_ATI_Driver

echo -e "\t\tbyhepha"

echo "你的版本是 $OSVER $BIT 位元"

if [[ $OSVER != 'jaunty' && $BIT != "32" ]]; then

echo "你所安裝Ubuntu版本非「jaunty」無法使用"

echo

exit

fi

echo "你所要安裝的版本是"

read -p "請輸入主版號(假設要安裝版本為9-8即輸入9):" main_ver

read -p "請輸入副版號(假設要安裝版本為9-8即輸入8):" sub_ver

Full_Ver=$main_ver-$sub_ver

if [[ $main_ver -le 9 && $sub_ver -le 3 ]]; then

echo 你所輸入的版號「$Full_Ver」無法使用需要大於「9-3」版

exit 0

else

echo -e "如你顯示卡在此清單之內將無法使用此驅動程式

9500 Series 9550 Series

9600 Series 9700 Series

9800 Series X300 Series

X550 Series X600 Series

X700 Series X800 Series

X850 Series X1050 Series

X1300 Series X1550 Series

X1600 Series X1650 Series

X1800 Series X1900 Series

Xpress Series X1200 Series

X1250 Series X2100 Series "

read -p "你的顯示卡是否不在清單之內(Y/N)?" -n1 yn

if [[ $yn = "y" || $yn = "Y" ]]; then

echo

echo 請看注意事項

echo "Resolved Issues

The following section provides a brief description of resolved issues with the latest version of the ATI CatalystTM Linux software suite. These include:

* With desktop effects enabled, transparent desktop no longer causes desktop icons and application windows to disappear

* Video playback no longer exhibits corruption when desktop effects are enabled and Composite is not explicitly disabled

* [Ubuntu 8.10] System now functions properly when starting X on surround view systems

* Resizing DVD playback window on Mplayer no longer causes blank video

* System instability no longer occurring when switching to full screen DVD playback with Totem Player

* Terminal window no longer displays error message when launching Catalyst Control Center in MultiView

* [Ubuntu 9.04] Xserver now starts properly with HD 4870 GPU configurations

* [Ubuntu 9.04] When xrandr --prop is evoked, Xserver failure no longer occurs under various system configurations

* The engine clock and memory clock values are now reported properly by ATI CAL"

else

echo 顯示卡在清單之內無法正常使用

exit 0

fi



read -p "你是否要開始安裝$Full_Ver版本? (Y/N) " -n1 yn

if [[ "$yn" = "y" || "$yn" = "Y" ]] ; then

sudo aptitude install build-essential cdbs fakeroot dh-make debhelper debconf libstdc++5 dkms -y

cd /tmp

wget -c "www2.ati.com/drivers/linux/ati-driver-installer-$Full_Ver-x86.x86_64.run"

chmod +x ati-driver-installer-$Full_Ver-x86.x86_64.run

./ati-driver-installer-$Full_Ver-x86.x86_64.run --buildpkg Ubuntu/jaunty

sudo dpkg -i xorg-driver-fglrx_*.deb fglrx-kernel-source_*.deb fglrx-amdcccle_*.deb

sudo aticonfig --initial -f

fi

fi


Step2、給予執行權限並執行

chmod +x perfect_ATI_Driver && ./perfect_ATI_Driver



以下圖片是安裝畫面









更新的驅動程式



如有新版驅動程式,只需要修改腳本即可。

搜尋



if [[ "$Drvier" = "9-4" || "$Drvier" = "9-5" || "$Drvier" = "9-6" || "$Drvier" = "9-7" || "$Drvier" = "9-8" ]]; then


如是9-9版在其內新增 || "$Drvier" = "9-9",修改為

if [[ "$Drvier" = "9-4" || "$Drvier" = "9-5" || "$Drvier" = "9-6" || "$Drvier" = "9-7" || "$Drvier" = "9-8" || "$Drvier" = "9-9" ]]; then

注意 ||前面要留空格, "]]前面也要留空格。




參考資料:

Ubuntu Jaunty Installation Guide - cchtml.com

2009年9月2日 星期三

「手把手」在chromium使用Greasemonkey的腳本_XP

目前ubuntu那台電腦掛蛋中,使用xp順便來寫一下chromium怎麼用Greasemonkey的腳本吧。

此篇以噗浪的表情符號為主,並不是每個腳本都能在chromium上使用,自己多嚐試嚕。



2009.10.06 更新下載腳本,圖示會變多







Step1、首先到這網頁,稍等一下有很多目錄開啟要一陣子,等他沒在跑時,下拉到最下面的數字資料夾,點進去下載mini_installer.exe檔。以後要用最新版都這樣嚕。











下載好就安裝吧,照著指示做就好了。



接下來要下載Greasemonkey的腳本,先到這網頁在右上方搜尋框填入plurk,在按放大鏡搜尋















我選用 Plurk Smile (3.7 主程式+基本款)點進去











install按右鍵鏈結另存新檔,我把檔案放在C:\下看你們要放在那吧!



















Step2、開啟我的電腦,在網址後面貼上以下文字在按Enter鍵

%USERPROFILE%\Local Settings\Application Data\Chromium\User Data\Default



在建立一個User Scripts資料夾並進入User Scripts。







右鍵另存新檔 把檔案貼入剛剛的資料夾內。







再來在你的捷徑上按右鍵內容







在目標最後面插入 --enable-user-scripts ,--前面要有一個空格,確定。







最後開啟/重開Chromium,到plurk,按下笑臉圖示應該有看到多了一些可以使用的表情符號了。







參考資料:

Run User Scripts in Google Chrome

一些Google Chrome可用的GreaseMonkey Scripts整理