個人心情和 Linux / FreeBSD 等技術

2009/10/25

ADELE - Make You Feel My Love





When the rain is blowing in your face

And the whole world is on your case

I could offer you a warm embrace

To make you feel my love



When the evening shadows and the stars appear

And there is no one there to dry your tears

I could hold you for a million years

To make you feel my love



I know you haven't made your mind up yet

But I would never do you wrong

I've known it from the moment that we met

No doubt in my mind where you belong



I'd go hungry, I'd go black and blue

I'd go crawling down the avenue

There's nothing that I wouldn't do

To make you feel my love



The storms are raging on the rollin' sea

And on the highway of regret

The winds of change are blowing wild and free

You ain't seen nothing like me yet



I could make you happy, make your dreams come true

Nothing that I wouldn't do

Go to the ends of the earth for you

To make you feel my love

2009/10/19

Argument list too long

錯誤訊息是


bash: /bin/rm: Argument list too long


今天用 rm -f db-* 遇到這個問題 ...


有點鳥呀


改用 find . -name "db-*" | xargs rm -f 就跑的蠻正常的

2009/10/09

Plugin 'InnoDB' init function returned error

我被這問題困擾了好久...


以下是完整的錯誤訊息


InnoDB: Error: log file ./ib_logfile0 is of different size 0 5242880 bytes
InnoDB: than specified in the .cnf file 0 268435456 bytes!
091009 1:52:14 [ERROR] Plugin 'InnoDB' init function returned error.
091009 1:52:14 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
091009 1:52:14 [ERROR] Unknown/unsupported table type: InnoDB
091009 1:52:14 [ERROR] Aborting




work around 的方式

1. 先把 mysql 停下來
2. 我把 ib_logfile0 和 ib_logfile0 直接移除了
3. 重跑 mysql 就好了 0rz


好了之後再來用 maatkit 修復 replication

2009/09/21

重新開始

無須多說什麼,就聽吧

mysql slave replication error

error log 裡面出現了這行...


Error: log file ./ib_logfile0 is of different size 0 67108864 bytes


仔細查才發現 master 的 my.cnf 裡面
innodb_log_file_size = 64M


而 replication slave 的 my.cnf
innodb_log_file_size = 8M


這樣跑就會出錯了,把 slave 的 my.cnf 改成和 master 一樣的大小就行了

2009/08/27

ssh-keygen

這已經在公司用了好久了,不是什麼了不起的應用

來這裡筆記一下吧

詳細的使用看 manpage 第一段就明確的告訴你

ssh-keygen generates, manages and converts authentication keys
for ssh(1). ssh-keygen can create
RSA keys for use by
SSH protocol version 1 and RSA or DSA keys for use by SSH
protocol version 2. The type of key to be generated is specified
with the -t option. If invoked without any arguments, ssh-keygen
will generate an RSA key for use in SSH protocol 2 connections.

預設不自作聰明的帶參數的話會是 SSH protocol 2 可使用的 RSA key。

但是 RSA非對稱式加密 有些歷史因素,個人認為在 1024 bits 以下都很危險..


所以個人還是偏好使用 DSA演算法

廢話不多說來產生 key

rellik@desktop(01:05:08)[~]$
ssh-keygen -t dsa

