2010-06-08

【手機】iPhone : App Store、mail 進不去,會自已跳出來…

0 comments

前天幫 Patty 把 iphone 小小整理一下,然後該update 的就update 一下,

因為被她用的太亂了,東西都亂放。

結果今天跟我說不能進 App Store ,也不能進 Mail 收信。

弄了老半天,我也沒啥 idea。

後來查到有人說是 3G Unrestrictor 2.0 的問題,

在此:使用3G Unrestrictor 2.0後進app store跳出

移掉後,就真的進的去了~太棒了!!

在這裡記錄一下。

 

 

 

 

2010-06-04

【軟體】Wine : 使用 Photocap 來製作 LOMO 風照片

0 comments

PhotoCap 是一個國人寫的軟體,功能非常多,而且簡單好用

但現在我都是用Ubuntu,所以還是要想辦法,看能不能在 Ubuntu上執行。

首先安裝 wine,然後再把 PhotoCap 的安裝檔下載下來。

因為我覺的中文可能又會有亂碼的問題,所以我就直接抓英文版。

接著在 Terminal 中執行

$ wine PhotoCap501_EN.exe

很簡單就安裝好了,而且也可以順利執行。

下圖是我用 PhotoCap 把照片加上 LOMO 風,成果就是最上面的那張照片。



我只能說:台灣人真強!!

 

 

 

 

【軟體】Ubuntu : Double Commander

0 comments

Double Commander 這軟體還蠻不錯的,可以很方便的複制二個不同路徑下的檔案。

網站:http://doublecmd.sourceforge.net/

Double Commander is a cross platform open source file manager with two panels side by side. It is inspired by Total Commander and features some new ideas.

Here are some key features of Double Commander:

  • Unicode support
  • All operations working in background
  • Multi-rename tool
  • Tabbed interface
  • Custom columns
  • Internal text editor (F4) with syntax hightlighting
  • Built in file viewer (F3) to view files of in hex, binary or text format
  • Archives are handled like subdirectories. You can easily copy files to and from archives. Supported archive types: ZIP, TAR GZ, TGZ, LZMA and also BZ2, RPM, CPIO, DEB, RAR.
  • Extended search function with full text search in any files
  • Configurable button bar to start external programs or internal menu commands
  • Total Commander WCX, WDX and WLX plug-ins support
  • File operations logging
  • And more...

下載:http://sourceforge.net/projects/doublecmd/files/

我是下載 doublecmd_0.3.5.1-1.gtk2_i386.deb

安裝:執行
$ sudo dpkg -i doublecmd_0.4.5.1-1.gtk2_i386.deb
安裝完後,會出現在 Applications > Accessories > Double Commander,如下圖

執行畫面如下:

另外還有一套叫 GNOME Commander (如下圖),不過畫面看起來比較陽春,我就沒有去試了。

 

 

 

 

2010-05-28

【軟體】Ubuntu : 使用 ffmpeg 轉檔

0 comments


在2010-05-20的時候,聖峰跟家琴結婚了,

我拿著我的550D記錄了他們公證的一刻。

但檔案超大的,一共6.5G。上傳到Vlog也不可能。

所以就想辦法先在本機上轉好,再上傳吧。

軟體要先裝 ffmpeg

$ sudo apt-get instll ffmpeg

裝完後,就可以執行下面的指令來轉檔,這個是產生 flv 格式的 output

$ ffmpeg -i source.mov -y -vcodec flv -f flv -r 29.97 -s 1280x720 -b 2000kb -g 160 -cmp dct -subcmp dct -mbd 2 -flags +aic+cbp+mv0+mv4 -trellis 1 -ac 2 -ar 44100 -ab 128kb output.flv

如果要產生h.264格式的影音,要再安裝 x264,

然後ffmpeg也要改成用自行 make 的方式來安裝,這樣才可以 enable h264
可見:Install FFmpeg and x264 on Ubuntu Jaunty Jackalope 9.04 & Ubuntu Intrepid Ibex 8.10

另外可再安裝 winff ( ffmpeg 的 GUI) 來使用。會更容易。

下面附上轉完後的影片:

 

