World of Pluto

2011/11/19

iGetWretch 05 updated…again

Filed under: 電腦相關,軟體,Mac — ipluto @ 5:34 pm

iGetWretch is a Wretch album downloader for MacOSX

iGetWretch是一支MacOSX上的無名相簿下載器

Due to recent changes of photo/music handling in Wretch albums, the old version no longer works.

由於無名相簿改變了照片/音樂的存放方式,舊版的軟體已經無法運作。

An updated version has been posted at the same download page, GUI remains unchanged.

新版的程式已經上傳,所有使用者介面都沒有改變。

2011/08/18

打造一支Apple牌USB隨身碟

Filed under: 電腦相關,Mac — ipluto @ 5:04 pm

先來看看外觀:

嗯,沒錯,它就是Macbook Air和OSX Lion隨身碟版所附贈的

系統還原隨身碟

所以今天這篇教學的第一步

就是去買一台Macbook Air(好像舊的才有附USB)或者一套USB版的Lion(誤)

這支隨身碟容量共8GB 也有不錯的讀寫能力 但是有個很大的問題…. 它根本不能寫入啊!!!

雖然說這東西的本意就是讓你做系統還原的

所以本來就不該去寫它

但是一支好好的8GB隨身碟加上這種獨特的外觀 一直放在抽屜裡也太浪費了吧…. (這種size掛在鑰匙圈超方便的!)

好 假設已經取得了這支隨身碟(那個…拍賣也有賣XD)

我們可以把它變成可讀寫的

首先,是備份裡面的東西

啊…可是Apple很厲害的讓Toast, Disk Utility, 甚至Super Duper都對它沒輒

沒關係…我們還有一招….叫做Terminal |||

請插上你的隨身碟 在Terminal內輸入:

DEVICE=`mount | fgrep 'Mac OS X Install' | awk '{print $1}'`

輸入完可以打這行指令檢查是不是顯示類似/dev/disk1s3的東西(數字可能不同)

echo $DEVICE

下一步請輸入:

diskutil unmount "/Volumes/Mac OS X Install"

應該會顯示Volume Mac OS X Install on disk?s? unmounted

最後是這行: 

/bin/dd if="$DEVICE" of="$HOME/Desktop/airinstall.iso" bs=2048

整個隨身碟會變成一個叫airinstall.iso的映像檔出現在你的桌面

請確定你硬碟有約8GB的空間,並且桌面上沒有同樣的檔案名稱 (當然你也可以修改路徑啦 這邊就不贅述)

總歸所有的指令是:


時間會有點久,過程中不會顯示任何的東西,可以觀察桌面上的映像檔size開始增加 增加到7GB多時就是好了!

結束時你應該會看到類似這樣的東西:

3738954 0 records in

3738954 0 records out (兩個數字會一樣)

這樣就備份完成了,請好好保存你的映像檔, 然後輸入這行指令:

diskutil eject "$DEVICE"

來退出隨身碟

接下來我們要用到Storage_Zone板常提到的”量產工具”

所謂量產工具是隨身碟原廠在刷大量隨身碟用的工具

同時還有附加一些特異功能可以把隨身碟刷出不只一個分割區 (你如果用Disk Utility把隨身碟分割上了Windows只會看到其中一個分割區…)

甚至把隨身碟刷成光碟的形式(Apple就是這樣的…)

當然…也可以把隨身碟刷回可讀寫

由於量產工具是Windows下的,接下來的步驟需要到Windows操作

請下載 SM3255AB_J0818這個量產工具

載點在以下這些文章裡都有:

http://bbs.weiphone.com/read-htm-tid-1486864-page-1.html

http://www.megaupload.com/?d=F3ZXV9JE (老外很努力的看懂第一個連結抓下來上傳的)

Windows的環境我選了Bootcamp,因為Parallel Desktop抓不到我的隨身碟 (也有人回報用Parallel成功就是了…可以試試看)

請記得把整個量產工具複製到Win磁區再執行 直接執行Mac磁區的執行檔會出現default.ini找不到的問題

