Skip to content

Instantly share code, notes, and snippets.

View lukewpatterson's full-sized avatar

Luke Patterson lukewpatterson

View GitHub Profile
input { generator {} }
filter {
ruby {
# Add a \t (tab) by using its ASCII code (9)
code => 'event.set("message", 9.chr + event.get("message"))'
}
ruby {
# Make a new field with the tab removed
code => 'event.set("tabless", event.get("message").gsub(9.chr, ""))'
@ben-albon
ben-albon / php5.6-pgsql.Dockerfile
Last active April 21, 2024 17:10
Docker PHP Image with PostgreSQL Driver
FROM php:5.6-apache
RUN apt-get update && apt-get install -y libpq-dev && docker-php-ext-install pdo pdo_pgsql
COPY src/ /var/www/html
@mosheeshel
mosheeshel / DockerContainerRule.java
Created October 2, 2014 14:31
JUnit @rule for starting a docker container from within an Integration test
package rules;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import com.spotify.docker.client.DefaultDockerClient;
import com.spotify.docker.client.DockerClient;
import com.spotify.docker.client.DockerException;
import com.spotify.docker.client.messages.ContainerConfig;
import com.spotify.docker.client.messages.ContainerCreation;
import com.spotify.docker.client.messages.HostConfig;
@bennadel
bennadel / code-1.htm
Created March 25, 2014 12:13
Preventing Links In Standalone iPhone Applications From Opening In Mobile Safari
<!DOCTYPE html>
<html>
<head>
<title>Index</title>
<!-- Stand-alone settings for iOS. -->
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no" />
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
server {
listen 443;
server_name example.com;
client_max_body_size 0;
chunkin on;
ssl on;
ssl_certificate /path/to/crt;
ssl_certificate_key /path/to/key;
@henrik-muehe
henrik-muehe / Dockerfile
Created August 5, 2013 11:47
Allows installing the ubuntu "fuse" package without creating any devices. Used to install packages on docker which require fuse but do not actively use it.
...
# Fake a fuse install
RUN apt-get install libfuse2
RUN cd /tmp ; apt-get download fuse
RUN cd /tmp ; dpkg-deb -x fuse_* .
RUN cd /tmp ; dpkg-deb -e fuse_*
RUN cd /tmp ; rm fuse_*.deb
RUN cd /tmp ; echo -en '#!/bin/bash\nexit 0\n' > DEBIAN/postinst
RUN cd /tmp ; dpkg-deb -b . /fuse.deb
@rca
rca / docker_registry.conf
Created July 10, 2013 09:11
nginx config for docker registry. The key setting is `client_max_body_size 600M;` which allows large uploads. The setting `proxy_read_timeout 900;` gives the upload enough time to complete (but this might not be needed).
upstream docker_registry {
server 127.0.0.1:15000;
}
server {
listen 443;
root /dev/null;
index index.html index.htm;
@smoser
smoser / gist:4756561
Last active November 8, 2023 15:20
boot a cloud image in kvm
## Install a necessary packages
$ sudo apt-get install kvm cloud-utils genisoimage
## URL to most recent cloud image of 12.04
$ img_url="http://cloud-images.ubuntu.com/server/releases/12.04/release"
$ img_url="${img_url}/ubuntu-12.04-server-cloudimg-amd64-disk1.img"
## download the image
$ wget $img_url -O disk.img.dist
## Create a file with some user-data in it
@chrisjacob
chrisjacob / README.md
Created July 16, 2011 11:23
How to: GitHub Pages "gh-pages" branch for User & Organization Pages

GitHub Pages "Normal" Setup for User & Organization Pages

Let’s say your GitHub username is “alice”. If you create a GitHub repository named alice.github.com, commit a file named index.html into the master branch, and push it to GitHub, then this file will be automatically published to http://alice.github.com/... The same works for organizations.

Read more here: http://pages.github.com/

However... the downside of this is that anyone that forks this repo won't get it as a GitHub Pages repo when they are working on it... because they have a different GitHub "username" (or "organisation name").

So the trick is to not use a master branch as the documentation tells you... rather, use a gh-pages branch, as you would for your other "Project Pages".

@irae
irae / _Stay_standalone.md
Last active January 29, 2024 12:38 — forked from kylebarrow/example.html
Stay Standalone: Prevent links in standalone web apps opening Mobile Safari

#Stay Standalone

A short script to prevent internal links to a "webapp" added to iPhone home screen to open in Safari instead of navigating internally.