Skip to content

Instantly share code, notes, and snippets.

View lauer's full-sized avatar

Jesper Grann Laursen lauer

  • Vedbæk, Denmark
  • 21:44 (UTC +02:00)
View GitHub Profile
@lauer
lauer / myip
Created May 25, 2020 07:28
Fast way to get External and Internal ip addresses
#!/bin/sh
echo "External: "
dig +short myip.opendns.com @resolver1.opendns.com
echo "Internal: "
ifconfig |grep inet | awk '{print $2}' |grep -v '127.0.0.1\|::1\|fe80::'
@lauer
lauer / zdb5100.yaml
Created March 7, 2021 07:32
Blueprint for Logic Group ZDB5100
blueprint:
name: Logic Group Matrix ZDB5100
description: Create automatisation for the ZDB5100 using zwavejs integration
domain: automation
input:
matrix_zdb5100:
name: Matrix ZDB5100
description: The matrix to interact with
selector:
device:
@lauer
lauer / add_build_number.sh
Created December 7, 2021 07:33
Small script to jenkinsfile which set the last .0 on alpha releases to the $BUILD_NUMBER from jenkins
#!/usr/bin/env bash
set -e
if [[ -z "${BUILD_NUMBER}" ]]; then
echo "No build number set"
env
exit 0
fi
BUILD_VERSION=`jq -r '.version' package.json | sed "s/0$/${BUILD_NUMBER}/"`
@lauer
lauer / docker-entrypoint
Created April 23, 2025 09:44
simple docker entrypoint for rails project - check if database is up, from $DATABASE_URL which contains both port and hostname.
#!/bin/bash
set -e
# Extract hostname and port from DATABASE_URL
DB_HOST=$(echo $DATABASE_URL | sed -n 's/^.*[^@]*@\([^:]*\):[0-9]*.*$/\1/p')
DB_PORT=$(echo $DATABASE_URL | sed -n 's/^.*[^@]*@[^\:]*:\([0-9]*\).*$/\1/p')
# Wait for the database to be ready before starting the application
until nc -z -v -w30 $DB_HOST $DB_PORT; do