iPad as a second screen for your laptop?

January 28th, 2010 Seb No comments

So the general opinion is that the iPad sucks. I’ve posted some comments on Reddit myself.

Obviously the product has been over-hyped and Steve Jobs himself used over-the-top words like “it’s a dream”, “revolutionary”, etc. Not really what you want to hear. I don’t want to go into a pro/con discussion too much, let me just say that for me I think it has a place. I’ve been looking at e-book readers for a while and haven’t liked them a lot. I don’t want a Netbook, I have a laptop so I don’t see the point of having a second one; I hate to manage the same data on multiple devices. I seriously need a viewing-centric device for reading documents and watching movies. It has to be something in tablet form, without keyboard. I also want it to work without too much hassle. On the other hand I will be disappointed if I can’t read any of the formats I want or watch any of the movies I want. I also would have loved a camera. Maybe in future versions.

Anyway, I just thought off a cool application for the iPad. Why not use it as a second screen for my Macbook Pro? I’m assuming that it should be possible to simply hook it up to a DVI-out. But of course the question is if it will support video-in. I know I can’t send any video into my Macbook Pro’s DVI port. Additionally it would be really cool if you could sync docs this way.

Imagine the following:

  1. You drag a document from you Macbook screen to your iPad;
  2. You undock it;
  3. The document stays on the iPad.

UPDATE: found out about Wi-Di, awesome stuff. Wouldn’t that be great for the iPad?

Hosted by imgur.com

Share:
  • Digg
  • del.icio.us
  • Google Bookmarks
  • NuJIJ
  • Reddit
  • Slashdot
  • LinkedIn
  • RSS
  • Twitter
Categories: Blogging Tags:

Playing Red Alert 3 on OS X with OpenVPN

December 13th, 2009 Seb No comments

So I wanted to play Red Alert 3 with my a friend in Germany. We wanted to use the LAN play option, so I decided to install OpenVPN on our FreeBSD server so we both could SSL-VPN into it and presto be on the same LAN (fyi, we are both in different countries and the server in a third country).

Everything seemed to work fine, I’d setup username/password authentication (using SSHD pam module) on top of the digital certificate validation for OpenVPN. There are a number of guides on the Internet if you need to know how to do it.

Because we where going with IP-only, routed connections, we decided to go for TUN interfaces instead of TAP interfaces. So we both logged in did some network tests, where able to ping each other (because I set client-to-client in opevpn.conf on the server), we could use each other network shares etc, so we decided to start a game. Unfortunately any game either of us would start wasn’t detected by the other. The game list stayed empty. The player list showed only our respective usernames twice, but not the username of the other person.

Then we switched to TAP interfaces to allow ethernet broadcast to pass the VPN (we thought that might help) and suddenly the game would show up in the games list, but if we tried to start it the game would time-out. Then we thought we force traffic to the limited broadcast address (LAN broadcast) to be routed/send over the SSL-VPN by adding a local route on our Macs by:

sudo route add -host 255.255.255.255 tap0 

and… it worked!

Now to push this route automatically to the clients you can add it to openvpn.conf on the server. However you can’t specify the TAP or TUN interface there, so instead you should use the IP-address of the TAP/TUN interface on the OpenVPN server, basically your next hop into the VPN network. By default this is 10.8.0.1 in OpenVPN world ;) Luckily this IP-address is automatically used if you use the following config line in openvpn.conf:

push “route 255.255.255.255 0.0.0.0″ See update 3 below for an alternate way of doing this.

Basically that is the equivalent to locally adding sudo route add -host 255.255.255.255 10.8.0.1 (10.8.0.1 should then be replaced with your servers TUN/TAN interface).

Update: After some quick Wiresharking, it does look like Red Alert 3 uses subnet broadcasts (for instance 10.255.255.255 for 10.0.0.0/8) to discover other Red Alert daemons, but then switches to LAN/Limited broadcasts (255.255.255.255) for playing the actual game. This is consistent with the behaviour I described above. FYI I’ve tested with TUN interfaces and this doesn’t seem to work. I’m going to do some tests and update this post this weekend.

Update 2: Ok, it looks like Red Alert 3 uses Netbios name service which uses subnet broadcasts like 10.8.255.255/16 to find other Red Alert servers. Then for connecting to an actual game it uses Limited/LAN broadcasts to 255.255.255.255 using UDP from source port 8087:

 
MyMac:~ littlebighuman$ netstat -an | grep 8087
udp4       0      0  *.8087                 *.*

Look up the process listening on 8087:

MyMac:~ littlebighuman $ lsof -i:8087
COMMAND    PID       USER   FD   TYPE    DEVICE SIZE/OFF NODE NAME
cider     4637 littlebighuman  346u  IPv4 0xec5d798      0t0  UDP *:8087
wineserve 4642 littlebighuman  316u  IPv4 0xec5d798      0t0  UDP *:8087

