Username:
Password:

Mac - iStumbler: a small program to have more information on Wifi

Creation: 18/07/2009 09:29

Last Modification: 18/07/2009 09:30

The Mac OS airport is nice and very fast to use to connect to a Wifi network but
it also gives very few information on the networks available (channels, mac adresse etc...).

iStumbler is filling this gap with a nice graphic tool giving detailled information
on every Wifi networks available.

You can download it from this website:
iStumbler.net


Mac - Command itunes remotely using ssh

Creation: 14/07/2009 17:22

Last Modification: 18/07/2009 17:59

With MAC OS X, a wonderfull command line program named "osascript"
is avaiable.

Using osascript you can command almost every graphical program in
command line and i will show you how to use it to command itunes
(which will make it possible to run those commands in an ssh session).

To start itunes:

osascript -e 'tell application "iTunes" to activate'


To jump to next track:

osascript -e 'tell application "iTunes" to next track'


Replacing "next track" in the last command you can:
- pause : pause playing
- play : start playing
- previous track : return to previous track.

Using this i made a small script to start itunes if needed and execute
the wanting command:


#!/bin/bash
mycmd=$(basename $0)
isStarted=$(osascript -e 'tell application "System Events" to (name of processes) contains "iTunes"')

if [ "$isStarted" = "false" ]; then
	osascript -e 'tell application "iTunes" to activate'
fi

case $mycmd in
	itunes_next)	
		osascript -e 'tell application "iTunes" to next track'
		;;
	itunes_pause)	
		osascript -e 'tell application "iTunes" to pause'
		;;
	itunes_play)
		osascript -e 'tell application "iTunes" to play'
		;;
	itunes_prev)
		osascript -e 'tell application "iTunes" to previous track'
		;;
esac


You then need to link this script to the itunes_next, itunes_pause,
itunes_play and itunes_prev and you are good to go.