Skip to content

Instantly share code, notes, and snippets.

:octocat:

Bengt Brodersen qoomon

:octocat:
Block or report user

Report or block qoomon

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@qoomon
qoomon / Log4jCollector.kt
Last active Sep 13, 2019
Log4jCollector Junit5 Extension
View Log4jCollector.kt
import org.apache.logging.log4j.LogManager
import org.apache.logging.log4j.core.Filter.Result
import org.apache.logging.log4j.core.LogEvent
import org.apache.logging.log4j.core.Logger
import org.apache.logging.log4j.core.filter.AbstractFilter
import org.junit.jupiter.api.extension.AfterAllCallback
import org.junit.jupiter.api.extension.BeforeAllCallback
import org.junit.jupiter.api.extension.BeforeEachCallback
import org.junit.jupiter.api.extension.ExtensionContext
@qoomon
qoomon / aws-ssm-ec2-proxy-command.sh
Last active Sep 13, 2019
AWS SSM SSH ProxyCommand
View aws-ssm-ec2-proxy-command.sh
#!/usr/bin/env sh
set -eu
######## Usage #################################################################
#
# #1 Install the AWS CLI
# https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html
#
# #2 Install the Session Manager Plugin for the AWS CLI
# https://docs.aws.amazon.com/systems-manager/latest/userguide/session-manager-working-with-install-plugin.html
@qoomon
qoomon / aws-session
Last active Aug 30, 2019
write aws session credentials to ~/.aws/credentials file
View aws-session
#!/usr/bin/env python3
########### Usage ##############################################################
#
# list available session profiles
# aws-session -l
#
# write session credentials to credentials file (~/.aws/credentials)
# aws-session <SESSION_PROFILE>
#
@qoomon
qoomon / aws-profile.py
Created Jul 23, 2019
aws cli util to manage named profiles
View aws-profile.py
from os import environ
from os import path
from argparse import ArgumentParser
from configparser import ConfigParser
_CONFIG_PATH = path.expanduser(environ.get('AWS_CONFIG_FILE', '~/.aws/config'))
_CREDENTIALS_PATH = path.expanduser(environ.get('AWS_SHARED_CREDENTIALS_FILE', '~/.aws/credentials'))
@qoomon
qoomon / aws-cloudformation-deploy-watcher.sh
Last active Aug 5, 2019
Watch CloudFormation Events during `aws cloudformation deploy`
View aws-cloudformation-deploy-watcher.sh
#!/usr/bin/env bash
set -e
function echo_help {
echo "usage: $0 [options]"
echo ""
echo "example: aws cloudformation deploy ... | $0 [options]"
echo ""
echo "options:"
echo " --stack-name"
@qoomon
qoomon / ChromeRemoveAllDomainSearchEngins.js
Last active Mar 11, 2019
[Google Chrome] Remove all domain search engines #cleanup
View ChromeRemoveAllDomainSearchEngins.js
// open chrome://settings/searchEngines and run following script in browser console
// will remove every 'other' search engine wich contains a '.' in its keyword
settings.SearchEnginesBrowserProxyImpl.prototype.getSearchEnginesList()
.then(engines => engines.others.forEach(engine => {
if(engine.keyword.includes(".")){
console.log("remove: " + engine.displayName + " - " + engine.keyword)
settings.SearchEnginesBrowserProxyImpl.prototype.removeSearchEngine(engine.modelIndex);
}
}));
@qoomon
qoomon / escapeHTML.js
Created Feb 28, 2019
JS Function to escape HTML text
View escapeHTML.js
function escapeHTML(text) {
let element = document.createElement('_');
element.innerText = text;
return element.innerHTML;
}
@qoomon
qoomon / check-pwned-passwords.sh
Last active Feb 1, 2019
check-pwned-passwords.sh
View check-pwned-passwords.sh
#!/bin/bash
set -e
set -o pipefail
##############################################################################
##############################################################################
#
###### prerequisites
#
# install ripgrep
@qoomon
qoomon / entrypoint.sh
Created Jan 15, 2019
docker container run forever
View entrypoint.sh
#!/bin/sh
# do some configuration
# Ah, ha, ha, ha, stayin' alive...
while true; do :; done &
kill -STOP $!
wait $!
@qoomon
qoomon / conventional_commit_messages.md
Last active Jul 1, 2019
Conventional Commit Messages
View conventional_commit_messages.md
You can’t perform that action at this time.