Skip to content

Instantly share code, notes, and snippets.

View mvanholsteijn's full-sized avatar

Mark van Holsteijn mvanholsteijn

View GitHub Profile
@mvanholsteijn
mvanholsteijn / locustfile.py
Created June 11, 2021 21:19
A simple locust performance test script to load test a privatebin installation
from locust import SequentialTaskSet, HttpUser, between, task
from locust.contrib.fasthttp import FastHttpUser
from pbincli.api import PrivateBin
from pbincli.format import Paste
class SequenceOfTasks(SequentialTaskSet):
def on_start(self):
self.payload = "hello world"
self.url = None
AWSTemplateFormatVersion: '2010-09-09'
Description: AWS Backup daily CloudFormation configuration
Resources:
BackupPlan:
Type: AWS::Backup::BackupPlan
Properties:
BackupPlan:
BackupPlanName: default
BackupPlanRule:
- RuleName: daily-backups
@mvanholsteijn
mvanholsteijn / update-all-route53-domains-contacts.py
Created February 10, 2020 14:48
update the contacts of all route53 registered domains
import boto3
import json
contact = {
"FirstName": "Mark",
"LastName": "van Holsteijn",
"ContactType": "COMPANY",
"AddressLine1": "Laapersveld 27",
"City": "Hilversum",
"CountryCode": "NL",
@mvanholsteijn
mvanholsteijn / test.js
Last active February 16, 2023 12:38
simple k6 performance test script for privatebin installations
import http from 'k6/http';
import {
sleep,
check
} from 'k6';
import {Trend} from 'k6/metrics';
import privatebin from 'k6/x/privatebin';
let createMetric = new Trend('01 - create-paste');
let getMetric = new Trend('02 - get-paste');
AWSTemplateFormatVersion: 2010-09-09
Description: bucket
Resources:
Bucket:
Type: AWS::S3::Bucket
@mvanholsteijn
mvanholsteijn / bulk-update-gitlab-repositories
Created December 22, 2022 12:03
bulk update of gitlab repositories. search desired repositories, checkout, update and push to origin as merge request
#!/bin/bash
CHECKOUT_DIR=/tmp/checkout
COMMIT_MESSAGE=
BRANCH_NAME=
UPDATE_SCRIPT=
SEARCH=
GROUP_NAME=
PUSH=no
@mvanholsteijn
mvanholsteijn / copy-ssm-parameters
Created February 14, 2018 10:47
script to copy all SSM parameter store parameters to disk
#!/usr/bin/env python
#
# copy all SSM parameter store parameters to disk
#
import os, sys, argparse, boto3
parser = argparse.ArgumentParser(description='copy all parameter values to local')
parser.add_argument("--path", dest="path", required=True,
help="to copy the keys from", metavar="STRING")
parser.add_argument("--directory", dest="directory", required=True,
@mvanholsteijn
mvanholsteijn / rdp-to-ec2
Last active October 26, 2022 05:49
simple script to rdp into an EC2 Windows server
#!/bin/bash
#
# Copyright 2022 - Binx.io B.V.
#
# Licensed 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
#
@mvanholsteijn
mvanholsteijn / gcp-least-privileged
Last active October 22, 2022 11:09
lists all Google IAM roles which contain the specified permission sorted by the number of permissions
#!/bin/bash
#
# NAME
# gcp-least-privileged - lists all Google IAM roles which contain the specified permission
#
# EXAMPLE
# gcp-least-privileged compute.disks.delete
#
main() {
local permission
@mvanholsteijn
mvanholsteijn / push-to-image-registry.yaml
Last active July 7, 2022 18:12
generic Github Action workflow to create and publish a container image to ghcr.io
---
name: Create and publish a Docker image
"on":
push:
tags:
- '*'
branches:
- 'main'