Love Death Robots: Season 1

is an amazing show. It’s weird, gory, funny and some of the mockery of humanity hits you like a bitter brick in the genitals.
If you’ve felt forgotten and waited for more than 9 episodes of The Animatrix or if you don’t mind a fast paced mash up like Into The Spiderverse, or an explicit master piece like Ghost in the Shell this is for you.
The show is available on Netflix and every episode so far has been a firework of effects, dystopian fantasies and science fiction amazeballsness.
Stop reading this blog and go watch it if any of what I just mentioned appeals to you in any way.

Deploying a Nuxt.js App with Docker

Let’s check out how you can deploy your Nuxt.js app, including server side rendering, with Docker. You can also view this post as a video:

The versions at the time of writing are:

  • nuxt: 2.6
  • Docker 18.09.3

Nuxt.js installation

For this tutorial I’ll create a new nuxt app

npx create-nuxt-app my_app

Hitting ENTER will work for us, but you can customise your app as you wish.

? Project name my_app
? Project description My shining Nuxt.js project
? Use a custom server framework none
? Choose features to install Prettier, Axios
? Use a custom UI framework none
? Use a custom test framework none
? Choose rendering mode Universal
? Author name Jonathan M. Hethey
? Choose a package manager npm

  To get started:

    cd my_app
    npm run dev

  To build & start for production:

    cd my_app
    npm run build
    npm start

Now let’s verify that our app works with:

    cd my_app
    npm run dev

If we access http://localhost:3000 now we should see:

Which is exactly like it should be.

Nuxt.js Dockerfile

Next, we’re going to write the Dockerfile for your Nuxt.js app.

FROM node:11.13.0-alpine

# create destination directory
RUN mkdir -p /usr/src/nuxt-app
WORKDIR /usr/src/nuxt-app

# update and install dependency
RUN apk update && apk upgrade
RUN apk add git

# copy the app, note .dockerignore
COPY . /usr/src/nuxt-app/
RUN npm install

# build necessary, even if no static files are needed,
# since it builds the server as well
RUN npm run build

# expose 5000 on container
EXPOSE 5000

# set app serving to permissive / assigned
ENV NUXT_HOST=0.0.0.0
# set app port
ENV NUXT_PORT=5000

# start the app
CMD [ "npm", "start" ]

This Dockerfile is based on the node alpine Linux image and then moves on to install git, the npm dependencies and finally builds and starts the Nuxt project.

Note that the NUXT_HOST and NUXT_PORT are set to Bind to any IP at port 5000, this might change depending on how you deploy your docker container.

My .dockerignore file contains the following to prevent using my local dependencies and builds:

node_modules
npm-debug*
.nuxt

Building your docker container can be done with, while in the repository with the Dockerfile present:

docker build -t my_app .

The output should be something along the lines of:

Removing intermediate container 7e9f607fb06e
 ---> c5b57739f412
Step 9/12 : EXPOSE 5000
 ---> Running in a326b4f25052
Removing intermediate container a326b4f25052
 ---> 796e335481fb
Step 10/12 : ENV NUXT_HOST=0.0.0.0
 ---> Running in 9aa3b799df0b
Removing intermediate container 9aa3b799df0b
 ---> 12f905ccb574
Step 11/12 : ENV NUXT_PORT=5000
 ---> Running in d9e9e111a32c
Removing intermediate container d9e9e111a32c
 ---> 0eab950732ab
Step 12/12 : CMD [ "npm", "start" ]
 ---> Running in 211496606e04
Removing intermediate container 211496606e04
 ---> 54779de7e817
Successfully built 54779de7e817
Successfully tagged my_app:latest

Next, to run the container:

docker run -it -p 5000:5000 my_app

Which should show this or similar:

   ╭────────────────────────────────────────────╮
   │                                            │
   │   Nuxt.js v2.6.1                           │
   │   Running in production mode (universal)   │
   │   Memory usage: 20.8 MB (RSS: 54.9 MB)     │
   │                                            │
   │   Listening on: http://172.17.0.2:5000     │
   │                                            │
   ╰────────────────────────────────────────────╯

and also display the app again when accessing the stated listening URL.

Summary

Setting Nuxt.js up with a Dockerfile couldn’t be much easier than it is already, so you know you have a reliable way of distributing your app after writing it.

I’m still new to Nuxt.js, but I suggest you give it a shot, since it’s amazing.

Elite Dangerous: You are small, the ‘Verse is big.

Elite Dangerous or simply Elite is somewhere between a space flight simulator and an immersive open world role play game. You get dropped into the universe after optional and basic training.

The space simulation part of the game is incredibly well executed, the sheer distances that need to be overcome can take up quite a portion of game time. However, depending on your preferred play style, you can play Elite in a number of different ways.

Continue reading “Elite Dangerous: You are small, the ‘Verse is big.”

Watchdogs 2: Hack the Planet!

Watchdogs 2 is a very worthy sequel to Watchdogs and in general it’s bigger and more colourful and light hearted than the original.

Ubisoft continues the series in San Francisco and again you’re a hacker that fights the super surveillance company Blume by exploiting their product ctOS to manipulate the environment to your advantage.

