Skip to content

Instantly share code, notes, and snippets.

View slachiewicz's full-sized avatar

Sylwester Lachiewicz slachiewicz

View GitHub Profile
@slachiewicz
slachiewicz / gist:0db4cb4153478fd117660457e6da6591
Created October 30, 2016 18:20 — forked from moneytoo/gist:ab3f34e4fddc2110675952f8280f49c5
nginx with OpenSSL 1.0.2 (ALPN) on CentOS 7
yum -y groupinstall 'Development Tools'
yum -y install wget openssl-devel libxml2-devel libxslt-devel gd-devel perl-ExtUtils-Embed GeoIP-devel
OPENSSL="openssl-1.0.2j"
NGINX="nginx-1.11.4-1"
mkdir -p /opt/lib
wget https://www.openssl.org/source/$OPENSSL.tar.gz -O /opt/lib/$OPENSSL.tar.gz
tar -zxvf /opt/lib/$OPENSSL.tar.gz -C /opt/lib
@slachiewicz
slachiewicz / export-dashboard.json
Created October 19, 2016 13:49 — forked from ahmedalami/export-dashboard.json
Set up a quick monitoring environment for WildFly and Apache ActiveMQ using Logstash, Elasticsearch and Kibana
[
{
"_id": "Wildfly-Monitoring-Dashboard",
"_type": "dashboard",
"_source": {
"title": "Wildfly Monitoring Dashboard",
"hits": 0,
"description": "",
"panelsJSON": "[{\"col\":7,\"id\":\"Active-Sessions-Statistics-jboss-hibernate4.war\",\"row\":3,\"size_x\":3,\"size_y\":2,\"type\":\"visualization\"},{\"col\":10,\"id\":\"Datasource-Pool-Statistics-jboss-hibernate4.war\",\"row\":3,\"size_x\":3,\"size_y\":2,\"type\":\"visualization\"},{\"col\":7,\"id\":\"Http-Requests-By-Client-IP\",\"row\":1,\"size_x\":3,\"size_y\":2,\"type\":\"visualization\"},{\"col\":10,\"id\":\"Http-Response-Status\",\"row\":1,\"size_x\":3,\"size_y\":2,\"type\":\"visualization\"},{\"col\":7,\"id\":\"Prepared-Statement-Cache-Statistics-jboss-as-hibernate4\",\"row\":5,\"size_x\":3,\"size_y\":2,\"type\":\"visualization\"},{\"col\":1,\"id\":\"ActiveMQ-Broker-Memory-Metrics\",\"row\":1,\"size_x\":6,\"size_y\":3,\"type\":\"visualization\"},{\"col\":1,\"id\":\"ActiveMQ-Broker-Total-Metrics\",\"row\":4,\"size_x\"
@slachiewicz
slachiewicz / explanation.md
Created September 20, 2016 13:30 — forked from ThatRendle/explanation.md
Why I am not a fan of Apache Kafka

Update, September 2016

OK, you can pretty much ignore what I wrote below this update, because it doesn't really apply anymore.

I wrote this over a year ago, and at the time I had spent a couple of weeks trying to get Kafka 0.8 working with .NET and then Node.js with much frustration and very little success. I was rather angry. It keeps getting linked, though, and just popped up on Hacker News, so here's sort of an update, although I haven't used Kafka at all this year so I don't really have any new information.

In the end, we managed to get things working with a Node.js client, although we continued to have problems, both with our code and with managing a Kafka/Zookeeper cluster generally. What made it worse was that I did not then, and do not now, believe that Kafka was the correct solution for that particular problem at that particular company. What they were trying to achieve could have been done more simply with any number of other messaging systems, with a subscriber reading messages off and writing

@slachiewicz
slachiewicz / upgrade-postgres-9.4-to-9.6.md
Last active October 7, 2016 04:14 — forked from Komzpa/upgrade-postgres-9.4-to-9.5-to-9.6-to-10.md
Upgrading PostgreSQL from 9.4 to 9.6 when upgrading Ubuntu 14.10 to 16.04

TL;DR

sudo pg_dropcluster 9.6 main --stop
sudo service postgresql stop
sudo pg_upgradecluster -m upgrade -k 9.4 main
sudo su postgres -c "/usr/lib/postgresql/9.5/bin/vacuumdb --all --analyze-in-stages"
sudo pg_dropcluster 9.4 main
@slachiewicz
slachiewicz / upgrade-postgres-9.3-to-9.4.md
Created September 19, 2016 11:09 — forked from dideler/upgrade-postgres-9.3-to-9.4.md
Upgrading PostgreSQL from 9.3 to 9.4 when upgrading Ubuntu 14.04 to 14.10

TL;DR

sudo pg_dropcluster 9.4 main --stop
sudo pg_upgradecluster 9.3 main
sudo pg_dropcluster 9.3 main

@slachiewicz
slachiewicz / overpass.geojson
Created September 18, 2016 21:40 — forked from anonymous/overpass.geojson
data exported by overpass turbo
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@slachiewicz
slachiewicz / enc_dec_test.py
Created September 12, 2016 19:52 — forked from justinfx/enc_dec_test.py
Speed test of common serializers on python 2.7.2 (pickle, cPickle, ujson, cjson, simplejson, json, yajl, msgpack)
"""
Dependencies:
pip install tabulate simplejson python-cjson ujson yajl msgpack-python
"""
from timeit import timeit
from tabulate import tabulate

Set up L2TP/IPsec VPN on Debian

Set up IPsec

Set up networking

@slachiewicz
slachiewicz / overpass.geojson
Created July 29, 2016 12:19 — forked from anonymous/overpass.geojson
data exported by overpass turbo
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@slachiewicz
slachiewicz / haproxy.cfg
Created July 28, 2016 16:51 — forked from thisismitch/haproxy.cfg
Let's Encrypt Auto-Renewal script for HAProxy
global
log /dev/log local0
log /dev/log local1 notice
chroot /var/lib/haproxy
stats socket /run/haproxy/admin.sock mode 660 level admin
stats timeout 30s
user haproxy
group haproxy
daemon
maxconn 2048