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.

Side Income #1 – Follow up 1

Following up on my earlier article Side Income #1, my “fun” design has been taken down automatically because it looked too much like the original Yoda face. This makes sense, since I used a high-ranking google image result for “Yoda” to draw my version in Photoshop. I received an email from the redbubble team saying that the owners of the copyright had a history of being very picky.

While looking at other Yoda-èsque designs on the website, I noticed that a lot avoided being very obviously taken out of a picture of the movies. It would make sense that Lucas Film & Co would protect their IP, I just didn’t imagine it would be this draconian.

However, I do enjoy redbubble’s proative approache towards this issue. The last thing I want is an experience at a side income costing me more than just time!

So to continue with my experiment, as I haven’t yet sold anything on the website, I’ve uploaded a new original design. This was something I doodled in Photoshop and uploaded to the website. I don’t expect it to be a great success, but again, this is experimenting. As soon as I get more free time, I might design several t-shirts in the same “style” and see if it’s something that catches on.

Love Me t-shirt
Love Me t-shirt design

Side Income #1

For several years now, I’ve been thinking of ways to get some side income through one or several side hustles. I’ve decided to try several things in 2017 in that regard, and plan on reporting my steps and progress here on this site.

Income Comparison
Difference between the current situation and the desired situation.

Programming is an easy candidate to generate some side income. There are several large websites that put programmers in contact with people ready to pay for their work, and it can be quite lucrative to the point of being a main gig. My problem with this approach is that my day to day job is programming, and I don’t have the energy to program much at home in the evening or on weekends, as it’s not something I can do with my fiancée.

I’ve tried to write some short stories related to the Dungeons and Dragons adventure I run, but as with any craft, it requires experience to get to a point where I am happy with my work. I am no where near that point yet, and one of my goals is to use this site to improve on that front, posting short stories for free before I pursue the road of selling PDFs on Amazon & co.

One craft where I feel like I am skilled enough to justify a price tag is photography. I started in 2010 and have been doing it more or less consistently since. My focus is on people and cosplay, but I do enjoy taking pictures of landscapes on holiday, and enjoy editing those pictures afterwards in Lightroom. It is also a hobby I share with my fiancée, so bonus points for that.

Last night, I had an epiphany while I was browsing the redbubble website and realised that I could also sell some art on this platform. I already have the pictures to upload, and would only need to re-export them in a higher resolution and without the watermark. For fun, I also spent a bit longer than I’m willing to admit in photoshop to create an ugly t-shirt design involving a badly drawn Yoda saying “Great America Again Make”. This is for me to have metrics on political shitposting content vs more traditional content.

redbubble yoda maga
My Yoda #maga t-shirt design

I am currently limiting myself to redbubble and don’t plan on doing any advertisement, but work on tags and updating my store at a regular interval. Since my content is more poster friendly and that website is more apparel oriented, I don’t expect my strategy to generate much (if any at all to be honest). However, this will be a first experience that I will share with here.

Hopefully it will provide moderate success, otherwise I won’t have much to talk about. You can view my store on redbubble.

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.

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

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.

Console

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.



Nginx

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

MySQL

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 127.0.0.1 to make sure only a connection from the server itself would work.

DNS

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.

WordPress

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 127.0.0.1, 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.

Hello world!

Hey, it’s another blog! I’ve recently had some thoughts I wanted to put down in text and share, so this seemed like the best way to achieve that. Might be as successful as all previous 9 tries, but you never know.