Skip to content

Instantly share code, notes, and snippets.

Paul Merker DerPauli

View GitHub Profile
@DerPauli
DerPauli / extend_win10_disk_qemu.md
Created June 13, 2024 13:20
#kvm #qemu Extend Win10 disk (and move it to NFS)

Move .qcow2 to NFS

Move

mv disk.qcow2 /mnt/nfs/disk.qcow2

Resize

qemu-img resize disk.qcow2 150G

@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 / 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"