Git Mode Changes Over Network Mounted Share

When work with a mounted network share which doesn’t support modes, git will complain that all files have changed. To disable this, you can issue the following command:

git config core.filemode false

from git-config(1) :

   core.fileMode
       If false, the executable bit differences between the index and the
       working copy are ignored; useful on broken filesystems like FAT.
       See get-update-index(1). True by default.

Manually Load Shared Library in Ruby

Recently I needed to run a Ruby script that required the openssl library for communications. However after setting up Ruby on Mac OS X for the first time and succeeding in installing all the required gems, the following error kept popping.

dyld: lazy symbol binding failed: Symbol not found: _SSL_library_init

I couldn’t find much help online and I have no idea yet how to actually debug linker problems with the ruby system. However I figured out a quick and easy way to overcome the error.

require 'dl'
ssl = DL::dlopen('/usr/lib/libssl.dylib');

Remote backup to image with rsync

  1. Create disk image file
    dd if=/dev/zero of=disk.image bs=1024 count=8388608
    8388608 is the size of the filesystem we will want, in kiloBytes. This one will be 8GB.
  2. Format to ext3
    mkfs.ext3 -F -b 1024 disk.image 8388608
  3. Mount
    mount -t ext3 -o loop disk1.image /tmp/disk1
  4. Sync the remote filesystem to the locally mounted image
    rsync -avz user@host.com:/ .