Skip to content

Instantly share code, notes, and snippets.

View maglub's full-sized avatar

Magnus Lübeck maglub

View GitHub Profile
@maglub
maglub / mask_swiss_cross.md
Last active April 17, 2024 09:29
Python script for masking the Swiss cross in a QRCode in an image or PDF read from <stdin>. Output is a PNG formatted image on <stdout>

Introduction

This script is basically a workaround for the bug in zbarimg that it cannot read QRCodes with the Swiss Cross in them (as every QR Bill in Switzerland has). See https://qr-rechnung.net/#/

Usage:

@maglub
maglub / urllist.json
Last active February 7, 2019 14:24
URL list for dashboard
{
"settingsReloadIntervalMinutes": 10,
"fullscreen": true,
"autoStart": true,
"websites" : [
{
"url" : "http://com-icinga-l01:3000/d/JGY36E_mz/skype-and-lucs?orgId=1&refresh=10s&from=now-6h&to=now&kiosk&comment=sfb_lucs",
"duration" : 40,
"tabReloadIntervalSeconds": 300
},
@maglub
maglub / RPI-influxdb.md
Last active January 20, 2019 13:05
Rasperry pi Demo - influx install and add data from DS18B20

Introduction

  • Install Raspbian Lite on an SD card
  • Set up InfluxDB
  • Create a logIt script to log data to Influxdb
  • Set up 1wire bit-banging (GPIO 4)
  • Create a getTemperature script to read temperatures from a connected sensor
  • Create a looping wrapper that fetches temprature from sonsors, then logging it to the database

This small writeup is meant to show that it is quite simple to write a data logger by relying on "unix style" programs that do one thing only.

@maglub
maglub / slack_pipe.md
Last active November 14, 2018 09:53
slack_pipe

Introduction

Use slack_pipe to just send quoted text through a pipe to slack.

Example:

echo arne | ./slack_pipe
@maglub
maglub / Ansible_inventory.md
Last active May 24, 2019 17:49
Ansible inventory file - AD integration

Introduction

  • An ansible inventory file that is set as executable will be executed instead of read as a normal inventory. This is called Dynamic Inventory.
  • The stdout of the executable should be a JSON file

The dynamic inventory will be called a number of times.

  • Once to get a list of hosts
  • Once per host with the option "--host HOSTNAME" - to get eventual host variables
@maglub
maglub / Rökgenerator.md
Last active May 4, 2021 12:29
Rökgenerator

Rökgenerator

Faktorer som påverkar förbränningen

  • Rökgeneratorns diameter och form
  • Rökrörets dimension
  • Luftpumpens kapacitet/Venturi-rörets luftflöde - spelar stor roll för luftflödet till glödbädden
  • Venturi-rörets utformning och dimension
  • Venturi-rörets placering för optimal venturi-effekt
  • Storlek på hålen i gallret på glödbädden, påverkar huruvida askan faller igenom när ett spån är färdigbrunnet
@maglub
maglub / Example.md
Last active January 27, 2018 20:56
Exempel på wpa-roam

Example

  • /etc/network/interfaces
source-directory /etc/network/interfaces.d

auto lo
iface lo inet loopback
country=GB
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
network={
ssid="ASUS"
psk="excitedstar654"
id_str="HOME"
priority=15
}
@maglub
maglub / code
Created September 20, 2016 01:30
/*
*/
#include <SPI.h>
#include <Ethernet.h>
byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
IPAddress server(192,168,1,101); //
//char server[] = "www.galgbacken.net"; // name address for Google (using DNS)
@maglub
maglub / gist:5540048
Created May 8, 2013 12:12
Script to do whatever
cat a b
ls -la