EnglishSvenska

Our game Bananpiren has launched!


After years of inactive development I have decided to release the game I made together with my brother; Bananpiren. It is a game where you control a banana boat in Gothenburg. Your task is to transport as many banana crates as possible. Give it a try!

The game was my first game project in Unity3D. Great fun creating a game, but even a very simple game like this took more time than I would like to admit to finish. Let's see if I ever make a second one. Maybe if this one becomes a great success.

Posted in Bananpiren, Blog, Timeline

Enable dark mode on your website with CSS

Dark mode is getting more and more popular. It is easier on the eyes and especially when working late. Both Windows and MacOS support setting the color scheme to a darker tint, but the websites we visit stay the same. But that might be about to change with a new CSS standard.

I added this CSS code on this website:

/* dark mode */
@media (prefers-color-scheme: dark) {
  body
  {
    background: #111;
    color: #fff;
  }

  #header h1#logo a {
    color: #fff;
  }
}

What it means is that if the user prefers dark mode, invert the colors and make the background dark, and the text white. It looks like this if you navigate to the site using using a browser that supports this new feature, and if you have dark mode enabled in your OS:

Support for this feature is at the moment quite low. Only the latest versions of Safari and Firefox supports it, but it looks like it will make the standard so more or less every browser will support it in a while.

Posted in Blog

Setup free VPN between Windows and Ubuntu Linux computers

VPN

Diagrammatic representation of Internet VPN (Originally uploaded by Ludovic via Privacy Canada) https://en.wikipedia.org/wiki/Virtual_private_network

Use case, say that you have a corporate server that you want team members to access. Maybe it is running a build server (Jenkins) and source control repository (GitLab). Instead of publishing these services on the web we can keep them in a local network and then add access to them via a VPN; Virtual Private Network.

I use DynVPN and netvirt-agent. It was a bit tricky to get it working on Ubuntu linux so I decided to share the config:


sudo apt-get install supervisor
sudo nano /etc/init.d/netvirt-agent
'''
[program:netvirt]
;command=/home/sebnil/start_netvirt.sh
command=netvirt-agent
autostart=true
autorestart=true
user=sebnil
environment=HOME="/home/sebnil",USER=sebnil"
stderr_logfile=/var/log/netvirt/long.err.log
stdout_logfile=/var/log/netvirt/long.out.log
'''
sudo supervisorctl reread
sudo supervisorctl reload
sudo supervisorctl status

Change "sebnil" to your user.

Getting it running on Windows is much easier:

 

Tagged with: ,
Posted in Blog

Moved to Gold Coast, Australia

A few months ago I moved from Gothenburg to Gold Coast, Australia, to work for Volvo Penta and enjoy a sunnier life style 🙂

I have only been here 4 months, but so far I really like it. The sun is almost always shining, people are for the most part nice and helpful, salary for engineers is higher (compared to Sweden), taxes are lower and it is much easier to find a good place to live compared to Gothenburg.

I was a bit hesitant about moving to Gold Coast since I knew nothing about the place, but it is starting to grow on me. Even though it is much smaller than Sydney, Melbourne and Brisbane, it is still large enough to host large events and have lots of ways to waste time. The city is right by the coast, and in the background you have large mountains. My main goal right now is to get my surf going which is one of the most popular activities around here.

Posted in Blog

Real estate finder

Location, location, location! When I was searching for an apartment in Gold Coast, Australia, I wanted to have a tool that would list travel times to some important locations. For me it was travel time to and from work during rush hour, and time with public transport to the city centre. This python script does a few things:

  1. You give it a start search.
  2. The script will find the travel time to the locations (that you need to edit)
  3. Output into excel

I was experimenting a bit with making it a web app but kinda gave up. It works though, but you need to manually edit the code in a few places. Hope you find it as useful as I did!

Source code:

https://github.com/sebnil/real_estate_finder

Prerequisites

Python 3, pip, .. Just use Anaconda. It is great.

Authors

License

  • All code is licensed under the MIT License - see the LICENSE file for details
Posted in Blog

Software Engineer at Volvo Penta Oceania

Moved to Gold Coast, Autralia to work with Volvo Penta. Daily work is troubleshooting and developing control systems in marine applications.

Posted in Blog, Timeline

Västtrafik Monitor v2

Västtrafik har uppdaterat sina api:er vilket gjorde att min bussmonitor slutat fungera. De hade gjort det lite klurigare med Oauth2 men i övrigt var det mest att byta url till https://api.vasttrafik.se/bin/rest.exe/v2/departureBoard

All kod finns på Github.

Posted in Blog, Bussmonitor för Västtrafik

Cross platform mobile app for Volvo Penta Easy Connect interface


Volvo Penta has commited to implement better connectivity functionality. Part of this was the release of Easy Connect. An app which lets boat users connect to their vessel via Bluetooth. I developed the proof-of-concept and then continued as one of the developers in getting this product to market. I was responsible for the initial requirement specification, choice of development platform and the continuous implementation of new features and bugfixes. We decided to develop the app in Xamarin to get cross platform (iOS and Android) with a shared code base. Looking back it was the right decision.

Posted in Blog, Timeline

Trying some cross platform stuff in C#

I was interested in the idea of writing cross platform C# app. What I found is that putting the common functionality is a shared project, and then every GUI platform in its own project. In my example I used WPF for windows GUI and GTK# for linux. Works kinda nice.

https://github.com/sebnil/CrossPlatformCsharpExperiment

 

Posted in Blog

Xamarin CustomView Example

Github repo

Example project showing how to create a custom control (UIView) with XIB so that it's available in Xamarin iOS designer. Custom UIView does not render in storyboard, but can be selected from the toolbox window. If you make rendering in storyboard work, please make a pull request and I will merge it into this repo. The reason to this example project simply is that I was looking for an example like this but could not find something that was working out of the box.

Design custom view in xib using Visual Studio or Xcode (less buggy):

xib

CustomView is visible in Toolbox:

Toolbox

CustomView can be droped into your storyboard:

Storyboard

Simulator run. View can also be resized/rotated during runtime:

Storyboard

Getting Started

Clone and run .sln in Visual Studio.

Prerequisites

Visual Studio (Tested on Visual Studio CE 2017)

Author

License

This project is licensed under the MIT License - see the LICENSE.md file for details

Acknowledgments

 

Github repo (to download code)

 

Posted in Blog