Laur IVAN

Run Restricted Groovy API in Jenkins

Posted by in IT, Tutorial

The more recent versions of Jenkins have improved on security. Unfortunately, a side-effect is that scripts which were running before would fail now. An example is:

… which would list the projects defined in Jenkins. Fortunately, you can have access to theis API via the In-process Script Approval plugin (which is installed by default). If the script (pipeline) is versioned or executed in the sandbox, then you’ll need to approve method by method. If the script is not versioned, then you have the option to execute it outside the…read more

Fix Missing In-process Script Approval in Jenkins

Posted by in IT, Tutorial

Normally, when you have a script or a method to be approved, you should see the In-process Script Approval entry in your Jenkins’ configuration: Unfortunately, the In-process Script Approval entry in Jenkins’ configuration is not always shown, even though we have items to be approved. I found that installing the Permissive Script Security and briefly enabling it would solve the problem. On linux (Ubuntu), you need to edit /etc/default/jenkins and add

Then, you need to restart Jenkins for the security plugin to be disabled. I executed one of the…read more

Bulk Change the Date on Photos

Posted by in Random, Tutorial

I’ve got a new camera and I forgot to update the date. Consequently, the first photos are taken on 01/01/2017 instead of 04/03/2018. Given that more than 100 photos were taken, it would be a pain to change them one by one. So, here are the steps I did update the date: Download exiv2. Just search for exiv2-0.26-msvc.tar.gz (0.26 was the most recent at the moment of writing). Open it and extract the relevant folder (\dist\2015\x64\dll\Release in my case) in a convenient place (e.g. C:\EXIV\) Open a command prompt to…read more

Fix Jenkins Ignored Plugin “Check Now”

Posted by in IT, Tutorial

TL;DR: Check if a browser extension is blocking your request when you click Check Now While playing more with jenkins, I’ve encountered an error while requesting Check Now for plugin updates: it seemed that my request got ignored. I’ve tried different URLs (with and without HTTPS, stable or not) with the same result: my request seemed to be ignored. I’ve assumed first there’s a proxy error or some limitation on the server side. The logs however didn’t reveal anything. Then, I’ve checked the browser side and I’ve found that my…read more

Fade colors in Corona using Transitions

Posted by in Software, Tutorial

Corona provides transitions. According to this post, a transitionTo(…) would suffice:

The user can also cancel the transition if needed (which is waht I would need to do later in the code). In case you’re into custom stuff and the easing functions are not enough, you can create your own. A sample can be found here. The signature of the easing function is (at the moment of writing) function customEasing(t, tMax, start, delta) where: t is the time elapsed since the start tMax is the duration of the transition…read more

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