反正就是開好工具插好隨身碟

你就會看到port1偵測到一個8GB左右的東西

start給他按下去就對了!

教學到這邊其實就算結束了

重開機回Mac你就可以發現這個隨身碟已經是可讀寫的, 可以用Disk Utility自由的改格式/名稱

根據這邊的測試: http://hi.baidu.com/8lei/blog/item/a7eaa4c310d63542b219a8bf.html

寫入也有10MB/sec以上

比不上我的Patriot Rage XT但是比一般的隨身碟好不少了

最後 有些人覺得當初Apple USB Disk插入時的icon比較好看

沒關係上面那個網址也有原始的icon給你下載(汗)

不過我直接用cmt+i然後複製貼上的方法沒有成功

最後是載img2icns把下載的icns重新存過一次

更名為.VolumeIcon.icns複製到Apple USB Drive裡面才成功

2011/03/18

Matlab calling C

Filed under: Code,電腦相關 — ipluto @ 12:18 am
本文假設讀者已經懂matlab 和C的funtion寫法以及C的指標應用
不懂的人請自己去複習….
所謂Matlab呼叫C 通常就是為了速度的提升
因為Matlab實在是跑太慢了….
像一個通訊系統裡的viterbi decoder就可以考慮用C來寫
再include到Matlab的主程式裡
作法上是這樣
我們要把一個Matlab function整個用C寫好
然後compile成一個執行檔
這個執行檔可以被matlab直接呼叫 就像在呼叫一個matlab function一樣
只要名字配合好上層的程式根本不需要動
當然要這樣做你電腦裡需要有c compiler
看要裝gcc還是visual studio
在matlab的主視窗打mex setup
你就會看到它偵測到的compiler 選擇你要的
然後你要寫.c的程式
寫好後打mex filename.c
filename通常就是function name
你會得到一個叫filename.mex***的檔案
這跟你用的系統有關
假設是32bit的Windows你會得到.mexw32 64bit的Mac會得到.mexmaci64
64bit的linux會得到.mexa64這樣
好 現在來講那個.c檔怎麼寫
既然是在port一個function
當然.c檔也要寫成一個c的function
但是這樣matlab認不出來
所以其實要寫兩個function
第一個是該function的主要功能(廢話)
第二是一個gateway function 是matlab跟c溝通用的橋樑
溝通的gateway function寫法基本上很固定
既然是一個matlab function的port
它的input和output應該都是matrix
所以gateway function就是要把這些input matrix的dimension和值抓出來
然後造一個output matrix
這些抓出來的值都要餵到主function去
方法當然是…C最愛用的…指標
help裡面會寫很多mex function的用法
不管是抓dimension、抓值、造output矩陣都有
廢話不多說
假設我們的function是y=main_func(x,h)這樣的matlab function
轉換到c的話
我們先來看gateway function怎麼寫:

