You can hack on FreeNAS 9

This post analyses the FreeNAS 9 code base and discusses the various places users may feel confident to hack on. FreeNAS uses the following software stack: Django A Python Web Application Framework which complies with WSGI Nginx A very fast web server which may act as a reverse proxy server for HTTP, HTTPS, SMTP, POP3, […]

Nginx with SSL and mixed content errors with upstream WSGI servers

Mixed content errors occur because Nginx (the front-end server) communicates to the upstream WSGI server using http. WSGI does not know (or care) about the SSL session between Nginx and the user. The WSGI server will naively generate URIs and serve assets as http. To fix mixed content errors, we need to communicate the inbound […]

How to patch Heartbleed OpenSSL defect (libssl) on Ubuntu

Lots of people claim that you need to upgrade openssl package, but this will not fix the issue. The issue is not the openssl package, it is one of the libraries that the package relies on (libssl). http://www.ubuntu.com/usn/usn-2165-1/ The output of openssl version -a command should have a built on date older then Mon Apr […]

Filter Salt Stack Return Data Output

Sometimes you only want to see what has changed, and that is OK. Create a file like this: filter.py #!/usr/bin/python from json import loads from json import dumps import fileinput stdin_lines = [line for line in fileinput.input()] ret = loads(”.join(stdin_lines)) for minion_id, data in ret.items(): print(minion_id) print(‘=’*len(minion_id)) for key, value in ret[minion_id].items(): if value['changes'] or […]

Replace the Nagios Scheduler and NRPE with Salt Stack

Note: I will update this post as I progress. So the idea is to use Salt Stack’s remote execution to communicate with all nodes and run the Nagios checks and collect the return output instead of using the NRPE client/service protocol. This reduces the number of agents running on each host and appears significantly more […]

Configuration Management and the Golden Image

When operations first became a thing, system administrators stood up servers using a base image from their favourite distribution. Things were done manually. Some administrators created their own distros, some wrote customised shell scripts to be run once-and-only-once to provision software and settings. This method worked, but it was slow, manual, and the human element […]

Automatic Backups

I maintain many scripts and applications for creating automatic backups or various systems. This page will act as a hub to each of those solutions. tar-back tar-back is a backup utility to tar and gzip target filesystems. It supports a custom retention, filter exclusions, and backup directory. virt-back virt-back virt-back is a python application that […]

tar-back

tar-back is a backup utility to tar and gzip target filesystems. It supports a custom retention, filter exclusions, and backup directory. I use tar-back in combination with cron to perform regular backups of all localhost filesystems into /archive/fs. I then have a central long term storage server that collects the /archive partition from every host. […]

mysql-back

mysql-backis a backup utility script to dump (backup) and gzip every MySQL database on a host. I use mysql-back in combination with cron to perform regular database dumps of MySQL servers to the /archive/db partition on localhost. I then have a central long term storage server that collects the /archive partition from every host. mysql-back: […]