css (1) jQuery (7) linux (38) mac (70) php (29) python (1) svn/git (9) trac (4) ubuntu (1) virtualbox (6) vista (2) windows (14)

Monday, 29 November 2010

Enable nat port forwarding in vmware fusion 3

If you have nat networking on vmware fusion 3 and want to enable port forwarding you need to edit /Library/Application Support/VMware Fusion/vmnet8/nat.conf at the bottom you'll see two sections [incomingudp] and [incomingtcp]

To add a port forwarding under whichever section you require add

<remoteport> = <vm ip address>:<vm port>

i.e. 8888 = will redirect all traffic from 8888 to the vm with ip to port 80

Then restart vmware fusion networking by running /Library/Application\ Support/VMware\ Fusion/ --restart

How to enable remote syslogd in OSX 10.6

If you have an apple airport under the airport utitlity advanced pane you'll see a Logging and Statistics tab, there contains a Syslog Destination Address, which basically logs info about your airport to the machine specified by the ip address so you can view it in the console.

However! By default syslogd on a mac isn't listening to enable it you need to edit /System/Library/LaunchDaemons/ at the bottom you'll see "Un-comment the following lines to enable the network syslog protocol listener." so do what it says, then either reboot or run 
unload /System/Library/LaunchDaemons/ 
load /System/Library/LaunchDaemons/ 

That'll enable the remote syslog feature and you'll get messages like 

28/11/2010 18:29:26 <AIRPORTIP> <AIRPORTNAME> natpmp[-1] Debug Public address reported as <YOURIP> to <CLIENT>:5353

Tuesday, 23 November 2010

PHP namespaces and exceptions

If you are converting all php errors to exceptions or dealing with other exceptions via a try catch statement you must put the path to the namespace in the exception.


namespace MyNameSpace;

//some code that causes an exception
catch (\Exception $e)


If you don't add the \ it won't be caught.

Thanks to this blog for pointing it out