Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
Coding

Matthias Pigulla mpdude

💭
Coding
View GitHub Profile
@mpdude
mpdude / projekt-img.sh
Last active May 12, 2020 — forked from scottsb/casesafe.sh
Create and manage a case-sensitive disk-image on macOS (OS X).
View projekt-img.sh
#!/bin/bash -e
# ---------------------------------------------------------
# Customizable Settings
# ---------------------------------------------------------
MOUNT_POINT="${CASE_SAFE_MOUNT_POINT:-${HOME}/Projekte}"
VOLUME_PATH="${CASE_SAFE_VOLUME_PATH:-${HOME}/.Projekte.sparsebundle}"
VOLUME_NAME="${CASE_SAFE_VOLUME_NAME:-Projekte}"
VOLUME_SIZE="${CASE_SAFE_VOLUME_SIZE:-200g}"
@mpdude
mpdude / whiteboardCleaner.md
Created Dec 22, 2019 — forked from Ocramius/whiteboardCleaner.md
Whiteboard Picture Cleaner - Shell one-liner/script to clean up and beautify photos of whiteboards!
View whiteboardCleaner.md

Description

This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.

The script is here:

#!/bin/bash
convert "$1" -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 "$2"

Results

View secrets.yaml
parameters:
env(SECRETS_FILE): .secrets.php
services:
# default configuration for services in *this* file
_defaults:
autowire: true # Automatically injects dependencies in your services.
autoconfigure: true # Automatically registers your services as commands, event subscribers, etc.
bind:
$someSecret: '%env(key:KEY3:require:SECRETS_FILE)%'
@mpdude
mpdude / renamedb
Created Apr 24, 2018 — forked from centminmod/renamedb
renamedb
View 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 Mar 24, 2018 — forked from bastman/docker-cleanup-resources.md
docker cleanup guide: containers, images, volumes, networks
View docker-cleanup-resources.md

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 / gist:f0d2e6ba5805a8e049f7
Created Mar 23, 2016 — 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.
View gist:f0d2e6ba5805a8e049f7
# 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 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 / 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