Skip to content

Posts...

Page 7 of 42

Initialise Python with GoCD

November 10, 2017Categories: IT, Tutorial
Following the deployment of a python-aware agent , we can start creating a pipeline. The first stage would be to: Clean up any previous data Create a virtual environment for python Install all dependencies from a requirements.txt file in our project Note: we assume the global pipeline settings…

Create a Python-friendly GoCD Agent in Docker

November 10, 2017Categories: IT, Tutorial
I've got two requirements to make GoCD useful: Run both the server and agent(s) in Docker Make it python-friendly Fortunately, GoCD offers Docker images (and Dockerfile s) for both, so it's just a matter of extending it: Unfortunately, pip is not quite adequate, so we re-install it from source…

Allow Docker Container Access Behind Proxy

November 10, 2017Categories: IT, Tutorial
In the previous post , I've described how to build an image when you're behind a proxy. Now, if your container needs access to the internet for e.g. downloading python dependencies, you'll need to give it explicitly. The way to do it is via -e parameter (environment) of docker run . You can…

Don't Symlink Indices in ElasticSearch!

November 9, 2017Category: IT
The other day I've been trying to improve the downtime when updating an index in elasticsearch (ES) and I've decided the best approach would be to create a new index and do a symlink to the active one, keeping the valid index. so, my structure would be: Note: this is likely not a best practice…

Show What's on Swap in Linux

November 6, 2017Categories: IT, Tutorial
If you find your machine running sluggish, it might be the case that you have too many things running and it's hitting the swap. You can check how bad (or good) things are with htop , but it won't tell you which process is sitting on swap. To find out, I've cooked up a tiny script: It will look in…

Fix Jenkins POM Freezer "Wrong Relative POM" Error

October 31, 2017Categories: IT, Tutorial
If you get a build error in Jenkins like: Then you have a POM freezing issue with the parent POM. I.e., the Jenkins plugin has failed to freeze the POM version from a 1.0-SNAPSHOT to an actual 1.0-6034-79 . A cause can be the plugin expects a certain sequence of tags in the POM and doesn't find…

Clean Up Your Zookeeper History

October 31, 2017Category: IT
TL;DR: Use zkCleanup.sh -n 5 command: By default, Zookeeper does not delete any of its history to allow recovery. This however can lead to disk space issues over long-ish periods of time. Therefore, it is advisable to clean up once in a while. Update: I found out that /usr/share/zookeeper/bin…

Match String on Multiple Columns

October 16, 2017Category: Software
TL;DR: Use concatenation, Luke! I had to search a name for an user in a table containing the first and last names in separate columns. After a while I got tired on looking up the first_name and last_name columns one at a time and I decided to try and search both. The result is something like: I…

Make a Shell Script with Arguments (Native)

October 13, 2017Categories: Software, Tutorial
I was building a bash script and I needed several arguments to make it more versatile (e.g. dry-run). The list of parameters was: help as -h or --help dry run ad -d or --dry-run to go through the motions without actually executing commands keep last N images ad -k num or --keep num to…

Handler for Global Logger in Python

October 11, 2017Categories: Software, Tutorial
While writing a command line tool, I've stumbled upon a strange situation: Some logs were written to a file while some others were printed to console . Quite annoying, particularly since every module I use has its own logger via logging.getLogger(__name__) . After some investigation I found out…
PreviousNext

All tags