The game does a good job at being an open world game with a few multiplayer (co-op and pvp) components along the immersive single player storyline.

Both story and visuals have received a ton of love, some characters return from the first Watchdogs and it doesn’t seem weird.

Continue reading “Watchdogs 2: Hack the Planet!”

Spiderman: Into the Spiderverse; Visual Style Mashup Deluxe

This post is about why Into the Spiderverse looks fantastic, for that I’ve taken some screenshots of the official trailers at intothespiderverse.movie to illustrate what I’m talking about.

The vibe I got from the trailers was that it’d be a similar movie to Big Hero 6 and I wasn’t disappointed. Into the Spiderverse is a great animated movie that does not take itself too seriously, has a fine story for the first of a potential series and is visually stunning.

It’s a PG movie (meaning no actual age restriction) so you can see it as a kids movie, but if you’ve seen any of the spider man stuff, especially the Toby Maguire ones, there’ll be stuff to laugh about.

Anyways, the story in a super hero movie isn’t exactly what you’re going for, but how the characters are going to overcome their challange and what funny stuff they say along the way.

The Visuals

The graphical style and combination of the movie pretty much blew me away. It’s a glitchy combination of:

  • relatively realistic 3D
  • old school comic looks
  • some anime elements

and a lot of street art style aesthetics come up in one way or another.

Generally the movie is in the 3D look, sometimes cutting over to the comic style for just a few frames, that are probably accurately enough grabbed from the comics to compete with Sin City on that one:

the most common 3D style

Notice the halftones that pretty frequently are used for varying effects, mostly to actually define brightness gradients of areas.

The composition with the split frame that has things happening in sequence was great as well, because it compresses a flashback or a scene where something expected happens in an entertaining way:

Next up is one of my favourite things, the channel splitting, which was actually sometimes used as a way of focusing. We watched the movie in 2D (because preference) but the channels are still split harder further away from the center or used in some action scenes:

Notice the blue and reds splitting away from the hand.

Lastly, the hatching was a welcome comic relic, which also was used to shade and shadow areas:

and this all is just what I noticed. I hope nobody from the studio reads this, because I probably missed a ton of things, but this was really different and really, really awesome.

9/10 would watch again!

Let me know what you thought about it if you’ve seen it!

Getting Started with Flutter on Linux for Android [Beginner Tutorial]

Flutter is a cross platform and performant native mobile app framework by Google and can target Android and iOS at the moment. The language that comes with it is Dart, which originally made it into Chrome Canary as a possible JavaScript replacement or alternative.

In this post we’re going to have a look at how to set up a development environment for Flutter and Android. At the end of this post, you’ll have a working development environment on Ubuntu, Linux Mint or similar, including your first Flutter app running in an emulator and device.

Installing Flutter and Android Studio

The Flutter Linux Installation Docs are the starting point and take you through downloading the appropriate file:

# adapted
cd ~/Downloads
wget https://storage.googleapis.com/flutter_infra/releases/stable/linux/flutter_linux_v1.0.0-stable.tar.xz
tar xf ~/Downloads/flutter_linux_v1.0.0-stable.tar.xz

Now you can add the flutter binaries to your PATH, either by running this in your terminal:

export PATH="$PATH:/home/$USER/Downloads/flutter/bin"

or by adding it to the configuration file of your shell permanently. Depending on which shell you use, these will typically be:

  • ~/.bashrc for bash
  • ~/.zshrc for zsh

Open the respective file and add around the bottom.

export PATH="$PATH:/home/$USER/Downloads/flutter/bin"

You can reload your config by running:

  • source ~/.zshrc
  • source ~/.bashrc

or restart your terminal.

You can verify your flutter installation with flutter doctor, the output should be something like:

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, v1.0.0, on Linux, locale en_US.UTF-8)
[✗] Android toolchain - develop for Android devices
    ✗ ANDROID_HOME = /home/jonathan/Android/Sdk
      but Android SDK not found at this location.
[!] Android Studio (not installed)
[!] Connected device
    ! No devices available

! Doctor found issues in 3 categories.

Installing Android Studio and Flutter Plugins

First, we’ll need to download Android Studio and unpack this into our Downloads or home folder. I have placed my unpacked version in /home/jonathan/android-studio. To start it I can run:

cd /home/jonathan/android-studio/bin
./studio.sh

This will open the IntelliJ based IDE for Android Studio and start off with a splash screen. After the IDE has started, just create a new Android project, because we want to head into the Tools menu and open the SDK Manager.

Inside the SDK Manager we want to navigate to the Plugins menu and press the Browse Repositories… In the following dialogue you can now search for Flutter and hit install, which should prompt you to install the Dart plugin as well.

Adding the Android Studio Home to your PATH

Now that we have the Android Studio installed, it should have created a directory in our home folder called Android, to add the tools and platform-tools that come with it, we need to add something like the following to our .zshrc or .bashrc. Remember to change the paths if you’re not called Jonathan 😉

export ANDROID_HOME="/home/jonathan/Android/Sdk"
export PATH="/home/jonathan/scripts:/home/jonathan/projects/go/bin:/home/jonathan/Downloads/flutter/bin:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools:$PATH"

