Author Archive

Upgrading turnkey redmine from version 0.8.x to 1.0

by Craig Mayhew on Aug.09, 2011, under Guides/Fixes

Upgrading the turnkey vm of redmine can be painful:

Hopefully this will take away some of the pain :)

cd /var/www
mv railsapp railsappOLD
svn co http://redmine.rubyforge.org/svn/branches/1.0-stable railsapp
cp ./railsappOLD/config/database.yml ./railsapp/config/database.yml
cp ./railsappOLD/config/email.yml ./railsapp/config/email.yml
cp -r ./railsappOLD/files ./railsapp/files
sudo chown -R root:www-data /var/www/railsapp
cd /var/www/railsapp
sudo chown -R www-data:www-data files log tmp
gem install rails -v=2.3.5
gem install rack
gem install rack -v=1.0.1
rake generate_session_store
gem install -v=0.4.2 i18n
rake generate_session_store
rake db:migrate RAILS_ENV=production
sudo chown -R www-data:www-data files log tmp public/plugin_assets
rake db:migrate:upgrade_plugin_migrations RAILS_ENV=production
rake db:migrate_plugins RAILS_ENV=production
sudo chmod -R 755 files log/ tmp/ public/plugin_assets
rake tmp:cache:clear
rake tmp:sessions:clear
sudo reboot

1 Comment :, more...

Email Charter

by Craig Mayhew on Jul.03, 2011, under General

Would like to spread the word on this as email is taking up an increasing amount of my time (and server diskspace/bandwidth!).

I already follow most of these rules but will be making more effort with number 8.

www.emailcharter.org.

Leave a Comment : more...

Remote Desktop Optimization for Firefox 4

by Craig Mayhew on May.30, 2011, under General

Firefox 4 has added some eye candy that greys out the webpage when an alert appears. This looks nice but is very slow over a remote desktop connection as it forces the entire window to be sent again to the client.

To fix, just add this to the end of userChrome.css


tabmodalprompt {
background: transparent !important }

The file should be found here: C:\Users\$username\AppData\Roaming\Mozilla\Firefox\Profiles\$letters.default\chrome\userChrome.css

If it doesn’t exist then copy and rename userChrome-example.css to userChrome.css

Leave a Comment :, more...

CUDA Development in Visual Studio 2008

by Craig Mayhew on May.30, 2011, under Code

When I started developing in cuda I had a bit of a nightmare setting up the development environment. This youtube video saved the day. Many thanks to Yuber Núñez for taking the time to make it.

1 Comment :, , more...

Automatically reboot minecraft on crashes

by Craig Mayhew on May.01, 2011, under Code

The latest version of minecraft has been extremely unstable for me, so I’ve written this quick script to automatically check if minecraft is running – and reboot it within 30 seconds if it isn’t. You will need php installed for this script to work.

  1. Install php on the minecraft server.
  2. Save this code to a file named “rebootCheck.php”

    <?php
    //options
    $url = 'localhost';//localhost or an ip address
    $port = 25565;//25565 is minecrafts default port
    $pauseLength = 20;//time between killing minecraft and booting it again
    //end options

    $fp = @pfsockopen($url, $port);
    if (!$fp) {
      echo 'SERVER DOWN! Rebooting it.',"\r\n";
      //kill anything with javaw.exe in the name
      `Taskkill /IM javaw.exe`;
      //take a nap, while minecraft shutsdown
      sleep($pauseLength);
      //boot minecraft
      `C:\Users\user\Desktop\minecraft alpha\Minecraft_Server.exe`;
    } else {
      echo 'SERVER UP :)';
    }
    ?>

  3. Add a scheduled task to run every 5 minutes and run the following command. Notice here that I have put php within the minecraft directory, you may not have php there and may need to adjust the directory accordingly.
    “C:\servers\minecraft alpha\php\php.exe” “C:\servers\minecraft alpha\php\scripts\check.php”
3 Comments :, more...

Generating SSL Certificates for Apache

by Craig Mayhew on Apr.29, 2011, under General/Techie

Generate a key:

openssl genrsa -des3 -out server.key 2048

Generate a certificate signing request (csr):

openssl req -new -key server.key -out server.csr

Country Name (2 letter code) [GB]:GB
State or Province Name (full name) [Berkshire]: Hampshire
Locality Name (eg, city) [Newbury]: Southampton
Organization Name (eg, company) [My Company Ltd]:Your Company Ltd
Organizational Unit Name (eg, section) []:Information Technology
Common Name (eg, your name or your server's hostname) []:www.craigmayhew.com
Email Address []:person@example.com
Please enter the following 'extra' attributes
to be sent with your certificate request
A challenge password []:
An optional company name []:

Remove the password from the key file:

cp server.key server.key.bak
openssl rsa -in server.key -out server.key

Leave a Comment : more...

OpenSim 0.7.1 RC1 and the shiny new media on a prim

by Craig Mayhew on Apr.25, 2011, under General

I’ve installed the release candidate and had a play with the new media on a prim feature. At the moment it’s only supported by the Second Life viewer. So, even though the OpenSim server supports it, none of the open source viewers do. I’m very impressed with it although I quickly hit limitations as you can see in the image.

moap screenshot

You may immediately notice that may avatar refused to render at all in the second life viewer. It does render fine in other viewers so I’m not yet sure what the reason was for this. That aside, the media on a prim feature was limited to 4 prims. Any more than that and they just appeared white. The closer I got to the prims, the less problems I had and clicking on a prim would force it to display at the expense of another previously working prim.

I’m not sure what causes this limitation, it may be hard coded into the second life viewer or may be something that can be modified via settings, but despite looking I haven’t yet been able to get it to display a whole wall of media enabled prims.

More on this soon!

Leave a Comment :, more...

Tiny little universe

by Craig Mayhew on Apr.22, 2011, under General

After my last post about second life, it’s time I got back on track about what I wanted from second life. For me, second life didn’t allow me to design without limits. Mostly because it has an economy, an economy is built on rules and therefore limitations. I wanted a virtual environment that can extend and supplement my reality. I needed my own virtual space where rules are none existent unless I impose them. I needed my own simulation. Enter openSim. openSim is a complete virtual environment much the same as second life where essentially, I can run my own private second life server. I can use as much space as I like, build as big as I like in any way I want to. I’m not limited to a very small quantity of computer resources, I’m only limited by my hardware and how efficiently I use it. Slowly I have begun merging this with other applications that I use in the real world. I intend to blog about these uses I find for the tiny universe I have created and experiments I will run.

Updates soon :)

Leave a Comment : more...

Windows 7 registry file open with association

by Craig Mayhew on Mar.22, 2011, under Guides/Fixes

For anyone that has accidentally clicked on an apllication, clicked “open with” and set it to open with another application by default. Here is how to fix it.

If you are lucky enough to still have a web browser open or some way of transferring files then put this file on your computer and run it. It will remove the default association for exe files.

http://www.craigmayhew.com/blog/wp-content/uploads/2011/03/exe.reg

If you aren’t lucky enough to be able to get this file to your damaged computer then you need to follow the steps in this Microsoft article.

Leave a Comment :, , more...

SSH Port Forwarding

by Craig Mayhew on Mar.16, 2011, under General/Techie

putty ssh port tunnelling for rdp

A very quick reference for anyone that wants to tunnel data via SSH. In this case I am using RDP over SSH.

Leave a Comment :, more...

Visit our friends!

A few highly recommended friends...