Skip to content

Instantly share code, notes, and snippets.

Avatar
🌳
Go for it.

Bengt Brodersen qoomon

🌳
Go for it.
View GitHub Profile
@qoomon
qoomon / clipperz2enpass.js
Created Oct 26, 2020
clipperz export to enpass converter
View clipperz2enpass.js
#!/usr/bin/env node
// requirenments
// npm install --save \node-html-parser uuid
const fs = require('fs')
const parseHtml = require('node-html-parser').parse
const uuid = require('uuid').v4
@qoomon
qoomon / git_configure.sh
Last active Sep 21, 2020
Opinionated Git Config
View git_configure.sh
#!/bin/bash
SELF_DIR="$(dirname "$0")"
cd "$SELF_DIR"
# git global config see $HOME/.gitconfig
git config --global color.ui 'auto'
git config --global merge.ff false
# ensures to convert CRLF to LF when writing to database
git config --global core.autocrlf 'input'
git config --global pull.rebase 'merges'
@qoomon
qoomon / aws-cloudformation-deployer.sh
Last active Aug 13, 2020
Deploy CloudFormation Templates including Packaging and Deploy Event Watching
View aws-cloudformation-deployer.sh
#!/usr/bin/env bash
set -o errexit # exit when a command line fails
set -o pipefail # pipes exit code will be the last non-zero exit code of all pipe commands
set -o nounset # exit on read a undeclared variable
#set -o xtrace # enable debug logging
cd "$(dirname "${BASH_SOURCE[0]}")"
### SOURCE: https://gist.github.com/qoomon/7e6f751415389a8bd67f05dd0b984d06
### REQUIREMENTS #######################################################################################################
@qoomon
qoomon / iptables-local-port-forward.sh
Created Apr 26, 2020
iptables - forward traffic from local port to target address
View iptables-local-port-forward.sh
#!/usr/bin/env bash
set -o errexit # exit when a command line fails
set -o pipefail # pipes exit code will be the last non-zero exit code of all pipe commands
set -o nounset # exit on read a undeclared variable
#set -o xtrace # enable debug logging
cd "$(dirname "${BASH_SOURCE[0]}")"
# Target Address e.g '123.123.123.123:1024'
TARGET_ADDRESS="$1"
@qoomon
qoomon / JsonbColumnType.kt
Last active Jun 14, 2020
Kotlin Exposed Postgres JsonColumnType
View JsonbColumnType.kt
package me.qoomon.examples
import kotlinx.serialization.KSerializer
import kotlinx.serialization.json.Json
import kotlinx.serialization.json.JsonConfiguration
import me.qoomon.examples.JsonbColumnType.Companion.JSONB
import me.qoomon.examples.JsonbColumnType.Companion.TEXT
import org.jetbrains.exposed.sql.*
import org.jetbrains.exposed.sql.Function
import org.jetbrains.exposed.sql.statements.api.PreparedStatementApi
@qoomon
qoomon / hibp
Last active Oct 20, 2020
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
View aws-ssm-ec2-proxy-command.sh
#!/usr/bin/env sh
######## Source ################################################################
#
# https://gist.github.com/qoomon/fcf2c85194c55aee34b78ddcaa9e83a1
#
######## Usage #################################################################
#
# #1 Install the AWS CLI
# https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html
#
@qoomon
qoomon / aws-cloudformation-deploy-watcher.sh
Last active May 26, 2020
Watch CloudFormation Events during `aws cloudformation deploy`
View aws-cloudformation-deploy-watcher.sh
#!/usr/bin/env bash
set -o errexit # exit when a command line fails
set -o pipefail # pipes exit code will be the last non-zero exit code of all pipe commands
set -o nounset # exit on read a undeclared variable
#set -o xtrace # enable debug logging
#### Source: https://gist.github.com/qoomon/d6633abe35eea297f475260478f86c8c
### Usage ###
#
@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);
}
}));
You can’t perform that action at this time.