Skip to content

Instantly share code, notes, and snippets.

View lkarsten's full-sized avatar

Lasse Karstensen lkarsten

View GitHub Profile
#!/usr/bin/python
"""
Multicast group scanner.
Author: Lasse Karstensen <lasse.karstensen@gmail.com>, November 2014
"""
import gevent
from gevent import monkey
monkey.patch_all()
@lkarsten
lkarsten / hitch.service
Last active November 6, 2015 14:15
hitch systemd
[Unit]
Description=hitch
After=syslog.target network.target
[Service]
Type=forking
#Restart=on-failure
LimitNOFILE=131072
Environment="HITCH_OPTIONS=--config /etc/hitch/hitch.conf"
@lkarsten
lkarsten / hitch
Created July 23, 2015 12:13
hitch init script for debian
#! /bin/sh
### BEGIN INIT INFO
# Provides: hitch
# Required-Start: $local_fs $remote_fs $network
# Required-Stop: $local_fs $remote_fs $network
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: The Scalable TLS Unwrapping Daemon
# Description: The Scalable TLS Unwrapping Daemon
#
# hitch(8), The Scalable TLS Unwrapping Daemon's configuration
#
# NOTE: all config file parameters can be overriden
# from command line!
# Listening address. REQUIRED.
# Can be specified multiple times for multiple listen endpoints.
# type: string
#!/usr/bin/env python
# .- coding: utf-8 -.
"""
Collect and store varnishstat counters every n seconds for a time period.
This file is in the public domain.
Author: Lasse Karstensen <lkarsten@varnish-software.com>, August 2015.
"""
import sys
[Unit]
Description=Varnish HTTP accelerator
[Service]
Type=forking
LimitNOFILE=131072
LimitMEMLOCK=82000
ExecStartPre=/opt/varnish/sbin/varnishd -C -f /etc/varnish/default.vcl
ExecStart=/opt/varnish/sbin/varnishd -a :80 \
-T localhost:6082 \
@lkarsten
lkarsten / gist:77a8a1a91d5956feaa40
Created September 7, 2015 18:38
varnish 4.1.0-beta1-dirty on el6 with selinux enabled
1074 setresuid(-1, 0, -1) = 0
1074 setresgid(-1, 0, -1) = 0
1074 open("/etc/varnish/secret", O_RDONLY) = 3
1074 close(3) = 0
1074 setresgid(-1, 496, -1) = 0
1074 setresuid(-1, 497, -1) = 0
1074 open("/etc/varnish/default.vcl", O_RDONLY) = 3
1074 fstat(3, {st_mode=S_IFREG|0644, st_size=1225, ...}) = 0
1074 read(3, "#\n# This is an example VCL file "..., 1226) = 1225
1074 close(3) = 0
#
# Example of pinterest.com -alike application deployment.
#
vcl 4.0;
import std;
import directors;
import cookie;
import header;
import var;
vcl 4.0;
import std;
import directors;
backend a1 { .host = "192.0.2.11"; }
backend a2 { .host = "192.0.2.12"; }
backend a3 { .host = "192.0.2.13"; }
backend a4 { .host = "192.0.2.14"; }