Code Maven

Welcome to the Code Maven!

The main topics in abc order

  • Angular JS - some old articles about Angular 1.
  • Ansible - the configuration management system.
  • Flask, the Python microframework.
  • Groovy, the programming language used for Jenkins pipelines.
  • Handlebars the HTML templating system written in JavaScript.
  • Java
  • JavaScript
  • Jenkins, the automation server used for Continuous Integration and Continuous Delivery.
  • Linux
  • NodeJS
  • Perl
  • PHP
  • Python
  • Ruby
  • SVG, Scalable Vector Graphics examples in JavaScript and Python.

Most of the article are written by Gabor Szabo who provides Automation and DevOps related services. (Setting up CI systems, intorducing test automation, moving the company to "the cloud", etc.)

How to return a 404 error in Flask application

If someone access a url that you have not implemented, Flask will return a 404 error, but it won't look nice. We would like to create customized 404 page.

Sometime in a route that exists we might want to return a 404 error. For example we have a route that has a variable part for some content. (e.g. the ISBN number of a book.) Like this: /book/ISBN If the user accesses an ISBN number that does not exist our route will still be executed but now we would like to return a 404 error.


How to return a 404 error in Flask application


Elasticseach administrative and configuration commands

Just some random curl command that help me with the administration and the configuration of an Elasticsearch cluster.


Elasticseach administrative and configuration commands


Bash set -e to stop script on failure

Normally if one of the commands executed by a shell script fails it set an exit code different from 0, but the script will not stop. In some cases this might be the proper behavior, but in many cases, especially in a CI system you'll probably want your shell script to fail of one of its commands failed.

The -e tells Bash to stop immediately if one of the statements it executes has an exit-code different from 0.


Bash set -e to stop script on failure