Wednesday 11 December 2013

Minecraft Backup for MultiWorld servers

Basic Server Backup

One of the main reasons we built our new Linux server was to be able to run a simple Minecraft server, but as time's gone by we've moved to a more sophisticated configuration. We started out by switching from vanilla Minecraft to (plug-in friendly) CraftBukkit and from there we've experimented with various plug-ins that improved security or added enhancements to the game.

We've always used the linux startup script from the minecraft wiki and this gives us the added benefit of easy world backups without having to shut the service down. Backups are triggered from an entry in the crontab as below.

10 23 * * * /etc/init.d/minecraft backup

Here the backup option is triggered at 23:10 every day and generates the following entries in the minecraft server log.

2013-12-01 23:10:01 [INFO] [Server ] SERVER BACKUP STARTING. Server going readonly...
2013-12-01 23:10:01 [INFO] CONSOLE: Disabled level saving..
2013-12-01 23:10:01 [INFO] CONSOLE: Forcing save..
2013-12-01 23:10:03 [INFO] CONSOLE: Save complete.
2013-12-01 23:10:19 [INFO] CONSOLE: Enabled level saving..
2013-12-01 23:10:19 [INFO] [Server ] SERVER BACKUP ENDED. Server going read-write...  

MultiSite Backup

It wasn't long before we had the Multi-World plug-in installed and a dozen new Worlds linked in. My son built a linking portal with teleports to all of the new worlds and it was great, but it became apparent that these weren't being backed up by the startup script.

Mojang's script covers just the main world which is defined in the #Settings section at the top of the file. (see example below)

#Settings
SERVICE='craftbukkit.jar'
OPTIONS='nogui'
USERNAME='root'
WORLD='Plop'

OTHERWORLDS='creative hungergames spawn griefcity'
MCPATH='/opt/minecraft'
BACKUPPATH='/TimeMachine/DailyBackup/minecraft'
MAXHEAP=2048
MINHEAP=1024
HISTORY=1024
CPU_COUNT=1

