Skip to content

Instantly share code, notes, and snippets.

View QNimbus's full-sized avatar
🎯
Focusing

Bas QNimbus

🎯
Focusing
  • The Netherlands
View GitHub Profile
@QNimbus
QNimbus / customDevices.json
Last active November 24, 2020 15:06
zwave2mqtt custom devices
{
"271-4096-258": [
{
"type": "light",
"object_id": "dimmer",
"values": [
"38-1-0"
],
"discovery_payload": {
"schema": "template",
@QNimbus
QNimbus / motion_light_smart.yaml
Last active December 16, 2020 11:45
Turn on a light when motion is detected
blueprint:
name: Motion-activated Light
description: Turn on a light when motion is detected...
domain: automation
source_url: https://gist.github.com/d7384358e6078e9d3add226d1c54ed87
input:
motion_entity:
name: Motion Sensor
selector:
entity:
#!/usr/bin/env bash
##
## Title: deploy_homeassistant.sh
## Description: Script to deploy uploaded certificates for use with Home Assistant
## Author: B. van wetten
## Created date: 28-12-2020
## Updated date: 28-12-2020
## Version: 0.1
## GitHub Gist: https://gist.github.com/cb7a61d4be538f80ccac7186a84e5ed4
##
@QNimbus
QNimbus / avg_time
Created January 22, 2022 19:24
Benchmark function that display average runtime for a command
avg_time() {
#
# usage: avg_time n command ...
#
n=$1; shift
(($# > 0)) || return # bail if no command given
for ((i = 0; i < n; i++)); do
{ time -p "$@" &>/dev/null; } 2>&1 # ignore the output of the command
# but collect time's output in stdout
done | awk '
@QNimbus
QNimbus / usefull_cmds.sh
Last active April 22, 2024 10:28
Usefull commands
# Recursively append newline to files that do not yet end with '\n'
# Excludes .git/ folder
find . -type f -not -path "./.git/*" -exec sed -i -e '$a\' {} \;
# Quick port forward to remote host (e.g. for webmin)
ssh -l user -L 8080:localhost:10000 # Then browse to http://localhost:8080
@QNimbus
QNimbus / placeholder.html
Last active January 27, 2022 07:57
Placeholder HTML
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Dummy Page</title>
<meta name="description" content="Simple, quick, standalone responsive placeholder Website without any additional resources">
<meta name="author" content="https://gist.github.com/qnimbus">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://unpkg.com/[email protected]/build/pure-min.css" integrity="sha384-nn4HPE8lTHyVtfCBi5yW9d20FjT8BJwUXyWZT9InLYax14RDjBj46LmSztkmNP9w" crossorigin="anonymous">
<!--[if lt IE 9]>
@QNimbus
QNimbus / PrusaSlicer startup.gcode
Last active February 9, 2022 09:16
PrusaSlicer startup g-code for 3D printing
M862.3 P "[printer_model]" ; printer model check
M862.1 P[nozzle_diameter] ; nozzle diameter check
M115 U3.10.0 ; tell printer latest fw version
M117 Initializing
; Set coordinate modes
G90 ; use absolute coordinates
M83 ; extruder relative mode
#!/usr/bin/env bash
##
## Title: deploy_pikvm.sh
## Description: Script to deploy uploaded certificates for use with PiKVM
## Author: B. van wetten
## Created date: 07-02-2022
## Updated date: 07-02-2022
## Version: 0.1
## GitHub Gist:
##
@QNimbus
QNimbus / PrusaSlicer original startup.gcode
Last active February 8, 2022 08:35
PrusaSlicer original startup g-code for 3D printing
M862.3 P "[printer_model]" ; printer model check
M862.1 P[nozzle_diameter] ; nozzle diameter check
M115 U3.10.0 ; tell printer latest fw version
G90 ; use absolute coordinates
M83 ; extruder relative mode
M104 S[first_layer_temperature] ; set extruder temp
M140 S[first_layer_bed_temperature] ; set bed temp
M190 S[first_layer_bed_temperature] ; wait for bed temp
M109 S[first_layer_temperature] ; wait for extruder temp
G28 W ; home all without mesh bed level
@QNimbus
QNimbus / README.md
Last active April 22, 2025 22:47
SSH Agent forwarding WSL2

SSH Agent forwarding in WSL2

Download npiperelay

To communicate between WSL and the 1Password SSH agent, we'd need to use npiperelay. This tool allows WSL to communicate with Windows' named pipes.

To install it, we need to open the GitHub repository and download the latest release. At the time of writing this post the latest release is v0.1.0 from July 2, 2020.

Unzip it and paste the npiperelay.exe file in any folder that's configured in your system's PATH. For example %USERPROFILE%/.wsl/mpiperelay.exe and then add %USERPROFILE%/.wsl to your PATH.