Ah what do you know Red Alert 3 runs in Cider and uses wineserver, but we knew that ;)

I still don’t know why limited/LAN broadcasts aren’t send over the TAP or TUN interfaces. I’ll research that for a bit.

Update 3: Pushing a host route from the OpenVPN server as I have described above doesn’t work, as far as I can tell it turns every pushed route into a net route and this route doesn’t work (you can test by pinging to 255.255.255.255 and see if it gets send out of the TAP interface). So you get 255.255.255.255/32 via 10.8.0.1 instead of 255.255.255.255 via 10.8.0.1. A workaround for this workaround is to add the route via your clients OpenVPN up-script and a delete route statement for your down-script. For Tunnelblick these scripts are in ../Tunnelblick.app/Contents/Resources, client.up.osx.sh and client.down.osx.sh respectively. Quick and dirty fix:

In client.up.osx.sh, probably best to put it right after the export PATH statement at the top:

/sbin/route add -host 255.255.255.255 -interface tap0

In client.down.osx.sh, also probably best to put it right after the export PATH statement at the top:

/sbin/route delete -host 255.255.255.255
Share:
  • Digg
  • del.icio.us
  • Google Bookmarks
  • NuJIJ
  • Reddit
  • Slashdot
  • LinkedIn
  • RSS
  • Twitter
Categories: Blogging Tags:

Wiimote + Classic Controler + MAME OS X

November 6th, 2009 Seb No comments

In a sudden craving for some old school arcade games I thought I have a look at MAME OS X. After playing for a while with the keyboard I got a bit frustrated with it and really wanted a gamepad. I think I have an USB gamepad, but couldn’t remember where I left it. While looking for it I came across my Wii’s classic controler. So I ended up hooking up my Wiimote with the classic controler extension to my Macbook Pro and I’m please to say that this works great :)

Now you need some software/driver to get your Wiimote connected. There are several programs out there, at first I tried DarwiinRemote, but it doesn’t work with MAME OS X, because MAME OS X expects a HID-like controller. DarwiiRemote does excellent key-mapping, but this isn’t picked-up in-game by MAME OS X. However I found that another program, Wiiji does work. It basically turns your Wiimote + most extensions in a HID device.

So here are the steps to set it up:

  • Download Wiiji from Sourceforge;
  • Install Wiiji. The installer will ask for you admin password, since it is a kernel extension. Make sure you realise the consequences of providing your password, then enter it when you can live with them ;)
  • Wiiji will install in /Applications/Utilities, you can get there by pressing shift + command + U in Finder;
  • Start Wiiji, it will launch as a small icon in your Menu Bar:

Picture-40.png

  • Click on the Wiiji icon and select Wiiji Preferences, adjust the prefences to reflect the image below:

Picture 46.png

  • We need to turn on Bluetooth on the Mac. You can do this in System Preferences. It’s more convenient to do this from the Menu Bar, because you probably need to turn Bluetooth on/off regularly. You can get the Bluetooth icon in the Menu Bar if you select this option in System Preferences Bluetooth:

Picture 48.png

  • Now make sure “Show Bluetooth status in the menu bar” is checked:

Picture-44.png

  • You should now have a Bluetooth icon in the Menu Bar:

Picture-45.png

  • Turn Bluetooth on by clicking on the Menu Bar icon etc;
  • Make sure you Wii is off otherwise the pairing with your Mac will fail;
  • Now press and hold the 1 and 2 button on the Wiimote until the blue leds blink;
  • Now click on the Wiiji icon, often the pairing has succeeded already, otherwise you will have to choose “Rescan for Wiimotes”;
  • If Wiiji doesn’t see your Wiimote you can do two things:

    1. Turn Bluetooth off/on and try again

    2. Click on the Bluetooth icon and disconnect the Wiimote, then press 1+2 again on the Wiimote and have Wiiji look for it. This is something you probably have to do regularly, because OS X seems to grab the Wiimote before Wiiji has it in some cases (please correct me if I’am wrong).

Picture-52.png

  • If you don’t have MAME OS X get that from Sourceforge and install it;
  • Get some ROMS into MAME (google if you don’t know how);
  • Now start MAME and go into preferences (command + ,), select the Inputs tab and make sure that “Enable joystick” is checked:

Picture 51.png

  • Personally I prefer to use the classic controller, so that’s what I use, but you can use just your Wiimote by itself. Whatever you use, you will have to configure it in Mame. Start a game in Mame, press p to pause (as long as you didn’t change it to something else) and tab to configure. Here you can set the controls for each player, in general or per game. Select the action you want to change, press enter and then press the key on your joystick that you want to map:

Picture-53.png

  • Game on!
Share:
  • Digg
  • del.icio.us
  • Google Bookmarks
  • NuJIJ
  • Reddit
  • Slashdot
  • LinkedIn
  • RSS
  • Twitter

