Skip to content

Instantly share code, notes, and snippets.

View fh's full-sized avatar
😫
Send me an email. Messaging me here will take months to react.

Florian Holzhauer fh

😫
Send me an email. Messaging me here will take months to react.
View GitHub Profile
@fh
fh / post-check.vcl
Last active October 8, 2015 19:28
varnish.vcl
if (
req.http.user-agent ~ "^$"
|| req.http.user-agent ~ "^Java"
|| req.http.user-agent == "Mozilla/4.0 (compatible; MSIE 5.0; Windows 3.1)"
|| req.http.user-agent == "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; FunWebProducts; MRA 4.6 (build 01425); .NET CLR 1.1.4322; .NET CLR 2.0.50727)"
|| req.http.user-agent == "Mozilla/5.0 (X11; U; Linux i686; rv:1.9) Gecko/2008080808 Firefox/3.0"
|| req.http.user-agent == "Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US) AppleWebKit/523.15 (KHTML, like Gecko) Version/3.0 Safari/523.15"
|| req.http.user-agent == "Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.9.0.13) Gecko/2009073022 Firefox/3.0.13"
|| req.http.user-agent == "Mozilla/5.0 (Windows NT 5.1; U; en) Opera 8.01"
|| req.http.user-agent == "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.5) Gecko/2008120122 Firefox/3.0.5"
@fh
fh / app.yml.erb
Last active March 28, 2019 14:00
Generating a Yaml Config file with Chef
<%= @content %>
@fh
fh / Vagrantfile
Created August 8, 2013 06:40
Vagrantfile: Name your Vagrantbox
Vagrant.configure("2") do |config|
config.vm.provider :virtualbox do |vb|
# list of all parameters for the customize call:
# VBoxManage modifyvm
vb.customize [
"modifyvm", :id,
"--name", "Some name for some box",
"--memory", "512"
]
end
@fh
fh / Vagrantfile
Last active December 23, 2015 09:35
Provisioning Shell Script inline
Vagrant.configure("2") do |config|
config.vm.box = "precise"
end
script = <<SCRIPT
apt-get update
SCRIPT
Vagrant.configure("2") do |config|
config.vm.provision :shell, :inline => script
@fh
fh / vagrant_cachier.txt
Created October 21, 2013 09:34
how to get vagrant cachier up and runing
vagrant plugin install vagrant-cachier
cat << 'EOF' > ~/.vagrant.d/Vagrantfile
Vagrant.configure("2") do |config|
config.cache.auto_detect = true
end
EOF
# for composer support: https://github.com/fgrehm/vagrant-cachier/pull/48
@fh
fh / nginx.conf
Last active December 28, 2015 04:48
My Crypto Configs
listen 443 ssl;
ssl_protocols SSLv3 TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers kECDH:HIGH:!aNULL:!MEDIUM:!LOW:!NULL:!SSLv2:!ADH@STRENGTH;
ssl_prefer_server_ciphers on;
ssl_certificate /path/to/file.crt;
ssl_certificate_key /path/to/file.key;
#to enable forward secrecy. Generate the file using
#openssl dhparam -outform PEM -out dh.pem 1024
ssl_dhparam /path/to/dh.pem;
@fh
fh / gist:7483360
Last active December 28, 2015 09:59
--- ./Optimizer/block_pass.c 2013-11-14 22:13:53.000000000 +0100
- * defined. We won't apply some optimization patterns for sush variables. */
--- ./Optimizer/compact_literals.c 1970-01-01 01:00:00.000000000 +0100
--- ./Optimizer/optimize_func_calls.c 1970-01-01 01:00:00.000000000 +0100
--- ./Optimizer/pass1_5.c 2013-11-14 22:13:53.000000000 +0100
- * - convert INTI_FCALL_BY_NAME, DO_FCALL_BY_NAME into DO_FCALL
- break;
- case ZEND_INIT_FCALL_BY_NAME:
- if (opline->extended_value == 0 /* not method */ &&
- ZEND_OP1_TYPE(opline) == IS_UNUSED &&
#https://rubygems.org/gems/bib-vagrant
Vagrant.require_plugin "bib-vagrant"
Vagrant.configure("2") do |config|
bibconfig = Bib::Vagrant::Config.new()
vagrantconfig = bibconfig.get
config.vm.synced_folder "./../", "/vagrant_data", :owner => "vagrant", :nfs => vagrantconfig["nfs"]
#! /usr/bin/env ruby
require 'haproxy'
haproxy = HAProxy.read_stats '/tmp/haproxy.sock'
statsd = UDPSocket.new
haproxy.stats.each do |hi|
if ['BACKEND', 'FRONTEND'].include?(hi[:svname])
%w(scur smax ereq econ rate hrsp_2xx hrsp_3xx hrsp_4xx hrsp_5xx).each do |statname|
stat = "haproxy.#{hi[:svname]}.#{hi[:pxname]}.#{statname}:#{hi[statname.to_sym]}|g"
<?php
function ☠($message = null) {
die($message);
}