Skip to content

Instantly share code, notes, and snippets.

Avatar

Robert McLeod penguinpowernz

  • Penguin Power
  • Auckland, New Zealand
View GitHub Profile
@penguinpowernz
penguinpowernz / 0README.md
Created Apr 17, 2021
Multi Tenant node-red
View 0README.md

Multi Tenant node-red

Copy the files into the recommended places.

  • /etc/default/node-red
  • /etc/systemd/system/node-red@.service

Then to run the service for a user that is installed on your system do:

systemctl start node-red@jim node-red@bob
@penguinpowernz
penguinpowernz / README.md
Created Aug 31, 2020
Building a Debian Package from installed files
View README.md

Building a Debian Package from installed files

Recently I had a package disappear on me from the mainline repos but one of my apps had a hard dependency on that version. I managed to find a machine that still had that package installed so here's what I did.

Get the file list:

dpkg -L firefox-esr|sed 1d|grep -v "package diverts" > esrfiles.txt
View updated.json
{
"type": "update",
"quake": {
"publicID": "2020p203673",
"time": "2020-03-16T08:37:10.376Z",
"depth": 23.87388039,
"magnitude": 1.222926187,
"locality": "10 km north-east of Matawai",
"mmi": -1,
"quality": "best",
View new.json
{
"type": "new",
"quake": {
"publicID": "2020p203673",
"time": "2020-03-16T08:37:10.376Z",
"depth": 10.83877039,
"magnitude": 1.021546187,
"locality": "10 km north-east of Matawai",
"mmi": -1,
"quality": "preliminary",
View lsb.sh
#!/bin/bash
lsb_release -a|grep stretch || exit 0;
apt-get update
apt-get install asl-agent
@penguinpowernz
penguinpowernz / .codeclimate.yml
Last active May 29, 2019
Golang project codeclimate config
View .codeclimate.yml
version: "2"
plugins:
govet:
enabled: true
golint:
enabled: true
gofmt:
enabled: true
FIXME:
enabled: true
View slack_notify.go
package main
import (
"fmt"
"log"
"time"
"github.com/ashwanthkumar/slack-go-webhook"
"github.com/autogrow/go-jelly/ig"
)
View keybase.md

Keybase proof

I hereby claim:

  • I am penguinpowernz on github.
  • I am mcleodr (https://keybase.io/mcleodr) on keybase.
  • I have a public key ASA_0KLhZhVGNBqQsfHZbL5uviW4hekKGx9bYtw5yH0kKAo

To claim this, I am signing this object:

@penguinpowernz
penguinpowernz / jsonpp.go
Last active Dec 12, 2017
Pretty print JSON files faster than json_pp
View jsonpp.go
// build by running go build ./jsonpp.go
package main
import (
"bytes"
"encoding/json"
"fmt"
"io"
"io/ioutil"
"os"
@penguinpowernz
penguinpowernz / index.html
Created Feb 15, 2017
Camera streaming proxy so you can block your botnettable camera at the firewall and serve this through your own NGINX
View index.html
<html>
<head>
<title>Safe Cam!</title>
<meta http-equiv="refresh" content="60"/>
</head>
<body style="padding: 0px; margin: 0px;">
<img id="MJPEG_streaming" src="http://<camip>/snapshot.cgi" align="CENTER">
<script type="text/javascript">
stretchImage = function() {
var image = document.getElementById("MJPEG_streaming");