Wednesday, April 2, 2008

OSX Leopard hamachi auto start

For those of you waiting to have a Leopard compatible gui for hamachi... This should help for now. This will get you up and running with the command line.


The following should start tuncfg on boot (as root) and then hamachi will start up on login.


First install the leopard tun/tap drivers.

You need to make sure that Xcode tools are installed (you can install them from your leopard disc -- find them under optional installs) or them from Apple's Developer connection. If this is not installed you will get an error when attempting to use "make".

You will them be able to install hamachi.

After you get hamachi working properly from the command line.... use the follow (very rough) steps to get it to auto-start for you.




Here's what I did:



created directory:

sudo mkdir /Library/BootScripts

created file:

sudo vi /Library/BootScripts/loadtuncfg.sh

filecontents of loadtuncf.sh

----- snip -----

#!/bin/bash

sleep 30
/usr/sbin/tuncfg

------- end of snip ------

sudo chmod 755 /Library/BootScripts/loadtuncfg.sh
(file is owned by root:admin on my machine)


created file:

sudo vi /Library/LaunchDaemons/com.loadtuncfg.launchd.loadtuncfg.plist



file contents of com.loadtuncfg.launchd.loadtuncfg.plist:


-------snip---------


<?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>com.loadtuncfg.launchd.loadtuncfg</string>

<key>KeepAlive</key>
<false/>

<key>ProgramArguments</key>
<array>
<string>/Library/BootScripts/loadtuncfg.sh</string>
<string>run</string>
</array>

<key>RunAtLoad</key>
<true/>
</dict>
</plist>


----------end of snip -----


All of the above should start tuncfg on boot (after 30 sec delay).




Now to start hamachi after local user login...

Make sure to change "yourusername" to the user that you use. Even in the .plist file below.




created directory: (notice not using sudo)

mkdir /Users/yourusername/Library/LoginScripts/

created file: (notice not using sudo)

vi /Users/yourusername/Library/LoginScripts/loadhamachi.sh

file contents of loadhamachi.sh:

-------- snip --------

#!/bin/bash
sleep 40
hamachi start
hamachi login
hamachi go-online yournetworkname

---- end of snip -----

chmod 755 /Users/yourusername/Library/LoginScripts/loadhamachi.sh
(file is owned by yourusername:yourusername)

created directory: (notice not using sudo and directory may already exist)

mkdir /Users/yourusername/Library/LaunchAgents


created file: (notice not using sudo)

vi /Users/yourusername/Library/LaunchAgents/com.loadhamachi.launchd.loadhamachi.plist

file contents of com.loadhamachi.launchd.loadhamachi.plist:

--- snip ----

<?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>com.loadhamachi.launchd.loadhamachi</string>

<key>KeepAlive</key>
<false/>

<key>ProgramArguments</key>
<array>
<string>/Users/yourusername/Library/LoginScripts/loadhamachi.sh</string>
<string>run</string>
</array>

<key>RunAtLoad</key>
<true/>
</dict>
</plist>

------ end of snip ------

file is 644 (as created and owned by youusername)


Now reboot...

tuncfg will load in 30 seconds after boot up..

hamachi will load 40 seconds after login.. (delayed longer to ensure that tuncfg loaded)..

(Credit: Most of this was from GirthP post at http://forums.macrumors.com/showthread.php?t=458736)



I hope this helps.

Thursday, January 17, 2008

Dreambox tricks

For a dreambox 500 et al:


Setup the dreambox CDK environment with these steps. I used RHEL 5 but I am sure the fedora or others would work fine. Prerequisites here can be found here: cvs.tuxbox.org/cgi-bin/viewcvs.cgi/tuxbox/cdk/doc/INSTALL.en?rev=HEAD


export CVS_RSH=ssh
cvs -d anoncvs@cvs.tuxbox.org:/cvs/tuxbox -z3 co -P -rdreambox .

cd cdk
chmod 755 prepare
./prepare dm500
make checkout
make core
(when it bombed on nptl-0.60.tar.bz2)
cd Archive
wget http://ftp.devil-linux.org/pub/devel/sources/1.2/nptl-0.60.tar.bz2
cd ..
make core

Hey look, another tech blog

This will help me organize my technical stuff.