void mexFunction( int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[] )
// 這一行基本上是照抄,nrhs是input個數,prhs[]是每個input的指標
// 我們的例子有兩個input, 那nrhs就是2, prhs[0]就是x, prhs[1]就是h
// 當然nlhs就是output個數,plhs就是我們的y
{

    double  *x_real, *x_imag, *h_real, *h_imag, *y_real, *y_imag;
    // matlab的input是double的矩陣
    // 因為C沒有complex這種data type,所以要分別存real和imag
    mwSize  x_ant, x_sample, Nrx, Ntx, Npath, Nsample;
    // 這些是要用來表示x和h的dimension,用mwSize這個datatype宣告
    // 其實在大部分的系統上,這個datatype跟int是一樣的...
    const   mwSize *h_dim_array;
    // 當input的dimension大於2D時,要抓dimension就要開一個矩陣存

    if(nrhs != 2)
      mexErrMsgTxt("Two inputs required.");
    // 檢查是不是真的吃到兩個input

    x_ant = mxGetM(prhs[0]);
    x_sample = mxGetN(prhs[0]);
    // 這邊是抓x的dimension,x是一個x_ant by x_sample的2D array

    h_dim_array=mxGetDimensions(prhs[1]);
    // 這邊是抓h的dimension,h是一個4D array所以不能用GetM和GetN
    // 來抓dimension,必須這樣寫把所有dimension一次抓齊

    Nrx = h_dim_array[0];
    Ntx = h_dim_array[1];
    Npath = h_dim_array[2];
    Nsample = h_dim_array[3];
    // 看出來了嘛?h就是一個Nrx by Ntx by Npath by Nsample的矩陣

    x_real=(double *)mxGetPr(prhs[0]);
    h_real=(double *)mxGetPr(prhs[1]);
    x_imag=(double *)mxGetPi(prhs[0]);
    h_imag=(double *)mxGetPi(prhs[1]);
    // 這邊就是在抓x和h的值了,在這邊因為x和h都是complex double
    // 所以要分別用不同的function抓

    plhs[0] = mxCreateDoubleMatrix(Nrx, x_sample+max_tap_delay, mxCOMPLEX);
    // 造output array,這是Nrx by  x_sample+max_tap_delay 2D矩陣
    // 內容一樣是complex double
    y_real = mxGetPr(plhs[0]);
    y_imag = mxGetPi(plhs[0]);
    // 把造好的矩陣的指標抓出來

    main_func(x_real, x_imag, h_real, h_imag, y_real, y_imag);
    // main_func就是你主要的function功能
    // 要用到的東西當然都要傳過去

    return;

}

就這樣 gateway function就是這樣的結構
視你的input, output格式 有很多mx function可以使用
這個就去help查吧
像如果你要造一個N-D的array當function output就要用其他指令
main_func怎麼寫就別問了…就看你的功能啊
像我是寫:

void main_func( double *x_real, double *x_imag, double *h_real, double *h_imag,
                        double *y_real, double *y_imag)
{

   ......
   return;
}

這樣 因為main_func會在gateway後面被call
所以我是把main_func寫在gateway前面
整個.c檔的架構是這樣:

#include "mex.h"
// 這個一定要include,剩下看需要要補math.h或stdio.h之類的自己加

void main_func(......)
{
    .......
    return;
}

void mexFunction( int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[] )
{
    .......
    main_func(......);
    return;
}

就這樣 存成main_func.c
然後打mex main_func.c就會編出main_func.mexw32之類的東西
只要那個mex檔在matlab的path下
你就可以在matlab裡面寫y=main_func(x,h);
而這段內容就會用C執行!
注意事項:
1. C的矩陣index是從0開始不是1喔XD
2. 如果你像我那樣寫但是你的input給的是real only,那x_imag和h_imag都會是空的
當你access到時就會segmentation fault….
建議加上if (mxIsComplex(prhs[0]))做判斷
輸入為real時生出全0的imag array
3. segmentation fault是最常見的錯誤,在matlab的語言它叫index out of dimension
這件事情發生時matlab會整個當掉 所以debug會更加困難
4. compile好的mex檔是跟你的系統的,所以win下compile好的.mex到mac上是不會動的
5. 在寫main_func時要注意,雖然x是2D,h是4D,但是他全部都會存成1xn的array
所以你要access h_real[m][n][k][i]時,假設h是Nrx by Ntx by Npath by Nsample
你要寫h_real[m+n*Nrx+k*Nrx*Ntx+i*Nrx*Ntx*Npath]
這樣也好,不然宣告指標時會頭昏…
先寫到這邊

2011/03/01

2011 Macbook Recommendation

Filed under: 電腦相關,Mac — ipluto @ 5:29 pm

這是筆者的Macbook採買推薦

不過買了不滿意請不要找我麻煩XD

 

Macbook Pro分13″和15″,每種各有高階和低階兩款(17″一般人不會買故不列出來)

Macbook Air分11″和13″,每種各有高階和低階兩款

 

