Skip to content

Instantly share code, notes, and snippets.

View mpdude's full-sized avatar
💭
Coding

Matthias Pigulla mpdude

💭
Coding
View GitHub Profile
@mpdude
mpdude / renamedb
Created April 24, 2018 13:42 — forked from centminmod/renamedb
renamedb
#!/bin/bash
# Copyright 2013 Percona LLC and/or its affiliates
set -e
if [ -z "$3" ]; then
echo "rename_db <server> <database> <new_database>"
exit 1
fi
db_exists=`mysql -h $1 -e "show databases like '$3'" -sss`
if [ -n "$db_exists" ]; then
echo "ERROR: New database already exists $3"
@mpdude
mpdude / docker-cleanup-resources.md
Created March 24, 2018 22:20 — forked from bastman/docker-cleanup-resources.md
docker cleanup guide: containers, images, volumes, networks

Docker - How to cleanup (unused) resources

Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...

delete volumes

// see: https://github.com/chadoe/docker-cleanup-volumes

$ docker volume rm $(docker volume ls -qf dangling=true)

$ docker volume ls -qf dangling=true | xargs -r docker volume rm

@mpdude
mpdude / gulpfile.js
Last active August 11, 2017 13:00
Gulp für Assetic-Veteranen
var phlough = require("./conf/phlough-configuration.json");
var gulp = require('gulp');
var $ = require('gulp-load-plugins')(); /// lädt alle gulp-*-Module in $.*
var mergeStream = require('merge-stream');
var path = require('path');
var saveLicense = require('uglify-save-license');
var autoprefixer = require('autoprefixer');
var config = {
@mpdude
mpdude / gist:248322fd78cba94ef68994d30a3b3180
Created November 24, 2016 13:52
Fix libxml 2.9.2 regression with relative URI handling and file:// URLs
diff --git a/uri.c b/uri.c
index 2bd5720..6e09018 100644
--- a/uri.c
+++ b/uri.c
@@ -2024,7 +2024,7 @@ xmlBuildURI(const xmlChar *URI, const xmlChar *base) {
}
if (bas->authority != NULL)
res->authority = xmlMemStrdup(bas->authority);
- else if (bas->server != NULL) {
+ else if ((bas->server != NULL) || (bas->port == -1)) {
@mpdude
mpdude / gist:f0d2e6ba5805a8e049f7
Created March 23, 2016 13:45 — forked from chrishaff/gist:83b0a3b621c3301ecc32
Install Thumbor on Ubuntu 14.04 includes python-opencv for face/feature detection. Don't forget to enable the detectors https://github.com/thumbor/thumbor/wiki/Enabling-detectors.
# sudo su and run the following
sudo apt-get update && \
sudo apt-get -y upgrade && \
# install all dependencies
sudo apt-get -y install \
build-essential \
checkinstall \
gcc \
<?php
namespace Webfactory\Bundle\PagesBundle\Tests;
use Doctrine\ORM\Tools\Setup;
use Doctrine\ORM\EntityManager;
use Doctrine\ORM\Tools\SchemaTool;
use Doctrine\Common\Persistence\ObjectManager;
use Doctrine\Common\Persistence\ObjectRepository;
@mpdude
mpdude / phpunit.xsd
Last active December 29, 2015 02:28
XML Schema für PHPUnit
<?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
-->
@mpdude
mpdude / gist:7590059
Created November 21, 2013 21:32
mod_rpaf configuration for transparent SSL termination on EC2 ELBs
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 / gist:7372480
Created November 8, 2013 15:18
Pushing the ConsoleHandler to the Monolog "app" logger instance in Symfony2
<?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:5825777
Last active December 18, 2015 18:29
Quick proof-of-concept patch for composer/composer#2022
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;