參考網站:

FFmpeg Documentation

Ffmpeg选项详解

 

 

 

 

2010-05-24

【系統】Ubuntu - 升級到 Lucid 後,USB 無法寫入

0 comments

非常奇怪的問題,自從我升級到 Lucid 後,將 USB 接上電腦後,就會出現奇怪的問題,沒辦法使用。

問題描述如下:

  • 會出現二個裝置,如上圖中 2.0 GB Filesystem 及 usb0
  • 點擊 2.0 GB Filesystem ,沒有反應
  • 點擊 usb0 ,會出現目錄,但如果有中文,會變成亂碼,而且擁有者是 root,所以你也沒權限做啥更改
  • 使用 gksu nautilus 使用 root 的權限,硬將資料 Copy 進去,到別台讀,有中文的變成 ?????
  • 讀好慢……好慢…

圖:出現二個裝置 2.0 GB Filesystem 及 usb0


圖:擁有者是 root

圖:無法建資料匣

這個問題我在公司的電腦中沒發生,但家裡的卻有這樣的問題,真是怪。

Google 了一陣子,看到一篇文章有人討論到:
[other] lucid upgrade causes USB automount problems (tips/advice)

解法就是把 usbmount 移掉

$ sudo apt-get remove usbmount

再重新插上 usb (usb0 要使用 root 權限才可以 unmount )。

結果就正常了,圖如下:

圖:只有一個 2.0GB Filesystem

圖:可以建資料匣

圖:擁有者變成 chingwei


 

 

 

 

 

2010-04-30

【程式】PHP : Curl with Session

0 comments

今天同事問了一個問題

A.php 用 Curl 去抓 B.php 。

然後 B.php 寫在 Session 的東西,

為什麼 A.php 抓不到 (當然 B.php 也抓不到 A.php 的值),

這是因為 curl 其實產生了另一個 session,

所以就算存了也抓不到。

當然也有解決的方法,就是使用 session_id()

程式如下:

A.php

function doHttpRequest($url, $args='') {
    $ch = curl_init();
    //Post Data
    curl_setopt($ch, CURLOPT_POST, 1);
    curl_setopt($ch, CURLOPT_POSTFIELDS, 'sid='.session_id());
                
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    $result = curl_exec($ch);
    curl_close($ch);
    return $result;
}

session_start();
$_SESSION['aa']='[A.php]';
session_write_close();

$url = 'http://cw.dev.com/B.php';
echo doHttpRequest($url);

session_id(session_id());
session_start();
var_dump($_SESSION);

B.php

session_id($_POST['sid']);
session_start();
$_SESSION['bb']='[B.php]';
var_dump($_SESSION);

執行結果:

array  'aa' => string '[A.php]' (length=7)  'bb' => string '[B.php]' (length=7)
array  'aa' => string '[A.php]' (length=7)  'bb' => string '[B.php]' (length=7)

 

以上,記錄一下…

【重灌】 Ubuntu 10.04 把 sun-java6-jre 移掉了…

0 comments

今天灌好 Ubuntu 10.04 後,發現 sun-java6-jre 怎麼都裝不起來了。

Google 一下,原來是被移掉了…現在改用 openjdk 來取代

參考: 在 Ubuntu Lucid 下请回 Sun Java6 Jre, 赶走 OpenJDK

但之前都用的好好的,所以我還是灌 sun-java6-jre 吧。

 

方法如下:

# sudo vi /etc/apt/sources.list

加上

deb http://ftp.sjtu.edu.cn/ubuntu/ karmic multiverse

接著

# sudo apt-get update

# sudo apt-get install sun-java6-jre

 

搞定。

【系統】jpegtran : ffmpeg 產生的縮圖在 facebook 上無法顯示!!

0 comments

最近發現從 Vlog 分享到Facebook 上的影片,都看不到縮圖,真是見到鬼了… ( 見上圖 )

後來 Mr. Kusan 有Google 到一篇文章:
Videos shared to Facebook and images/thumbnails generated with ffmpeg

原來是 Facebook 的 safe_image.php 在產生縮圖時,沒辦法處理 ffmpeg 產生出來的縮圖。