以下是由需求推到機種:

  • 你已有一台正常運作的筆電or桌機希望加一台小型輕薄的機種&你工作的地方有螢幕可以外接->Macbook Air 11″ 低階,RAM加到4GB
  • 你想要一台輕薄但又可以當主電腦使用的筆電->Macbook Air 13″低階,RAM加到4GB
  • 你想打電動而且預算夠高->2011 Macbook 15″ 高階
  • 你想打電動但是預算沒有那麼高->2010 Macbook 15″ 低階
  • 你想打電動但是預算很低->買PC
  • 你預算不高,但是希望筆電可以跑程式(非電玩)不會太慢,顯卡對你不重要->2011 Macbook Pro 13″ 低階

 

常見添購配件:

  • MiniDisplay Port to VGA adapter:接投影機必備
  • USB外接光碟機:假設你要拿Air當主電腦,因為它沒有光碟機
  • USB Ethernet adapter:假設你要拿Air當主電腦,因為它沒有網路孔

2011/01/12

On the Verizon iPhone

Filed under: iPhone — ipluto @ 2:03 pm

Since this generally concerns only people in the US, I will write it in English.

 

Today Verizon announced their version of iPhone, detailed informations can be found in the following links:

 

http://www.cnn.com/2011/TECH/mobile/01/11/cancel.att.contract/index.html

http://www.tuaw.com/2011/01/11/verizon-iphone-cant-handle-data-and-voice-simultaneously/

http://www.engadget.com/apple/verizon-iphone/

http://www.verizonwireless.com/b2c/splash/iphone.jsp

 

 

Below are the advantages of a Verizon iPhone, as well as the reasons why I’m not interested in it:

 

1. Verizon offers a “better” plan

 

This is actually related to your usage. My current plan from AT&T has 450 anytime minutes for $39.99, 2GB/month data for $25, and 200 sms/month for $5. With Verizon I can get a 200 anytime minute plan for $29.99, unlimited data for $29.99, and 250 sms for $5, which is around $5 less compared to my current plan.

 

The catch being I rarely use more than 1GB of data per month, the highest I’ve ever reached was 1.6GB, and that is because I shared my 3G data to my laptop, so unlimited is not that appealing. For SMS I never made it to 50 anyway, so 250 and 200 are the same to me. As for minutes, I don’t talk much so 200 and 450 is still the same for me. That being said, AT&T and Verizon have roughly the same plan to me, but a $5 per month is just too little for me to even consider switching.

 

 

2. Verizon has a better 3G coverage.

 

Well since I live in Westwood, AT&T does fine in this area. Also, we don’t know what kind of impact the new iPhones will bring to Verizon’s network. AT&T’s 3G usage raised 50 times (yeah, FIFTY) after it offered iPhone.

 

 

3. Verizon offers Internet tethering via Wifi (and possibly USB?)

 

For those of you who does not understand what is “Internet Tethering”, it means you share your cell phone’s Internet connection to your computer/tablet/iPod, etc.

 

On AT&T you are going to be charged an additional $20 per month for this feature, and the connection is shared over an USB cable or bluetooth. On Verizon this is offered at no additional cost, and you get to do it over Wifi.

 

However this is merely a software issue, as a Jailbreaker I’ve been using this tethering feature at no additional cost since day one. In fact, this is how I’m typing this note right now lol

 

 

Enough about advantages, let’s talk about the drawbacks:

 

1. Verizon’s iPhone is CDMA, and it’s 3G

 

Meaning? It does not support a GSM system, also it’s without a SIM card. So unlike my AT&T iPhone, I can’t put my Taiwanese SIM card in it and use freely in Taiwan, or even put in a T-mobile SIM card to use it on T-mobile.

 

(Well even if it’s 4G LTE it won’t support GSM either, so I’m actually referring to it being “CDMA only”)

 

You can find additional information here:http://tinyurl.com/y8g2vlk (Sorry, it’s in Chinese, I’m too lazy to write it in English)

 