Generating public/private dsa key pair.
Enter file in which to save the key (/home/rellik/.ssh/id_dsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/rellik/.ssh/id_dsa.
Your public key has been saved in /home/rellik/.ssh/id_dsa.pub.

大概按兩三次 Enter 鍵就結束了

而在工作環境下我的 HOME 目錄又是使用 NFS 掛載到每一台機器上的

這有個好處可以讓我快速的游移在多台機器中不需要打帳號密碼節省了

很多敲鍵盤的時間。

作法是在 $HOME/.ssh 目錄底下建立一個 authorized_keys

然後把 $HOME/.ssh/id_dsa.pub (記得是 public key 呀)貼到

authorized_keys 裡,權限 600 ,這樣就可以利用 nfs 快速的在

機器間遊走了 。

最後忘了說,Debian liked 的系統強烈建議安裝 openssh-blacklist

這個套件 ......, 不清楚的人可參考之前的文章 Debian的openssl漏洞

2009/07/13

難得一見的畫面

先說說我幹了啥事,我只是在灌我們家的機器時測試


了最新一周的Debian testing weekly build,然後在


root partition 跑ext4+raid1 , 才剛裝完重開後就看到


以下的畫面


2009/06/05

個人近況

最近一直沒更新,純粹是有點懶。


在公司目前為止,跑機房的業務量還不是很大,


最近這幾天幾乎都在改 code 。尤其是 shell script...


最近改得不是備份程式就是要開發檢查系統的程式,


在 perl 完全不熟得情況下,又要快速把我的 ticket 結掉


就只好選擇目前最熟悉的 bash 囉。比較好玩的是今天用到了


些 bash 獨特功能,由於公司獨特環境下本考慮改回最原始的


Bornie Shell 來跑,忽然發現某些陣列會爛掉 ...


還好公司裡 FreeBSD系統上也裝了bash,還貼心的把路徑 soft link


到 /bin 底下,才讓我開發了四個小時的程式不用更換成 sh而重寫


os.
為什麼台北這兩天一直下雨呢 (?)

2009/04/17

Google Chromium Nightly Build

XP版載點:http://build.chromium.org/buildbot/snapshots/chromium-rel-xp/

nightly build 比 google 上安裝的 stable版本速度更快更嚇人......

測試了兩週發現就算firefox上有裝noscript擋掉了部分JavaScript

速度還是比Chromium慢,而且對於asp網頁的支援情況看起來比

firefox還好。


以下是家中ip分享器管理頁面

Chromium的畫面,版本2.0.175.0












Firefox 3.0.8畫面












hmm.....如果不是因為Firefox有很多好用外掛的話我應該會直接

換到Chromium

ps.而且上半部畫面大很多,眼睛長期看螢幕下來是比較舒服的
(一個深度近視使用者心聲)

2009/03/29

瀏覽器評測

http://www.101asian.com/webtest.htm

測試 javascript 速度,以時間為單位,越小越好,進入點選最底 Run all tests



我測試成績如下

firefox 3.0.8  Average time: 425ms

Google Chrome 1.0.154.53  Average time: 43ms (shock!)

Opera 9.64  Average time: 525ms (.......我之前最愛的opera)

IE 7 Average time: 923ms  (......................測試到一半還會彈出視窗)


ps.來人補個IE 8來看看....

詐騙電話

就在剛才打來的人自稱是金石堂 XD,講了一堆blabla會自動重複扣

款之類的鬼話,重點是我每本書都是先送到超商後付款,從來沒給

過銀行帳號。不過奇怪的是他還可以知道我在幾月幾號有訂過什麼

書,書名blabla都講的出來,我在金石堂訂書時都還特別注意是在

SSL加密之下進行的,合理的懷疑就是金石堂資料庫又被 hack 啦,

來電顯示是0223644672 ...是金石堂的傳真 Orz,後來我掛了他電

話請他等會再打後就到到官方網站查詢且回撥客服,聽到了語音留

言『 現在非上班時間....blabla 』,我更確定我接到詐騙啦,而且電

話品質非常的差,講話中還會聽到疑似有電台在賣藥


XDDD
ps.幹x媽的,知道我訂網路安全的書籍還打來煩我

2009/03/25

伊藤由奈 trust you OO鋼彈第二季主題

喜歡上OO鋼彈這作品後,忽然發現主題曲聽也不錯聽題外話,


我覺得光是OO鋼彈劇情深度就比赤壁......這種商業電影好多了


ps.我無法接受在三國時代還會出現爆破場面,而卻一點也不考究


火藥到了宋朝才發明...,更別說劉關張的對話內容儘是讓我聽不


下去的仁義道德,長板橋之戰卻一直讓自己的部隊送死斷後,到處


出現前後矛盾或與史實不符的情況。






歌詞:

は風に揺れ踴るように

雨は大地を潤すように

この世界はより添いあい生きてるのに

なぜ人は傷つけ合いうの

なぜ別れは訪れるの

君が遠くで行ってもまだ

いつもこの心の真ん中

あの優しい笑顔で埋めつくされたまま

抱きしめた君の欠片に

痛み感じてもまだ

繋がる から信じてるよまた會えると

I'm waiting for your love

I love you I trust you

君の孤獨を分けてほしい

I love you I trust you

光でも闇でも

二人だから信じ合える

NO~ 離さないで


彷如花朵在風中飄搖

彷如細雨滋潤大地

世上之物都彼此依偎共同生存

為何人卻要彼此傷害

為何總有別離

即使你已遠行

在我心深處

總為那溫柔笑顏所填滿

緊擁著你的碎片

雖覺疼痛卻依然相連

我深信還會再見

I'm waiting for your love

I love you I trust you

請與我分享你的孤獨

I love you I trust you

無論光明或是黑暗

我們都在一起彼此信任

No...不要分開


2009/01/20

Fedora 9下tarball安裝PHP(with mysql)

OS: Fedora 9

PHP版本:5.2.6

1.安裝相關的相依性套件

# yum -y install mysqlclient14 mysqlclient14-devel freeradius-mysql

mysql-server mysql-devel pcre-devel libc-client-devel cyrus-imapd-devel

gd-devel openldap-devel freetype-devel

##備註:安裝過程有缺檔案快速查詢方式,到別台已經裝好的電腦上利用 locate 找出

該檔案絕對路徑和使用 rpm -qf 做反查套件。


2.把 php 解壓縮到 root 家目錄

# tar -jxvf php-5.2.6.tar.bz2 -C /root/

3.編譯前先啟動 mysql,並在 runlevel 3 和 5 自動啟用

# service mysqld start && chkconfig --level 35 mysqld on

4. 開始配置 php

# cd php-5.2.6

# ./configure --prefix=/usr/local/php5 --with-mysql --with-apxs2

=/usr/local/apache2/bin/apxs ( 這裡由於apahce2也是自己編譯的,使用

系統預設 apache 的人要注意路徑 ) --with-regex=php --enable-shared

--with-gd=/usr --enable-gd-native-ttf -with-zlib --with-freetype-dir=/usr

--with-ldap=/usr

5. 編譯並安裝

# make && make install

6. 檢查自己的 apache modules 資料夾下有無 libphp5.so 並檢查 httpd.conf

是否已經載入模組。 沒有的自行加入下一行

LoadModule php5_module modules/libphp5.so

要注意 modules資料夾位置 , 寫法是相對於 ServerRoot 的位置 ,

我的 apache ServerRoot 是在 /usr/local/apache2, 實際上 libphp5.so

絕對位置在 /usr/local/apache2/modules/libphp5.so )

如有修改 httpd.conf 的話要做 apachectl restart

(使用rpm安裝的 apache 可用 service httpd restart )

##備註:我測試 2.2.9 和 2.2.11 版的 apachectl 工具上偶而會出現

restart 無效的情況,可嘗試 apachectl stop 後再 apachectl start

7. 設定 mysql 資料庫

# mysqladmin -u root password '123456' //設定root密碼123456

# mysqladamin -u -h localhost password '123456' -p

# mysql -p

8. 拷貝php.ini 到 /usr/local/php5下 ,並確認 register_globals 關閉

# cd /root/php-5.2.6/ ; cp php.ini-dist /usr/local/php5/lib/php.ini

# vi /usr/local/php5/lib/php.ini

register_globals=off

9. 到 apache 的 DocumentRoot 資料夾下建立一個 test.php

測試頁面,內容如下

<?php
phpinfo();
?>

10. 瀏覽器測試

http://打入你的ip/test.php

成功的話就會看到 php 的頁面