kvigor:Does anybody out there have a netbsd system I (and others) could get ssh access to for testing purposes? I know, testing is for nancies. Just call me wuss-boy.
I tried not testing. I really did. I couldn't help myself. I had to know it would compile and run cleanly on the judging system. I couldn't let it go off half-cocked, either. Of course, I also have 25 check-ins to a subversion repository and a branching strategy.
First, to answer your stated question. No. I do not have a NetBSD install you can ssh to. If you did, I wouldn't let you compile code for this contest on it (jeez, what do you think I am, crazy? I'm entering too, I know what's getting compiled out there...).
Now, to answer your real question, "How do I test this abomination before I submit?"
Since you're going the Unix route, I'm going to assume you are running Ubuntu Purple Poodle. Hold on to your butts people, and get ready for more WTFery.
First, you'll need QEMU.
Ok, now that you've installed that on Purple Poodle, you'll need NetBSD. I installed it on QEMU from the proper install CD. You can find it here. The torrent was wicked fast. Your other option is to get a pre-installed QEMU image, there's one to be found here (it's near the bottom in the disk images section). It's a minimal install, so I don't know if it has Xwindows installed. I didn't use it. If you want to be lazy, you'll have to put some work in.
Next, you'll need to install NetBSD onto a QEMU image. It's simple. First create a QEMU disk image, this command: 'qemu-img create netbsd.img 500M' will create a 500 MiB empty harddrive image.
Next, fire up QEMU and install NetBSD: 'qemu -cdrom /path/to/netbsd-install.iso -boot d /path/to/netbsd.img'
Install NetBSD. You managed to get Purple Poodle shoe-horned onto what ever ol' thing you call a workstation. NetBSD is actually pretty simple. It doesn't have a GUI installer though, so be sure to get your blanket of protection +2 if that bothers you.
Done installing NetBSD? Great. Now, you won't even need to get Xwindows setup on the QEMU image. We'll just take advantage of some of Xwindows' more esoteric features to avoid that little snafu.
First, make sure you have the tun/tap driver installed on your machine. It's a kernel module. Or it probably is. If it isn't, you probably know what your doing anyway, why are you reading this? So, to check if you have it, run 'locate tun.ko', if you see a line that looks like: /lib/modules/2.something.orother/stuff/foo/bar/tun.ko then you have it. Run 'modprobe tun' to install it.
You don't have it? Uh, go turn it on in your config. It's in the network drivers, like where your ethernet card is. Somewhere. Turn it on (module!) and re-run 'make modules modules_install'. Then you'll be set. If that was greek to you, maybe you shouldn't be attempting this.
Finally, boot NetBSD using: 'qemu -net nic -net tap,ifname=tap0,script=no /path/to/netbsd.img' You'll need to do this as root, so QEMU can setup the tap0 networking interface. On your linux side, also as root, run something like 'ifconfig tap0 10.1.1.1 netmask 255.255.255.0 up' and on NetBSD (as root) do 'ifconfig ne2 10.1.1.2 netmask 255.255.255.0 up'.
Use scp or something to get your tarball (as you will submit it) onto your NetBSD virtual machine (your machine's address is 10.1.1.1 if you followed me blindly, sucker). Untar it and build. Whatever your instructions are. You'll probably get to enjoy figuring out how to get stuff to compile on BSD. It's different, not much, but enough. Beyond the scope of this lesson.[1]
So, it built, right? Then, on Linux, 'xhost +10.1.1.2'. On NetBSD: 'DISPLAY=10.1.1.1:0.0 ./mywtfery' in whatever directory your binary ended up in.
Bam. Your calculator should pop up on your desktop, but it's really running on your NetBSD virtual machine. And for the record, Xwindows has always been able to do that.
There's your lesson for the day. Now, everyone, see how much easier it is to do things on Linux? Why are you still wasting your valuable time with that MacOSX and MS Windows junk?
Notes: [1] If you need help with getting your entry to compile on NetBSD, I'll be available to answer questions on the 15th. There's a schmaltzy JPEG on the line here folks.
All men are frauds. The only difference between them is that some admit it. I myself deny it.
-- H. L. Mencken