Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
Coding

Matthias Pigulla mpdude

💭
Coding
View GitHub Profile
@mpdude
mpdude / Portfile
Created Apr 16, 2014
MacPorts Portfile for APCu
View Portfile
# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:filetype=tcl:et:sw=4:ts=4:sts=4
# $Id: $
PortSystem 1.0
PortGroup php 1.1
name php-APCu
version 4.0.4
categories php devel
@mpdude
mpdude / 0004-oversize-dns.diff
Created Nov 10, 2014
Patch Ubuntu netqmail-1.06 to handle DNS packets >512 byte and remove unneeded CNAME checks
View 0004-oversize-dns.diff
--- qmail-1.03/dns.c.103 Mon Aug 17 16:06:58 1998
+++ qmail-1.03/dns.c Wed Aug 26 16:28:56 1998
@@ -21,10 +21,12 @@
static unsigned short getshort(c) unsigned char *c;
{ unsigned short u; u = c[0]; return (u << 8) + c[1]; }
-static union { HEADER hdr; unsigned char buf[PACKETSZ]; } response;
+static struct { unsigned char *buf; } response;
+static int responsebuflen = 0;
static int responselen;
@mpdude
mpdude / phpstorm-init-vcs-roots
Created Nov 11, 2014
Initialize .idea/vcs.xml file with all Git or Mercurial repos below current directory
View phpstorm-init-vcs-roots
#!/usr/bin/env php
<?php
print <<<HEAD
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
HEAD;
View gist:a123e0233dba164ef896
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
@mpdude
mpdude / apache-2.2-mod_remoteip.c
Created Dec 3, 2011 — forked from bfg/apache-2.2-mod_remoteip.c
Working backport (doesn't crash when using Allow/Deny ACLs) of Apache 2.3 module mod_remoteip to Apache 2.2.x
View apache-2.2-mod_remoteip.c
/* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@mpdude
mpdude / socket.io-1-0-apache-2.4-ssl.conf
Created Dec 16, 2015 — forked from iacchus/socket.io-1-0-apache-2.4-ssl.conf
Set reverse proxy websockets in Apache 2.4 using socket.io 1.0. Needs mod_rewrite module, this version uses SSL. As seen here https://serverfault.com/questions/616370/configuring-apache-2-4-mod-proxy-wstunnel-for-socket-io-1-0
View socket.io-1-0-apache-2.4-ssl.conf
<VirtualHost *:80>
ServerName forum.example.com
Redirect permanent / https://forum.example.com
</VirtualHost>
<VirtualHost *:443>
ServerName forum.example.com
@mpdude
mpdude / gist:5825777
Last active Dec 18, 2015
Quick proof-of-concept patch for composer/composer#2022
View gist:5825777
diff --git a/src/Composer/DependencyResolver/RuleSetGenerator.php b/src/Composer/DependencyResolver/RuleSetGenerator.php
index b40ce1a..2255c36 100644
--- a/src/Composer/DependencyResolver/RuleSetGenerator.php
+++ b/src/Composer/DependencyResolver/RuleSetGenerator.php
@@ -12,6 +12,7 @@
namespace Composer\DependencyResolver;
+use Composer\Package\LinkConstraint\MultiConstraint;
use Composer\Package\PackageInterface;
@mpdude
mpdude / gist:7372480
Created Nov 8, 2013
Pushing the ConsoleHandler to the Monolog "app" logger instance in Symfony2
View gist:7372480
<?php
// ... see http://symfony.com/doc/current/components/console/introduction.html#creating-a-basic-command
namespace Acme\DemoBundle\Command;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Bridge\Monolog\Handler\ConsoleHandler;
@mpdude
mpdude / gist:7590059
Created Nov 21, 2013
mod_rpaf configuration for transparent SSL termination on EC2 ELBs
View gist:7590059
LoadModule rpaf_module modules/mod_rpaf.so
<IfModule mod_rpaf.c>
RPAF_Enable On
RPAF_ProxyIPs 10.0.0.0/8
RPAF_SetPort On
RPAF_SetHTTPS On
</IfModule>
@mpdude
mpdude / phpunit.xsd
Last active Dec 29, 2015
XML Schema für PHPUnit
View phpunit.xsd
<?xml version="1.0" encoding="UTF-8"?>
<!--
- Defines a xml schema for PHPUnit xml configuration files as described in
- the official PHPUnit documentation at:
- http://www.phpunit.de/manual/current/en/appendixes.configuration.html
-
- @author Matthias Molitor <matthias@matthimatiker.de>
- @version $Rev: 371 $
- @since 02.03.2011
-->