詳細的原因,在上面那篇文章中都有寫。

解決的方式就是使用 jpegtran 來 fix 這個問題

原文:
To make this work with ffmpeg generated (thumbnail) images, you've to apply some sort of a fix. The jpegtran utility is perfect for the job, because it writes JPEG images only with a JFIF marker in the header and it does not recompress the image (thus image quality is preserved).

好,那我們就來裝裝 jpegtran 吧 ( 但記得系統要先有裝 libjpeg )

OS : SLES 10 & 11

至 http://www.ijg.org/ 下載 jpegsrc.v8a.tar.gz 

# wget http://www.ijg.org/files/jpegsrc.v8a.tar.gz

# tar -zxvf jpegsrc.v8a.tar.gz

# cd jpeg-8a

# ./configure

# make ; make install

目前為止,就正式裝完了。

執行 jpegtran 他居然出現:
jpegtran: error while loading shared libraries: libjpeg.so.8: cannot open shared object file: No such file or directory

查詢一下 libjpeg.so.8 在那

# whereis libjpeg.so.8
libjpeg.so: /usr/lib/libjpeg.so.62 /usr/lib/libjpeg.so.6 /usr/local/lib/libjpeg.so /usr/local/lib/libjpeg.so.8

明明就有呀!

所以照 Garlic 說的,這就是 Include PATH 的問題了。

# vi /etc/profile.local
# Add PATH
export LD_LIBRARY_PATH=/usr/local/lib

重新登入,執行 jpegtran 已經不會再出現錯誤訊息了。

然後將 ffmpeg 產生的圖片用 jpegtran 再跑一次。

# jpegtran -outfile fixed_image.jpg input.jpg

然後再次到 Facebook 看,縮圖總算出來了。

Facebook 的 safe_image.php 大概只會 Cache 一段時間,所以之前沒有縮圖的只要修正好後,過一段時間就會出現了。

結果如下圖 :

太好了~~解決了!!

 

PS. 

今天 Ubuntu 10.04 正式 Release 了

我要準備來灌 Ubuntu 10.04 了!! 耶!! 

 

 

 

 

2010-04-28

【系統】HP : Enable PXE Boot Support for Embedded NIC

0 comments

因為之前已經有裝好PXE Server了,所以之後的安裝,當然都要用PXE來裝,才不會浪費PXE這個好物。

可是我明明就在開機的時候,按 F12 說要用 PXE 來 Boot,可是他就是都沒有抓到 IP。

結果… 又是靠 Garlic ,原來是要將 Embedded NICs 設定 PXE 為 Enable,否則…預設是 Disable。

好~來記錄一下吧。

步驟是:System Options > Embedded NICs > NIC 1 Boot Options > PXE Boot

Step By Step

System Options > Embedded NICs

System Options > Embedded NICs > NIC 1 Boot Options (可以看到下面是顯示 Disabled )

會出現 Note

System Options > Embedded NICs > NIC 1 Boot Options > PXE Boot

System Options > Embedded NICs > NIC 1 Boot Options > PXE Boot (選完後,你看下面,他顯示 PXE Boot了)

重開機,就可以輕鬆的用 PXE 安裝 Server 囉~耶~

【系統】HP : kernel requires an x86_64 cpu .... !!

0 comments



當我用VM Ware 在安裝 x64 的 OS 時,他出現了下面的錯誤訊息:

kernel requires an x86_64 cpu, but only detected an i686 cpu
unable to boot - please use a kernel appropriate for your cpu

經 Garlic 說明,是要進去BIOS裡面將 VT Enable 即可。

首先進iLO,然後重開Server,按 F9 進入設定畫面。

接著就依序
Advanced Options > Processor Options .. > Intel (R) Virtualization Technology > Enabled

下面來個 Step By Step .....

選擇 Advanced Options

Advanced Options > Processor Options ..

Advanced Options > Processor Options .. > Intel (R) Virtualization Technology

Advanced Options > Processor Options .. > Intel (R) Virtualization Technology > Enabled


接著重新開機,搞定~~

但太舊的 Server 可能就沒有支援 VT 了~~