Remember to reload your shell config with source ~/[config name here].

Now to verify that we have installed the Android SDK correctly, let’s run flutter doctor again:

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, v1.0.0, on Linux, locale en_US.UTF-8)
[✓] Android toolchain - develop for Android devices (Android SDK 28.0.3)
[✓] Android Studio (version 3.2)
[!] Connected device
    ! No devices available

! Doctor found issues in 1 category.

After installing the Android SDK, you’ll have to agree to some license agreements via the CLI. Now we still have No devices available, let’s fix that with an Android Emulator.

Adding an Android Emulator

In Android Studio, head to Tools and then AVD Manager (Android Virtual Devices) and add a new emulator. This should be straight forward.

After you have gone through this process and started your emulator, you should no longer receive the warning that no devices are present by flutter doctor.

Troubleshooting the AVD

If you can’t add an AVD due to errors regarding /dev/kvm permission denied on Linux, you can try to install some additional dependencies and adding your user to the kvm group:

sudo apt install qemu-kvm libvirt-clients libvirt-daemon-system bridge-utils virt-manager
sudo adduser $USER kvm

NOTE: after running the adduser command you should restart your machine.

If you’re still facing trouble, there may be a BIOS setting which is not set correctly, for the most common BIOS versions you can see how to change it here: fedora wiki: BIOS setting for virtualisation

For GIGABYTE mainboards this setting is slightly hidden within Advanced CPU Core Settings and called SVM mode which needs to be enabled.

Enabling your Android Phone for Development

To set your phone up for app development, you’ll need to enable some developer settings, like explained by the Google Android Docs.

After this, if your phone is the target device for flutter and attached to your computer, it will automatically install the app and launch it when you use flutter run.

Creating your first Flutter App

For the next step you can either use Visual Studio Code or the Android Studio, as you wish. I’ll use vscode in the example:

  1. I create a directory where my flutter projects will live with cd ~/projects && mkdir flutter && cd flutter
  2. I create a new flutter project with flutter create test1
  3. I follow the instructions and run cd test 1 and flutter run
  4. The app should now appear in your AVD

To open your project with Visual Studio Code, change to your project directory with cd ~/projects/flutter/test1 && code .

Now you will be able to edit the flutter app and change the text labels or counter behaviour (try adding 3 at a time!).

If you want to integrate VSCode more closely with Flutter, make sure to install the Dart and Flutter plugins, which will enable you to create new projects or run your app from within Visual Studio Code.

That’s it! You’re now up and running with Flutter development for Android! Happy coding and remember to share your first app results!

PS: Thanks to some sub-reddits and Thomas for the review!

Physical Location Security (Wild West Hacking Fest Talk)

This year the lady gave me a lock picking set (affiliate link). I’ve always been interested in security, mostly in the digital space, but also for assets in the real world.

When we got our apartment I was very pleased that the door locks in three places and that the key is two dimensional. Certainly not high security stuff, but at least not kicked down with one swing.

When I talk to other people they usually become uncomfortable or resignated when we look at how easily things can be broken, broken into or exploited. In a way I think that’s a mindset issue.

The ones that get uncomfortable usually resort to something like:

These hackers should just stop showing everybody how to break into stuff on YouTube!

Continue reading “Physical Location Security (Wild West Hacking Fest Talk)”

Strange Brigade Review

Strange Brigade is a co-op shooter that I recently acquired and actually find quite entertaining. You are an Indiana Jones or Lara Croft style adventurer in the 1930s that shoots their way through hordes of zombies and solves various riddles on the way to a boss fight that finals every map that usually takes about 45 minutes.

This, in essence, describes the game relatively accurately, but its charm really comes through the overly British 19th century commentator that relentlessly points out what ever you are doing, the diverse characters you can select, and the fact that it doesn’t take itself too seriously.

Continue reading “Strange Brigade Review”

Lenovo IdeaPad 120s-14 AP Review

I’ve used a Lenovo IdeaPad 120s temporarily because of a slight emergency and even did some coding on it. To say the least, it’s been weeks of managing resources very carefully and learning why performance is still an important factor in computing in general 🙂

If you’re considering buying it, make sure to be aware that this is an incredibly low end machine and that you exclusively want to use it as a distraction free environment (it doesn’t run many applications at once) and that you’ll probably only use it to write your novel. Using vim. Also you want a machine you can probably charge using a solar panel on your van and that lasts 5+ hours without flinching (8h advertised, depends what you do).

Continue reading “Lenovo IdeaPad 120s-14 AP Review”

Using Vue.js with Parcel.js Tutorial

Vue.js is ever growing in popularity and even though it has a strong CLI that allows you to kick start projects, you can use other bundlers like the Parcel bundler.

The Parcel bundler excells at simplicity and only requires and entry file like index.html, yet it results in highly optimised builds with its powerful defaults.

Also Parcel, like webpack, works well with all kinds of JavaScript frameworks like React, Preact and of course Vue.

Continue reading “Using Vue.js with Parcel.js Tutorial”