Skip to content

Instantly share code, notes, and snippets.

View DerPauli's full-sized avatar
📧
consulting@codezenith.com

Paul Merker DerPauli

📧
consulting@codezenith.com
View GitHub Profile
@DerPauli
DerPauli / git.patch.sh
Created September 16, 2025 10:56
Create a git patch on a folder
# create patch
git diff origin/main..origin/<branch-to-compare> -- folder/to/patch/ another.file > my.patch
# apply the patch
patch -p1 < my.patch
@DerPauli
DerPauli / winutil.ps1
Last active June 13, 2024 13:10
Windows Util
# Run from an elevated PowerShell
# Credits to Chris Titus (https://christitus.com/windows-tool/)
iwr -useb https://christitus.com/win | iex
@DerPauli
DerPauli / print.groovy
Created February 11, 2022 22:37
Print Jenkins credentials from script console
import java.nio.charset.StandardCharsets;
def creds = com.cloudbees.plugins.credentials.CredentialsProvider.lookupCredentials(
com.cloudbees.plugins.credentials.Credentials.class
)
for (c in creds) {
println(c.id)
if (c.properties.description) {
println(" description: " + c.description)
}
@DerPauli
DerPauli / keybase.md
Created April 23, 2021 16:59
keybase.md

Keybase proof

I hereby claim:

  • I am derpauli on github.
  • I am codepauli (https://keybase.io/codepauli) on keybase.
  • I have a public key ASCqGw0HrjsWP0k1ONWmNItJcm47SlLqJqifpiPsecjfQAo

To claim this, I am signing this object:

@DerPauli
DerPauli / delete.md
Last active November 3, 2020 17:26
Delete docker images locally

For Unix

To delete all containers including its volumes use,

docker rm -vf $(docker ps -a -q)

To delete all the images,

@DerPauli
DerPauli / change.py
Created May 1, 2020 15:26
lambda_change
import json
import boto3
import zipfile
import tempfile
code_pipeline = boto3.client('codepipeline')
s3 = boto3.client('s3')
@DerPauli
DerPauli / headers.js
Created April 11, 2020 15:25
CloudFront Lambda@Edge function to change response headers
'use strict';
exports.handler = (event, context, callback) => {
const response = event.Records[0].cf.response;
const headers = response.headers;
// Server header to conceil technology
headers['server'] = [{
key: 'Server',
value: ""
@DerPauli
DerPauli / change.py
Created April 11, 2020 15:23
Lambda function to change a imageDetails.json file into a imagedefinitions.json file
import json
import boto3
import zipfile
import tempfile
code_pipeline = boto3.client('codepipeline')
s3 = boto3.client('s3')
@DerPauli
DerPauli / reroute.sh
Created September 15, 2019 13:05
Reroute port 80 to 3000
sudo iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-port 3000
sudo iptables-save