Speedtest.edpnet.be Bash script

October 21st, 2009 Seb No comments

Google Docs graph of two weeks of speedtest.edpnet.be

Google Docs graph of two weeks of speedtest.edpnet.be

This script is for people using the Belgium provider EDPnet. I wrote it to get a couple of weeks worth of download speed data, because my download speed regulary drops dramatically. The script is meant to be run in the background by calling it with ./speedtest.sh &. It will start an infinite loop and do the speedtest.edpnet.be speedtest on a configurable interval (one hour defaultly). It uses curl, but if put in wget as well, just uncomment the wget line and comment out the curl line. It can easly be adjusted for most other providers download-speed-tests, just figure out which exact file you need to download for the test.

The output is in CSV format meant to be imported by Excel, Google docs etc.

An example report including a graph can be found here.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#! /bin/bash
# DESCRIPTION:
# Simple script to monitor your EDPnet ADSL connection speed by doing the speedtest.edpnet.be test on a set interval
# This script uses an infinite loop with a while loop that never ends, which is crude, but makes it easy to employ
# Output is in CSV format optimized for Excel import, script does some simple log numbering as well
 
# USAGE:
# Best is to run in it the background with: speedtest.sh  &
# Don't forget to kill (ps ax|grep speedtest.sh) it when your are done or it will run until the computer is restarted
 
# EXCEL IMPORT:
# In Excel do  File  Import  CSV  Finish. Or manually specify the comma seperator and double quotes as field markers
 
# VARIABLES
TEMPFILE=tempfile
# CSV file name, csv extension automatically appended as well as a log number
CSV=speedtest-log
SEPERATOR=","
# If you want you can change the interval at which the test is run (in seconds)
INTERVAL=3600
# Used for the infinite while loop
COUNTER=OMEGA
 
# Find logfile with highest number and determine the log number for this run
OLDNR=$(find . -name "$CSV*.csv" -maxdepth 1 | cut -d"." -f3 | sort -nr | head -n 1)
NR=$(($OLDNR + 1))
 
echo "Script running, infinite while loop in effect"
 
# Print header row and create log file
echo "\"Date and time\"$SEPERATOR\"Speed in Kbyte\""  > $CSV.$NR.csv
 
while [ $COUNTER = OMEGA ]; do
 
	# Execute the speedtest
	# Defaultly I use curl, but you can use wget as well. Just uncomment the one you want, and comment out the one you don't
	curl -A "Mozilla/5.0 Littlebighuman.com/edpspeedtest.sh 1.0" -s "http://speedtest.edpnet.be/speedtest4.php" -o TEMPFILE
	# wget -O$TEMPFILE "http://speedtest.edpnet.be/speedtest4.php" 2> /dev/null
 
	# Get the line with the data we need
	DATALINE=$(cat "$TEMPFILE" | awk '/Your result is/')
 
	# Empty TEMPFILE for the next while run
	cat /dev/null  > $TEMPFILE
 
	# Get the current time and date
	CURRENTDATE=$(date +"%d-%m-%Y %H:%M")
 
	# Get the speed in kbyte and replace the dot with a comma for Belgium international format
	SPEED=$(echo $DATALINE | awk '{print $5}' | sed 's/\./\,/g')
 
	# Output in CSV format
	echo "\"$CURRENTDATE\"$SEPERATOR\"$SPEED\""  >> $CSV.$NR.csv
 
	# Sleep
	sleep $INTERVAL
done
Share:
  • Digg
  • del.icio.us
  • Google Bookmarks
  • NuJIJ
  • Reddit
  • Slashdot
  • LinkedIn
  • RSS
  • Twitter
Categories: Networking, Scripts Tags:

iCrap

October 2nd, 2009 Seb No comments

My first attempt to coin a term: iCrap

Definition:

iCrap [ahycrap] icrapped, icrap-ing, noun

- verb (used without object)

1. to go to a secluded place, usually a toilet at work, possibly with the intention to avoid someone or something and use and operate an iPhone, often a game, often using headphones.

– verb (used without object)

2. the act of iCrapping.

– noun

3. anything starting with i followed by a capital letter, but isnt cool.

Origin: Littlebighuman, while chatting with his friend Alexis, came up with it when explaining that he was going to iCrap on the toilet for a while.

Related forms: iCrap, noun

Synonyms: None yet.

Examples:

  • I totally need to go iCrapping right now;
  • He was taking a huge iCrap, seriously, he was gone for one hour at least;
  • Our company has a policy against taking iCraps.
Share:
  • Digg
  • del.icio.us
  • Google Bookmarks
  • NuJIJ
  • Reddit
  • Slashdot
  • LinkedIn
  • RSS
  • Twitter
Categories: Apple, Fun, Geek, Mac Tags: ,