Skip to content

Instantly share code, notes, and snippets.

Avatar
🌳
Go for it.

Bengt Brodersen qoomon

🌳
Go for it.
View GitHub Profile
View convert-pdf2scan.sh
#!/usr/bin/env bash
################################################
#
# Prerequisits:
# ensure ImageMagick is installed
#
# Usage:
# convert-pdf2scan [--gray] files...
#
################################################
@qoomon
qoomon / youtube_clean_watch_later_videos.js
Last active May 11, 2021
Clean YouTube Watch Later Videos
View youtube_clean_watch_later_videos.js
// This script will remove all videos from watch later list
//
// Usage
//
// #1 go to https://www.youtube.com/playlist?list=WL
// #2 run following script
// adjust REMOVE_BUTTON_TEXT_MAP if your language is missing
(async function() {
const REMOVE_BUTTON_TEXT_MAP = {
@qoomon
qoomon / jira_card_shrinker_bookmarklet.js
Last active Feb 27, 2021
JIRA Card Shrinker Bookmarklet
View jira_card_shrinker_bookmarklet.js
javascript: (function() {
let style = document.createElement('style');
style.type = 'text/css';
style.appendChild(document.createTextNode(`
.ghx-column > .ghx-parent-group.ghx-away > .ghx-parent-stub > .ghx-group {
padding-left: 6px;
height: 16px;
}
.ghx-column > .ghx-parent-group.ghx-away > .ghx-parent-stub > .ghx-group > .ghx-key {
margin: 0; padding: 0;
View jira-queries.md

Board Quick Filters

  • Recently Updated

    • updatedDate >= -1d OR ( updatedDate <= endOfWeek(-1w) AND updatedDate >= -3d)
    • Filter issues updated since last weekday
  • Flagged

    • Flagged is not EMPTY
    • Flter flagged issues
@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 Feb 26, 2021
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 Apr 21, 2021
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 Apr 6, 2021
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