osx

Unison OS X launchd plist

unison_sync.sh

#!/bin/bash
pref=my_unison_pref
pid=`pgrep unison`

[ -z $pid ] && $HOME/bin/unison $pref -auto -batch

unison_sync.plist

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
  <dict>
    <key>Label</key>
    <string>unison_sync</string>
    <key>ProgramArguments</key>
    <array>

Tags: 

Build unison 2.40.65 (ocaml 4.0) to work between Ubuntu 12.04 and OS X Mountain Lion

I could not find any pre-built binaries (macports) that worked properly out of the box between my laptop and the ubuntu server. So build your own.

NOTE: This will break unison with hosts that use unison 2.40.65 built with ocaml 3.x!

Tags: 

Fix PHP 5.3 timezone warnings for drupal

I recently installed drupal 6.14 on Snow Leopard and got these timezone warnings.

warning: strtotime() [function.strtotime]: It is not safe to rely on the system's timezone settings. 
You are *required* to use the date.timezone setting or the date_default_timezone_set() function. 
In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. 
We selected 'Asia/Tokyo' for 'JST/9.0/no DST' instead in /Users/<user>/Sites/drupal/sites/all/modules/views/modules/node/views_handler_argument_dates_various.inc on line 67.

Tags: 

Simple netstat bandwidth summary script

This is a simple script for showing the bandwidth usage on all your network interfaces using netstat. It displays the total usage per interface and an approximation of the usage per day and month.

Uptime 2 days 22:49, Sun Aug  9 15:46:25 CEST 2009 
Iface    Rx Total     Tx Total       Rx/day       Tx/day     Rx/month     Tx/month   Rx+Tx/month
             (GB)         (GB)         (MB)         (MB)         (GB)         (GB)         (GB)
lo0           .03          .03        10.86        10.86          .32          .32          .65
en1          2.48          .15       841.32        52.56        25.23         1.57        26.81

Tags: 

How to enable ssh access to a VirtualBox guest

Enable ssh access to a virtualbox guest instance using VBoxManage. The guest is the guest machine name and should be quoted if the name contains spaces.

$ VBoxManage setextradata 'guest' "VBoxInternal/Devices/pcnet/0/LUN#0/Config/ssh/HostPort" 2222
$ VBoxManage setextradata 'guest' "VBoxInternal/Devices/pcnet/0/LUN#0/Config/ssh/GuestPort" 22
$ VBoxManage setextradata 'guest' "VBoxInternal/Devices/pcnet/0/LUN#0/Config/ssh/Protocol" TCP

Tags: 

Subscribe to osx