Alle Beiträge von David

Lakka 2.0 – Retro-Gaming

It’s has been a long time since I had time for some useful and useless stuff. So we (isticktoit) found some useless stuff on Heise open: A Linux Retro-Gaming distribution and thought about bringing some old stuff up to ‚waste‘ some hours.

4:3 on a FullHD TV and pixels

In this case I tried the new release of the Lakka distribution, which is mostly for Retro/Emulator-Gaming. It contains a lot of emulators from Atari up to PlayStation and Nintendo.

Weiterlesen

Docker a nice tool for developers

Docker is the world leading software containerization platform. I tried using GitLab as versioncontrol system and Jenkings as continuos integration system but the system turned out as not completly useful.

In that way a colleague told me about a system he wants to create based on Docker.

What we want:

  • a git system under ouer control
  • a continuos integration that is flexible and customizable
  • every system available per SSL connection

Git Service -> GoGs – Go Git Service

It’s a simple self-hosted Git servise.

  • easy to install, cross-platform, lightweight and OpenSourse

It contains everything importent to develop something in collaboration.

https://gogs.io/

Continuos Integration -> drone

It’s a continuous integration platform build on container technology. Every build run will be triggerd by a push to a repository if it’s linked to drone.

  • flexible and customizable: by setting up a config file you tell drone what is to do

https://github.com/drone/drone

SSL -> NGINX as reverse proxy

It’s a fine powerfull tool and a nice reverse proxy. With it we are able to provide the GoGs and the drone to the internet more secure and with SSL encryted.

We will colleced the SSL/TLS certificates from a Let’s Encryt service.

https://www.nginx.com/ https://letsencrypt.org/

Weiterlesen

YouTube Audio Player

screen

For one year I have tried to create my own YouTube Audio Player. I wanted something that can play my playlists and favorite music from YouTube, but I only wanted the sound – no video. In that case I usually used a separate browser-window or -tab and that was sometimes very annoying.

Download all OS

So this player is build on top of NodeJS and Electron and uses the Google API for all YouTube requests. The code and the structure is available on GitHub.

Angular 2, Electron, NodeJS

Currently I’m working on a private project with Angular 2 (v.2.0.0-beta.0 | TypeScript), Electron (Atom Shell) and NodeJS.

I had some issues with Angular 2 and webpack modular bundler.
In my system I have to transcode all the TypeScript code with all the nice features to normal JavaScript-code (ES5).

first issue
  • It took me many hours to get the InterProcess Comunication from the Electron to the NodeJS running. The Problem is that the IPC-module is a native Electron-module and webpack is trying to find it in the node_modules folder.
    StackOverflow issue

Solution: webpack-target-electron-renderer
You have to change/update your webpack config. After that webpack will ignore or find the native Electron-modules.

second issue
  • In Angular 2 you can write components, services, …. and more. I wanted to use a service to get data from one component to another but I never got the data exchanged between them.

Solution: In my case I used the Componenttag „providers“ to create an instance of the declared service but every time you write „providers“ with a service in it, you are creating a new instance of the service and you will never get data from one component to another. You start your app with that

bootstrap(App, ['services']);

since then you have an instance of the provided services. To use them, you only have to import the service and to write in the somponent-constructor

constructor( %varname% : %servicename% )

 

conclusion:

The combination of Angular 2 (TypeScript), Electron (Atom Shell) and NodeJS is very nice. With that components you are able to build a client application rapidly. My next „nice to have“ is to integrate a CSS-preprocessor (SASS, LASS, …) in my projects to write CSS-code in the ways of a programmer.

Silvester ohne Raketen muss nicht sein

Im Süden Österreichs gilt heuer ein Feuerwerks-Verbot an Silvester wegen der Trockenheit, die in letzter Zeit herrschte.
Das hat David inspiriert, einen Countdown zu schreiben, der zu Mitternacht ein virtuelles Feuerwerk initiiert.

Zum Countdown gesellen sich Bilder aus der Umgebung – die mit wenigen Eingriffen im Code natürlich ausgetauscht werden können.

–> Hier geht’s zum GitHub Projekt
https://github.com/2er0/silvester

Ein gutes, neues und nerdiges Jahr wünschen das Isticktoit-Team
Florian, David, Tobias

Basemap.at (WMTS) in Leaflet.js

Mein Problem war es, dass ich in eine Leaflet-Map die „basemap.at“-Grundkarte einbinden wollte.

Hierbei bin ich auf einigen Widerstand gestoßen, denn es gab so gut wie keine Beschreibungen wie man die „basemap.at“ als Gurndkarte einzubinden hat.

Doch dank Google-Codesuche hatte ich ein Beispiel gefunden wo genau diese Kombination vorhanden war.

  1. Als erstes benötigen wir eine Javascript-Erweiterung:

    <script src="https://rawgithub.com/mylen/leaflet.TileLayer.WMTS/master/leaflet-tilelayer-wmts.js"></script>
  2. Nun wird eine Variable erstellt welche die Verbindung beinhaltet:
    var ign = new L.tileLayer("http://{s}.wien.gv.at/basemap/geolandbasemap/normal/google3857/{z}/{y}/{x}.png", {
        subdomains : ['maps', 'maps1', 'maps2', 'maps3', 'maps4'],
        attribution: '&copy; <a href="http://basemap.at">Basemap.at</a>, <a href="http://www.isticktoit.net">isticktoit.net</a>'
    });
  3. jetzt noch zur Leaflet-Map hinzufügen und fertig:

    map.addLayer(ign);

Man kann auch die Punkte 2 und 3 in einem Schritt durchführen.

Will man die derzeit verfügbaren anderen „Kartenlayer“ von basemap.at einbinden (zB die Orthophotos, Basemap grau,…), so muss man einfach die Tiles-URL in L.tileLayer anpassen – entsprechend den Angaben, die sich im getCapabilities.xml des WMTS-Dienstes finden.

Link-Grundkarte: Basemap.at

UPDATE:

Hier ein volles Beispiel mit Basemap & OSM & Blank: Leaflet & Basemap example

Linux „awk“ & more

„awk“ ist ein sehr angenehmes Linux-tool zum Analysieren von Texten und Werten.

Ein kleiner Vorgeschmack:

awk -F "," '{print $6 " " $4 " " $2}' export_airports.csv | sort | awk '{sum+=$1;print $0} END {print "SUM: "sum}'

Dies liefert eine sortierte Liste mit den Werten aus dem GeoDatenFile von meinem Kollegen. Dort habe ich mir die Werte aus dem „.dbf“ File in eine „.CSV“ File gespeichert, um mit „awk“ angenehm diese zu analysieren. Weiterlesen