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

Text wrapping inside a table

Sometimes I have a long continuing string inside a table that messes up my table width. For example, SDFSDFDGFHDGREFGFGSDFGFGHGDSFGHJTYRGHTYYEGHJTRTWEGRTYEGFHERGHRETERHRTTWERHGEWGERGW That will give you a very wide column… Just how to squeeze the column to the width we specify? “Easy,” you might say, “just set the td width!” SDFSDFDGFHDGREFGFGSDFGFGHGDSFGHJTYRGHTYYEGHJTRTWEGRTYEGFHERGHRETERHRTTWERHGEWGERGW Nope. It turns out the same, one long continuous string. The root problem here is that, the table width is determined by the content, but not the width we specify! ...

July 20, 2012 · 1 min · birdchan