Showing posts with label Linux. Show all posts
Showing posts with label Linux. Show all posts

Feb 22, 2013

(XCode) How to search text in xib files

After several months of dev, a project could easily become ugly, probablly contains many used resources files(like pngs). It is easy to remove images that you know they are not using anymore, but that's not working for these looks unfamiliar. So i need to check their existence, it's simple to do a search in xcode, but xcode doesn't search in the xib files. Here is a line of command you can use in the terminal:

grep -i -r --include=*.xib "text you want to search" /your project's path

This command could search for all files (*.*).

Jan 4, 2012

(Linux) Couldn't start Apache in Lampp

After upgrading Lampp to the latest version, apache could not be started, the error message is:

/opt/lampp/bin/php: error while loading shared libraries: /opt/lampp/lib/libsybdb.so.5: cannot restore segment prot after reloc: Permission denied
XAMPP: Starting Apache with SSL …
XAMPP: Error 1! Couldn't start Apache!
XAMPP: Starting diagnose…
XAMPP: Sorry, I've no idea what's going wrong.


It needs to disable selinux by using this command:

setenforce 0

Oct 20, 2008

(Linux, Mac OS X) How to get the memory alloc history

There is a good debug tool in Linux and Mac which is gdb, it has a useful command to show the history of a memory allocation.

(gdb) shell malloc_history 2417(processId) 0x35d4f0(memoryAddress)