年少無知

[youtube &w=640&h=360] 年少無知 電視劇【天與地】片尾曲 主唱:林保怡.陳豪.黃德斌 作曲:黃貫中 填詞:林若寧 編曲:黃貫中.劉志遠 監製:黃貫中 歌詞 林:年少多好 頑劣多好 不甘安於封建制度裡迷信上街真理會達到 旗幟高舉 群眾聲討 不惜犧牲一切去上訴權貴的想法太俗套 只可惜生活是一堆挫折 只可惜生命是必須妥協 陳:年少多好 貧困多好 一蚊積蓄足以快樂到廉價結他抒發我暴躁 財富得到 年歲不保 捐輸不必講究有回報人世間總會有異數 只可惜生活是一聲發洩只可惜生命是一聲抱歉怕追討 合:如果命運能選擇十字街口你我踏出的每步更瀟灑 如果活著能坦白舊日所相信價值不必接受時代的糟蹋 黃:年少多好 朋友多好 一番爭執不會有被告遊戲競爭不會記入腦 年歲增長 無法修補 青春的詩總會老 時間多恐怖 合:如果命運能選擇十字街口你我踏出的每步無用困惑 如果活著能坦白舊日所相信價值今天發現還未老 如果命運能演習現實中不致接納一生每步殘酷抉擇 留守過去的想法我會否好像這樣生於世上無目的鞭撻

September 3, 2012 · 1 min · birdchan

Install Homebrew on osx

Homebrew is simply the The missing package manager for OS X. Notice it’s better to not install macport on the same system with homebrew. To install it, do: ruby <(curl -fsSkL raw.github.com/mxcl/homebrew/go) Then to install say autoconf, simply do brew install autoconf It’s that simple!

August 22, 2012 · 1 min · birdchan

Adding a user to a group on osx

Here is a handy command line to say, add user user1 to the wheel group. sudo dseditgroup -o edit -a user1 -t user wheel Very handy command. Then you may want to add group write permission to your target directory.

August 22, 2012 · 1 min · birdchan

Outgrow.me

I think we all heard of Kickstart or Indiegogo, where projects are funded by the crowd. Some projects died without enough funding, while some made it and became very popular. For those projects that made it, you can go to this place called outgrow.me to look them up once again in case you forget about them. It’s also a nice place to brainstorm gift ideas as well!

August 21, 2012 · 1 min · birdchan

iDisk is gone...

If you freaked out like me coz you forgot to back up your iDisk, then you can calm down a bit. Yes, MobileMe ended on June 30, 2012, and iDisk syncing is no longer available. But perhaps your files are backed up by osx. Check and see if you have a folder called Previous local iDisks folder on your Desktop. If you see it, then you are in luck. Double-clicking on the image file will give you back all your files. ...

August 14, 2012 · 1 min · birdchan

test -x /etc/init.d/sendmail &amp;&amp; /usr/share/sendmail/sendmail cron-msp

I recently got lots of cron error emails having the email subject " test -x /etc/init.d/sendmail && /usr/share/sendmail/sendmail cron-msp", and body being " /usr/share/sendmail/sendmail: 1248: /usr/sbin/sendmail-msp: not found". According to this post, it was probably due to my POSTFIX installation, having the side effect of not removing the OLD sendmail files, and thus those error emails… sigh… So do the following to fix it: sudo apt-get --purge remove sendmail-base sendmail-cf sendmail-doc sudo apt-get install sendmail-bin Here we remove the old sendmail, install the plain sendmail binary back, and removes postfix. ...

August 14, 2012 · 1 min · birdchan

Of Monsters and Men - Little Talks

[youtube &w=640&h=360] “Little Talks” Hey! Hey! Hey! I don’t like walking around this old and empty house So hold my hand, I’ll walk with you, my dear [Video version:] The stairs creak as you sleep, it’s keeping me awake [Live version:] The stairs creak as I sleep, it’s keeping me awake It’s the house telling you to close your eyes ...

August 8, 2012 · 2 min · birdchan

things broken after installing mountain lion?

Just got a chance to upgrade to mountain lion today. Looking good so far. If you haven’t done it, make sure after you install it also install the system software update from the Mac App Store. Again they renamed my apache and php config files, thus making my website not working properly. To fix that just rename and copy old config files back (they got renamed to /etc/apache2/httpd.conf~previous and php.ini-5.2-previous). ...

July 26, 2012 · 3 min · birdchan

Dirty Waters, Dangerous Fish

[youtube &w=640&h=360] oh gosh… my lovely catfish…

July 23, 2012 · 1 min · birdchan

Representing a class in variable in PHP?

Say you wrote some code below for projectA. function do_task(){ // init my_init(); // calling a class function $v = class_A::some_method($p1, $p2, $p3, $p4, $p5, $p6, $p7); // return return $v; } Now, your boss loves it. Then he asks you to do a very similar thing for projectB. Naively, you may do: function do_task($project_type){ // init my_init(); // calling a class function if ($project_type == "projectA"){ $v = class_A::some_method($p1, $p2, $p3, $p4, $p5, $p6, $p7); }elseif ($project_type == "projectB"){ $v = class_B::some_method($p1, $p2, $p3, $p4, $p5, $p6, $p7); } // return return $v; } Um… it would work, but imagine if you will soon have projectC, and D, and on… and what if you need to add one more parameter to the some_method function? ...

July 23, 2012 · 2 min · birdchan