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 / 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 / .profile
Last active March 31, 2022 15:20
~/.profile für OS X
# ~/.profile wird bei jedem Shell-Start ausgeführt
# (In der Bash: NUR ausgeführt, wenn ~/.bash_profile nicht existiert)
# Autocompletion z. B. auch für SSH-Hostnamen
if [ -f $(brew --prefix)/etc/bash_completion ]; then
. $(brew --prefix)/etc/bash_completion
fi
# Shortcut für: Bei einem SSH-Login auf einer anderen Maschine, den eigenen
# SSH-Schlüssel mitnehmen (z.B. damit man dort dann ein per SSH ausgechecktes
@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 \
@mpdude
mpdude / socket.io-1-0-apache-2.4-ssl.conf
Created December 16, 2015 08:40 — 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
<VirtualHost *:80>
ServerName forum.example.com
Redirect permanent / https://forum.example.com
</VirtualHost>
<VirtualHost *:443>
ServerName forum.example.com
<?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 / phpstorm-init-vcs-roots
Created November 11, 2014 11:42
Initialize .idea/vcs.xml file with all Git or Mercurial repos below current directory
#!/usr/bin/env php
<?php
print <<<HEAD
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
HEAD;
@mpdude
mpdude / 0004-oversize-dns.diff
Created November 10, 2014 10:12
Patch Ubuntu netqmail-1.06 to handle DNS packets >512 byte and remove unneeded CNAME checks
--- 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 / 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 / Portfile
Created April 16, 2014 08:22
MacPorts Portfile for APCu
# -*- 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