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 / winutil.ps1
Created November 18, 2022 17:41
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 / codepipeline.authms.tf
Last active April 25, 2020 17:09
Auth MS CodePipeline
resource "aws_iam_role" "cp-iam-role" {
name = "AWSCodePipelineDeployImage"
assume_role_policy = <<EOF
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": {
@DerPauli
DerPauli / ecr_cwr.tf
Last active April 25, 2020 16:28
ECR CWR
# ECR TRIGGER
resource "aws_cloudwatch_event_rule" "cwt-rule" {
name = "ecr-trigger-deploy-authms"
description = "Trigger codepipeline on image change"
event_pattern = <<PATTERN
{
"detail-type": [
"ECR Image Action"
],
@DerPauli
DerPauli / iam_ecr.tf
Created April 25, 2020 16:17
IAM ECR
resource "aws_iam_access_key" "iam-key-ecr-deploy" {
user = aws_iam_user.iam-ecr-deploy.name
pgp_key = var.iam_pgp_ecr_deploy
}
resource "aws_iam_user" "iam-ecr-deploy" {
name = var.iam_user_name_ecr_auth
}
resource "aws_iam_user_policy" "iam-policy-ecr-deploy" {
image: docker:latest
stages:
- build
services:
- docker:dind
variables:
REGION: "eu-central-1"
@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: ""