Laur's blog
  • Home
  • About
  • Support my work
Sign in Subscribe
Rundeck - Speeding Up Even More the  Cleaning Process
execution

Rundeck - Speeding Up Even More the Cleaning Process

As I was running the script, I've noticed it ran very slow. I have left it for a few days to run (700K executions), I've noticed the speed increased linearly over time. As Rundeck has both DB and files to store its data, it looked to
Oct 12, 2018 1 min read
Delete Executions in  Rundeck - Wrapping it all Up
delete

Delete Executions in Rundeck - Wrapping it all Up

The previous posts have built the components to allow us to get projects, jobs, executions and remove executions from a Rundeck instance via its API. Now, we can just wrap them up :) The list of packages we need is: import time import datetime import sys import logging For convenience, I&
Oct 9, 2018 1 min read
Remove Executions in Rundeck
execution

Remove Executions in Rundeck

TL;DR: You have to get the executions' list and remove the appropriate ones using hte API. Once we've managed to get the list of job executions, we can use the API to remove the relevant executions. The command is rather simple: def deleteExecutions(server, port, api_
Oct 8, 2018 2 min read
Get Job Executions in Rundeck
date

Get Job Executions in Rundeck

Following the previous articles, we are now in position to query job executions. The query is done via API as well. As a job can have an arbitrary number of executions, it's advisable to use pagination. The code follows the same lines as the one in the previous
Oct 3, 2018 1 min read
Map Subdomains to Docker Containers with Synology
alias

Map Subdomains to Docker Containers with Synology

The other day I got fed up with having to insert diskstation.local:12345 to point towards an installed service on my NAS. I also thought that my SO has difficulties remembering all the ports (I do too) and cleaning up the browser cache doesn't help either. So,
Oct 2, 2018 3 min read
List Rundeck Jobs for a Project
api

List Rundeck Jobs for a Project

Now that we Rundeck have a list of project names, we might want to see which jobs were created for each project. To do this, we need: 1. The Rundeck instance's address (server, port) 2. The API key (api_key) 3. A project's name (project_name)
Sep 6, 2018 1 min read
List Rundeck Projects
list

List Rundeck Projects

The other day I found out that Rundeck has an API which allows it to be controlled remotely by scripts. I've decided to write a script to list all the projects defined in a rundeck instance. Prerequisites Before you start, you need: * The instance's URL (server
Sep 6, 2018 1 min read
Remove Large Files in Git
bfg

Remove Large Files in Git

TL;DR: BFG is your friend. java -jar bfg.jar -b 50M myrepo-bfg.git for example The other day I've committed a rather large file by mistake (generated movie of the git commit history). This was a bit annoying because all other developers would have suddenly to check
Sep 6, 2018 1 min read
Fix 418 Unused Error on Dreamhost
418

Fix 418 Unused Error on Dreamhost

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
Sep 6, 2018 1 min read
Run a Rundeck Command as a Different User
other

Run a Rundeck Command as a Different User

TL;DR: Add the rundeck user to the sudoers and then use sudo Installing rundeck on Ubuntu usually results in creating a rundeck user. We had a bunch of issues creating a rundeck job because we needed to execute a command as a specific user (only that user had access
Sep 6, 2018 1 min read
Fix Not Found Package Errors with .staging Warnings on Npm Install
404

Fix Not Found Package Errors with .staging Warnings on Npm Install

TL;DR: Clean the npm cache and the package-lock.json The other day I started to get ENOENT warning when running npm install like: [WARNING] npm WARN tar ENOENT: no such file or directory, open '/home/test/app/node_modules/.staging/mydatepicker-b7bb53d9/dist/index.js' only to have
Sep 5, 2018 1 min read
Fix TS1144 for e.g. flex-layout
angular

Fix TS1144 for e.g. flex-layout

TL;DR: Update your typescript version dependency. These days we're updating some angular apps to the most recent version (6 at the time of writing this entry). Everything is nice, with the exception of various errors we get because of the other dependencies. The most recent one was
Sep 5, 2018 1 min read
Build a Django Docker Image with Cx-Oracle
django

Build a Django Docker Image with Cx-Oracle

TL;DR: Don't use alpine images. There's a glibc issue. We added a cx-oracle dependency to one of our django apps. As the previous image was just an alpine basic (python) image we needed to put in place a process to build the new image. Initially,
Jul 17, 2018 3 min read
Execute a Command in Every Directory with Bash
bash

Execute a Command in Every Directory with Bash

TL;DR: Use a find-based loop The other day I was wondering how to execute a command in each sub-directory of a project. In python, you have os.walk. In C, I would've probably written myself something just for fun etc. In shell, I know you have find
Jul 13, 2018 1 min read
Build Update Statements with Oracle SQL Developer and Python
developer

Build Update Statements with Oracle SQL Developer and Python

By default, SQL Developer can only export INSERT statements. This is quite unfortunate when one needs to build UPDATE statements because their syntax is different. I've tried to use regexp to convert the statements but I didn't find it not straight forward at all. So, I
Jun 18, 2018 2 min read
How to Develop Pipelines - Some Best Practices
best

How to Develop Pipelines - Some Best Practices

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
May 30, 2018 1 min read
Sending HTTP requests with Jenkins Pipelines
http

Sending HTTP requests with Jenkins Pipelines

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
May 24, 2018 1 min read
An Initial CI/CD Pipeline
deploy

An Initial CI/CD Pipeline

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
May 24, 2018 1 min read
Copy Files From B to C via A with SSH
copy

Copy Files From B to C via A with SSH

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
May 24, 2018 1 min read
Run Restricted Groovy API in Jenkins
approve

Run Restricted Groovy API in Jenkins

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: jenkins.model.Jenkins.getInstance().getAllItems().each { // MavenModule is superfluous project returned by getAllItems() if (!(it instanceof hudson.maven.MavenModule || it instanceof hudson.matrix.MatrixConfiguration)
Mar 16, 2018 3 min read
Fix Missing In-process Script Approval in Jenkins
approve

Fix Missing In-process Script Approval in Jenkins

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
Mar 16, 2018 1 min read
Bulk Change the Date on Photos
bulk

Bulk Change the Date on Photos

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
Mar 13, 2018 1 min read
Fix Jenkins Ignored Plugin "Check Now"
browser

Fix Jenkins Ignored Plugin "Check Now"

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
Mar 13, 2018 1 min read
Fade colors in Corona using Transitions
corona-sdk

Fade colors in Corona using Transitions

Corona provides transitions. According to this post, a transitionTo(...) would suffice: local rect = display.newRect(50,50,100,100) rect:setFillColor(0,0,0,0) transition.to( rect.fill, { r=1, g=1, b=1, a=1, time=500, transition=easing.inCubic } ) The user can also cancel the transition if
Mar 11, 2018 2 min read
Fade Colors on a Polygon using the Game Loop
color

Fade Colors on a Polygon using the Game Loop

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: hud = display.newGroup() -- Build
Mar 11, 2018 2 min read
← Newer Posts Page 11 of 26 Older Posts →
Laur's blog © 2026
  • Sign up
Powered by Ghost