Archive for the ‘OSX’ Category

Private Browsing with Safari

Sunday, November 15th, 2009

I use firefox as my primary browser, both at home and at work. So I have setup my Safari browser, as my private browser – that is sans cache, history, cookies or anything of a similar nature. I noticed that the “Private Browsing” option in Safari, doesn’t do that good a job of not leaving files hanging around in one’s operating system, furthermore unless your careful, Spotlight will eventually end up indexing your browser history, cache, which may be less than ideal.

In order to have a zero cache safari instance on my laptop I have taken the following steps :

  • 1: Removed spotlight’s prying eyes, by excluding the following directories :
    • /Users/<USERDIR>/Library/Caches
    • /Users/<USERDIR>/Library/Safari
    • /Library/Caches
  • 2: Setup two cronjobs to constantly delete Safari cache-dir
  • */10 * * * * find /Users/<USERDIR>/Library/Safari -type f -exec rm {} \; 2>&1 > /dev/null
    */10 * * * * find /Users/<USERDIR>/Library/Caches/Metadata/Safari/ -type f -exec rm {} \; 2>&1 > /dev/null

Timemachine to a Linux Box

Tuesday, July 7th, 2009

By default TimeMachine on Mac OSX is configured to run through the Apple Filing Protocol only.

At home I run a backup server for Time Machine on one of my Linux boxes, I did this by enabling the following feature on the machine which I have configured to be backed up.

defaults write com.apple.systempreferences TMShowUnsupportedNetworkVolumes 1

This in turn allows for unsupported network volumes to be used as backup volumes.

Below are some other Apple related preferences I have configured on my macbook:

defaults write com.apple.dock persistent-others -array-add '{ "tile-data" = { "list-type" = 1; }; "tile-type" = "recents-tile"; }'

defaults write com.apple.terminal FocusFollowsMouse -string YES

defaults write com.apple.Safari IncludeDebugMenu 1

defaults write com.apple.finder AppleShowAllFiles Yes (ALL FILES IN FINDER)

ld: duplicate symbol _g_bit_nth_lsf Mac OSX Leopard/Darwin

Tuesday, July 7th, 2009

I have had some problems installing software from source on my Max OS X Leopard machine. I should thank Martin Szomszor for his help on getting this working, but after some time faffing we finally got it sorted out.

I found that I was having problems making software on Leopard, which I could build fine on my linux (fedora) machines. The error I was getting was:

ld: duplicate symbol _g_bit_nth_lsf in foo.o and bar.o

I am running Leopard 10.5.3. I was using glib2, installed via Fink, version number: 2.12.0-103. After spending lots of time googling I found the following article to be of the most use, “Wireshark with Macports”, where Anders Brownworth pointed out that the error was due to a “extern inline bug in glib/gutils.h which is easily fixed“.

So to fix this:

  • I located gutils.h, which I found here:

    /sw/include/glib-2.0/glib/gutils.h
  • I then replaced these lines:

    #ifdef G_IMPLEMENT_INLINES

    # define G_INLINE_FUNC

    # undef G_CAN_INLINE

    #elif defined (__GNUC__)

    # define G_INLINE_FUNC extern inline

    #elif defined (G_CAN_INLINE)

  • With this:

    #ifdef G_IMPLEMENT_INLINES

    # define G_INLINE_FUNC

    # undef G_CAN_INLINE

    #elif defined (__APPLE__)

    # define G_INLINE_FUNC static inline

    #elif defined (__GNUC__)

    # define G_INLINE_FUNC extern inline

    #elif defined (G_CAN_INLINE)

  • By adding these two middle lines:

    #elif defined (__APPLE__)

    # define G_INLINE_FUNC static inline
  • The start of the fragment of code was at line number 96 in my gutils.h file

Here is a link to my edited and working gutils.h file.

Note 1: I would make sure I get a copy of my original gutils.h file, as this may come in handy

Note 2: There is a patch which one could apply to make the same changes which I have just described here. This patch follows this ticket. I didn’t know what to do with the patch file, so I ended up editing the file by hand:). I am guessing that is something todo with macports, mmm, nevermind, its working now.

duplicate dylib libiconv.2.dylib

Tuesday, July 7th, 2009

When building from source on Mac OSX, I have regularly come across the problem whereby the compiler complains about duplicate dylibs.

duplicate dylib libiconv.2.dylib

This is due to my use of the Fink and Darwin packages to install various bits I need for OSX development.

I recently noticed that many configure scripts cater for the user to select which dylib they would like to include. So I figured that my problem of duplicate iconv’s can be overcome by looking for options like :

--with-iconv=

So look out for similar parameters in configure scripts

./configure --with-iconv=/opt/local/..

So, why do I not just remove all but one instance of iconv? Well, Leopard ships with an old version of iconv, and I require recent versions for my development work.