Category Archives: idea / rant

Redirect IP address to localhost in os x

Use this command to redirect ip address to localhost in os x. Not sure if it will work in other os. ifconfig lo0 alias 10.0.0.1 will redirect 10.0.0.1 to the localhost / loopback adapter ifconfig lo0 -alias 10.0.0.1 will remove it

Posted in idea / rant | Leave a comment

NSLog replacement

copied from http://iphoneincubator.com/blog/debugging/the-evolution-of-a-replacement-for-nslog basically just put these code into your precompiled header file: you might need to add this flags to the project: OTHER_CFLAGS = -DDEBUG GCC_PREFIX_HEADER = YourProject_Prefix.pch # this is needed especially for static library

Posted in idea / rant | Leave a comment

OS X Leopard DNS performance problem – enabling local name server

Lately I have been having problem with slow DNS lookup while browsing. You can see it when I browse, it took some time in the “looking up for youtube.com …” for example. I googled around and tried several solutions as suggested by others. Using Open DNS (208.67.222.222, 208.67.220.220) and verizon? (4.2.2.1, 4.2.2.2, 4.2.2.3) as my [...]

Posted in idea / rant | 5 Comments

Mercurial tips & tricks for mac

I am collecting several useful mercurial tricks for me : – See diffs when committing in vim see : http://www.selenic.com/mercurial/wiki/index.cgi/DiffsInCommitMessageInVIM but instead of using the instruction as is, I have to modify the string a little bit to work in my mac: what I did is replacing : $EDITOR “$HGTMP/msg” “$HGTMP/diff” || exit $? with [...]

Posted in idea / rant | Leave a comment

Reminder to self. Never set the permission of the /

In a lapse of judgment, I set my hard drive permission to disable readonly for all user, except myself & admin (Using hard drive get info – sharing & permission ). The reasoning was because I can see my root when I enable wireless sharing. It turned out to be a very bad decision though, [...]

Posted in idea / rant | Leave a comment

batch file rename in mac

I am missing batch renaming functionality that I used to have in windows -> “ren *.xxx *.xxx.orig” in my macbook. But using utility “mmv”, I finally can do the same in mac & windows. You can download the utility from here : http://www.joel.lopes-da-silva.com/articles/computer-science-technology/62-tips-tricks/79-mmv-under-mac-os-x-leopard-for-mac-intel.html some example usage : http://debaday.debian.net/2007/06/13/mmv-mass-moving-and-renaming-files/ Tags: macmmv linux batch rename

Posted in idea / rant | Leave a comment

IPhone simulator breakpoints problem

Sometimes I got problem settings breakpoints. I found this solution in apple discussions: x As saggymac said: “The default setting for debugging libraries and frameworks is Load Symbols Lazily. On occasion this causes breakpoints to not be hit. Turning off this setting makes it take longer to start debugging, but hits breakpoints more reliably.” may [...]

Posted in idea / rant | 5 Comments

Objective-C simple command line program and compilation

I am trying to compile a simple command line for experiment, and it is somehow not as obvious as I thought. Here is a the very simple program I copied somewhere from internet and here is how to compile it : setting “-framework Foundation” is the one that threw me off. I couldn’t find it [...]

Posted in idea / rant | 8 Comments

My os x nginx configuration

First, to install nginx do this : sudo port install nginx then use this configuration – this is only for testing, with setting for my os x (for access log / pids). It also use proxy to merb # nginx using macports installation # for my local testing user kusno staff; worker_processes 1; pid /opt/local/var/run/nginx.pid; [...]

Posted in idea / rant | 2 Comments

Perl breakpoint

Put : $DB::single=2; to enable breakpoint in the code. Don’t forget to run with -d Tags: perldebug

Posted in idea / rant | Leave a comment