Some might wanna argue that the iPhone from AT&T is SIM locked to AT&T, well again this is a software limitation, and is not an issue for Jailbreakers like me. With Verizon it’s a hardware issue, so it’s physically impossible to use other GSM carriers.

 

2. Verizon’s iPhone can’t do Voice/Data simultaneously

 

This is the deal breaker for me.

 

Though AT&T sometimes handles this feature poorly, i.e. people can’t call me when I’m surfing the web with my iPhone, it actually works most of the time. And one thing cool about the iPhone is the ability to Google things while on the phone with someone. For a heavy internet user like myself, if Voice/Data can’t get through at the same time, it is a serious issue.

 

(From the data I read, when you get a call while surfing the internet on Verizon, your data connection is terminated to let your call gets through)

 

3. Most of my friends are on AT&T

 

Yeah..well…this is just me lol

 

 

 

Overall, I think the Verizon iPhone will be appealing mostly to existing Verizon users, but we will see how this goes. I’m actually happy about this, since this will “hopefully” take off some of the 3G load on AT&T (please continue to offer Tethering for $20 per month!), also more competition is always good for the industry.

 

Share

2010/08/13

簡單堵住iOS重大漏洞

Filed under: 電腦相關,iPhone — ipluto @ 8:00 am

前一陣子發表的Jailbreakme
讓大家只要連到一個網站就可以越獄成功
連電腦都不用
相當方便

但是這背後的安全性問題非常大
也就是有心的駭客可以撰寫惡意網站
只要上網連上了整支iPhone/iPod/iPad就會被駭客入侵掌控

因此蘋果很快的在一週多一點的時間就推出了新的iOS更新把該漏洞修掉
因為實在是太恐怖了

更恐怖的是,JailbreakMe的作者Comex昨天公布了他的程式原始碼
也就是現在有心人士要用這個漏洞來作壞事相對容易很多

就像之前改SSH密碼一樣
使用者當然也要有相對應的處理方式來保護自己安全
如果你沒有Jailbreak,那直接更新iOS就好,該漏洞會被堵住

問題在於已經Jailbreak的人,
因為升級iOS會造成Jailbreak失效
更何況iPhone 2G和一代的Touch根本不能裝最新的iOS
也就是Apple完全不打算為這兩種裝置修補這個漏洞

然而又一次的,蘋果不願意做的事情Saurik幫我們做了
請打開Cydia搜尋PDF Patch
安裝起來….你的機器就安全了
所有機型都適用

建議大家趕快安裝這個Patch,以保障你的機器安全

Share

2010/08/03

FullForce 強制把iPhone app變成iPad app

Filed under: 電腦相關,軟體,iPhone — ipluto @ 2:02 pm

剛收到iPad時很高興的把iPhone app們裝進去,

此時才發現太多iPhone app都沒有針對iPad做改良,

或者是要重新購買該軟體的iPad版。

雖然使用者付費是很正常的…所以像Good Reader那種$1的重買我無所謂,

可是像Beejive IM要價$9.99…我已經買了iPhone版本了不能打個折嘛~_~

當然也可以直接把iPhone app放大兩倍來用

這種方式玩玩極速快感這種圖型為主的東西還可以,可是像字典或Facebook這類型

文字居多的程式,放大2倍後馬賽克非常嚴重。

還好有Fullforce這東西,它可以強制叫iPhone App變成iPad app執行

因為畢竟是一種改造所以並不是每個app都會適用,介面當然也比不上真正的iPad app

基本上這跟app當初是怎麼寫的有關,所以也是文字為主的app反應較好

而剛好這類app也是最受解析度影響的。

Anyway…來看看一些app啟用full force的效果吧:

(點圖可放大)

Beejive IM:

Flight Track:

Opera Mini:

鐵道時刻表:

Facebook:

SketchBoxX

當然也會有失敗的狀況,例如FStream開起來畫面會整個錯亂

行動股市則是一開就當掉

除此之外倒是有不少好用app可以在full force的”加持”在iPad上更好用

Full force可以在Cydia安裝,安裝好後到設定部分選擇哪些app要用full force模式開

