Skip to content

Instantly share code, notes, and snippets.

View tomplayford's full-sized avatar

Tom Playford tomplayford

  • London / Palo Alto / Cambridge
View GitHub Profile
@tomplayford
tomplayford / gist:509a1444e7a0e81dd2ab
Last active May 18, 2023 21:16
haproxy log file regex for fluentd. This actually seems to work, unlike the one in the fluent docs. Reads the full HTTP log file format. It'll also catch all other haproxy logs, but only as one big string.
^(?<syslog_time>[^ ]* +[^ ]* +[^ ]*) (?<syslog_host>[\w-\.]+) (?<ps>\w+)\[(?<pid>\d+)\]: ((?<c_ip>[\w\.]+):(?<c_port>\d+) \[(?<time>.+)\] (?<f_end>[\w\~-]+) (?<b_end>[\w-]+)\/(?<b_server>[\w\.-]+) (?<tq>\d+)\/(?<tw>\d+)\/(?<tc>\d+)\/(?<tr>\d+)\/(?<tt>\d+) (?<status_code>\d+) (?<bytes>\d+) (?<req_cookie>\S?) (?<res_cookie>\S?) (?<t_state>[\w-]+) (?<actconn>\d+)\/(?<feconn>\d+)\/(?<beconn>\d+)\/(?<srv_conn>\d+)\/(?<retries>\d+) (?<srv_queue>\d+)\/(?<backend_queue>\d+) \{?(?<req_headers>[^}]*)\}? ?\{?(?<res_headers>[^}]*)\}? ?"(?<request>[^"]*)"|(?<message>.+))
@tomplayford
tomplayford / designer.html
Last active August 29, 2015 14:08
designer
<link rel="import" href="../topeka-elements/avatars.html">
<link rel="import" href="../core-icon/core-icon.html">
<polymer-element name="my-element">
<template>
<style>
:host {
position: absolute;
width: 100%;
import re
from django.utils.text import compress_string
from django.utils.cache import patch_vary_headers
from django import http
try:
import settings
XS_SHARING_ALLOWED_ORIGINS = settings.XS_SHARING_ALLOWED_ORIGINS
import re
from django.utils.text import compress_string
from django.utils.cache import patch_vary_headers
from django import http
try:
import settings
XS_SHARING_ALLOWED_ORIGINS = settings.XS_SHARING_ALLOWED_ORIGINS
def test_simple_route_manipulation(self):
message = SendMessageJob()
message.to_run_datetime = datetime.datetime.now()
message.save()
id = message.id
message.routes = EnumSet(MessageRoute, initial_values=[MessageRoute.sms])
>>> bundle.obj.verification.verified
Traceback (most recent call last):
File "/Users/tom/.virtualenvs/native/lib/python2.7/site-packages/ipython-0.13-py2.7.egg/IPython/core/interactiveshell.py", line 2746, in run_code
exec code_obj in self.user_global_ns, self.user_ns
File "<ipython-input-12-5d842a6d0fc4>", line 1, in <module>
bundle.obj.verification.verified
File "/Users/tom/.virtualenvs/native/lib/python2.7/site-packages/django/db/models/fields/related.py", line 350, in __get__
rel_obj = qs.get(**params)
File "/Users/tom/.virtualenvs/native/lib/python2.7/site-packages/django/db/models/query.py", line 361, in get
num = len(clone)
==> Downloading http://pkgconfig.freedesktop.org/releases/pkg-config-0.27.tar.gz
Already downloaded: /Library/Caches/Homebrew/pkg-config-0.27.tar.gz
/usr/bin/tar xf /Library/Caches/Homebrew/pkg-config-0.27.tar.gz
==> ./configure --disable-debug --prefix=/usr/local/Cellar/pkg-config/0.27 --with-pc-path=/usr/local/lib/pkgconfig:/usr/local/share/pkgconfig:/usr/lib/pkgconfig --with-internal-glib
./configure --disable-debug --prefix=/usr/local/Cellar/pkg-config/0.27 --with-pc-path=/usr/local/lib/pkgconfig:/usr/local/share/pkgconfig:/usr/lib/pkgconfig --with-internal-glib
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... ./install-sh -c -d
checking for gawk... no
checking for mawk... no
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by pkg-config configure 0.27, which was
generated by GNU Autoconf 2.68. Invocation command line was
$ ./configure --disable-debug --prefix=/usr/local/Cellar/pkg-config/0.27 --with-pc-path=/usr/local/lib/pkgconfig:/usr/local/share/pkgconfig:/usr/lib/pkgconfig --with-internal-glib
## --------- ##
## Platform. ##