Laur IVAN

Fade Colors on a Polygon using the Game Loop

Posted by in Software, Tutorial

One of the features I need to implement is to smoothly change the fill/stroke color of a polygon, like this: A manual approach In order to better understand the mechanics, I built my own fading PoC. First, one would need to build the polygon:

In this particular case, I have a text field and a rounded rectangle beneath it. the hud group contains both in the right order. Once the components have been created, we build the function to be called each frame:

The idea is to only…read more

Antialias a Polygon with Corona SDK

Posted by in Software, Tutorial

The other day I figured I needed to draw a polygon in Corona SDK. With display.newPolygon(...), the job is extremely easy and a result like (apologies for the JPEG artefacts): It is obvious that in non retina cases, one can see the aliasing of the polygon’s edges. Hence I’ve thought and searched of various ways to provide the polygons with antialiasing. The sum of solutions I found is: Find a flag to enable antialiasing for a polygon Use effects to perform e.g. a blur or a glow and adapt it…read more

Update Jenkins on Ubuntu

Posted by in IT, Tutorial

I’ve got an installation of Jenkins on a Ubuntu 14.04.5 LTS which I needed to update. In order to do so I did the following: Download the new version (2.107 at the moment of writing this post). In /home/user/backup/ execute:

Backup the old version (Jenkins war is installed in /usr/share/jenkins):

Overwrite the old jenkins.war:

Restart jenkins

Now, you’re all set and you can start updating the plugins. HTH, A little experiment: If you find this post and ad below useful, please check the ad out :-)

Ignore ESLint Directives in Code

Posted by in Software, Tutorial

The other day I’ve had to refactor a piece of angular code. Unfortunately, the original code was written a long time ago and has some issues like having $scope in controllers and a rather large number of unused variables. changing the $scope to this is a very time-consuming task as it implies prefixing functions and variables in the HTML code as well as selective replacements in JS ($scope.$watch for example must remain intact). In order to minimise the effort, I’ve decided to only move the code blocks around using John…read more

Monitor ethOS Distro with Elastic Search – 3

Posted by in IT, Software, Tutorial

Once we’ve set up the data sending from out ethOS machine, we can check that ElasticSearch collects data. With GET /ethos/_count, we get something like:

If the count is greather than 0, we can start analysing the data. Metrics I am currently measuring only machine. Therefore, I’ve set up some simple measurements: Hash rate Temperature Network Fan speed Hash rate I am measuring the average sum of all GPUs’ hash rates and the trend: I’ve built this with Timelion and the code is:

As you can see, there…read more

Proxy Content from URL with Webpack Dev Server

Posted by in Software, Tutorial

An application I’m working with has a large amount of static files (path starting with ‘/files/’) deployed on a mounted volume in Docker. They are subsequently served via nginx. for local development, I thought of two options: Add files to the local dev server (e.g. copy assets) Build a proxy to pipe the request to the nginx-served site The first option is somewhat restrictive: I’d have to make sure the files are kept in sync with the latest version. I’d have to integrate the syncing process with the build scripts….read more

Monitor Docker Logs with ELK – 2

Posted by in IT, Tutorial

This second post in the series provides a starting point for visualising the log data. It makes some assumptions that logs are collected in a way described by the first part, so I would suggest to read through it if you haven’t already. Verify First, make sure you have some data logged in: You should have at least two indices:

The Discover tab in Kibana should display some records. If it doesn’t please adjust the Time Range (top right at the time of writing). Tip: I set up a…read more

Monitor Docker Logs with ELK – 1

Posted by in IT, Tutorial

Following my attempts to monitor ethOS data via ElasticSearch and Kibana, I’ve thought it would be a good idea to start monitoring the logs produced by my various docker instances. This first part deals with configuring ELK and logspout. Prerequisites I assume the following: ELK is installed. You can do it either as a set of Docker images (oh, the meta!) or just plain package install. The receiver machine is configured. E.g., if you’re on windows, create a firewall rule opening TCP port 35000 (corresponding to the config). Once this…read more

Monitor ethOS Distro with Elastic Search – 2

Posted by in IT, Software, Tutorial

Following the previous post, we are now in position to install the monitoring code on the monitoried machine, of course. The easiest way is to download the code on the machine in /home/ethos. Following steps will assume you have the unpacked code in

Once you have downloaded the code, you need to add the location of the ElasticSearch server to the local.conf:

Dissecting the scripts The scripts are written in PHP, like ethOS‘s own scripts. I did that for two reasons: Take advantage of the already written code…read more

Monitor ethOS Distro with Elastic Search – 1

Posted by in IT, Software

TL;DR: It’s possible to monitor your ethos distro install on an ElasticSearch instance. I like EthOS. I like its panel too, but at the time of writing it had some issues on updating values This was somewhat unfortunate because it’s the same time when I set up my rig so monitoring without typing show stats every minute or so was quite important. So, I’ve proceeded to try and find a replacement for the panel. Initially, I’ve thought to develop my own solution with something like django, but since I’m not…read more