Skip to content

Instantly share code, notes, and snippets.

View jforge's full-sized avatar

jforge

  • Germany, Bargteheide
  • 15:42 (UTC +01:00)
View GitHub Profile
@jforge
jforge / shelly_gen2_mqtt.yaml
Created November 5, 2023 12:03 — forked from arfoll/shelly_gen2_mqtt.yaml
shelly gen 2 mqtt
## configuration.yaml
automation: !include automation.yaml
switch: !include switches.yaml
binary_sensor: !include binary_sensors.yaml
sensor: !include sensors.yaml
## automation.yaml
- id: shellies_get_status
alias: Shellies Get Status
description: ''
docker images | grep -v REPOSITORY | awk 'BEGIN{OFS=":"} {print $1,$2}' | xargs -L1 docker pull
@jforge
jforge / watch.sh
Created July 28, 2023 18:08 — forked from JarredMack/watch.sh
Bash file watcher
#!/bin/sh
############
# Usage
# Pass a path to watch, a file filter, and a command to run when those files are updated
#
# Example:
# watch.sh "node_modules/everest-*/src/templates" "*.handlebars" "ynpm compile-templates"
############
description: >
MQTT demonstrator for Shellies and Tinkerforge components
metadata:
name: shelles and tinkerforge
provider: jforge
version: 1.0.0
parameters:
host:
node {
// https://registry.hub.docker.com/_/maven/
def maven32 = docker.image('maven:3.2-jdk-7-onbuild');
stage 'Mirror'
// First make sure the slave has this image.
// (If you could set your registry below to mirror Docker Hub,
// this would be unnecessary as maven32.inside would pull the image.)
maven32.pull()
// We are pushing to a private secure docker registry in this demo.
@jforge
jforge / ldap2json.sh
Created May 30, 2023 09:49 — forked from deardooley/ldap2json.sh
Parse output of ldapsearch to json
#!/usr/bin/env bash
# ldap2json.sh
#
# Example shell script showing how to parse LDIF output from the
# ldapsearch command into a json array. Please note that this
# script almost certainly does not handle every edge case, and
# is best used to pull a handful of fields a user or group
# record in a FreeIPA ldap server and format them as JSON for use
# in other tools.
@jforge
jforge / reg-cli2
Created April 27, 2023 13:33 — forked from omerfsen/reg-cli2
dockerhub-search-for-image.sh
#!/bin/bash
#
# search dockerhub via APIv2 and print images and tags.
# get token to be able to talk to Docker Hub
TOKEN=dckr_pat_XXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#TOKEN=$(curl -s -H "Content-Type: application/json" -X POST -d '{"username": "'${UNAME}'", "password": "'${UPASS}'"}' https://hub.docker.com/v2/users/login/ | jq -r .token)
UNAME=${1}
macos brew install erlang
erl -eval 'erlang:display(erlang:system_info(version)), halt().' -noshell
"13.2"
erl -eval 'erlang:display(erlang:system_info(otp_release)), halt().' -noshell
"25"
which erlang
/usr/local/bin/erl
@jforge
jforge / bash_strict_mode.md
Created February 9, 2023 12:42 — forked from mohanpedala/bash_strict_mode.md
set -e, -u, -o, -x pipefail explanation
# https://git-scm.com/docs/git-rev-parse
$ ~/git/abc/xyz/123   main ±✚  git rev-parse --show-toplevel
/Users/me/git/abc/
$ ~/git/abc/xyz/123   main ±✚  git rev-parse --show-prefix
xyz/123/
$ ~/git/abc/xyz/123   main ±✚  git rev-parse --show-cdup