當然要有Cydia你的iPad需要先Jailbreak

Share

2010/07/27

Inception: Jailbroken

Filed under: iPhone,創作 — ipluto @ 5:44 pm

Just editing the subtitles….

I own nothing.

2010/07/05

舊版iPhone 3GS Jailbreak 4.0

Filed under: 電腦相關,iPhone,Mac — ipluto @ 4:57 am
翻譯自:
感謝 PTT chuliu板友的資料和測試
先說明這篇文章的效果:
用刷自製軔體的方式升級到Jailbroken 4.0
再來說明這篇文章的適用對象:
舊版bootrom的3GS 也就是可以用黑雨完全JB的那種 不確定的話可以用這個方法查:
你必須要有3.1.3的SHSH (如果你有3.1.2的話…別鬧了…降3.1.2黑雨後刷自製吧)
因為要刷自製軔體必須要Jailbreak,而且不能是用Spirit
偏偏如果你只有3.1.3的SHSH那也只有Spirit可以越獄
而Spirit越獄後的機子是不能刷自製軔體的
(原因請參考本人的文章 http://tinyurl.com/2dpwer3 )
我們現在要做的就是把Spirit後的機器”改造” 讓它可以刷自製軔體
步驟如下:
  1. 因為有3.1.3的SHSH,先降級到3.1.3 (本來就是3.1.3的就省略這步)
  2. 用Spirit越獄(本來用Spirit越獄過的也是省略這步 請不要用iTunes9.2)
  3. 在Cydia裝Afc2Add, OpenSSH 以及 mobile terminal
  4. 用sn0wbreeze或PwnageTool打造一個3.1.3的自製軔體
  5. 把造好的軔體檔附檔名從ipsw改成.zip並解壓縮
  6. 到解開的資料夾底下的Firmware/all_flash/all_flash.n88ap.production,把該資料夾裡的東西全部copy到iPhone的/tmp裡 (看要SSH還是iFunBox還啥的)
  7. http://code.google.com/p/iphone-img3-flasher/downloads/list,下載spirit2pwn_r2.zip,解開後把裡面的東西也全丟到iPhone的/tmp
  8. 在iPhone上打開mobile terminal,會出現一個終端機,請依序輸入以下指令:
  • su root
  • (輸入你的密碼,沒改過的話預設是alpine)
  • cd /tmp
  • chmod 755 pwn_old_boot_r2.sh
  • ./pwn_old_boot_r2.sh

最後就可以用PwnageTool或sn0wbreeze打造4.0自製軔體刷上去

恭喜您獲得Jailbroken 3GS on iOS4!

Share

2010/06/23

iOS 4.0的多工

Filed under: 電腦相關,軟體,iPhone,Mac — ipluto @ 4:29 pm

http://thebigboss.org/2010/06/18/ios4-hold-off-a-bit

bigboss的文章主要提到幾件事情

1. task bar裡面包含兩種東西,一種是真正在背景執行的程式,另一種是你最近開過的程式。但是你無法分辨哪個是背景執行哪個是最近開過,而且要移除還要長按才能出現關閉選項。

2. Apple內建程式,包含股票、時鐘、天氣、計算機那些,只要開過後一律自動背景執行,除非你去task bar關掉它

3. Built for 4.0的程式也會一直在背景跑,除非你去關掉它

4. iOS 4.0會memory leak…莫名其妙狂吃記憶體,不過他當時是在GM版看到的狀況,不知道正式版有沒有修好

5. 很多app還沒有更新,所以根本辦法多工

6. 很多cydia的app也還沒更新,根本不能用

7. 他覺得4.0比JB過的3.0還不如,建議大家先等等XD

沒想到Apple是這樣處理多工的…

當初還說we’re not the first, but we’re going to be the best…

我覺得backgrounder+pro switcher表現還比較好咧….

Share

Next Page »

Theme: Rubric. Blog at WordPress.com.

Follow

Get every new post delivered to your Inbox.