安裝完 ubuntu 需要做一些調整, 或是安裝一些常用的軟體, ubuntu tweak 是一個很好的工具, 一些常用軟體的 source list 都包含在裡面, 對於 gnome gui 的設定很直觀, 不需要開 gconf-editor 慢慢找. 安裝方法如下.wget http://ubuntu-tweak.googlecode.com/files/ubuntu-tweak_0.4.7.1-1%7Ejaunty1_all.deb
dpkg -i 'ubuntu-tweak_0.4.7.1-1~jaunty1_all.deb'
ref: this
[+/-] |
ubuntu tweak in ubuntu 9.04
poster:
MarlboroMoo on
03:48
tag:
ubuntu,
ubuntu tweak
/
Comments: (0)
|
[+/-] |
terminator in ubuntu 9.04
poster:
MarlboroMoo on
03:13
tag:
screen,
terminal,
terminator,
ubuntu
/
Comments: (0)
|
Terminator安裝方式如下:
The goal of this project is to produce a useful tool for arranging terminals.
It is inspired by programs such as gnome-multi-term, quadkonsole, etc. in that the main focus is arranging terminals in grids (tabs is the most common default method, which Terminator also supports).
Much of the behaviour of Terminator is based on GNOME Terminal, and we are adding more features from that as time goes by, but we also want to extend out in different directions with useful features for sysadmins and other users. If you have any suggestions, please file wishlist bugs!
wget http://launchpadlibrarian.net/23910566/terminator_0.12-2_all.deb
dpkg -i terminator_0.12-2_all.deb
ref: this and this
[+/-] |
postwp-mu.sh |
因為工作的關係, 用 bash 寫了一隻 script 可以從 command line 直接 blogging, 原理是將資料轉換成 xml, 並使用 netcat 將 xml 透過 xml-rpc protocol 塞給伺服器, 不過是這個 script 是給 wordpress 用的.. 如果 blogger 有支援 xm-rpc 的話, 我會生一個 for blogger 的版本, 應該會很黑皮, 嘎嘎嘎 !
實作功能:
- 發佈文章
- 發佈頁面(page)
- 發佈文章 or 頁面可指定分類(Categorie)和標籤(tag)
- 列出文章 or 頁面
- 刪除頁面(page)
- 刪除文章
- ...
- 請先修改 script 裡的帳號密碼.
- 可以先編輯一篇文章, 再將檔案指定給 script.
- wordpress 支援的 html tag 都可以使用, 如 <pre> <code> <blockquote>.
直接使用以下指令來看說明.
chmod +x ./postwp-mu.sh
./postwp-mu.sh -h
ref: this, this and this
[+/-] |
Internet Explorer 6 SUCK !!
poster:
MarlboroMoo on
15:46
tag:
blogger hack,
ie6 suck
/
Comments: (0)
|
What the fuck, ie6 問題真的有夠多, 都不照 W3C 的規範走, 用它來瀏覽常有莫名其妙的東西出現, 為了抓這些奇奇怪怪的蟲子, 浪費了我很多的生命, M$ 真是造孽. 列出幾個這幾天碰到的問題. 請大家務必愛用 firefox 啊 ...
- 如果 div 同時設定 float 和 margin, pixel 會加倍, 10px 變成 20px. 必須透過加上 display:inline; 來修正.
- 文字 or 圖片常度過寬未手動斷行, 整個 layout 爆炸, 於 main-wrapper 或是 sidebar-wrapper 的 css 加入 word-wrap 還有 overflow 的參數來修正.
- 圖檔為 png 格式的透明背景在 ie6 無法正常顯示, 必須使用 gif ! 嘖嘖.
#IamFloat{
float:left;
margin:10px;
display:inline;}
< #div id="imfloat">
width: 410px;
float: left;
word-wrap: break-word; /* fix for long text breaking sidebar float in IE */
overflow: hidden; /* fix for long non-text content breaking IE sidebar float */
....... }
#sidebar-wrapper {
width: 220px;
float: right;
word-wrap: break-word; /* fix for long text breaking sidebar float in IE */
overflow: hidden; /* fix for long non-text content breaking IE sidebar float */
........ }
What is Browsershots?ref: this, this and this.
Browsershots makes screenshots of your web design in different browsers. It is a free open-source online service created by Johann C. Rocholl. When you submit your web address, it will be added to the job queue. A number of distributed computers will open your website in their browser. Then they will make screenshots and upload them to the central server here.
[+/-] |
My Chemical Romance |
My Chemical Romance (wiki) 雖然是老團, 不過還是很正點, 每次聽 welcome to the black parade (mv), 還是會起雞皮疙瘩.
The Black Parade track listing
# Title Length
1. "The End." 1:52
2. "Dead!" 3:15
3. "This Is How I Disappear" 4:02
4. "The Sharpest Lives" 3:20
5. "Welcome to the Black Parade" 5:11
6. "I Don't Love You" 4:00
7. "House of Wolves" 3:04
8. "Cancer" 2:22
9. "Mama" 4:41
10. "Sleep" 4:43
11. "Teenagers" 2:41
12. "Disenchanted" 4:55
13. "Famous Last Words" 5:01
14. "Blood" (hidden track) 2:53
B-sides
# Title Length
1. "Kill All Your Friends" 4:28
2. "Welcome to the Black Parade (Live)" 5:29
3. "Heaven Help Us" 2:54
4. "My Way Home Is Through You" 2:59
5. "Famous Last Words (Live)" 4:53
Welcome to the Black Parade
When I was a young boy my father took me into the city
to see a marching band
He said 'Son when you grow up, would you be,
the saviour of the broken, the beaten and the damned?'
He said 'Will you, defeat them, your demons,
and all the non-believers, the plans that they have made?
Because one day I'll leave you a phantom
to lead you in the summer to join the Black Parade.'
WHEN I WAS A YOUNG BOY, MY FATHER TOOK ME INTO THE CITY
TO SEE A MARCHING BAND!
HE SAID 'SON WHEN YOU GROW UP, WOULD YOU BE,
THE SAVIOUR OF THE BROKEN, THE BEATEN AND THE DAMNED?!'
Sometimes I get the feeling
She's watching over me
And other times I feel like I should go
And through it all; the rise and fall,
the bodies in the streets
And when you come we watch you want to know
We'll carry on
We'll carry on
and though you're singing, god believe me
Your memory will carry on
You'll carry on
And in my heart I can't contain it
The end of world is waiting
Your romances you reel in from decimated dreams
Your misery and hate will kill us all!
So paint it black and take it back
And let's shout aloud at prayer!
Defy unto the end we hear the call!
So carry on
We'll carry on
and though your singing, god believe me
Your memory will carry on
And carry on
And though you're broken and defeated
Your weary widow marches
On and on we carry through the fears
Disappointed faces of your peers
Take a look at me
Cause I could not care at all
Do or die
You'll never make me
Because I won't
You'll never take my heart
And though they try
They'll never break me
They want it all
They wanna break this heart
I won't explain
Or say I'm sorry
I'm not ashamed
I'm gonna show my scar
Give the chair
Now while I'm broken
Listen here!
And listen to me!
I'm just a man,
I'm not a hero
Just a boy
Now let him sing this song
I'm just a man
I'm not a hero
I don't care
We'll carry on
We'll carry on
And though you're singing, god believe me
Your memory will carry on
You'll carry on
And though you're broken and defeated
Your weary widow marches on!
Do or die
You'll never make me
Because I won't
You'll never take my heart
And though they try
They'll never break me
They want it all
They wanna break this heart
Do or die
You'll never make me
Because I won't
You'll never take my heart
And though they try
They'll never break me
They want it all
They wanna break this heart
[+/-] |
apt-key in ubuntu 9.04 |
有時候需要增加一些非官方的 repositories 到 apt 的 source list 裡面, 使用以下指令手動下載並新增 pgp key, "5A9BF3BB4E5E17B5" 這一串數值是 keyid. 因 repositorie 而異.sudo apt-key adv --recv-keys --keyserver subkeys.pgp.net \
5A9BF3BB4E5E17B5
但是 pgp keyserver 的 port 預設不是開在 80, 如過公司的 firewall 有檔的話, 就必須另外找有 80 port 的 keyserver 了, 使用下面的方式指定.sudo apt-key adv --recv-keys --keyserver hkp://sks.nanofortnight.org:80 \
5A9BF3BB4E5E17B5
p.s 這裡可以找到許多的 80 pgp keyserver.
[+/-] |
syncCE with windows mobile 6.1 plus evolution2 in ubuntu 9.04 |
在 ubuntu 裡要同步 windows mobile 的聯絡人, 當然無法用 activesync, 不過有 opensource 的 project 可以替代, syncCE.
- 因為要安裝的東西真不少, 這次用 apt-get 的方式, 加入 syncCE 位於 launchpad.net 的 repositories.
- 加入這個 repositories 的 pgp key.
- 開始安裝相關套件, 其中 opensync-plugin-evolution 如其名, 就是 evolution2 的 plugin, multisync0.90 則是 gui.
- 安裝完後, 可以使用以下的指令來啟動服務並確認是否正常連線 windows mobile, 沒有意外應該可以看見一些 mobile 裡面的資料夾.
- 如同使用 activesync, 要先建立 profile, 因為 windows mobile 的限制, 最多只能建立兩個 profile, 如果要再建立, 必須先刪除, 使用以下指令來查詢,或是刪除.
- 如過沒問題, 就開始建立 profile, 下方的範例是建立一個名稱為 "Ubuntu notebook", 並且同步聯絡人和行事曆的 profile.有四種同步的類型做選擇, 分別為 Contacts(聯絡人), Calendar(行事曆), Tasks(事件), Files(檔案).
- 設定 sync 群組, 將 snycCE 透過 opensync 的 plugin 同步到 evolution2.
- 終於可以同步了, 推薦使用 gui, 輸入以下指令.
- 也可以使用 command line.
- 打開 evolution2, 可愛的聯絡人都出現了, ya !!
sudo echo '
#syncCE
deb http://ppa.launchpad.net/synce/ubuntu jaunty main
deb-src http://ppa.launchpad.net/synce/ubuntu jaunty main' >> /etc/apt/sources.list
sudo apt-key adv --recv-keys --keyserver subkeys.pgp.net \
5A9BF3BB4E5E17B5
sudo apt-key adv --recv-keys --keyserver subkeys.pgp.net \
B152F042D246C25D
sudo apt-get update
sudo apt-get install synce-hal librra-tools librapi2-tools
sudo apt-get install multisync-tools opensync-plugin-synce synce-sync-engine
sudo apt-get install opensync-plugin-evolution
sudo apt-get install multisync0.90
synce-sync-engine &
synce-pls
synce-list-partnerships #查尋
synce-delete-partnership #刪除
synce-create-partnership "Ubuntu notebook" "Contacts,Calendar"
msynctool --addgroup synce-sync
msynctool --addmember synce-sync synce-opensync-plugin
msynctool --addmember synce-sync evo2-sync
multisync0.90
msynctool --sync synce-sync
ref: this, this and this.
[+/-] |
virtualbox in ubuntu 9.04
poster:
MarlboroMoo on
10:41
tag:
ubuntu,
virtualbox
/
Comments: (0)
|
雖然歐若扣收購了太陽, 還是要用 virtuallbox, 我喜歡從 offcial site 抓, 安裝完還要針對 guest os 無法使用 usb 的 bug 做修正, 順便安裝 "額外客端功能"(guest additions) , 可以和 guest os 有更方便的互動.
- 我不喜歡加到 source list 的方式, 還要新增 gpg key, 真麻煩, 直接抓, 然後 install, 要加入 source list, 請看這裡.
- 修正 guest os 無法使用 usb 的 bug, 先將你的帳號加入 vboxusers 的群組.
- 取得群組 vboxusers id 並且修改 usbfs 的權限, 讓 vboxusers 群組可以存取.
- 最好的方式, 重起你的 os !
- Finishhhhhhh !
wget http://download.virtualbox.org/virtualbox/2.2.2/virtualbox-2.2_2.2.2-46594_Ubuntu_jaunty_i386.deb
dpkg -i virtualbox-2.2_2.2.2-46594_Ubuntu_jaunty_i386.deb
sudo usermod -G vboxusers -a `whoami`
vboxusers_id=`sudo grep vboxusers /etc/group | cut -d':' -f3`
sudo echo "
# /dev/usb
none /proc/bus/usb usbfs auto,busgid=$vboxusers_id,\
busmode=0775,devgid=$vboxusers_id,devmode=0664 0 0" >> /etc/fstab
sync;sync;sync
sudo reboot
[+/-] |
blogger post always show date
poster:
MarlboroMoo on
04:03
tag:
blogger hack
/
Comments: (0)
|
為了使用 update time 的 hack, 所以也得讓每篇文章都顯示日期, google 一下找到 hack 的方法, 用 java script 把日期存入變數再印出.
- 將下方 script 放在 <head> 後, <b:skin> 前.
- 找到類似下方 data:post.dateHeader 的區段.
- 參考成下方的 code 做修改, 依 teamplate 而異
- weeeeeeeeeee ;D
<script type='text/Javascript'>
var d;
function saveDate(c){
if(c!='') d=c;
document.write(d);
}
function showDate(a){
document.write(d);
}
</script>
<b:if cond='data:post.dateHeader'>
<data:post.dateHeader/>
</b:if>
<b:if cond='data:post.dateHeader'>
<script>saveDate('<data:post.dateHeader/>');</script>
<b:else/>
<script>showDate();</script>
</b:if>
[+/-] |
blogger post template
poster:
MarlboroMoo on
23:53
tag:
blogger tip
/
Comments: (0)
|
常常需要在 blogger 裡用 custom 的 tag, 覺得很麻煩, 直接把這些 tag 加到文章範本裡就 ok 了,步驟如下:
- 登入 blogger 的後臺
- 設定 -> 格式 -> 文章範本
- 加入你常用的 tag
- 發表新文章, 切換到修改Html的tab
- done.
<code class="prettyprint">
</code>
<code class="cmd">
</code>
[+/-] |
blogger hack list
poster:
MarlboroMoo on
15:28
tag:
blogger hack
/
Comments: (0)
|
- recent comments
- recent posts
- page generation time
- font size
- blog peek boo view of posts in
- page menu
- search bar
- blogger plus google code prettify code
- always show post time
- show post update time
- bookmark icon feat post icon
- related post
- label cloud
- archives default collapsed
- sidebar element toggling
p.s blogger 真是殺時間的玩具.
[+/-] |
blogger hack resource
poster:
MarlboroMoo on
15:02
tag:
blogger hack,
resource
/
Comments: (0)
|
hack reference:
- http://abintech.azhai.org/
- http://chenkaie.blogspot.com/
- http://www.xavierliu.com/
- http://themelib.com/
- http://www.techieblogger.com/
teamplate:
- http://btemplates.com/
- http://quiterandom.com/
- http://themelib.com/
- http://www.bloggerstyles.com/
- http://falconhive.com/
- http://www.deluxetemplates.net/
[+/-] |
blogger plus google-code-prettify = code block hightlight
poster:
MarlboroMoo on
11:16
tag:
blogger hack,
highlight,
prettify
/
Comments: (0)
|
為了 blogger 的 code block hightlight 搞了好幾天, 先後試了 SyntaxHighlighter 和 google-code-prettify , 最後決定用後者, 因為 SyntaxHighlighter 的 js 實在太多了, blogger 打開的速度慢的嚇人, 雖然有很多方便的功能(toolbar), 且有不同的 theme 可以選擇, 不過為了效能, 還是算了吧 :( . 下列做一些安裝筆記.
- 先下載 google-code-prettify , 將壓縮檔解開目錄下的 /src 都上傳到你的網頁空間(推薦 hostse.com).
- 修改 blogger teamplate(版面配置 > 修改 HTML), 找到 <head> 於下方加入以下的 code.
- 再找到 <body>, 將它修改成下方的 code.
- 自訂 css 給 <code> tag 用.
- <code> tag 使用方式如下, 以後就有 hightlight 啦, ohya.
<!-- google prettify -->
<link href='http://你的網頁空間網址/prettify.css' rel='stylesheet' type='text/css'/>
<script src='http://你的網頁空間網址/prettify.js' type='text/javascript'/>
<!-- load google prettify -->
<body onload='prettyPrint()'>
/* CSS for Code Block and Cmd Block in content */
code {
display: block; /* fixes a strange ie margin bug */
white-space: pre-wrap; /* css-3 */
white-space: -moz-pre-wrap; /* Mozilla, since 1999 */
white-space: -pre-wrap; /* Opera 4-6 */
white-space: -o-pre-wrap; /* Opera 7 */
word-wrap: break-word; /* Internet Explorer 5.5+ */
font: normal normal 100% Verdana, Arial, Sans-serif;
font-size: 10pt;
color:#000000;
overflow:auto;
background: #fbfaf7 url('http://你的網頁空間網址/Code_BG.gif') left top repeat-y;
border: 1px solid #000000;
padding: 10px 5px 10px 20px;
margin: 5px 15px 5px 15px;
max-height:250px;
height: expression(this.offsetHeight>205?205:''); /*fix for IE without max-height*/
line-height: 1.2em;
text-decoration: none;
}
code.cmd {
color:#ffffff;
background: #000000 url('http://你的網頁空間網址/BG_CMD.gif') left top repeat-y;
border: 1px solid #ffffff;
}
<code class="prettyprint">
你的 code.
</code>
<code class="cmd">
你的 command.
</code>
p.s 一些字元還是需要手動轉換的, like < > & " , 就用 Text -> HTML Entities Encoder 吧.
ref: this, this, this, and this.
[+/-] |
syntax highlight test. |
#!/bin/sh
echo 'hello world!'
echo 123:456 | cut -d':' -f2 | sort > /tmp/123.log
[+/-] |
font in ubuntu 9.04 |
一些 ubutnu 9.04 的字型 note, 我還是不怎麼喜歡黑體字 !!
- 英文字型:目前使用點陣字型 Terminus, 可以直接 apt-get install.
- 中文字型:改用點陣字型 WenQuanYi Zen Hei, 預設已安裝, 另外字型模糊的部份, 請修改以下檔案的三個數值, 並做連結, 或是直接安裝新版的文泉驛正黑體.
- Flashl亂碼:修改以下檔案裡的字型名稱.
sudo apt-get install xfonts-terminus
sudo vi /etc/fonts/conf.avail/66-wqy-zenhei-sharp.conf
<test compare="more_eq" name="pixelsize"><double>12</double></test>
<test compare="less_eq" name="pixelsize"><double>17</double></test>
<edit name="antialias" mode="assign"><bool>false</bool></edit>
sudo ln -s /etc/fonts/conf.avail/66-wqy-zenhei-sharp.conf /etc/fonts/conf.d/
sudo vi /etc/fonts/conf.d/49-sansserif.conf
<edit name="family" mode="append_last">
<string>WenQuanYi Zen Hei</string>
</edit>
ref: this, this and this
[+/-] |
screen-profile in ubuntu 9.04 |
今天在 cofig .screenrc 的時候無意發現 , 原來 ubuntu 9.04 裡面有 screen-profile 這種方便的工具,裡面預設有四套 profile, 終於不用自己手動編輯啦 ;>
NAME.
screen-profiles - Configuration utility for screen-profiles
DESCRIPTION
screen-profiles is an application that can configure a number of options available in the screen-profiles utility.