install openvpn client in Mac OS X 10.7.5 via macports

sudo port install openvpn2
sudo port install tuntaposx

or you can download tuntaposx package manually from here

let’s check it after installation

bash-3.2# ls /dev/tap*
/dev/tap0 /dev/tap10 /dev/tap12 /dev/tap14 /dev/tap2 /dev/tap4 /dev/tap6 /dev/tap8
/dev/tap1 /dev/tap11 /dev/tap13 /dev/tap15 /dev/tap3 /dev/tap5 /dev/tap7 /dev/tap9
bash-3.2# ls /dev/tun*
/dev/tun0 /dev/tun10 /dev/tun12 /dev/tun14 /dev/tun2 /dev/tun4 /dev/tun6 /dev/tun8
/dev/tun1 /dev/tun11 /dev/tun13 /dev/tun15 /dev/tun3 /dev/tun5 /dev/tun7 /dev/tun9

TunTAP creates virtual interfaces using the supplied kernel extensions.Configure it to startup at boot.
launchctl load -w /Library/LaunchDaemons/org.macports.tuntaposx.plist
If you don’t have tuntaposx installed, it is possible to get the following error when you try and make vpn connection:
Cannot allocate TUN/TAP dev dynamically
Exiting due to fatal error

Now, run the vpn client
sudo openvpn2 router-udp-1197-client.ovpn

Cloning Mac OS X system to new hard drive using FireWire cable

firewire

First connect your Source and Target Mac’s with Firewire cable.
Power on the Target Mac and hold on T key to boot in FireWire target disk mode.
On the Source machine will appear the new hard drive, erase it from the Disk Utility tool.Now run the Carbon Copy Cloner tool
and select your source and destination drives, and clone :)) . Download the Carbon Copy Cloner from here.

carbon3

carbon2

carbon1

static routes in MacOS X howto

Sometimes we need to add permanently static routes, we can do that in this way

cd /Library/StartupItems

vi AddRoutes


#!/bin/sh

# Set static routing tables

. /etc/rc.common

StartService ()
{
sleep 10
ConsoleMessage "Adding Static Routing Table"

sudo /sbin/route add -net 192.168.101.0 -netmask 255.255.255.0 -gateway 192.168.101.1
sudo /sbin/route add -net 192.168.102.0 -netmask 255.255.255.0 -gateway 192.168.102.1
}

StopService ()
{
return 0
}

StopService ()
{
return 0
}

RestartService ()
{
return 0
}

RunService "$1"

vi StartupParameters.plist

{
Description = "Add static routing tables";
Provides = ("AddRoutes");
Requires = ("Network");
OrderPreference = "None";
}

chmod 755 AddRoutes
chmod 755 StartupParameters.plist

make bootable usb flash drive with linux in MacOS X

bash-3.2# hdiutil convert -format UDRW -o Debian7live.img debian-live-7.0.0-i386-standard.iso
Reading Master Boot Record (MBR : 0)…
Reading Debian wheezy 20130505-06:54 (Apple_ISO : 1)…
Reading (Windows_NTFS_Hidden : 2)…
...........................................................................................................................................................................................................................
Elapsed Time: 4.551s
Speed: 118.2Mbytes/sec
Savings: 0.0%
created: /Users/bentoslack/Downloads/Debian7live.img.dmg

bash-3.2# mv Debian7live.img.dmg Debian7live.img

bash-3.2# diskutil list
/dev/disk4
#: TYPE NAME SIZE IDENTIFIER
0: FDisk_partition_scheme *15.8 GB disk4
1: DOS_FAT_32 UNTITLED 1 15.8 GB disk4s1

bash-3.2# diskutil unmountDisk /dev/disk4
Unmount of all volumes on disk4 was successful

bash-3.2# dd if=Debian7live.img of=/dev/disk4 bs=1m
538+0 records in
538+0 records out
564133888 bytes transferred in 105.770259 secs (5333578 bytes/sec)

bash-3.2# hdiutil eject /dev/disk4
"disk4" unmounted.
"disk4" ejected.
bash-3.2#