Build release pipelines on S3 with s3p

This weekend I finished my first sprint on s3p which is a Python library and CLI application that manages release pipelines on AWS S3. I put a lot of effort into the readme.rst file, so look there for usage and examples. The main purpose of s3p is to use code to enforce process when promoting […]

Dealing with pagination in Python

So I’m working with a API (AWS ElastiCache) that offers mandatory pagination of results. I need to get all results, so I took some time to work out this logic. The big difference between this example and the real API is this example passes around tuples while the real API passes around dicts. def my_func_that_paginates(max_results=3, […]

Turn python dict into a key=value string

I’m currently refactoring a script that tags AWS resources and I came up with this one liner to generate pretty output. It basically turns {‘tag1′:’value1′,’tag2′:’value2′} into tag1=value1, tag2=value2. Here is the code: ‘, ‘.join([‘=’.join(key_value) for key_value in {‘a':’1′,’b':’2′}.items() ]) Oh and here is a function if you love this! def dict_to_key_value(data, sep=’=’, pair_sep=’, ‘): “””turns […]

Migrating MongoDB from Ubuntu to SmartOS

I installed the mongodb 14.2.0 (uuid a5775e36-2a02-11e4-942a-67ae7a242985) dataset and launched a new zone. The zone automatically creates a username and password for admin and “quickbackup”. You can find these passwords by running the following command inside the zone: cat /var/svc/log/system-zoneinit\:default.log | grep -i mon First thing I did was disable authentication by modifying /opt/local/etc/mongod.conf: #auth […]

Set Root Password SmartOS Percona MySQL Zone

I used project-fifo to launch the percona (14.2.0) MySQL dataset. I couldn’t get into the MySQL instance so I reached out on IRC. Johngrasty, a friendly guy in the #smartos IRC channel, provided a command to display the randomly generated MySQL password emitted to the zone-init log: cat /var/svc/log/system-zoneinit\:default.log | grep MYSQL_PW I used this […]

Heka, World2!

This article expands on my “Hello World” for Heka blog post. Check that one out first if you are new to Heka. In this guide we introduce using Heka over the network by utilizing two Hekad processes on localhost. For discussion purposes we name one of the Hekad processes “sender” and the other “receiver”. The […]

Mailpile Salt States for Ubuntu or Debian

I wrote these Salt States to install Mailpile on an Ubuntu host. Fun fact, it took me 20 minutes to write these states and they worked the first time I ran them. Disclaimer – I used a throw away server and wasn’t concerned that buckets of packages were installed to the system instead of using […]

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 […]