Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
Coding

Matthias Pigulla mpdude

💭
Coding
View GitHub Profile
View gpg-0x85CEF3EC5D9F247C-2021-06-08.txt
-----BEGIN PGP PUBLIC KEY BLOCK-----
mDMEYLvsoRYJKwYBBAHaRw8BAQdAfGlCQI9xzi6s/JSfkcE19grdeW3Xf/hIUv1T
Czfgo+G0I01hdHRoaWFzIFBpZ3VsbGEgPG1wQHdlYmZhY3RvcnkuZGU+iI4EExYK
ADYCGwEECwkIBwQVCgkIBRYCAwEAAh4BAheAFiEEhU82pmfobc+YBhNGhc7z7F2f
JHwFAmC/A1UACgkQhc7z7F2fJHxfywD+KimyGRa5Fv4NyS+eXRE+5xIy0q+SeMkQ
djU36a1jVfIA/RNkseAmUe3BB9xavrBklwxetynXtjUZsIzmwaxyFyUAuDMEYLvt
jhYJKwYBBAHaRw8BAQdAPeAqSij5tu/5ol3zmeFCU98g5U3LCAqPIfVsstH7g6aI
7wQYFgoAIAIbAhYhBIVPNqZn6G3PmAYTRoXO8+xdnyR8BQJgvwNiAIF2IAQZFgoA
HRYhBIW5u5oK9SUa2Pft5wdiXbCBXWyhBQJgu+2OAAoJEAdiXbCBXWyh43cBAKyp
@mpdude
mpdude / ssh-deploy-key-wrapper.sh
Last active Oct 5, 2021
Wrapper around `ssh` to pick the right one from several GitHub deploy keys
View ssh-deploy-key-wrapper.sh
#!/bin/bash
# The last argument is the command to be executed on the remote end, which is something
# like "git-upload-pack 'webfactory/ssh-agent.git'". We need the repo path only, so we
# loop over this last argument to get the last part of if.
for last in ${!#}; do :; done
# Don't use "exec" to run "ssh" below; then the trap won't work.
key_file=$(mktemp -u)
trap "rm -f $key_file" EXIT
@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 / fix-cs-php.yml
Last active Jun 1, 2021
GitHub Actions workflow to open PRs for php-cs-fixer changes
View fix-cs-php.yml
# Update this by running
# curl https://gist.githubusercontent.com/mpdude/ca93a185bcbf56eb7e341632ad4f8263/raw/fix-cs-php.yml > .github/workflows/fix-cs-php.yml
on:
push:
branches:
- master
pull_request:
name: Coding Standards
@mpdude
mpdude / AWS-permissions.json
Created Jan 15, 2020
Build a Docker Image on GitHub Actions and push to AWS ECR
View AWS-permissions.json
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "VisualEditor0",
"Effect": "Allow",
"Action": [
"ecr:GetDownloadUrlForLayer",
"ecr:BatchGetImage",
"ecr:CompleteLayerUpload",
@mpdude
mpdude / build.yml
Last active Jan 15, 2020
Build Docker image and push it to GPR
View build.yml
on:
push:
branches:
- master
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
@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 keybase.md

Keybase proof

I hereby claim:

  • I am mpdude on github.
  • I am mpdude (https://keybase.io/mpdude) on keybase.
  • I have a public key ASAdscxl5DfSh-Nrq8J95UjzAg6e7bIgoSGKTdOzeB_8VAo

To claim this, I am signing this object:

@mpdude
mpdude / README.md
Last active May 2, 2021
`phpinfo` output for various PHP versions shipped with GitHub Actions
View README.md
View draft.md

Question on how to best build Docker images

Initial situation

In most of my projects I need to run a few steps after I checkout the code from version control and before I can actually use (or work on) it. Examples include

  • run composer, npm, yarn, ... to fetch dependencies
  • run grunt, gulp or similar front-end build pipelines
  • run some legacy code generation tools 🙀