Skip to content

Instantly share code, notes, and snippets.

View qoomon's full-sized avatar
🌳
Go for it.

Bengt Brodersen qoomon

🌳
Go for it.
View GitHub Profile
@qoomon
qoomon / script.sh
Last active February 9, 2023 16:13
Google Drive - Hide Symbolic Link in Home Directory
# lock and hide Google Drive link
chflags -h uchg,hidden "$HOME/Google Drive"
# undo by following command
# chflags -h nouchg,nohidden "$HOME/Google Drive"
@qoomon
qoomon / parse-body.js
Created October 25, 2022 14:38
Parse http.IncomingMessage body
async function parseBody(res) {
return new Promise((resolve, reject) => {
let body = '';
res.on('data', (chunk) => body += chunk);
res.on('end', () => resolve(body));
}).then(body => res.body = body ? JSON.parse(body) : undefined);
}
@qoomon
qoomon / base-vpc.ts
Created September 30, 2022 14:32
AWS CDK - Vpn Construct - Configure default security group according to "CIS AWS Foundations Benchmark controls",
import {Stack} from "aws-cdk-lib";
import {Vpc, VpcProps} from "aws-cdk-lib/aws-ec2";
import {AwsCustomResource, AwsCustomResourcePolicy, PhysicalResourceId} from "aws-cdk-lib/custom-resources";
import {Construct} from "constructs";
export class BaseVpc extends Vpc {
constructor(scope: Construct, id: string, props: VpcProps) {
super(scope, id, props);
// Configure default security group according to "CIS AWS Foundations Benchmark controls",
// section "4.3 – Ensure the default security group of every VPC restricts all traffic".
@qoomon
qoomon / GitHubBulkOperations.sh
Created July 29, 2022 11:11
GitHub Bulk Operations
# list repos
# gh repo list $owner --json nameWithOwner -q '.[].nameWithOwner'
repos=(
example/example
)
for repo in "${repos[@]}"
do
echo $repo
@qoomon
qoomon / ticktok_clean_favourites.js
Created April 29, 2022 07:42
Clean TikTok favourites
async function sleep (timeout) {
return new Promise(res => setTimeout(res, timeout))
}
let videoElement = document.querySelector('div[data-e2e="user-liked-item"]').parentElement
while(videoElement) {
console.log(videoElement)
videoElement.scrollIntoView()
await sleep()
@qoomon
qoomon / ATOSS Bulk Insert Bookmarklet.js
Last active June 1, 2022 10:05
ATTOS Time Insert Bookmarklet
javascript:(async function() {
console.info('author: bengt brodersen - www.qoomon.de');
console.info('version: 1.0.1');
'// this bookmarklet will insert configured workingTimes for all visible empty days in the past';
'// === configuration ====================================================';
const workingTimes = {
'Mo': [{checkIn: '08:00', checkOut: '16:30'}],
'Di': [{checkIn: '08:00', checkOut: '16:30'}],
@qoomon
qoomon / ecs-execute-command.sh
Last active February 1, 2022 07:50
Connect into AWS ECS Container
CLUSTER_NAME=$1
SERVICE_NAME=$2
CONTAINER_NAME=$3
COMMAND=${4:-'/bin/sh'}
# get first running task
TASK_ID=$(aws ecs list-tasks \
--cluster $CLUSTER_NAME \
--service-name $SERVICE_NAME \
--desired-status RUNNING \
@qoomon
qoomon / jira_script runner_behaviour.groovy
Last active January 23, 2024 09:30
Jira Script Runner - Behaviour - Issue Templates, Restrict Links Types
// ------------------------------------------
// ---- Set default Description -------------
// ------------------------------------------
def defaultDescriptions = [
Story: """
*As a* USER
*I want* FEATURE
*so that* BENEFIT
@qoomon
qoomon / convert-pdf2scan.sh
Last active January 21, 2022 14:51
fake pdf scanner.
#!/usr/bin/env bash
set -e # exit on error
################################################
#
# Prerequisits:
# ensure ImageMagick is installed
#
# Usage:
# convert-pdf2scan [--gray] files...
#
@qoomon
qoomon / youtube_clean_watch_later_videos.js
Last active August 1, 2025 23:32
Clean YouTube Watch Later Videos
// Version 2.0.1
// 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 in your browser console
(async function() {
const playlistName = document.querySelector('.metadata-wrapper #container #text')?.textContent || document.querySelector('#text')?.textContent