status.omgmog.net

Max Glenister

I’m still alive, even if nothing here has been updated in a while.

Today I’ve got some notes about Android Virtual Devices…

Running AVD emulator from the Windows command line/Powershell/mingw32

This assumes you’ve got Android Studio installed.

First you need to have the tools path in your $PATH variable, to do this edit Path in Windows’ Environment variables to include for example:

C:\Users\Max\AppData\Local\Android\Sdk\tools

Then you can use emulator.exe from anywhere. The Android Studio docs fail to mention this.

$ emulator -no-boot-anim -accel auto -writable-system -no-snapshot -gpu host -avd K10_API_22

Installing Google Play Services

I’ve been messing around with older device profiles, and trying to run things in Chrome on Android 5.0 (API level 21).

You’ll need to sideload the Google Play services system APKs (from a gapps package for your target system, e.g. https://androidhost.org/BcyG7), but you might find that the /system partition is full.

No problem, you can sideload to /sdcard and symlink:

$ adb remount
# Fails...
$ adb push .\GmsCore.apk /system/priv-app
$ adb: error: failed to copy '.\GmsCore.apk' to '/system/priv-app/GmsCore.apk': No space left on device

# Works...
$ adb push .\GmsCore.apk /sdcard/system/priv-app
$ adb push .\GoogleLoginService.apk /sdcard/system/priv-app
$ adb push .\GoogleServicesFramework.apk /sdcard/system/priv-app
$ adb push .\Phonesky.apk /sdcard/system/priv-app

# Symlink them
$ adb shell ln -s /sdcard/system/priv-app/GmsCore.apk /system/priv-app/GmsCore.apk
$ adb shell ln -s /sdcard/system/priv-app/GoogleLoginService.apk /system/priv-app/GoogleLoginService.apk
$ adb shell ln -s /sdcard/system/priv-app/GoogleServicesFramework.apk /system/priv-app/GoogleServicesFramework.apk
$ adb shell ln -s /sdcard/system/priv-app/Phonesky.apk /system/priv-app/Phonesky.apk
$ adb shell stop
$ adb shell start

Messing around with /etc/hosts

It’s trivial to edit the /etc/hosts on your AVD, but it only works if you have blank new line at the end of the hosts file.

$ adb pull /etc/hosts hosts
$ nano hosts # make your changes to the hosts file locally...
$ adb push hosts /etc/hosts

Max Glenister

Following up from my earlier post about enabling Daydream on my OP3T, I’ve now got a Daydream controller. Read more here: https://blog.omgmog.net/reviews/mini-review-virtoba-s1-daydream-vr-controller/

In reply to:

Max Glenister

I enabled Google Daydream support on my OnePlus 3T today. I’m pretty impressed.

The OnePlus 3T costs about half as much as the Google Pixel or any other Daydream compatible devices, but it’s powerful enough to run Daydream. The screen resolution is a bit low, and OnePlus seem to not be interested in getting the device certified.

To enable Daydream support you need to root the OnePlus 3T, and then modify a couple of files:

/system/etc/permissions/handheld_core_hardware.xml

Before the closing </permissions> tag, add the following keys:

<feature name="android.software.vr.mode" />
<feature name="android.hardware.vr.high_performance" />

/system/build.prop

At the end of the file, add the following line:

ro.product.device=sailfish

To modify those, I used the app “Root Explorer”, navigated to each file and opened them in the built-in editor in Root Explorer.

Once you’re done, reboot the OnePlus 3T and the install Daydream VR, Google VR Services and Daydream Keyboard. You might not be able to view/install these from the Play Store, but you can find the .apk files on apkmirror.

I don’t have a Daydream headset or controller, but I do have numerous Google Cardboard headsets (nice plastic ones with elastic straps!) and some old/spare Android phones.

You can use a second Android phone as a controller using the Daydream Controller Emulator and instructions from Google’s VR Developer Site.

Over-all it works pretty nicely. It’s a bit laggy in places, but not too bad. The tracking is as good you would expect – a bit better than Cardboard experiences on Android by my experience. It’s certainly not going to compate with my HTC Vive, but it’s a fun thing to play with none the less.

As soon as the battery on the controller phone charges a bit more, I’m going to sideload the Netflix VR apk and give that a go.

Max Glenister

I enabled Google Daydream support on my OnePlus 3T today. I’m pretty impressed.

The OnePlus 3T costs about half as much as the Google Pixel or any other Daydream compatible devices, but it’s powerful enough to run Daydream. The screen resolution is a bit low, and OnePlus seem to not be interested in getting the device certified.

To enable Daydream support you need to root the OnePlus 3T, and then modify a couple of files:

/system/etc/permissions/handheld_core_hardware.xml

Before the closing </permissions> tag, add the following keys:

<feature name="android.software.vr.mode" />
<feature name="android.hardware.vr.high_performance" />

/system/build.prop

At the end of the file, add the following line:

ro.product.device=sailfish

To modify those, I used the app “Root Explorer”, navigated to each file and opened them in the built-in editor in Root Explorer.

Once you’re done, reboot the OnePlus 3T and the install Daydream VR, Google VR Services and Daydream Keyboard. You might not be able to view/install these from the Play Store, but you can find the .apk files on apkmirror.

I don’t have a Daydream headset or controller, but I do have numerous Google Cardboard headsets (nice plastic ones with elastic straps!) and some old/spare Android phones.

You can use a second Android phone as a controller using the Daydream Controller Emulator and instructions from Google’s VR Developer Site.

Over-all it works pretty nicely. It’s a bit laggy in places, but not too bad. The tracking is as good you would expect – a bit better than Cardboard experiences on Android by my experience. It’s certainly not going to compate with my HTC Vive, but it’s a fun thing to play with none the less.

As soon as the battery on the controller phone charges a bit more, I’m going to sideload the Netflix VR apk and give that a go.

Replies:

Max Glenister

Following up from my earlier post about enabling Daydream on my OP3T, I’ve now got a Daydream controller. Read more here: https://blog.omgmog.net/reviews/mini-review-virtoba-s1-daydream-vr-controller/

Max Glenister

To follow-up. I finished this. It’s an awesome book. I have recommended it to others. Even my wife is reading it, and she typically loathes sci-fi books and spiders!

In reply to:

Max Glenister

I’ve been using Good Reads lately to track what I’m reading (mostly sci-fi and dystopian), and this week I’ve been reading my first suggestion from Good Reads: Adrian Tchaikovsky’s “Children of Time”.

So far I’m hooked. This is a great take on some common themes. As usual I can’t help but thinking “This would make an awesome movie” after each chapter.

Synopsis:

A race for survival among the stars… Humanity’s last survivors escaped earth’s ruins to find a new home. But when they find it, can their desperation overcome its dangers?

WHO WILL INHERIT THIS NEW EARTH?

The last remnants of the human race left a dying Earth, desperate to find a new home among the stars. Following in the footsteps of their ancestors, they discover the greatest treasure of the past age - a world terraformed and prepared for human life.

But all is not right in this new Eden. In the long years since the planet was abandoned, the work of its architects has borne disastrous fruit. The planet is not waiting for them, pristine and unoccupied. New masters have turned it from a refuge into mankind’s worst nightmare.

Now two civilizations are on a collision course, both testing the boundaries of what they will do to survive. As the fate of humanity hangs in the balance, who are the true heirs of this new Earth?

Soo yeah. Worth reading.

Max Glenister

Well I’ve kept this up well then…

4 Months between posts isn’t that bad, if you compare it to my full blog anyway. I should get back on the Status bandwagon.

As of tomorrow I’m going to be switching to working remotely. Same job, just from the comfort of my home office (and without 2-3 hours of commute daily!). With this change I figure I’ll have about 8-10 hours of extra time per week to work on things.

So I’ve got a couple of posts lined up for my blog, and some big plans for UX of VR.

As to the technical side of working from home, I find myself predominantly using Windows 10 for this, and connecting to work over VPN.

Windows lacks a nice way to manage VPN connections and indicate VPN connection status – it’s all click 10 times and then cross your fingers. I’ve been digging around for a solution to this, and have settled on a couple of oldish Windows apps to make this nicer:

  1. VPN Connection Indicator
  2. Tray Tools 2000

The first simply indicates if you’re connected to a VPN or not, the second allows you to make custom command icons for the system tray.

I’ve got two commands set up in Tray Tools:

First, single-click connect to VPN. This uses the built-in rasdial.exe that comes as part of Windows since forever. You simply run that along with the name of the VPN to connect to, and it connects:

C:\Windows\System32\rasdial.exe "Name Of Your VPN"

Second, single-click disconnect from VPN. This uses the built-in rasphone.exe that also comes as part of Windwos since forever. Again you just run this with the name of the VPN to disconnect from, and the -h flag:

C:\Windows\System32\rasphone.exe -h "Name Of Your VPN"

Right now I’m using some of the 90s-esque icons that come bundled with Tray Tools, but I think I’m going to make something a bit nicer if I get bored.

Max Glenister

I’ve been using Good Reads lately to track what I’m reading (mostly sci-fi and dystopian), and this week I’ve been reading my first suggestion from Good Reads: Adrian Tchaikovsky’s “Children of Time”.

So far I’m hooked. This is a great take on some common themes. As usual I can’t help but thinking “This would make an awesome movie” after each chapter.

Synopsis:

A race for survival among the stars… Humanity’s last survivors escaped earth’s ruins to find a new home. But when they find it, can their desperation overcome its dangers?

WHO WILL INHERIT THIS NEW EARTH?

The last remnants of the human race left a dying Earth, desperate to find a new home among the stars. Following in the footsteps of their ancestors, they discover the greatest treasure of the past age - a world terraformed and prepared for human life.

But all is not right in this new Eden. In the long years since the planet was abandoned, the work of its architects has borne disastrous fruit. The planet is not waiting for them, pristine and unoccupied. New masters have turned it from a refuge into mankind’s worst nightmare.

Now two civilizations are on a collision course, both testing the boundaries of what they will do to survive. As the fate of humanity hangs in the balance, who are the true heirs of this new Earth?

Soo yeah. Worth reading.

Replies:

Max Glenister

To follow-up. I finished this. It’s an awesome book. I have recommended it to others. Even my wife is reading it, and she typically loathes sci-fi books and spiders!

Max Glenister

New buttons and switches for my arcade arrived today. Previously I already have a bunch of red and black buttons, but I’ve decided to change to a more specific Neo Geo-esque button layout.

I realise the arcade I’ve mentioned in this and the last update is completely out of context, so here’s a quick summary:

… and that’s where we’re at. I’ve got a pretty thorough photo album going on Google Photos that you can view here: https://goo.gl/photos/MypBLjMRnSjMfMmC8

Attachment for 1491220651

Max Glenister

Heavy CRTs be damned! Well, at least it’s out of the arcade now…

I’m working on my arcade project some more lately. As you can see there was some breakage – the monitor is all intact, but the touch screen overlay took some damage when I tried to remove it.

The current task is replacing the old dark 19” CRT (that only does 640x480 at 31hz) with a flatscreen display.

I’ve ordered a Dell P190st (19”, 1280x1024) on eBay which I’m hoping will fill at least part of the space left by the CRT. While I’m waiting for that, I can get working on the OS and software side of things…

But before that, I need to find the loose bits of glass on the rug.

Attachment for 1490209941

Max Glenister

A lightweight, smooth scrolling javascript library without any dependencies https://github.com/hsnaydd/moveTo https://hsnaydd.github.io/moveTo/demo/

Max Glenister

Some useful bash aliases that I use on my VPS’:

www=/srv/www
conf=/etc/apache2/sites-enabled
alias ra='/etc/init.d/apache2 restart'
alias ownit='chown -R www-data:www-data .'

Create an Apache conf and directory for a new domain:

function makeconf {
primary=${1}
conffile="${conf}/${primary}.conf"
site_path="/srv/www/${primary}"
mkdir -p ${site_path}
echo "<VirtualHost *:80>" >> "${conffile}"
echo "  ServerName ${primary}" >> "${conffile}"
echo "  ServerAlias www.${primary}" >> "${conffile}"
shift
for i; do
cat >> "${conffile}" <<EOL
        ServerAlias ${i}
        ServerAlias www.${i}
EOL
done
echo "  DocumentRoot ${site_path}" >> "${conffile}"
echo "</VirtualHost>" >> "${conffile}"
}

Grab the latest Wordpress tar and extract it to the current directory:

function wordpressitup {
  wget --no-check-certificate https://wordpress.org/latest.tar.gz
  tar xfz latest.tar.gz
  cd wordpress
  cp -R * ..
  cd ..
  rm -r wordpress
  echo "Wordpress installed"
}

Some shortcuts to go to common directories:

function dwww {
  cd /srv/www
}
function dcache {
  cd /var/cache/mod_pagespeed/v2
}
function dconf {
  cd /etc/apache2/sites-enabled/
}

See which directories and files are using up all of the space:

function fsizes {
  du -h --max-depth=1 | sort -hr
  df -BG
}

Max Glenister

I’m seeing a weird “new tab” behaviour in Chrome since the latest update (56.0.2987.110) the tab title shows “chrome://newtab” until you reload the page:

Seems to be a known problem and interestingly it’s probably caused by a server-side issue rather than an issue on the client-side in Chrome.

Max Glenister

This seems pretty cool:

hello.js - A client-side JavaScript SDK for authenticating with OAuth2 web services and querying their REST APIs.

Max Glenister

The “Mirror” mode in Sketch is really awesome. If you have an Android device you can use Crystal to mirror your Sketch design to your device.

I’ve been playing with this today to size-test some mobile UI design mockups, and it works really nicely!

Max Glenister

Pete’s thoughts on my lovely microblog, a haiku:

Your own personal Twitter, someone to hear your prayers, someone who cares

Thanks I guess! 💯

Max Glenister

Embedding a Tweet example:

https://twitter.com/omgmog/status/732896145987473408

Max Glenister

This post has the same parent as the previous post

In reply to:

Max Glenister

Things I should probably add to this…

  1. Style the individual status pages
  2. Add an RSS/JSON feed
  3. Add links to share (twitter?) a post
  4. Link off to my other pages in a nice way – perhaps like a profile
  5. Some sort of way to make posting here via (web or Github GUI) easier… Chrome extension?
  6. Make ./newpost command work cross-platform
  7. Encourage people to clone and create their own status feed!
  8. Move the styles and things out to their own files.

Otherwise… this is pretty cool!

Max Glenister

What about post hierarchy? Can this post have a parent?

Yes it can! Using the handy parent frontmatter, and specifying the post that it’s a child of.

Also, the parent will be embedded in place, and on the parent post it’ll indicate it has a reply.

In reply to:

Max Glenister

Things I should probably add to this…

  1. Style the individual status pages
  2. Add an RSS/JSON feed
  3. Add links to share (twitter?) a post
  4. Link off to my other pages in a nice way – perhaps like a profile
  5. Some sort of way to make posting here via (web or Github GUI) easier… Chrome extension?
  6. Make ./newpost command work cross-platform
  7. Encourage people to clone and create their own status feed!
  8. Move the styles and things out to their own files.

Otherwise… this is pretty cool!

Max Glenister

I’ve added Twemoji support!

🎉 😜 👯 🍻 🎈 🎤 🎮 🚀 🌉 ✨

Max Glenister

If you’re following at home, this is essentially a git-powered (Jekyll + Github Pages in this case) microblogging platform. No silly character limit, and markdown support. Magic! ✨

Max Glenister

I’ve been thinking about how I could go about creating an extension to make posting easier as part of my usual workflow. Github conveniently have an API for creating files (that they use in their own GUI infact!).

https://developer.github.com/v3/repos/contents/#create-a-file

So I’ll need to create an extension with a popup that lets you enter the body of your status update, and then creates a .md file at _updates/{timestamp}.md automatically.

Should be easy enough – though it’s not an urgent requirement as I have my handy ./newpost shell script.

Max Glenister

Things I should probably add to this…

  1. Style the individual status pages
  2. Add an RSS/JSON feed
  3. Add links to share (twitter?) a post
  4. Link off to my other pages in a nice way – perhaps like a profile
  5. Some sort of way to make posting here via (web or Github GUI) easier… Chrome extension?
  6. Make ./newpost command work cross-platform
  7. Encourage people to clone and create their own status feed!
  8. Move the styles and things out to their own files.

Otherwise… this is pretty cool!

Replies:

Max Glenister

What about post hierarchy? Can this post have a parent?

Yes it can! Using the handy parent frontmatter, and specifying the post that it’s a child of.

Also, the parent will be embedded in place, and on the parent post it’ll indicate it has a reply.

Max Glenister

Oh right yeah… and it’s powered by Jekyll, MomentJS and Linkify so I get all the magic of writing Markdown and keeping everything super simple.

Take this for example, boom extra paragraphs!

Max Glenister

So this is a small thing I’ve wanted to do for a while. Longer-form than Twitter, shorter form than https://blog.omgmog.net – Maybe I’ll use this frequently. Who knows?

Max Glenister

Alright! Finally got the designs of https://blog.omgmog.net and https://omgmog.net in line. 📐💯

Max Glenister

New blog post: “Well that has been a crazy couple of months… Onward!” 💥🙌📣🎁