Dabbling in Augmented Reality

I’ve been somewhat following augmented reality (AR) from a distance for a while now, and have always wished to get my feet wet and try some stuff. But as many before me, a lack of time and motivation to learn the toolsets has always stopped me.

That changed yesterday when we were talking about it at work for potential clients, and my colleague and I set sail on to new worlds.

He was to test AR with an SDK called wikitude, while I would test vuforia with Unity3D. We both had little to no prior experience with Unity3D, other than installing it and failing early on in the tutorial, and both had 0 experience with AR.

My setup was really easy. I had to follow several tutorials on YouTube, as I couldn’t find one that took me from start to finish and did what I wanted to do. After about 2 hours, my prototype was ready to show.

My next step is to work further on this in my free time, and I want to try and do the following:

  • Have a bigger item tracked, that will act as an arena
  • Have 2 monsters spawn when the image is tracked
  • Both monsters fight until one has no life points anymore
  • Monsters respawn when a new image appears

This should keep me busy for a while.

New MBR partition for Windows 10

I’ve recently updated my computer and realised that the drive containing my Windows 10 partition didn’t contain a MBR (master boot record) partition. This is because I originally installed Windows on a new disk while another disk with another version of Windows installed was present in the computer. This lead the MBR partition to be on the old disk.

This wasn’t a problem until the disk with the old installation died, and with it my ability to boot my computer.

Fixing it wasn’t as simple as booting the Windows 7 DVD and using a tool, so here are the steps I took and problems I faced.

First of, make sure there are no other drives attached to the computer except for the drive with your Windows partition. The repair tool on the DVD didn’t want to work as long as I had several disks connected.

Also, I had to make sure I was booting from the DVD in “UEFI” mode, since my motherboard is modernish (2011). This meant using the F8 key on the bios screen, and selecting the correct drive. I was also prompted to press on a key to actually start the Windows DVD. Doing nothing meant booting in “normal” mode, which also prompted an error.

With that out of the way, I managed to boot on the DVD and enter the repair tool, which is just a console command. I was lucky that my ssd still have about 500 mb of unpartitioned space that I could use for the MBR.

I ended up doing the following commands, following the instructions from here.

list disk
select disk 0
list partition
create partition efi
format quick fs=fat32
list partition

A breakdown of what I did.

diskpart. This is the tool to view and edit partitions on your drives.

list disk. Lists all your disks. Should only be one.

select disk 0. This is to select my first disk, based on the previous command.

list parition. Self-explanatory, it lists your partitions. Allowed me to make sure I had unaffected space at the end of my disk. If you don’t have space at the end, the rest will become more tricky, but you can resize your partition using other tools.

create partition efi. This tells diskpart to create a partition tagged “efi” at the end of the disk with all the remaining available space. If you don’t have enough space, following the link provided earlier as there is walk-through on how to shrink your main partition’s size.

format quick fs=fat32. Quickly format the new partition in the fat32 format. This is required for the MBR to load properly.

list partition. Make sure your new partition has been created and is in fat32 format.

exit. Exists the diskpart command, because there is still more to do.

Now that the efi partition is created and ready, we can rebuild the mbr with the following commands.

bcdboot C:\windows

Replace C:\ with the letter of your windows partition. This will recreate the mbr on your new partition and tell it where your windows is located.

There you go, you should be able to boot again.

Setting up the blog

For a first post, I thought it would be fitting to write down the process I followed to install this blog onto my website.

This website is hosted on a virtual server configured with an Ubuntu operating system, Nginx for the web server, MySQL for the databank, and PHP-FMP for scripting. I won’t cover any of this, since it’s pretty standard stuff.


The blog is provided by WordPress that I installed on my server. The first thing to do was to download the compressed files to a destination of my liking and extract it. One might need to use the sudo command to get the following working.

cd /var/www
wget https://wordpress.org/latest.tar.gz
tar -xvf latest.tar.gz
rm latest.tar.gz
mv wordpress blog

These files needed some proper permissions, so following the WordPress instructions, I did the following.

find /var/www/blog/ -type d -exec chmod 755 {} \;
find /var/www/blog/ -type f -exec chmod 644 {} \;
chown -R myuser:www-data /var/www/blog
chown -R www-data:www-data /var/www/blog/wp-content/uploads

The last line allows the web user from uploading files into wp-content/uploads.


As mentioned above, this server runs with Nginx, so I did the following to make it work. First, I created the /etc/nginx/sites-availables/blog file.

server {
 listen 443 ssl;
 server_name blog.jpayne.ch;
 root "/var/www/blog";

 index index.html index.htm index.php;

 charset utf-8;

 location / {
 try_files $uri $uri/ /index.php?$query_string;

 location = /favicon.ico { access_log off; log_not_found off; }
 location = /robots.txt { access_log off; log_not_found off; }

 access_log off;
 error_log /var/log/nginx/blog-error.log error;

 sendfile off;

 client_max_body_size 16m;

 location ~ \.php$ {
 fastcgi_split_path_info ^(.+\.php)(/.+)$;
 fastcgi_pass unix:/var/run/php5-fpm.sock;
 fastcgi_index index.php;
 include fastcgi_params;
 fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
 fastcgi_intercept_errors off;
 fastcgi_buffer_size 16k;
 fastcgi_buffers 4 16k;
 fastcgi_connect_timeout 300;
 fastcgi_send_timeout 300;
 fastcgi_read_timeout 300;

 location ~ /\.ht {
 deny all;

 ssl_certificate /etc/letsencrypt/live/blog.jpayne.ch/fullchain.pem;
 ssl_certificate_key /etc/letsencrypt/live/blog.jpayne.ch/privkey.pem;


server {
 listen 80;
 listen [::]:80;

 server_name blog.jpayne.ch;

 location / {
 return 301 https://$host$request_uri;

Can’t forget the symbolic link in the sites-enabled so that Nginx knows that this site needs to be loaded.

ln -s /etc/nginx/sites-available/blog /etc/nginx/sites-enabled/blog

I use letsencrypt for my certificats, so I also needed to generate those.

certbot-auto certonly -a webroot --webroot-path=/var/www/blog -d blog.jpayne.ch

Now that all is set up, I can restart Nginx.

service nginx restart


Next up is setting up the mysql schema and user. I have MysqlWorkbench set up to connect through ssh onto my server, which makes managing mysql very easy.  I created a schema simply called blog, as well as a new user with all permissions except grant to only the schema.

I did set up the matching host to to make sure only a connection from the server itself would work.


So be able to access blog.jpayne.ch, I first had to creat a dns entry for it. This is a fairly simple process of me logging into the admin panel of my name provider, and creating a new CNAME.


Now that my server and dns is properly set up, I can take care of my WordPress configuration. Navigating to my new blog dns prompted a configuration screen with the details for the mysql connection. Making sure I also set the host to be, the connection was successful. I had to manually create the wp-config.php.

I also added the following line in the wp-config file to improve security of the app.

## Disable Editing in Dashboard
define('DISALLOW_FILE_EDIT', true);

And voilà, the blog is ready to go! All I have left to do now is populate it with fake real data.