Skip to content

Instantly share code, notes, and snippets.

add-apt-repository -y ppa:formorer/icinga
apt-get update
apt-get install -y icinga2 nagios-plugins postgresql icinga2-ido-pgsql apache2 pnp4nagios
service icinga2 start
cd /tmp
sudo -u postgres psql -c "CREATE ROLE icinga WITH LOGIN PASSWORD 'icinga'";
sudo -u postgres createdb -O icinga -E UTF8 icinga
sudo -u postgres createlang plpgsql icinga
# Add bittorent sync repo
add-apt-repository ppa:tuxpoldo/btsync
# Update repo
apt-get update
# Upgrade server packages
apt-get dist-upgrade
# Install dev stuff
apt-get install -y build-essential btsync htop pbzip2 python-dev python-pip
# Install virtualenvwrapper
pip install virtualenvwrapper
@JMSwag
JMSwag / producer-consumer-go.md
Last active January 2, 2025 09:34 — forked from drio/producer-consumer-go.md
producer consumer in go explained

Producer consumer pattern

Question: Can you write code implementing the consumer and producer pattern?

This is a classic concurrency problem where we have threads generating data to be consumed (producers) by other threads (consumers).

The implementation with POSIX threads can be a pain in the ass but it is quite straight forward in golang thanks to its concurrency constructs.

deployment_id | app_id | old_release_id | new_release_id | strategy | processes | created_at | finished_at
--------------------------------------+--------------------------------------+--------------------------------------+--------------------------------------+-------------+------------+-------------------------------+-------------------------------
a61572f3-a0bc-48c5-bee2-ac9a83acc6be | 35ceb222-9824-4260-b23d-04d74957c9d3 | | 22be1c6b-1838-4d22-abe8-7ce569d69700 | all-at-once | | 2015-08-09 03:17:38.305919+00 | 2015-08-09 03:17:38.305824+00
8d8c220c-3a68-4b52-84bb-fc5b0a774e41 | 0e91b750-e134-4039-9129-76bfe513c051 | | 6839526d-14f3-4152-8422-68b966d27e8d | all-at-once | | 2015-08-09 03:17:39.202328+00 | 2015-08-09 03:17:39.202213+00
1398a565-3e7f-4706-b9cc-ba2fef10ba98
@JMSwag
JMSwag / Contract Killer 3.md
Last active August 29, 2015 14:26
The latest version of my ‘killer contract’ for web designers and developers

Contract Killer

The popular open-source contract for web designers and developers by Stuff & Nonsense

  • Originally published: 23/12/2008
  • Revised date: 15/12/2013
  • Original post

@JMSwag
JMSwag / commands.txt
Last active August 29, 2015 14:23 — forked from lmars/commands.txt
# create a redis app
flynn create --remote "" redis
# create a release using the latest (at the time of writing) Docker Redis image
flynn -a redis release add -f config.json "https://registry.hub.docker.com/_/redis?tag=3.0.2"
# scale the server to one process. This may time out initially as the server pulls the image, but watch "flynn -a redis ps" and should come up.
flynn -a redis scale server=1
# redis should now be running in the cluster at redis.discoverd:6379
#!/usr/bin/env python
import bz2
import datetime
import os
import sys
import time
import urllib2
import warnings

Keybase proof

I hereby claim:

  • I am jmswag on github.
  • I am johnymoswag (https://keybase.io/johnymoswag) on keybase.
  • I have a public key whose fingerprint is 746D 73C3 E4F1 6E2A 69A2 305B 5CCC 9553 BB92 F302

To claim this, I am signing this object: