Skip to content

Instantly share code, notes, and snippets.

View mpdude's full-sized avatar
💭
Coding

Matthias Pigulla mpdude

💭
Coding
View GitHub Profile
<?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 / 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
@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 / 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 / .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 / 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 / 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 / srsd
Last active May 21, 2018 20:36
init script for srsd
#!/bin/bash
### BEGIN INIT INFO
# Provides: srsd
# Required-Start: $networking $local_fs $remote_fs $syslog
# Required-Stop: $networking $local_fs $remote_fs $syslog
# Should-Start:
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: SRS daemon
#!/bin/bash -e
pushd . > /dev/null
INTERPRETER=/usr/bin/php
while [ "`pwd`" != "/" ]; do
if [ -x ./bin/php ]; then
INTERPRETER=`pwd`/bin/php
break
fi
cd ..
done
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="PublishConfigData" serverName="wf-development-vm">
<serverData>
<paths name="wf-development-vm">
<serverdata>
<mappings>
<mapping deploy="/var/www" local="$PROJECT_DIR$/../" web="/" />
</mappings>
</serverdata>