This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# See http://www.varnish-cache.org/trac/ticket/540 | |
sub inject_forwarded_for { | |
# Rename the incoming XFF header to work around a Varnish bug. | |
if (req.http.X-Forwarded-For) { | |
# Append the client IP | |
set req.http.X-Real-Forwarded-For = req.http.X-Forwarded-For ", " regsub(client.ip, ":.*", ""); | |
#unset req.http.X-Forwarded-For; | |
} | |
else { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
# | |
# Finds if a perl file contains 5.10-isms | |
# but lacks the "use 5.010" at the top | |
# | |
use strict; | |
use warnings; | |
use Data::Dumper (); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DELIMITER // | |
DROP PROCEDURE IF EXISTS populate_table // | |
CREATE PROCEDURE populate_table () | |
BEGIN | |
DECLARE CONTINUE HANDLER FOR SQLSTATE '23000' BEGIN | |
SELECT tap.ok( | |
0, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
include "/etc/varnish/reset-connection.vcl"; | |
backend default { | |
.host = "127.0.0.1"; | |
.port = "8080"; | |
} | |
sub vcl_recv { | |
if (req.http.CloseMe) { | |
C{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
# | |
# Find unused CSS selectors by crawling a list of URLs | |
# (--url, even more than one) and matching all elements in | |
# a page to find out which selectors are never used across | |
# all given URLs | |
# | |
# Usage: | |
# ./find-unused-css-selectors.pl --css file.css --url http://some.url [--url http://some.other.url ...] | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<meta name="viewport" content="width=device-width, initial-scale=1"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sub vcl_fetch { | |
# ... | |
if (beresp.http.Cache-Control ~ 'no-cache') { | |
set beresp.ttl = 0s; | |
return (deliver); | |
} | |
# ... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# Example of how to parse short/long options with 'getopt' | |
# | |
OPTS=`getopt -o vhns: --long verbose,dry-run,help,stack-size: -n 'parse-options' -- "$@"` | |
if [ $? != 0 ] ; then echo "Failed parsing options." >&2 ; exit 1 ; fi | |
echo "$OPTS" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
=head1 NAME | |
anyevent-udp-server.pl - Simple AnyEvent::Handle::UDP UDP server | |
=head1 DESCRIPTION | |
Starts a UDP server that listens on a given port for | |
input (incoming udp packets). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
echo 'deb http://backports.debian.org/debian-backports squeeze-backports main contrib non-free' > /etc/apt/sources.list.d/squeeze-backports.list | |
apt-get update | |
apt-get -t squeeze-backports install linux-base initramfs-tools linux-image-3.2.0-0.bpo.4-amd64 |