Laur IVAN

Fix 418 Unused Error on Dreamhost

Posted by in IT

TL;DR: Have a look at the error log and then to the violated rule. Suddenly, I started to get 418 errors on one of my sites. I’d just get 418 from the source and as they say: that was that. Normally, I don’t even notice such errors, but this one broke a bunch of pages. The 418 errors look in general like this:

Now, this translates to an rule for mod_sec2. To fix, you need to go to the file referred by the error, at the specific line and…read more

How to Develop Pipelines – Some Best Practices

Posted by in IT, Software

These days I’m developing a bunch of pipelines to automatise the build/deployment process. Here are some things I’ve learned: How to develop Initially, I’ve started developing the pipeline as any other program: Create a repository, fire my editor, write a Jenkinsfile and use the Pipeline script from SCM. While the result is exactly what you want to have at the end, the edit-deploy-run cycle becomes a chore and it’s quite unpleasant at the beginning (I had a bunch of typos for example), so DON’T. Instead, create a simple pipeline with…read more

Sending HTTP requests with Jenkins Pipelines

Posted by in IT

As part of the CI/CD process, we might need to communicate with some external services’ APIs (e.g. notifying elastic search of a new index alias). I found an easy way to do it: Using a jenkins plugin. Jenkins plugin Jenkins has a HTTP request plugin. If you install it (or have it installed), you have the ability to send HTTP requests to external servers from Jenkins. Fortunately, this plugin also plays wery well with pipelines. You can sent practically any (REST) command to a destination:

You can customisethe request…read more

An Initial CI/CD Pipeline

Posted by in IT

Release-based deployments are sort of nice in the sense that you plan, draw a line, prepare stuff and release one or more components at the same time. It however stalls feature deployments a lot (e.g. a nice feature can be implemented in say a day but the release is sheduled in a month). It also gives way to out-of-order releases to please the business. Agile (CI/CD) aims to alleviate some of these problems. Prerequisites As part of the transition process, one has to establish a stack. In my case, it’s…read more

Copy Files From B to C via A with SSH

Posted by in IT

The other day I had an interesting situation to solve: I have some data on machine B and I want it copied on machine C. However, machines B and C have no direct connection (known_hosts), but machine A can connect to B and C without password. It is obvious that one needs to use machine A as a proxy between B and C.

After a while thinking of tunnelling and using some sort of actual network proxy, I realised that I/O would also do the trick: We can have…read more

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

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

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 :-)

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