Sunday, August 19, 2007

Upcoming articles...

Im traveling this week so not much will get done but upcoming articles will be:
-WebDav server for Ical and Outlook sharing
-Aperture tips
-DVD ripping on OSX
-JVC Everio Droplets for FFMPEGX to allow importing into iMovie
-the Easy way to import outlook contacts into Address Book...this was so simple i cant believe no one else figured this out
-and I might even do a list of Software I cant live without on OSX.

If you have an interoperability tech tip for OSX and Windows or Linux shoot me a message and I will either post it or see if I can get it to work.

Avahi announcing services on behalf of other machines.

The coolest feature of Avahi is to announce services to Bonjour/Rendezvous clients both Mac and Windows with the Bonjour IE plugin when they dont actually have an mDNSresponder on them. I am using my linux box(FC5) to announce a bunch of my intranet web pages so I dont have to remember all the links.

I am announcing my two webcams, Wireless router, printserver, network switch, Apache on my linux box, Cacti network monitoring on my linux box and my router. The cool thing is it will even let you do links.

For example.
Router = http://router or http://192.168.1.1
(I am using static hostnames in /etc/hosts on OSX and Linux and the windows hosts file)

Cacti = http://firefly/cacti
(cacti after the hostname being the path)


You need to do two things assuming you have Avahi up and running which I am not going to cover here...but contact me if you need help with that. You need to create .service files and you need to create hosts files.

First well create the hosts file that is located in /etc/avahi: vi /etc/avahi/hosts

paste in your IP to Name conversions noting that any service on the localhost does not need to be in this file. Mine happen to be as follows:
192.168.1.1 router.local
192.168.1.3 printserver.local
192.168.1.5 switch.local
192.168.1.6 wlan.local


Now create the .service files. You can search google for any service type as they are almost all defined already.

>create a service file: touch wlan.service

paste the following into the wlan.service file.


<?xml version="1.0" standalone='no'?>
<!DOCTYPE service-group SYSTEM "avahi-service.dtd">
<service-group>
<name>WLAN Web Server</name>
<service>
<type>_http.\_tcp</type>

<host-name>wlan.local</host-name>

<port>80</port>
</service>
</service-group>




If you wanted to create one with a patch such as the cacti example above simply add a txt-record tag.

>create a service file: touch cacti.service

paste the following into the cacti.service file.


<?xml version="1.0" standalone='no'?>
<!DOCTYPE service-group SYSTEM "avahi-service.dtd">
<service-group>
<name>Cacti Web Interface</name>
<service>
<type>_http.\_tcp</type>

<port>80</port>

<txt-record>path=/cacti</txt-record>

</service>
</service-group>


Save the file and restart Avahi: service avahi-daemon restart



Once Avahi is restarted you can check the log file to make sure the services are announcing successfully. You can even use avahi-browse -a to see if the services are all announcing. Then just open your Bonjour window and they should all show up.

Itunes Server on Linux for OSX

I dont have a spare Mac laying around but I do have a linux box with 2 Terabytes of Disc space and I wanted to have all my MP3's online and accessible by my all the macs in the house(mine and my wifes). This is where mt-daapd comes in. Its now called firefly but all the RPM's are still mt-daapd. I built this on FC5 but it will work on any linux.

Get the RPM.
ftp://rpmfind.net/linux/sourceforge/m/mt/mt-daapd/mt-daapd-0.2.4-1.src.rpm

Extract the SRPM: rpm -Ivh mt-daapd-0.2.4-1.src.rpm
Build the RPM: rpmbuild -ba /usr/src/redhat/SPEC/mt-daapd.spec
Install the RPM: rpm -Ivh mt-daapd-0.2.4-1.rpm
Edit the config file: vi /etc/mt-daapd.conf

In this config file there are lots of options that you dont need to change. I have not been successful in getting the admin web page to work...but I dont need it.

admin_pw: set this to whatever you want.
mp3_dir: set this to the location of your MP3 archive. Mine is /storage/MP3
servername: this is what shows up in iTunes as a shared playlist. Mine is Music Jukebox
rescan_interval: how fast to check for new music. I have 400 gigs of music and it only takes a few seconds to scan the whole directory so you can make this small. Mine is set at 300

Almost there...Now if your running Avahi which comes default on FC5 then you have to modify one last file. If that service is disabled or your running the MDNSresponder you are good to go. If you are running Avahi you must edit the service file for mt-daapd.

vi /etc/rc.d/init.d/mt-daapd

under the section called start() you need to add a -m flag to the end of the line that is daemon mt-daapd. This is becuase mDNSResponder that is built into mt-daapd conflicts with Avahi.

Since I am using Avahi i need to create a service file to allow Bonjour/Rendezvous to find the share. Ensure Avahi-Daemon is running(service avahi-daemon status).
create a service file: touch daap.service
paste the following into the daap.service file.

Save the file and start the process: service mt-daapd start

<?xml version="1.0" standalone='no'?>
<!DOCTYPE service-group SYSTEM "avahi-service.dtd">
<service-group>

<name>Music JukeBox</name>
<service>
<type>_daap._tcp</type>
<port>3689</port>
</service>
</service-group>


Save the file and restart Avahi: service avahi-daemon restartd

The log file should show scanning the entries and the playlist should show up in iTunes. Soon I will be working on a way to use Blue Coconut to allow copying of shared songs via iTunes. Right now you have to mount the MP3 dir and manually copy them into the local library.

Mount SMB Shares in OSX via an Application

If your like me I hate the command-K option because it leaves your usernames and passwords unsecured in the finder. Here is a way to use an application to mount smb shares. Just paste the applescript into the Script Editor, change the credentials, check the "run only"(to make it secure) and save as type = Application.

tell application "Finder"
open location "smb://usernamme:pass@ServerName1/share1"

open location "smb://usernamme:pass@ServerName2/share2"

end tell

For an application to unmount these paste the following in...or just drag them to the trash.

tell application "Finder"
try
if "Share1" exists then
eject "Share1"

end if
if "Share2" exists then
eject "Share2"

end if
end try

end tell

Enjoy...

Saturday, August 18, 2007

Coming Soon...

Working on some posts. coming soon.