Entries Tagged 'Nerdy Stuff' ↓

Installing freeglut on Vista x64

I’ve recently had to install freeglut as part of a uni subject and ran across an issue due to the fact that I’m running Vista x64 and wanted to dynamically link freeglut against anything I develop during the semester. First of all, building freeglut (version 2.4.0) was problem free. I simply opened the “freeglut.dsw” file (in the root directory of the freeglut download) in Visual Studio 2005 (VS2005), agreed to convert the project files to a newer format, and then built the solution. An additional step I took, which may be completely unnecessary, was to change the build type from Debug to Release. Both build types built fine, but I used the release versions as I doubt I will be debugging freeglut. Also note that I compiled this as the default 32-bit, not 64-bit, as I’m building 32-bit GLUT apps for compatibility.

Once this was done, I followed the info in “README.win32″ (in the freeglut directory) and copied the files to the relevant directories. The specific directories I used for a Vista x64 system with VS2005 were as follows:

  • copy “freeglut.h”, “freeglut_ext.h”, “freeglut_std.h”, and “glut.h” from freeglut-2.4.0\include\GL to C:\Program Files (x86)\Microsoft Visual Studio 8\VC\PlatformSDK\Include\gl.
  • copy “freeglut.lib” from freeglut-2.4.0\Release to C:\Program Files (x86)\Microsoft Visual Studio 8\VC\PlatformSDK\Lib. Note that the correct destination should already contain “opengl32.lib”, “glu32.lib”, and “glaux.lib”
  • Now here’s the part that caused me problems: copy “freeglut.dll” to C:\Windows\SysWOW64 and NOT C:\Windows\System32 as you might expect, given that it’s a 32-bit library being used in 32-bit projects

Once the files are in place, you should be ready to use freeglut in your apps. To do so, simply include freeglut as follows:
(for some reason Wordpress hates this line in a code block…)
#include “GL/glut.h”

As you can see, we’re referencing “glut.h” and not “freeglut.h”. My guess is that this is done to maintain platform independence if your code was being built by a different incarnation of GLUT. For example I used this method to build and run the test app provided by my lecturer (unchanged), who uses the original GLUT.

***UPDATE 2009-02-27 ***
I copied the files I built on my Vista x64 machine to a 32-bit install of XP SP3 on my laptop and GLUT worked fine. The only difference to the above instructions (obviously aside from not building freeglut again) is to copy “freeglut.dll” to C:\Windows\System32. I’ve also put together a zip package of my build for anybody who wants to avoid building themselves.

More Fun with OpenSolaris

Partly due to laziness, and partly due to me still working out the kinks, I never included this stuff in my original post on setting up an OpenSolaris fileserver.

VNC

In order to save physical space and make your server more accessible, it can be a good idea to setup a VNC server so you can control it remotely without having to have a monitor, keyboard and mouse plugged in.  This is a fairly straight forward procedure and I hope to outline it for you now.

First of all, you’re going to need the software.  This can be obtained from sunfreeware.com.  Simply search for x11vnc and download the binary package, which at the time of writing is x11vnc-0.7-sol10-intel-local.gz.  There is a note there on the dependencies that must be installed for this to work, however I believe these were already installed for me, but your mileage may vary.  Once you’ve downloaded the gzip file, you should be able to extract the contents by simply double clicking the downloaded file and then dragging the contents somewhere (e.g. the desktop).  Now, RTFM.  It’s only two lines, so I’ll repeat it here for you =P
Continue reading →

How to Build a 2TB ZFS Fileserver for AUD800

My aspirations to build a Solaris fileserver have finally been realised and I now have 2TB of networked storage sitting beneath my desk as I type this. Now that the server is built and working, I figured it was time to share my experiences with the world.

The Requirements

Put simply, I wanted a fileserver to host all of my music, movies and other files in a central location that was networked with the rest of my house. Not only did I want to store my files, but I wanted around 2TB of actual storage so that it would last me a while, as well as some sort of protection against an inevitable drive failure. Unless you want to run some sort of backup software, which I don’t, then RAID is generally how you protect against drive failures.  So RAID it was.

After some research, I decided that a dedicated box with RAID was definitely going to meet my needs the best. I also decided that RAID 1 (a simple mirror) was inefficient as it sacrifices too much drive space. As cheap as storage is these days, I’m still a poor uni student. So, something like RAID 5 is what I wanted. Once this was decided, it was time to look at filesystems. It didn’t take long to see that Sun’s ZFS with raidz was probably the way to go. This made the choice of operating system simple, as ZFS means Solaris unless you want to run your filesystem in userspace. To be honest, I’m not sure how much this would impact performance, but a chance to get acquainted with a new OS was too good to pass up, so Solaris it was.
Continue reading →

Execute Command on All Files in Directory Structure by Extension

I’ve been looking into converting a bunch of OGG files to MP3 files for a friend using BASH.  As the files are organised in a directory structure, I need to traverse the directory structure, and run lame against each file to convert it.  Having a look around for BASH scripts to traverse a directory structure, I found someone with a similar problem who solved it using the “find” command.  I’ve taken their solution and added filtering by file extension.  This solution traverses a directory structure, filters the results using a regular expression, and then executes a command against each of the filtered results.  In general the command works something like this:

find /home/music -iregex ^.*\\.ogg$ -exec mysweetcommand '{}' \;

Continue reading →

Wordpress Pro Tip #1

Here’s a pro tip for anyone working with Wordpress.  If you’re ever faced with a completely blank page when you visit your site, check that the theme you are meant to be using actually exists.  I just spent about half an hour checking permissions and error logs for my development environment, only to find that when I backed up the theme I was working on I inadvertently cut the theme’s folder instead of copy it.  It appears that when Wordpress doesn’t find the theme it is meant to use it just returns an empty page instead of an error message.  Better than an error message, it could even try using the default theme and email the adminstrator that something has gone wrong with their chosen theme.  I’m using Wordpress 2.7 at the moment, so if this is version specific or shouldn’t be happening, can someone please leave a comment or email me.

Given that Wordpress appears to be open source, maybe I should attempt to write such a fix and finally contribute to an open source project like I’ve been planning to.