I added a new variable called 'OTHERWORLDS' and I populated it with a list of the worlds currently being missed. (Note: these are separated by a space character so make sure the worlds don't include spaces in their names)

Next I altered the backup section of the script to loop through the OTHERWORLDS list and add each world directory to the backup tar file. (see script below)

mc_backup() {
mc_saveoff
NOW=`date "+%Y-%m-%d_%Hh%M"`
BACKUP_FILE="$BACKUPPATH/${WORLD}_${NOW}.tar"
echo "Backing up minecraft world…"
#as_user "cd $MCPATH && cp -r $WORLD $BACKUPPATH/${WORLD}_`date "+%Y.%m.%d_%H.%M"`" as_user "tar -C \"$MCPATH\" -cf \"$BACKUP_FILE\" $WORLD"

  for i in $OTHERWORLDS
  do
    as_user "tar -C \"$MCPATH\" -rf \"$BACKUP_FILE\" $i"
  done

echo "Backing up $SERVICE"
as_user "tar -C \"$MCPATH\" -rf \"$BACKUP_FILE\" $SERVICE"
#as_user "cp \"$MCPATH/$SERVICE\" \"$BACKUPPATH/minecraft_server_${NOW}.jar\""

mc_saveon

echo "Compressing backup..."
as_user "gzip -f \"$BACKUP_FILE\""
echo "Done."
}

Now when the backup runs the main world is backed up to a daily tar file and then the other worlds are added to it. (It will create a TAR file named after your main world and a timestamp)

Possible Updates

The only real problem with this script is that is doesn't cater for world names containing spaces. This was initially an issue that I struggled to fix, and in the end I took the easy option and altered the world name to remove the offending character.

But as is often the case the script is good enough, so I have no plans to fix it.

Update

An improved method can be found here http://theperfectbeast.blogspot.co.uk/p/linux-minecraft-server-script.html

Thursday 24 October 2013

BlueStacks Android Emulator

Android Emulation

My new TV has an android and iOS App as an alternative to the old fashioned remote control. I sometimes use this on my iphone or ipad, but because the App can also be used to stream what's on the TV, I want to run it on my Laptop too.

When I started looking into this I discovered you could run an Android disk image in a VM such as VirtualBox. But I carried on looking for a hassle free way and eventually found an emulator called BlueStacks App Player. The best thing is that it's available for both Windows (XP, Vista, Win7/8) and Mac OSX (which is still in Beta right now) and it's FREE.

Installing BlueStacks

After downloading the install went easily, but it took some time to start up. So go and make yourself a cup of tea or something, you've got something like a 5 minute wait.
BlueStacks Loading Screen - Takes A While

Once initialised you come to a My App screen where you'll see there's a few popular apps preloaded. But click on the Top Charts icon to start adding new ones.

If you're running a laptop with a standard trackpad then you can scroll up and down through the lists quite easily, but you might have problems if you use a mouse. I struggled a bit with my aging Mighty Mouse because the little scroll ball doesn't work very well anymore.

(I couldn't find any other way of page scrolling)


The Charts Screen - Lets Add Some Apps

Click on the search icon (the blue magnifying glass) you'll find all of the apps that you could ever want (and loads more besides). Sadly my TV app refused to install but I did find that most of the popular games I tried worked fine.

As soon as you make a selection BlueStacks will take you through the login or registration process. I then turned off the automatic account syncing because I don't have any other Android devices (although it listed my old phone in the Google account details as a registered device).


Angry Birds - The Defacto Test

Generally it works great (even if my TV app was a no-go) so I went on to install it on the kid's Mac Mini. I left them playing "Cut The Rope" as most things run ok with a mouse, and then half an hour later I noticed they'd installed and were playing other games.

It's that easy to use, it's kid's play!

I hope this has been some use to those who want to run a android apps on their laptop or desktop computer. It's easy to do and completely free, so don't waste any more time, lets get those green piggies.

Monday 14 October 2013

Minecraft Server Log Web Interface

Introduction

If you run a Minecraft server in Linux then you'll probably like to keep track of what's going on in the server log. I found that it was a real pain having to remote shell into the server all the time and if it was available via a web browser I could keep track of it more conveniently, or by using my phone or tablet.

I decided that I would use PHP (even though PERL is generally my scripting weapon of choice) and once I'd found the correct commands and syntax it came together quite quickly. If you fancy giving it a try you just need a web server (such as Apache) and of course PHP running on your server.

How it works

It started out being a simple process of opening the server.log file and outputting each line as pre-formatted html.

Something like this..

<html>
<head><title>Minecraft Log</title></head>
<body><pre>
<?php
$filepath = "/opt/minecraft/server.log";
$file = file($filepath);
foreach($file as $line) {
    echo $line."<br/>\n";
}
?>
</pre></body>
</html>

This was great at first, but after we'd been running for a few weeks the server.log file gets too big and the web page gets slower and slower to load. What we needed was a way of only showing the current days log entries, and maybe a date selector so you can reference older stuff.

So I created version two with the following enhancements:-
  • Default to showing today's log entries.
  • A date selector is added to the top of the web page which sends the new value if altered.
  • If page requested with a date parameter then use this instead of today's date.
  • If no date has been passed then run a javascript function to scroll the log section to the bottom.
There's a nice feature in the log where text is coloured. This would typically be for chat or system warnings, but as it stood they left messy control codes littered about the log. Rather than remove these I decided to replace them and style the text to match these colours.

This enhancement required the following:-
  • Create a series of regular expression replaces to match the control codes.
  • Each colour code instance is replaced by a span tag which corresponds to a set of pre-defined styles (the css for these is defined in the head section).
  • Put log into a scrollable div.
Here's the completed code..

<!DOCTYPE html>
<html>
<head>
<title>Minecraft Log</title>
<style>
    #log{
        height:400px;
        overflow-y: scroll;
        margin: 5px 0 0 1px;
        border: 1px solid;
    }
    .green{color: green;}
    .red{color: red;}
    .purple{color: purple;}
    .black{color: black;}
    .blue{color: darkblue;}
    .gold{color: gold;}
    .cyan{color: darkcyan;}
    .aqua{color: cadetblue;}
    .gray{color: #888;}
    .bold{ font-weight:bold;}
</style>
<script>
    function scroll(){
    //scroll div to bottom
    var objDiv = document.getElementById("log");
    objDiv.scrollTop = objDiv.scrollHeight;
    }
</script>
</head>
<?php
$pass = htmlspecialchars($_POST["date"]);
if (!$pass){
    echo "<body onLoad='scroll()'>";
}
else {
    echo "<body>";
}

$filepath = "/opt/minecraft/server.log";
$file = file($filepath);
$dates = array();
$last = "";


/* Get List Of Dates */
foreach($file as $line) {
    $date = substr($line, 0, 10);
    if ($date != $last){
        if(preg_match('/\d{4}\-\d{2}\-\d{2}/',$date)) {
            array_push($dates, substr($line, 0, 10));
            $last = $date;
        }
    }
}

/* If Date Provided Use This */
if(preg_match('/\d{4}\-\d{2}\-\d{2}/',$pass)) {
    $last = $pass;
}

/* Add Form Element and Date Selector */
echo "<form method='post'>Select date: <select name='date' onchange='this.form.submit()'>\n";
foreach($dates as $value){
    $select = "";
    if ($value == $last){ $select = " selected='selected'"; }
    echo "<option value='".$value."'".$select.">".$value."</option>\n";
}
echo "</select></form>\n";

/* Output Log For Required Date */
echo "<div id='log'>";
foreach($file as $line) {
    /* Remap Problem Characters */
    $line = preg_replace("/</","&lt;",$line);
    $line = preg_replace("/>/","</span>&gt;",$line);
    $date = substr($line, 0, 10);
    if ($date == $last) {
        /* Remove Unrequired Formatting Codes */
        $line = str_replace("[m","",$line);
        $line = str_replace("[21m","",$line);
        $line = str_replace("[3m","",$line);
        /* Split Log Line Into Sections to Using First Formatting Code Style */
        $segarray = preg_split( '/(\[0|\[m)/', $line );
        for ($i = 1; $i < count($segarray); ++$i){
            /* Do Replace to Add Styled Spans */
            if (preg_match('/;\d{2};\d+m/', $segarray[$i])) {
                $segarray[$i] = preg_replace("/;30/","<span class='black",$segarray[$i]);
                $segarray[$i] = preg_replace("/;31/","<span class='red",$segarray[$i]);
                $segarray[$i] = preg_replace("/;32/","<span class='green",$segarray[$i]);
                $segarray[$i] = preg_replace("/;33/","<span class='gold",$segarray[$i]);
                $segarray[$i] = preg_replace("/;34/","<span class='blue",$segarray[$i]);
            $segarray[$i] = preg_replace("/;35/","<span class='purple",$segarray[$i]);
                $segarray[$i] = preg_replace("/;36/","<span class='aqua",$segarray[$i]);
                $segarray[$i] = preg_replace("/;37/","<span class='gray",$segarray[$i]);
                $segarray[$i] = preg_replace("/;22m/","'>",$segarray[$i]);
                $segarray[$i] = preg_replace("/;1m/"," bold'>",$segarray[$i]);
                $segarray[$i] = $segarray[$i]."</span>";
            }
        }
        /* Rejoin Then Split Log Line Using Second Formatting Code Style */
        $line = join("",$segarray);
        $segarray = preg_split( '/§/', $line );
        for ($i = 1; $i < count($segarray); ++$i){
            /* Do Replace to Add Styled Spans */
            $segarray[$i] = preg_replace("/^0/","<span class='black'>",$segarray[$i]);
            $segarray[$i] = preg_replace("/^1/","<span class='blue'>",$segarray[$i]);
            $segarray[$i] = preg_replace("/^2/","<span class='green'>",$segarray[$i]);
            $segarray[$i] = preg_replace("/^3/","<span class='aqua'>",$segarray[$i]);
            $segarray[$i] = preg_replace("/^4/","<span class='red'>",$segarray[$i]);
            $segarray[$i] = preg_replace("/^5/","<span class='purple'>",$segarray[$i]);
            $segarray[$i] = preg_replace("/^6/","<span class='gold'>",$segarray[$i]);
            $segarray[$i] = preg_replace("/^7/","<span class='gray'>",$segarray[$i]);
            $segarray[$i] = preg_replace("/^8/","<span class='gray'>",$segarray[$i]);
            $segarray[$i] = preg_replace("/^9/","<span class='blue'>",$segarray[$i]);
            $segarray[$i] = preg_replace("/^a/","<span class='green'>",$segarray[$i]);
            $segarray[$i] = preg_replace("/^b/","<span class='aqua'>",$segarray[$i]);
            $segarray[$i] = preg_replace("/^c/","<span class='red'>",$segarray[$i]);
            $segarray[$i] = preg_replace("/^d/","<span class='purple'>",$segarray[$i]);
            $segarray[$i] = preg_replace("/^e/","<span class='gold'>",$segarray[$i]);
            $segarray[$i] = preg_replace("/^f/","<span class='black'>",$segarray[$i]);
            $segarray[$i] = preg_replace("/^r/","<span class='black'>",$segarray[$i]);
            $segarray[$i] = $segarray[$i]."</span>";
        }
        /* Rejoin and Output to Webpage */
        $line = join("",$segarray);
        echo $line."<br/>\n";
    }
}

echo "</div>";
?>
</body>
</html>

nb. Notice the log must now be read twice!

Installation Instructions

Copy the code into a file called index.php and drop it into a directory accessible to your web server and ensure you grant the file execution rights.

Alter the $filepath = "/opt/minecraft/server.log"; line so that it points to your server log and ensure the web server has read rights to this file.

How to Use

Just open the PHP code in your browser and the a page should open showing today's log entries, scrolled to the bottom of the log.

If you then select an earlier date the page will refresh and show this dates entries without the auto-scrolling.

Friday 4 October 2013

OSX Time Machine kills old disks

Round 1

Earlier this year I decided to replace the disk in my Macbook Pro with an SSD. The HDD was only a year old but I was already having problems that required frequent fixing in DiskUtility. Also those odd clicking noises it was making were making me feel nervous.

I decided to backup asap (once I'd fixed the disk again) and set about manually copying my data to an external disk in the finder window. After is kept failing on a bad block I decided to try and update my Time Machine backup instead. It ran for a while and then the machine froze, forcing me to reboot the machine. I then found that the disk was corrupted and Diskutility could see it but refused to touch it.

I bought a copy of Stellar Phoenix Mac Recovery because the demo version showed all my files listed, but after recovering about 200Gb they all proved unusable. Other attempts have proved equally unsuccessful with days of processing not finding any files what-so-ever. My experience of buying recovery software has proven to be a huge waste of money! (I found similar trying to recover ReiserFS partitions)

So I ran fsck (details here) to see if it would fix it..

admin$ fsck /dev/disk1s2 -f

BAD SUPER BLOCK: MAGIC NUMBER WRONG

LOOK FOR ALTERNATIVE SUPERBLOCKS? [yn] y


CANNOT READ: BLK 16585216

CONTINUE? [yn] y

THE FOLLOWING DISK SECTORS COULD NOT BE READ: 16585216, 16585217, 16585218, 16585219, 16585220, 16585221, 16585222, 16585223,

CANNOT READ: BLK 567944160

CONTINUE? [yn] y

THE FOLLOWING DISK SECTORS COULD NOT BE READ: 567944168, 567944169, 567944170, 567944171, 567944172, 567944173, 567944174, 567944175,

SEARCH FOR ALTERNATE SUPER-BLOCK FAILED. YOU MUST USE THE
-b OPTION TO FSCK TO SPECIFY THE LOCATION OF AN ALTERNATE
SUPER-BLOCK TO SUPPLY NEEDED INFORMATION; SEE fsck(8).

So that didn't work then! (I haven't got a clue where I'd find an alternative super-block.)

Round 2

This last weekend I bought a new USB portable disk unit to use as a new Time Machine volume. My wife's Macbook hadn't been backed up since earlier this year so I decided that was the first machine to try it out on.

I hooked up the drive, kicked off Time Machine and left it running. I noticed after about an hour that it was stuck at 48% so I attempted to kill it and start again, but the Macbook refused to respond. In the end I rebooted the machine but wasn't able to get past a blank grey startup screen. I booted from a startup CD can ran DiskUtility but it refused to see the internal disk.

In the end I replaced the HDD (which was 4½ years old) and recovered from her old Time Machine backup. So that's another internal disk that Time Machine pushed over the edge, and this time it refused to show as a drive.

I'm definitely reaching the conclusion that you shouldn't use Time Machine if you have any doubts over the integrity of your hard disk. Make sure you backup regularly and you'll not lose much.

You do backup don't you?

Update (10th Oct)

I've found that Disk Warrior 4.4 can cope with a faulty disk and will mount this disk in read-only mode so that you can copy off your files. It wasn't without it's problems though, the failing disk causing disk copies to occasionally hang on certain files.

Monday 19 August 2013

PermissionsEx: Anti-griefing methods for Minecraft

More Grief

If you've already installed and configured Grey Lists using PermissionsEx (as described in my earlier post) then you are well aware of the protection this provides against those pesky griefers. Yeah I know you can white-list your server but this helps you want to showcase your work without risk.

My son can be a little too trusting, and far too keen to attract new builders, and it always seems to be when we have friends of friends connected that trouble starts brewing. A few days ago the inevitable happened, a school pal and his friend paired up for an orgy of TNT abuse, dropping as many buildings as they could in full view of the regular builders. The server was downed soon as he figured out what was happening and the permissions.yml file altered to remove the offenders building rights, but ultimately damage had been done. One of the longest standing buildings was hit so hard that it was reduced to a crater, all in about a minutes chaos!

PermissionsEx Revisited

All the griefing we've experienced so far has been the result of fire or TNT, with the latter obliterating buildings well beyond repair. It made sense after this attack to limit their use, removing them from the standard 'builder' groups rights, but after well over an hour of altering permissions and testing we had only managed to remove the rights to place TNT. It's really a case of trying different modifyworld  restriction in the permissions.yml file until you get a result.

The first thing to be aware of is the order of the permission lines is important. The file is scanned top to bottom and as soon as a match is found it stops. This means restrictions must go before grants using wildcards or they'll never be reached.

Builder:
      prefix: '&0(&8Builder&0)&7 '
      permissions:
      - -modifyworld.blocks.place.46
      - -modifyworld.bucket.empty.10
      - -modifyworld.bucket.fill.10
      - -modifyworld.items.pickup.259
      - -modifyworld.items.craft.259
      - -modifyworld.items.use.259.on.block.*
      - -modifyworld.items.use.259
      - modifyworld.*
      options:
          rank: '900'

nb. Our restrictions go before modifyworld.* and use the '-' minus symbol to differentiate them from grants. The objects are listed by item/block id (46 = tnt, 10 = lava, 259 = flint and steel)

Now when TNT (46) is placed by a builder the block gets picked straight back up again, similarly the restrictions on flint and steel (259) don't allow you to pick it up or use it. The lava bucket (327) lines need to restrict filling and emptying of a liquid, in this case lava.

You will also need to enable some options in the modifyworld.yml before this works.

item-restrictions: true
use-material-names: false
drop-restricted-item: true
item-use-check: true

I set use-material-names to false so that I could use item and block numbers, but you can leave this set to 'true' and use proper names. Then your restriction would read as per the example below:-

   - -modifyworld.blocks.place.TNT

Don't mix the two up or your permissions won't work. Also be aware that the plugins are very sensitive to formatting errors, so check your server log after changing and if necessary run your config through a YAML file validator.

In the mean time I'll work on the fire problem & if anyone has any suggestions then please comment.

Tuesday 6 August 2013

Automatic for the People - Part 2

Down in the Dumps

I run a few systems that use databases and these (I'd assumed) were being backed up using my weekly backup script. But just copying the system files while the database was running proved to be a great way of losing the last few records should you need to restore. And I'd invariably be forced to run myisamchk on the recovered database before mySQL was happy.

After this happened a few times I started dumping my databases on a daily basis. A dump is not something nasty, but a flat file containing the database structure and contents in an SQL format.


- Example for mySQL
For each database you have add a line as follows to your backup script:-

mysqldump wiki --password=iliketurtles --add-drop-table > /var/backups/wiki.sql

Here I'm dumping my wiki database and it assumes I have an admin user for mySQL called root with a password as 'iliketurtles'. For convenience we'll make it add drop table commands, and recovery would be as simple as:-

   pingu:=# mysql -u root -p wiki < wiki.sql

NB. You would need to ensure is that a database called wiki exists or it will thrown an error, but an empty one will do.

- Example for PostgreSQL
For each database add a line as follows to your backup script:-

pg-dump -Fc davical > /var/backups/davical.pgdump

This also assumes you have a superuser called root in Postgresql.

NB. Again the database must exist before you can recover, then you would just enter the following command:-

   pingu:=# pg_restore -d davical davical.pgdump

So two very different databases engines taken care of. Just duplicate these commands for all the databases you want to backup.

Daily Increments

The weekly backup I described last time has served me well for many years, and the few times that I've needed to recover anything have been a success. But more recently my friend Grunders (who'd been storing open office files in his home directory over a VPN) lost his files when the hard disk failed. I offered him the backup from the weekend but he said it was no good because he'd made too many changes.

Luck was with him though, that old trick of turning off the computer and powering back on brought the drive back to life long enough to retrieve his missing files. However we went on to convinced ourselves that we needed a daily incremental backup. My Initially attempt at doing this simply failed as I'd tied myself in bash script syntax knots. But a few days later Grunders came to the rescue with the following code:-

SOURCE=/home/
TARGET=$(date +%Y.%m.%d-%H%M)
RUNTIME=$(date +%Y%m%d%H%M)

cd "$SOURCE"
IFS="
"
LIST=`ls`
for i in $LIST
do
  DirUser=$(echo "$i")
  echo $DirUser
  cd /home/$DirUser
  find * \( ! -regex '.*/\..*' \) -newer /root/REFTIME -print0 | xargs -0 tar --no-recursion -cpf /DailyBackup/$DirUser/$TARGET.tar &gt;&gt; /root/dailyincbackup.log
  if [ -e /TimeMachine/DailyBackup/$DirUser/$TARGET.tar ]
  then
    mkdir /TimeMachine/DailyBackup/$DirUser/$TARGET
    tar -xvf /DailyBackup/$DirUser/$TARGET.tar -C /TimeMachine/DailyBackup/$DirUser/$TARGET
    rm /DailyBackup/$DirUser/$TARGET.tar
  fi
done
touch -t $RUNTIME /root/REFTIME

It's actually a little bit odd as the script is using find to locate files that have changed since the date held in /root/REFTIME and create a tar file of the changes. (The regex part removes hidden files, such as those that Apple Mac's add) Then to avoid tar files he's untarred the resulting file and deleted it. Obviously this is not ideal, but there is an alternative way that uses a cp command:-

find . \( ! -regex '.*/\..*' \) -newer /root/REFTIME -exec cp -Ra {} /DailyBackup/$DirUser/$TARGET \;

The receiving directory must exist for this to work, and it may leave empty directories if no changes where detected, so I'll leave the script as it is for now.

Thanks G, all it needs now is something to purge old files.

Sunday 4 August 2013

Minecraft Grey Lists

Anti-Griefing

A few weeks ago my son's Minecraft world became trashed (buildings completely obliterated) by friends of a friend who visited our server. Thankfully we had a backup to restore from and then to ensure it didn't happen again we turned on white lists in the server.properties file.

But the story doesn't end here... a few days ago number one son asked me if I knew anything about grey lists, informing me roughly what they're supposed to do. Apparently if you set up a grey list then it enables anyone to join the server but they're restricted from building. This was new to me and seems ideal, meaning he'd be able to pass about the server connection details freely without worrying about being griefed again.

Grey Lists

The vanilla server only supports black lists (to ban people) or white lists (to only allow access to those listed). There's no setting in the properties file to enable grey lists, so I googled until I found that a plugin called PermissionsEx. This enables you to define access groups with appropriate rights, and assign users to them.

But you can't add plugins to the vanilla version of Minecraft server,.. there's no plugin directory, instead you have to use the CraftBukkit server instead. (Click here for download page)

While I'm at it, here's the link for the PermissionsEx plugin. (Click here for download page)

Installing Bukkit & PermissionsEx

Here's the steps we went through:
  1. Edit your server.properties file and disable white-lists if you where using them.
  2. Download the craftbukkit jar file and copy it into your minecraft server directory.
  3. Run the craftbukkit server program to create the extra files and folders (it also converts your world files).
  4. Download the PermissionEx jar files and copy these into the newly created plugin directory.
  5. Restart the server again and a PermissionEx sub-directory will be created.
  6. Change to this directory but leave config.yml alone.
  7. Edit the permissions.yml file and replace the contents with the following lines, then add your users into the end section (in line with the examples).
groups:
    default:
        default: true
        options:
            rank: '1000'
        permissions:
        - modifyworld.chat
    Builder:
        prefix: '&0(&8Builder&0)&7 '
        permissions:
        - modifyworld.*
        options:
            rank: '900'
    Moderator:
        prefix: '&0(&1Moderator&0)&7 '
        permissions:
        - -modifyworld.mobtarget.*
        - modifyworld.*
        options:
            rank: '100'
    Admin:
        prefix: '&0(&4Admins&0)&7 '
        permissions:
        - -modifyworld.mobtarget.*
        - modifyworld.*
        - permissions.*
        options:
            rank: '1'
users:
    SomePlayerName:
        group:
        - Builder
    YourPlayerName:
        group:
        - Admin

NB. Ensure you don't add any spaces before 'groups' or 'users' or the file will be ignored.

We found that if your name is in the ops.txt file then you automatically get admin level.

Follow this link for further details on configuration and how to type /pex commands when in the game.

Finally I updated the /etc/init.d/minecraft startup script to use the CraftBukkit jar file.

Thursday 1 August 2013

Automatic for the People - Part 1

DYBB

Many, many years ago I took over a Support Manager role at a snack factory and I inherited my predecessor's office. Chris (who I'd met a few years before when I'd worked there in my summer holidays) now worked at head office, but was around a few days a week to help me learn the systems. He'd left me a lot of his old stuff and there was an A4 (approx US letter size) page stuck to the wall above the HP Deskjet 500 printer that just had the letters 'DYBB' filling the page. I pondered for a while what this should mean (I was sure it was nothing to do with boy scouts and "Doing Your Best") and eventually I just asked him.

Chris smiled and replied, "That what I tell all my users... Do Your Bloody Backups!"

Of course this was back in the days of 386 and 486 computers running DOS, and hardly anyone stored files on the Novell file server. Therefore there was a portable Colorado Trakker tape backup unit that the finance departments looked after, and it was up to the few PC owners to run weekly backups to QIC tapes. Some did, some didn't, and many just relied on floppy disks.

Technology has a way of picking the least opportune moment to catch us out (see my previous blog entry). Over the last ten years of running a home server I've learnt that if you're passionate about keeping your data, then backups need to be automatic.


Keeping it Simple

I took the decision many years ago that I'd just perform a backup once a week for my /data, /etc, /var and /home directories. I have a 2Tb backup disk formatted with a 50Gb partition, with another partition for the remainder. There are no entries in the fstab file so it's not mounted automatically, and it uses standard EXT3 formatting.

1 - Backup of data is just a straight copy of new and updated files onto the bigger backup partition. The disk is temporarily mounted to /mnt and then a simple copy refreshes the files and directories within it. It does have a few disadvantages but I love the simplicity of it, and so far it's served me well.

Here's the bit of script that does this:-

Drive="/dev/sda2"
mount -t ext3 $Drive /mnt
# CHECK MOUNTED OK
OK=`df | awk '/[ \/]mnt/ {print $1}'`
if [ "$OK" = "$Drive" ]; then
  cp -Rvu /data /mnt
  umount /mnt
  sleep 120
  hdparm -y /dev/sda
fi

It's using df and awk to check to ensure the drive gets mounted OK before continuing, then cp to copy the data. At the end it unmounts the drive and uses hdparm to put it to sleep.

2 - The Etc, Var and Home directories contain files where I wanted to keep a few versions because file updates are common. So here I mount the smaller backup partition and implement a Grandfather, Father, Son approach to the problem. Son is a directory containing a full copy of the files, which then gets GZ Tarred the next week to become the 'father', and later 'grandfather' file. I hate untarring files so it means if needed I can retrieve recently versions of files conveniently from the /son directory. In practice I've hardly ever had to resort to plundering the older tar files.

Here's the bit of script that does this:-

Drive="/dev/sda2"
# CHECK MOUNTED OK
OK=`df | awk '/[ \/]mnt/ {print $1}'`
if [ "$OK" = "$Drive" ]; then
  # if exist father, rename to grandfather
  cd /mnt/
  if [ father.tar.gz ] ; then
    mv father.tar.gz grandfather.tar.gz
  fi

  # if exist /son then tar to father.tar.gz

  if [ son ] ; then
    tar -zcf father.tar.gz son/*
    rm son -R

  fi


  mkdir son

  cd son
  mkdir etc
  mkdir var
  mkdir home
  mkdir root

  cp /etc/* /mnt/son/etc/ -a

  cp /var/* /mnt/son/var/ -a
  cp /home/* /mnt/son/home/ -a
  cp /root/* /mnt/son/root/ -a

  # Unmount drive

  cd /
  umount /mnt
  sleep 120
  hdparm -y /dev/sda

fi

Again it's using df and awk to ensure the drive gets mounted, then performs the grandfather, father, son backup as described above. Finally it unmounts the drive and puts it to sleep.

I've completely ignored database backups and incremental backups for now, I'll continue with that next time.

Wednesday 31 July 2013

Recovery Time

Happy Returns

After a week at the seaside I returned home and immediately had computer problems. My trusty laptop who's hard drive I'd suspected being on the verge of failing, finally let go. I was in the process of trying to backup my data at the time when it repeatedly failed at the same file. So I ran a disk repair... diskutility reported a B Tree error, recommended I backed up my data, and then seemed unable to remount the disk. GREAT, how was I supposed to do that now?

I have a new disk on order, a Sandisk 480Gb Extreme SSD which has a read speed of 540MB/s and a write of 460Mb/s. That's nearly as fast as the mSATA card I installed in the new server. I'm looking forward to having faster access, longer battery life and hopefully better stability.

Not So Stellar

In the mean time I downloaded and installed Stellar Phoenix Mac Data Recovery. Initially it was just the free version, but when you see your apparently fine files listed you feel the impulse to grab your credit card and purchase a full license. So, I left it churning away for 24 hours, happily pulling hundreds of Gb of files off the damaged disk. Sadly when I tested them yesterday they all turned out to be garbage.

I've powered down the machine and restarted the attempt, but after 12 hours it's still reading the disk with not a file in sight. Yikes, this might be harder than I'd thought!

I'll just have to swap the disk out, stick it into a caddy and work on it later. I need the laptop working again, apart from everything else I use it to type blogs with!! I can't cope with just an ipad because I still use an ipod nano for audio books and podcasts, and I really need a proper keyboard and decent processing power for photo editing.

Tuesday 16 July 2013

Going Live

The State of Things

My four wire case fan arrived last week featuring low speed operation, rubberised frame and unique corrigated design blades. Originally I'd ordered the three wire version by mistake, but this was unsuitable if you want the system board to be able control the fan speed. Then towards the end of the week I worked out how to transfer my databases over for Davical and Mediawiki. I'd already transferred my other mySQL databases by copying the files from /var/lib/mysql, but the Wiki failed to work and Davical uses PostgreSQL. I knew next to nothing about PostgreSQL so it was a slog to work out how the security worked, how data might be transfered, and how to fix the annoying missing PHP library problems along the way. Nothing works without a battle and this was a fresh install, so it should have been easy?! Go-live was now or never, the other apps could wait, and I didn't want to go through the hassle of transferring data again.

On the hardware side, the new fan (an 80mm 'be quiet!' SHADOW WINGS SW1)
required its mounting plugs to be modified, as the plastic locking pins wouldn't go through the threaded mounting bracket. It would have been flimsy anyway, so I discarded the pins, shortened two of the mounting plugs and used a couple of long bolts and washers to secure it. The fan was then plugged into the system fan header on the motherboard and the computer started. It was immediately obvious that the fan was running very slowly, the BIOS reporting just 500 rpm.

Fan mounted using modified only the lower pegs.

Nb, always test things before you modify them, that way if it's DOA you can get it replaced!

That should be just enough to keep a small amount of air moving through the case, and if temperatures heat up, then the fan should speed up to a maximum of 2000 rpm, at a whisper quiet 16.6dB sound level.

Out With The Old

Going live essentially means moving the data and backup disks over to the new server. But before doing this I was keen to compare power usage and disk speeds, (before and after) ultimately reassuring myself that spending all that money was worthwhile.

With all drives running on the old Via C7 based machine the system was shown to draw a steady 32 watts. This dropped to 24 watts after the drives were removed, leaving just the IDE SSD and case fan as additional loads. That's higher than expected for an eleven watt system board, even allowing for power supply inefficiencies.

I used a utility called hdparm to measure the drive speeds. This is a general purpose drive tweaking tool that can perform a multitude of tasks such as optimising speeds and changing time-out parameters. The following command produces two performance measurements:

   pingu:=# hdparm -Tt /dev/sdx (where x is the drive letter to be measured)

DriveCached ReadsBuffered Reads
IDE SSD225Mb/sec28.4Mb/sec
Samsung Momentus HN-M101MBB 2½" sata disk (via IDE to SATA adapter)225Mb/sec29.5Mb/sec
Samsung Momentus ST1000LM024 2½" sata disk (sata port)233Mb/sec30.1Mb/sec
Western Digital Caviar Green 3½" sata disk (sata port)234Mb/sec111.5Mb/sec

It's interesting that the SSD wasn't out-performing the other drives in this test, though in practice it had certainly yielded a performance boost when I'd first installed it. I know they wear out, but I'm sure they don't go slower!

For Shiela.

In With The New

The disks where installed in the new Intel i3 based machine and mount points added to the fstab. These I added using their Block ID rather than their device name, which is a unique drive identifier rather than one that's tied to the port being used. You can find out which disks are connected by typing the following command:

   pingu:=# blkid

The address numbers are a little bit too long to write down and type in manually, so I piped the output of this file into my fstab and edited the result to the correct format.

   pingu:=# blkid >> /etc/fstab

This task completed, I re-tested the disks for speed.

DriveCached ReadsBuffered Reads
Intel 525 60Gb mSATA card6470Mb/sec247Mb/sec
Samsung Momentus HN-M101MBB 2½" sata disk6500Mb/sec103Mb/sec
Samsung Momentus ST1000LM024 2½" sata disk6590Mb/sec100Mb/sec
Western Digital Caviar Green 3½" sata disk (in SATA2 port)6500Mb/sec119.5Mb/sec

There's quite obviously a performance boost but it's surprising that the 3½ inch desktop drive connected to a faster sata2 port wasn't any quicker on buffered reads. To be fair this disk is designed for efficiency and low power with only a 5,400 rpm platter.

Two laptop drives on top and a desktop drive under the mounting plate.

With all disks running the power drawn was just 23 watts, a nine watt saving over the previous machine. That's like turning off a compact fluorescent light bulb that's been burning for the last four years.

Tuesday 9 July 2013

Power Corrupts

Pleased to Meter

My plug-in electricity usage meter arrived from Maplin (N67FU). It cost just just a tenner and gives me the ability to see if my careful purchasing has actually delivered me an efficient server. You plug it into a mains outlet, and then the device to be measured connects to the three pin 13 amp socket in the front. It has a maximum power rating of just over 3Kw so it should be enough for an Intel i3 (laffs), and the flat-ish design means wall-warts shouldn't be a problem.



It works really well, and it's cheap as chips, but the niggle I've had with it is reading the LCD screen. Parts of the display are really tiny and my eyes aren't what they used to be. Plus mains power sockets tend to be in low, poorly lit places, making reading harder still. The only real issue has been the mode indicator, which is the smallest bit and block inverse. (Who dreamed that up?.. I can understand from a design point of view how you'd want to differentiate that a little, but they might as have well used Egyptian Hieroglyphs!)

Meter mode indicator shown top right.
Thankfully the screen layout changes enough so that you can work out which mode you're in, and it's mostly about that big number in the top left so I can get by without needing a flashlight and my reading glasses.

Measuring Up

The existing Pingu had to be shut down to install a replacement /home and /data drive. I use 2.5" laptop drives these days to keep check on the noise and heat, and this disk was the first one I'd bought after switching to the policy four years ago. Last week it started to fail big time, throwing numerous errors, making loose rattling noises and finally showing files with zero bytes size. I won't bore you with the gory details because I have regular backups, but it gave me the chance to plug in the power meter and see how much juice my trusty old server has been using all these years.

The Via system board is rated at 11 watts, there's an SSD, two laptop drives and a 2Tb desktop drive for my auto-backups, which is normally asleep. So after allowing for a power supply efficiency of 80%, I'd estimated about 25 watts in total, but found it actually used just under 27w. I'm pretty sure it's the disks that are dragging it up so high, but until I unplug them it's just an educated guess. But having the electricity meter means I can be a little more pragmatic about future disk purchases. Maybe one day SSD's will be big enough and cheap enough to fulfil my data storage requirements.

Next to be benchmarked was the new Intel i3 based machine. The bulk of the software, two database servers (Postgresql and mySQL), as well as Apache2 had already been installed but not configured. And as I blogged last time, Minecraft Server was ready to go. Turning on the machine it peaked for a few seconds at 20 watts and then dropped to a very reasonable 14.5 watts. It pretty much stayed at that value until I started the Minecraft service and then it went up by about ½ a watt. I measured CPU temperature by installing LM-Sensors and CPU utilisation was monitored using the Top utility.

With one player joining the game the power rose to about 15.5 watts and (by pressing 1 while running top) I was able to see that all four of the CPU cores had started to register light utilisation. (So I stand corrected, Minecraft Server does use multiple cores - thanks to Dr Vesuvius for that heads-up).

top - 18:47:19 up 1 day, 22:48,  1 user,  load average: 0.18, 0.12, 0.08
Tasks: 106 total,   2 running, 104 sleeping,   0 stopped,   0 zombie
%Cpu0  :  5.6 us,  0.7 sy,  0.0 ni, 93.4 id,  0.3 wa,  0.0 hi,  0.0 si,  0.0 st
%Cpu1  : 18.6 us,  1.0 sy,  0.0 ni, 80.4 id,  0.0 wa,  0.0 hi,  0.0 si,  0.0 st
%Cpu2  :  3.3 us,  0.0 sy,  0.0 ni, 96.7 id,  0.0 wa,  0.0 hi,  0.0 si,  0.0 st
%Cpu3  :  6.4 us,  0.3 sy,  0.0 ni, 93.3 id,  0.0 wa,  0.0 hi,  0.0 si,  0.0 st
KiB Mem:   8127440 total,  1199480 used,  6927960 free,    19984 buffers
KiB Swap:  3090420 total,        0 used,  3090420 free,   862192 cached

Some of this could be the other services running but without the Minecraft Server there's very little utilisation on the other cores.

With the case lid removed the CPU temperature drifted up to around 45 degrees centigrade and the fan still turned at it's original lazy rate. I gotta admit, that's better than I expected.

Sunday 7 July 2013

Coup de Grace

Digging in the Wrong Direction

Sometimes when you take a step into the unknown you fall into a hole. But when you start digging your way out, make sure you're not digging downwards! I'm starting to feel this way about the new server project. There's been new stuff to learn and as ever, the devil's in the detail.


I took the decision earlier this week to order a new mSata card, altering my return request from 'replacement' to 'money back'. The idea being to get alternative hardware much quicker, and once the returned item had been processed I'd be back in pocket in a week or so. Sure enough the order for the replacement card arrived the next day (another thumbs up for eBuyers free five day postage) and I called eBuyer's tech support to get a returns number, then printed off the postage label they'd emailed.

After seeing the newly delivered jiffy envelope my son was keen for us to try the server again that evening. We got the younger two off to bed, I set the server back up, whipped the lid off and fastened in the new card. To keep things simple I decided to just try a plain disk format rather than doing a partition copy. I ran fdisk, creating two partitions, and then entered the following command to format as the basic Ext2 linux format.

   pingu:=# mke2fs /dev/sda1

I'm using Ext2 because I want to limit writes to the SSD as writing to them wears them out. (No seriously it does!) Similarly I'll specify noatime in the fstab so that file last access times are not saved, further reducing disk writes.

The format command started OK, then I felt that awful deja vu as it crashed again with the same "Buffer I/O error on device" error, followed by a segmentation failure. There seemed little point in sending the original mSata card back now, clearly the problem lies elsewhere!

Search and Ye Shall Find

I did a bit of googling using search terms 'DQ77KB' and 'mSATA' and eventually I found Martijn Koster's blog about his almost identical build. The only real difference is that he's using a slightly faster processor. He'd put together quite a good overview but the thing that really interested me was that he'd updated his BIOS to 'KBQ7710H.86A.0051' using the F7 and USB stick method.

Well, in for a penny, in for a pound, I downloaded the zip version & did the same. Then I then restarted the computer and ran another format using the Debian 7 installer disk. This time it seemed to get through and went on to install the operating system. It still threw up the odd error along the way, but it allowed me to continue. After a few minutes it announced it was finished and then performed an auto re-boot. Sadly it but didn't get very far, more kernel errors flashed by and then it locked up. I was starting to wonder if something else might be wrong, maybe the memory?

I decided to sleep on it.  Z Z Z Z Z Z z z z z . . . . .

The following day I did a few more searches, mostly hitting the same stuff from the previous day, but then I saw a post where somebody recommended resetting the BIOS to defaults after after an update. Well that made sense, and I certainly hadn't, so I decided to give it a try that evening.

To my amazement it worked, so I returned back to the task of cloning my old disk and setting up lilo so the mSATA card would boot. Then remembering I'd previously altered some of the bios settings I set the RAM voltage back down to 1.35 volts. Restarting again I found that the computer would no longer boot, the errors coming back. This continued until I set the voltage back to the default  of 1.5 volts.

I'd gone out of my way to buy low voltage sodimms, but it looks like that may have been one of the root causes of my hardware problems. Now I had a 2nd nSATA card that I didn't need along with an mSATA to 1.8" adapter board (which I'd hoped to use as a backup plan). To add to my frustration the adapter came with a micros-sata connector on it (which was no use to me). Ghaahh.. how many connection standards do we bloody need!!!

1.8" Adapter board alongside standard SATA plugs

I looked up the micro-sata connection standard on wikipedia and found the data connection is the same but the power is much smaller. Instead to two separate plugs it expects one, with the data and power merged together.

Quick, Think of a Plan B!

The computer was now working fine, but cloning the old servers root partition wasn't. After messing about setting up the boot loader, all attempts to start it resulted in an invalid chipset error. I can't say that I'm that surprised, but it meant I was going to have to re-install Debian from scratch. It's not the end of the world, but it means running two servers until I got all the software installed and configured on the new box. I was really hoping to avoid this!

The first thing after a fresh operating system build was to install Java 7 and get Minecraft server running for 'His Nibbs'. Stack Overflow had a Q&A page where somebody had asked about how to install java using the apt-get utility. So I scrolled down to the answer, then copy and pasted the following code into the terminal window:

echo "deb http://ppa.launchpad.net/webupd8team/java/ubuntu precise main" | tee -a /etc/apt/sources.list
echo "deb-src http://ppa.launchpad.net/webupd8team/java/ubuntu precise main" | tee -a /etc/apt/sources.list
apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys EEA14886
apt-get update
apt-get install oracle-java7-installer

It worked a treat, adding the java sources and then performing the install in only a few minutes.

Next thing was to get the latest Minecraft Server build from www.minecraft.net/download. We grabbed the minecraft_server.1.6.1.jar and installed the linux screen utility. Requiring us to simply copy the jar file onto the server and run it with the following command:

screen java -Xms512M -Xmx1G -jar minecraft_server.1.6.1.jar

Then you can leave it running by pressing Ctrl + A D, and return to it later by entering screen -r

Is it me or do some sites seem to hide there stuff in amongst a load of old twaddle and psuedo-information? I scanned down the main minecraft.net page unsure of where to click,  then gave up and googled "minecraft server download" to find that link above. I despair at times!!

Friday 5 July 2013

Designed to Confuse

Font of All Knowledge

It's a play on words, I don't mean "fount", and it's not about wisdom, rather the lack of. What I want to talk about is confusion within computer fonts... yeah I've found another problem that nobody else even considers to be one. Generally computers have brought beautiful typography to the masses. You try and draw letters on a poster without it, or use a typewriter to bash out a page of text, centering your titles and without making any mistakes. We have oodles of different font styles that we can use and (often) abuse, but strangely we tend to just stick to one or two.

The Arial font displayed in Windows Character Map.
Let's look for a moment at the characters in Arial, they look clean and familiar don't they. It's a hugely useful font designed in 1982 as a generic and bland version of a sans serif font. (Yeah somebody thought standard Sans Serif was too flashy!) Microsoft started shipping truetype versions of it in Windows 3.1 back in 1992, and it first appeared on the Mac when Apple released OSX in 2001.

Sans Serif means it doesn't have the small projecting features (called serifs) at the end of the strokes. Times New Roman is probably the most well known example with serifs.
Serifs shown here in red.
Undoubtedly the serifs looks grand, and they help differentiate some of the similar characters, but they have the disadvantage of being slightly less easy to read. They tend not to be used in large bodies of text, so fonts like Arial have become very popular, almost the de-facto standard because mostly people want clear readable text. But here's the rub, without the serifs some of the letters look the same.

 So What's the Problem?


It all came to a head recently when I was sent a new server password at work that had been created to fall in line with a rigid password policy. The policy states (something like) don't use real words, and include a mix of capitals numbers and characters. That's nothing unreasonable until you understand which characters had been selected to fit in with this policy.

The password was based on a meaningful term, in this instance system name and company abbreviation, as we outsource our IT hardware support to HP. The system was called TAMS and the company abbreviation is PLS, so the HP system administrator had unthoughtfully set the password to "T@msPl5"

OK, if you didn't know (& I didn't) what the password was based on then you might not be sure which letter was after the 'P'. "Big deal, just try again," you might say, but what if your policy is set to lock the account after three failed attempts? Non word passwords are difficult to type at the best of times.

I've had similar issues in the past when fellow developers had been slightly foolish in the selection of variables or labels in their code. One guy habitually used 'i' (for iteration) within his function loops, which was OK until he switched to using capital letters.

Still not 100% sure what I'm on about?.. well certain letters and numbers in fonts are either difficult or impossible to distinguish from one another. Look at the table showing comparison of some well used fonts.

Problem characters displayed using common fonts.

All of a sudden our Arial doesn't look so good. It tends to be mainly restricted to the fonts without serifs, and normally it isn't a problem because context helps us out. Where it becomes a problem is when you need to exactly identify the character when context is missing. Examples of this might be:
  • Passwords - where a mixed character and uppercase policy is involved.
  • Computer code or script - where single letter variable names are used.
  • Serial Numbers - especially where the font size is tiny.
It seems that the problem is rooted in the past. Back in the days of moveable type you could reduce complexity by reusing the lower case L character for a 1. Indeed this practice was carried through to early typewriters which would typically exclude the number 1 from their keyboards. And fonts are created by designers, who care more about how something looks that whether it might cause the odd confusion between similar letters.

Avoiding The Problem

In years gone by when Car Registration plates in the UK used a single letter as a year suffix, certain letters where avoided. The letters I, O, Q, U and Z were never issued as year identifiers.
  • I because of its similarity to the numeral 1
  • O because of its identical appearance to a zero
  • U because of similarity to the letter V
  • Z because of similarity to the numeral 2

So back in years 1963 to 1983 they were aware of the problem and took proactive steps to reduce confusion and to assist with the correct identification on registration plates.So it's not rocket science, the boys at the ministry have been doing it for years.

Useful Methods

Not all solutions to problems have to be technical in nature, the common way we cope with such problems is to use comparison:
  • Are there similar letters you can compare against, or similar examples that help identify the character you're unsure of?
  • Are there any coding standards that prohibit certain characters?

Also you could consider the following:
  • If you generate any codes, simply avoid any characters that might confuse?
  • Start using a font like MS Trebuchet which retains character differentiation without resorting to serifs.

A Dim Outlook

I started looking into altering the font in my company email, but it only effects the outgoing emails that you create. Incoming emails are sent with the font pre-selected in what Microsoft calls the stationary, so it's not possible to change them. I found a tantalising stationary override tick-box in the setup page, but that disappointed me by doing nothing.

So I'm still stuck with copying and pasting before I can alter the font. Windows used to be all about control and configuration, what went wrong? I can't switch to another email client, it has to be outlook, yet it seems rigid in it's ability

Unless you know the answer!

Monday 1 July 2013

A Game Of Two Halves

Building the Beast

It was the day of building the eponymous beast, we had all the bits, the house was cleared of small urchins with their touching fingers, and we were finally ready to go. I opened the system board box and carefully removed & inspected the contents. The Intel DQ77KB board comes with a poster sized "how-to-do" instruction sheet. It has good clear instructions, colour diagrams and each stage is split into simple numbered steps. My son Saul (who was new to computer building) had no problems following them under my watchful eye and with the odd word of assurance. I was like the sensei passing on noble skills to his apprentice.
Number one super guy!

We had a chat about static electricity and being careful about which bits you touch, and then kicked Off with Stage 1: processor installation. The Intel 1150 socket is a marvel of engineering and easier than it looked to use. I open and closed it a few times admiring the action, (it's a sort of tilt, slide and spring-lock). The retail boxed i3 processor came with a standard (four wire) cooling fan which just pressed into the four holes in the system board around the base of the socket. The fan header was close enough by to accommodate the short cable, and under operation it turned quite slowly and was almost silent.

nb. Inside the box I found a HDMI to DVI adaptor, which I'd gone out of my way to buy separately, but hey these things happen. The one I bought is far nicer :-)

Next the laptop style memory just slotted in like normal, though Saul was a little worried about how you had to joggle them a little before they would firmly snap down. The mSATA card fixes onto the full size PCI Express mini-card slot on the system board. I'd never seen these cards before and it really was small (see picture below with it in my son's hand). Resembling memory, it slid in at an angle and then had to be pushed flat against quite a springy force. Two tiny screws held it in place and there was some potential for this "liveliness" to catapult them (never to be seen again) if you didn't have your wits about you.

The mSATA card in Saul's hand.
Overall I am very impressed with the Intel system board, it's clear english instructions and the nifty processor socket and fan. Next step was to mount the board in the case and fire-it-up.

A Case of Beauty

The Streacom F7C EVO came exquisitely packed in a matt black cardboard box not unlike an Apple product, (we have a few of those in the house) protected by foam packaging and a white fabric bag. The comparison didn't end there, the look and quality of the case was equally top notch.

The Streacom F7C EVO Mini-ITX case.
I must say, I've very impressed by the solid feel and attention to detail. It's made of sand blasted thick anodised aluminium, laser engraved with large padded plastic feet and a minimalistic look. This does mean you don't get a reset button or a hard disk light. As a side project I started to contemplate adding an LED shining through the infra-red receiver window. The case is designed for a multimedia PC so an add-on receiver board for a remote control can be fitted behind the font panel, next to the two USB sockets.

Inside is also quite minimal (and no sharp edges anywhere, leaving fingers safe from cuts), there's a painted steel rack that bridges from front to back where you can bolt your hard disks (1 x 3.5" and 1 x 2.5") and a mount for a slot-loading CD/DVD drive. Then towards the rear there's a small bracket for mounting a standard 8" case fan.

Bagged Up Hardware.

Mounting hardware comes in individually labelled bags, but only sizes are stated & not what they're intended for. I took them out and by process of elimination worked out which ones where intended for mounting the system board. But I think they missed a trick here because there are no instructions in the box. Just adding 3.5" HDD or Motherboard to the appropriate label would have really helped, but if you've built a few machines before you'll soon work it out.

The motherboard matched the four mounting pillars exactly, but it does sit a little low in the case making some of the rear sockets slightly hard to access. Finally the power switch and power LED connectors were attached to the colour coded headers.


System Board Mounted Ready to Boot.
That went well, we had a full computer system on a board less than 9 inches square in under an hour.

And then the Fun Began

We both smiled as it booted first time, but then I couldn't get it into the BIOS settings. The splash-screen with instructions flicked by so quickly!! After a few restarts I figured out that F2 needs to be held down and then I was able to continue (surprising this wasn't on the quick-start sheet). I reduced the memory voltage down to 1.35 volts, and then spent a few moments looking at the various config pages. Each option has help text that displays over on the right of the screen, and it actually makes sense. This is a far cry from what I'm used to.

To take care of the disk cloning I downloaded a bootable CD image of Parted Magic. It took a while to start from a USB CD drive up on my old 1Ghz machine but once running it gives you a gnome based system to modify and manage your disks without having to get "down and dirty" with the command line. It actually does a whole lot more so I'd recommend checking it out if you run Linux.

Parted Magic Screen.
The plan was to clone the old IDE solid state disk onto a temporary disk, then clone that onto the mSATA drive. The first clone worked OK, taking about 10 minutes to do a 30Gb disk, but when I attempted the second stage (onto the mSATA card) it kept hanging. In one instance I left it running for over an hour, but it wasn't able to move on from 61% complete. I repeated this a few more times in vein, and then tried to manually format the mSATA from the command line. This rewarded me with a kernel panic and a "Buffer I/O error on device" message.

After a few more hours of trying different things I reverted back to my old server. I've raised an RMA with eBuyer to have it replaced, but it's left my son a little disappointed. He was really hoping to get the Minecraft server up and running. Perhaps it had been going too well, as those who have previously built computers will recognise, but as Saul's first experience at PC building it has actually been quite positive. He did tell me later that it was much easier than he'd imagined, and I think he enjoyed doing it.

So a result,.. though for the meanwhile only a minor one. (We'll try again after I've been through eBuyer's returns process)

Thursday 27 June 2013

Mail Pending

Latest Arrivals

There's been little to add over the last few days, all parts I need had been ordered, so it's just been ticking them off as they started to arrive. The CPU arrived first, shortly followed by the case, and then the rest of the stuff. The only thing that's been holding the job up is the HDMI to VGA converter which I'd bought on eBay.

My son has been highly interested in keeping track of which bits have been outstanding. Obviously the whole process just isn't happening fast enough for him. But I've given over wasting my money on the lure of next day delivery, or the hope of orders arriving by the weekend and the disappointment it typically brings. Now I go for the cheapest shipping cost and accept that it'll get here in about a week, and for places like eBuyer (here's a good tip) go for the free 5 day shipping option and it'll be delivered in two days anyway.



Educating the Upstarts

I've decided to involve my 12 year old son Saul in the build as much as possible. Number two son is also interested but at 6 he's a little too young to be more than a hindrance, even though he is mega-bright. The young brainiac's already been reading about motherboards & daughterboards and such things that my oldest son hasn't even heard of, so I'll have to find some way of letting him join in. But Saul wants the Minecraft server, so he can get his hands dirty (he might even enjoy it) and I'd like him to see there's more to computers than game platforms. Honestly I despair at times for all the game install requests I get from him.

I've tried to interest him in learning more but it seems there's no "street creds" in it, so he normally shows little interest. We've tried HTML and Databases (which we suggested could form the basis of scouts badge work), but it just doesn't compare to semi-mindless clicking on crudely rendered blocks. Perhaps these building blocks are just too abstract for him?!

It certainly seems a quandary these days, how to get your kids interested in the nuts and bolts of technology. Back when we were kids computers were all about the nuts and bolts, and if you wanted to play space invaders then you'd better bloody well write it first. Of course we never did, but we tinkered around learning basic programing in the guise of having fun, or we typed in simple (and slightly rubbish) adventure games from the pages of computer magazines.

But look at what they ARE teaching kids at school! Back in the 80's I was fortunate to have Computers Studies classes on Commodore Pets and we learnt real programing and used words like algorithm and hashing, but even back then I was aware of the rise of something involving BBC Micro Model B's called ICT that the less bright kids did. These days ICT is all there is, unless the school runs a computer club, so our kids are being taught how to use Microsoft Office. So if you need help knocking together a power-point, or tips for collating your data in excel then you'll know where to turn! I can't help feel slightly outraged by this... and slightly saddened.

Britain used to have a booming computer industry,..(sighs).. it's hardly surprising there's little sign of it these days.