Skip to content

Instantly share code, notes, and snippets.

@giehlman
giehlman / snippets.js
Created November 15, 2021 19:54
Gelbe Seiten DOM Scraper
// copy&paste in chrome dev tools console
var hits = document.getElementsByClassName("mod-Treffer");
var all = [];
for (var i = 0; i < hits.length; i++) {
var res = getLineFromDomHit(hits[i]);
console.log(res);
all.push(res);
@giehlman
giehlman / remove-loggroups.sh
Last active March 12, 2020 12:15
Removes cloudwatch loggroups that contain a given search string using aws-cli
#!/usr/bin/env bash
#title : remove-loggroups.sh
#description : Removes cloudwatch loggroups that contain a given search string using aws-cli
#author : Christian-André Giehl <christian@emailbrief.de>
#date : 20200312
#version : 1.0
#usage : sh remove-loggroups.sh <search-string>
#==============================================================================
# Exits in case the supplied state is != 0. State is typically supplied via $?
#!/usr/bin/env sh
#title : bb-pipelines-builder-nodejs.sh
#description : For npm/yarn projects! Convenience script to build, check and pack fat artifacts. For personal and experimental use only!
#author : Christian-André Giehl <christian@emailbrief.de>
#date : 20200322
#version : 1.4
#usage : sh ./bb-pipelines-builder-nodejs.sh <project-name> <target-zip-name>
#==============================================================================
PROJECT_NAME=${1:-$(basename "$PWD")}
@giehlman
giehlman / setup-cloudwatch.sh
Last active July 18, 2019 19:34
Creates cloudwatch log filter, metric and alarm
#!/usr/bin/env bash
#title : setup-cloudwatch.sh
#description : Creates cloudwatch log filter, metric and alarm
#author : Christian-André Giehl <christian@emailbrief.de>
#date : 20190718
#version : 1.1
#usage : sh setup-cloudwatch.sh <keyword-list> <lambda-function-name>
#==============================================================================
# Exits in case the supplied state is != 0. State is typically supplied via $?
#!/usr/bin/env sh
#title : bb-pipelines-builder.sh
#description : For npm/yarn projects! Convenience script to build, check and pack (fat) artifacts. For personal and experimental use only!
#author : Christian-André Giehl <christian@emailbrief.de>
#date : 20200324
#version : 1.5
#usage : sh ./bb-pipelines-builder.sh <project-name> <target-zip-name>
#==============================================================================
PROJECT_NAME=${1:-$(basename "$PWD")}
@giehlman
giehlman / updateSonarProps.sh
Created February 20, 2018 16:36
Update SonarQube properties file with project name and version from package.json
#!/usr/bin/env bash
#title : updateSonarProps.sh
#description :
# This script parses the project's name and version from its package.json and automagically
# updates the version and package name in the SonarQube configuration properties file.
# It can be used as a pre step before running the sonar-scanner command
# It also creates a backup of the props file with suffix *.bak
#prerequisites : NodeJS based project with package.json, sonar*.properties file in the cwd
#author : Christian-André Giehl <christian@emailbrief.de>
#date : 20180220
@giehlman
giehlman / updateVersionInSwagger.sh
Last active May 10, 2022 17:39
Takes the version in package.json and seds it in swagger.yaml
# Get the version from package.json
PACKAGE_VERSION=$(cat package.json \
| grep version \
| head -1 \
| awk -F: '{ print $2 }' \
| sed 's/[",]//g' \
| tr -d '[[:space:]]')
echo "Extracted version: ${PACKAGE_VERSION}"
# Find the swagger file
@giehlman
giehlman / .bash_profile
Created December 3, 2017 13:27
Excerpt of my mostly used commands written in my bash_profile
if [ -f ~/.bashrc ]; then
source ~/.bashrc
fi
export PS1="\[\033[36m\]\u\[\033[m\]@\[\033[32m\]\h:\[\033[33;1m\]\w\[\033[m\]\$ "
export CLICOLOR=1
export LSCOLORS=ExFxBxDxCxegedabagacad
export AWS_PROFILE=internal-user
alias ls='ls -GFh'
@giehlman
giehlman / eb-deploy-gradle.sh
Created November 21, 2017 14:43
For gradle projects! Convenience script to build, pack and upload code to an AWS ElasticBeanstalk environment, using the AWS CLI 'eb' command. For personal and experimental use only!
#!/usr/bin/env bash
#title : eb-publish-gradle.sh
#description : For gradle projects! Convenience script to build, pack and upload code to an AWS ElasticBeanstalk environment, using the AWS CLI 'eb' command. For personal and experimental use only!
#prerequisites : AWS CLI with 'eb' cmd, Procfile, gradle project, .elasticbeanstalk/config.yml
#author : Christian-André Giehl <christian@emailbrief.de>
#date : 20170410
#version : 1.1
#usage : sh eb-publish-gradle.sh
#==============================================================================
@giehlman
giehlman / lambda-publish-npm.sh
Last active November 21, 2017 14:22
For npm projects! Convenience script to build, pack and upload code to an AWS Lambda function, using the AWS CLI. For personal and experimental use only!
#!/usr/bin/env bash
#title : lambda-publish-npm.sh
#description : For npm projects! Convenience script to build, pack and upload code to an AWS Lambda function, using the AWS CLI. For personal and experimental use only!
#author : Christian-André Giehl <christian@emailbrief.de>
#date : 20170410
#version : 1.1
#usage : sh lambda-publish-npm.sh
#==============================================================================
# Exits in case the supplied state is != 0. State is typically supplied via $?