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 / hibp
Last active Oct 7, 2019
Have I been pwned! Script to check your password against https://haveibeenpwned.com/
View hibp
#!/usr/bin/env sh
set -e
color_red=$'\e[1;31m'
color_green=$'\e[1;32m'
color_reset=$'\e[0m'
########################### Usage ##############################################
#
# password prompt 'hibp'
# or
@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 Nov 4, 2019
AWS SSM SSH Proxy Command
View aws-ssm-ec2-proxy-command.sh
#!/usr/bin/env sh
set -eu -o pipefail
######## 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-cloudformation-deploy-watcher.sh
Last active Nov 1, 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 Nov 3, 2019
Conventional Commit Messages
View conventional_commit_messages.md

Conventinal Commit Messages

See how a minor change to your commit message style can make a difference. Examples

Have a look at CLI Util git-conventional-commits

Commit Formats

Default

@qoomon
qoomon / dind_example.md
Created Dec 17, 2018
Docker in Docker (dind)
View dind_example.md

docker network solution

BUILD_TAG="Dummy Job #$RANDOM"

echo "Create job network '$BUILD_TAG'"
job_network_id=$(docker network create "$BUILD_TAG" | tee $TTY)

echo "Start service container 'dind'"
docker run -d --privileged --net=${job_network_id} --network-alias dind docker:dind
You can’t perform that action at this time.