NGINX dynamic fastcgi_param based on host

Techstack: Ubuntu/Debian, NGINX, PHP5FPM ( I will assume that you have these installed and nginx is talking to php5fpm)

Supposed you have a php application that needs to do different things based on a fastcgi_param variable, but you want to set a different variable based on another variable in nginx (like http hostname).

The nginx http_map module is the answer, but it may not be immediately obvious how to use it.

Continue reading


Simple Ansible playbook to install Puppet 3.6.2 on your Ubuntu 12.04 servers

This is a super simple way of installing a current version of Puppet on your Ubuntu servers.

You will need

All you need is SSH access with SSH KEYS, and Ansible installed. My thinking is that once you have SSH access, you should be able to do anything you please with the resources.

Why would you want to do this?

  • Puppet can be a pain to install (up to date versions, instead of OS version)
  • You may not have a preseeded, kickstart iso
  • You may have previous outdated installation, and you need to get compliant
  • With Ansible you will not need to repeat a series of steps, and you will know for sure that all the steps have been completed

Here I assume you have a recent version of Ansible installed with pip.

My ansible hosts file looks like this (it can live in your home folder and can be called staging ~/staging )

My ansible playbook looks like this, it should live next to the hosts file for convenience. I called this file puppet.yml .

This is how I ran my playbook against my proxmox-webservers :

The -v option will make the output busier, so you see what is going on.





Proxmox + ZFS on Linux local storage Part 1

CAVEAT: This is by no means stable, reliable or noobie friendly.  June 12 2014, zfsonline release update, your zfs pool is now not accessible.

PROXMOX is a free open source virtualization environment based on Debian. Proxmox has KVM and openvz virtualization.

ZFS is the legendary Solaris filesystem and volume manager, that really cares about keeping your data intact.

Running ZFS and PROXMOX on the same box is not the best idea for production, but it is very convenient if you have dev/lab setup.

This should be a very clear guide on how to setup ZFS on PROXMOX.

I have this running on my Supermicro server.

MODEL: SuperServer 6026TT-GTRF
CPU: 1x Xeon X5620 Quadcore 2.4Ghz
RAM: 3x 4GB = 12GB
STORAGE: 4x 1TB, 1x 500GB

Only one server node is being used.
The virtual machines are relatively fast, I should really run some benchmarks and share the output.

Continue reading

Youtube full window bookmarklet

I like watching youtube videos along side whatever I am reading.
But the player is clunky.

So I made this bookmarklet that opens the youtube video in a new full window, it scales if you resize it.

Click, hold and drag this bookmarklet to your bookmarks toolbar.

Then click on it when you are watching a video on youtube.

Here is the code:


Terraria Server

Hosting a dedicated Ubuntu Terraria server behind a wall of routers and firewalls with reverse ssh tunnels, rackspace and tshock.

I am now addicted to Terraria, it’s really really good, and I would like to play with friends across the interwebs.


Because at home I have two routers and two firewalls between my computer and the internet, my wi-fi is a separate network and I use open-vpn (OpenVPN for Android) from my android to connect to my media on the “safe network”.

It’s all really complicated, and in my opinion NAT (network address translation) is stupid because you have to “control” so many points along the route that configuration changes become a nightmare.


You will install tshock and mono on Ubuntu 12.04 (I used a virtual machine for the Terraria server 2CORES 2GB RAM because mono was not happy with 512MB of RAM). Then you will configure the ssh service on your rackspace Ubuntu server to accept “Gateway ports”.

Then you will run a reverse SSH tunnel from the terraria server and everything will work.

Continue reading

How to sign android APK packages so they can be installed on your phone after you have tinkered with the files

The humble bundle for android is out, it’s good and awesome and you should go buy it now because it will make you a better person.

I installed, and then played star command for many hours because commuting is only fun when you aren’t making any eye contact with anybody else (those are actually the rules if you read the back of your oyster card).

Continue reading

words are for people