Making a backup of a dead hard drive

When you realize one of your (external) hard drives are making funny squeaky or ticking noise, it’s probably a good idea to start making backups. However if unfortunately you have ignored the engine light until one day you can no longer mount the drive, I hope this little guide can still save you. BTW, I use osx, so keep going if you are on the same page. First open up a terminal. (What’s a terminal? um… ok, maybe you can stop now and ask one of your tech friends to help you out). ...

July 24, 2011 · 2 min · birdchan

Matt Cutts: Try something new for 30 days

[youtube &w=560&h=349] Matt Cutts: Try something new for 30 days http://www.ted.com/talks/matt_cutts_try_something_new_for_30_days.html This is not really anything life transforming, but this is probably something I wanna try. ;)

July 22, 2011 · 1 min · birdchan

osx Lion mysql sock path

I just installed Lion and for some reasons my internal website stopped working due to the mysql lock file not being found. I found out that the new osx installation changed the mysql sock file default path from /var/mysql/mysql.sock to /tmp/mysql.sock. So, to re-enable everything, do: shut down your Web Sharing cp /etc/php.ini.default /etc/php.ini (for some reasons my old php.ini got renamed to php.ini.default php.ini-5.2-previous…) modify /etc/php.ini, change ALL /var/mysql/mysql.sock to /tmp/mysql.sock ...

July 20, 2011 · 1 min · birdchan

The Aurora Borealis

[youtube &w=560&h=349] A very good explanation of the aurora. Aurora is the mysterious lights that only appear at the north and south poles. You will know why that’s the case after watching this video.

July 16, 2011 · 1 min · birdchan

User interface

July 10, 2011 · 0 min · birdchan

投資+避稅 IRA 10項須知

2010年全美個人退休儲蓄帳戶(IRA)金額估計4.7兆元,占所有退休帳戶金額25%,擁有IRA退休帳戶的美國人有4900萬人。 IRA帳戶該選擇何種投資?該如何避稅?都關係到未來的退休生活,因此對於IRA帳戶應有以下十項基本認識: 1. 是否延後繳稅 50歲以下每人每年最多可存5000元至傳統IRA帳戶,50歲以上可存入6000元。存入金額由該年所得中扣除,免繳所得稅,等提領時本金與利息一併繳稅。 羅斯IRA(Roth IRA)帳戶金額則不能從所得扣除,至少五年後提領時,本金與利息都無需再繳稅。 2. 存款截止日期較401(k)遲 由雇主提供的401(k)退休帳戶每年存款截止日期是12月31日,IRA帳戶截止日期則可等到報稅截止。你可先報完稅再將錢存入IRA帳戶,但一定要在報稅截止前。 3. 多數錢從401(k)轉入 根據2008年報告,IRA帳戶多由401(k)帳戶轉存(rollover)而來。每人每年可存入IRA帳戶最高金額5000元或6000元,但如換工作或屆退休年齡,由401(k)帳戶轉存至IRA帳戶的金額則無上限。 4. 提領退休年齡較高 55歲退休人士由401(k)帳戶提領存款沒有任何罰款,但如將錢轉存至IRA帳戶,則須等到59歲半提領才不會罰款。因此專家建議,55歲退休的人可將部分暫時不用的錢轉存至IRA帳戶,將可能需要急用到的錢留在401(k)帳戶。 5. 提早提領免罰款規定 如果醫療費用超過全年所得的7.5%,提領IRA帳戶的錢不受59歲半以前提領需付10%罰款的規定限制。 此外,失業後買健保、殘障、後備軍人受徵召服役時,提領IRA帳戶的錢也無罰金。IRA帳戶的錢還可用來支付高等教育學費,購買第一棟房子 (單身者不超過1萬元,夫妻不超過2萬元)。根據壽命預估支付年金,也無須繳10%罰金。 6. 自行負責選擇投資 最受歡迎的IRA帳戶投資方式是股票和共同基金,其次為現金和債券。選擇何種投資和如何轉移投資,均由個人自行負責。年紀愈大,IRA帳戶存款愈多,愈應該分散投資,規避風險。 7. 羅斯IRA漸受歡迎 原本由傳統IRA轉至羅斯IRA有收入不得超過10萬元的限制,但這個限制2010年取消後,轉存至羅斯IRA帳戶的金額大幅增加。 雖然將存款從IRA帳戶提領出來轉存羅斯IRA時需繳稅,但退休提領時就無需繳稅。專家認為,現在先繳稅可免除對日後稅率變動的疑慮。 8. 限期提領 傳統IRA帳戶的錢不可以無限期延稅,必須在70歲半以前提領,未按規定提領的金額須繳50%的稅金。 按規定,年滿71歲半後隔年的4月1日前需提領第一筆錢,之後則須在每年12月31日前提領。因此,如果在4月1日前提領第一筆錢,同年的12月31日前又領第二筆錢。兩筆錢可能使收入增加,稅率提高。 9. 費用有差 相較於401(k)帳戶,IRA個人退休帳戶無法享有團體優惠,因此投資時所付的費用較高。因此需仔細比較每種投資費用,盡可能選擇費用較低廉的類似投資。即使只差1%,數十年下來仍頗可觀。 10. 高低收入者的稅務優惠 已有大筆儲蓄,在70歲半又必須從IRA帳戶提領第一筆錢,卻用不到這筆錢的退休人士,若在2011年12月31日前將這筆錢捐出,即可免繳稅金。捐贈金額以不超過10萬元為限,且須由IRA帳戶直接轉給合格的慈善機構。 在2011年調整後的稅前總收入低於2萬8250元 (夫妻低於5萬6500元)者,如在IRA或401(k)退休帳戶存入退休金,每人可享有最多1000元的稅金減免。 Ref link: 世界新聞網-北美華文新聞、華商資訊 - 投資 避稅 IRA10項須知

July 9, 2011 · 1 min · birdchan

Disallow de-select when select-all is checked

Very often we need to present many checkboxes, and there is one additional checkbox for select-all. The html code is somewhat like the following: Select All 1 2 3 4 Notice I name the js function toggle_selection because you may actually make it toggle later on. Then, to enable the usual select-all action, this is the code: function toggle_selection(){ $("input[name='opt[]']").each(function (index, el) { if ($("#my_select_all").is(":checked")) $(el).attr("checked", "checked"); }); } Straightforward. ...

July 8, 2011 · 1 min · birdchan

Installing PEAR on osx

Assuming you have php installed and working already. And I am using osx 10.6. Obtaining the installation package/script. curl http://pear.php.net/go-pear.phar > go-pear.phar Then run it sudo php go-pear.phar It will then ask you for the path settings. I suggest installing pear at the /usr/local dir, but this is really your preference. In my case, I entered 1, then changed the $prefix to “/usr/local/pear”. The paths below #1 should automatically change accordingly. Then enter to install. ...

July 4, 2011 · 2 min · birdchan

IMEI

If you need to obtain your IMEI # for some reasons, here is how. No, you don’t need the original box of your phone. ;) BTW, I am using an iphone 4 with at&t. Fire up your phone app, then go to the Keypad tab, then punch in *#06# and a screen should automatically pop up with your IMEI #. Actually… upon more research, for iphone 4 users, it’s actually a lot simpler. Just go to Settings -> General -> About, then scroll down to find out your IMEI and ICCID #s. ...

July 3, 2011 · 1 min · birdchan

MySQL TEXT field types

The maximum amount of data that can be stored: TINYTEXT256 bytesTEXT65,535 bytes64kbMEDIUMTEXT16,777,215 bytes16MBLONGTEXT4,294,967,295 bytes~4GB

July 1, 2011 · 1 min · birdchan