Using Mustache template system with CFEngine

Mustache is a template system logic-less(no ifs, else’s or for loops) and can be used for HTML, config files, source code and so on. CFEngine 3.6.x have support for Mustache, in this tutorial we will create a template and a CFEngine rule to parse the template and generate the file that we want. Create the template file /tmp/template.mustache My hostname is: {{hostname}} My name is: {{name}} Fruits that I like: {{fruits}} Our CFEngine file /tmp/parse_template....

April 13, 2015 · 1 min · Danilo Fernando Chilene

Install Virtualenv and Virtualenvwrapper on Ubuntu 14.04

Virtualenv helps a lot when you work with various Python projects or when you have to use specific packages or different Python versions. In this tutorial, we are going to install Virtualenv on Ubuntu 14.04 and configure it on zsh. Install pip, virtualenv and virtualenvwrapper sudo apt-get install -y python-pip python-virtualenv virtualenvwrapper Create the directory for our virtual environments mkdir ~/.venvs Configure ZSH - .zshrc Edit the file ~/.zshrc and paste the content below:...

February 10, 2015 · 1 min · Danilo Fernando Chilene

Pyramboia - a simple way to test webservices

I’m learning Django 1.7 lately and nothing better than practice and create something from scratch. I have a bunch of scripts to tests webservices(XML, soap, etc.) in python using requests library, it works well so far. It returns the time it spent running, the result in an XML format and based on these data I make decisions(send email, feed it to a monitoring tool, etc.). When it’s 1 or 2 scripts is easy to admin and make changes like the XML request, headers and so on....

September 29, 2014 · 5 min · Danilo Fernando Chilene

Monitoring CFEngine with Zabbix

I created a template to monitor CFEngine with Zabbix, that monitor processes, memory use and the promise summary log. Below what is included on the template: Process CF-serverd Process CF-monitord Process CF-execd Memory use process CF-serverd Memory use process CF-monitord Memory use process CF-execd Log cf-engine - Log view of /var/cfengine/promise_summary.log CFEngine listen port 5308 and generate alerts if (CF-serverd, CF-monitord, CF-execd) is down The template you can download it directly here: bit....

August 22, 2014 · 1 min · Danilo Fernando Chilene

Using Python to access SQL Server

Install the required packages UnixODBC and FreeTDS packages yum install -y unixODBC unixODBC-devel freetds Configure unixODBC Add the content below to the file /etc/odbcinst.ini [FreeTDS] Description=ODBC for SQL Server Driver=/usr/lib/libtdsodbc.so Setup=/usr/lib/libtdsS.so FileUsage=1 Configure FreeTDS Add the content below to the file /etc/freetds.conf tds version = 8 client charset = UTF-8 Install pypyodbc to Python handle ODBC connections pypyodc is a pure python ODBC interface. For more information access https://code.google.com/p/pypyodbc/ I’m using pip to install it....

August 7, 2014 · 2 min · Danilo Fernando Chilene