Skip to content

Instantly share code, notes, and snippets.

View yoshz's full-sized avatar

Yosh yoshz

  • El Zorro IT
  • Netherlands
View GitHub Profile
@yoshz
yoshz / light_switch_multiple.yaml
Created December 11, 2024 18:13
Home Assistant blueprint to control multiple lights with a single light switch
blueprint:
name: Light switch for multiple lights
description: "## Light switch for multiple lights
This automation controls multiple lights with a single light switch.
It is tested with the follwoing Zigbee2MQTT devices:
@yoshz
yoshz / k8s-certs-check.sh
Created March 25, 2020 11:20
Kubernetes Certificate check/renew scripts
#!/bin/bash
set -e
configfiles=(
/etc/kubernetes/kubelet.conf
/etc/kubernetes/admin.conf
/etc/kubernetes/scheduler.conf
/etc/kubernetes/controller-manager.conf
)
@yoshz
yoshz / generate-favicon.md
Last active October 22, 2022 10:54
Favicon
  1. Create a 144x144 pixels favicon.png from a svg
inkscape -z -e favicon.png -w 144 -h 144 icon.svg
  1. Convert to favicon.ico
convert favicon.png -define icon:auto-resize=128,64,48,32,16 favicon.ico
@yoshz
yoshz / watch.sh
Last active October 2, 2017 16:18
Restart process when a source file changed
#!/bin/sh
# make sure you have inotify-tools installed: https://github.com/rvoicilas/inotify-tools/wiki
# process you want to execute
PROCESS="php server.php"
# directory you want to watch for modified files
SOURCE_PATH=src
$PROCESS &
@yoshz
yoshz / BigQuery node import.md
Last active May 8, 2017 12:29
Json import stream into BigQuery

This script imports a .json.gz file to BigQuery as a stream without any filesize limitation.

Make sure you have exported an account.json for authentication in the GCE console or run this script on a GCE server with the right scopes.

Install npm packages:

docker run -it --rm -v $PWD:/app -w /app \
  node:6.3 npm install
@yoshz
yoshz / gitconfig
Last active August 24, 2017 08:49
gitconfig
[alias]
co = checkout
cm = commit
cp = cherry-pick
br = branch
me = merge
rb = rebase
st = status
sm = submodule
lol = log --graph --decorate --pretty=format:'%C(yellow)%h%Creset%C(auto)%d%Creset %s %Cgreen(%ci) %C(bold blue)<%an>%Creset' --abbrev-commit --all