This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# frozen_string_literal: true | |
# | |
# Script to fetch current weather data from Open-Meteo | |
# and post it to EmonCMS over HTTP | |
# | |
# By Nicholas Humfrey <njh.me> | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
####################################################################### | |
####################### emonhub.conf ######################### | |
####################################################################### | |
### emonHub configuration file, for info see documentation: | |
### https://github.com/openenergymonitor/emonhub/blob/emon-pi/configuration.md | |
[hub] | |
### loglevel must be one of DEBUG, INFO, WARNING, ERROR, and CRITICAL | |
loglevel = DEBUG | |
autoconf = 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# | |
# Bash script to convert 4x6 label from PDF to a monochrome PNG on Mac OS | |
# | |
# I wrote this because I was unhappy with the print quality, printing | |
# directly to a Zebra GX420d using the system print drivers (CUPS). | |
# In particular dithering could stop barcodes from being scanned. | |
# | |
# By scaling and converting to monochrome first, I found that the print quality | |
# was much better. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"can_flt": [ | |
{ | |
"CANID": 905, | |
"Name": "ac_volts", | |
"PID": -1, | |
"PIDIndex": 1, | |
"StartBit": 8, | |
"BitLength": 8, | |
"Expression": "V", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# | |
# Ruby function to display an array of strings | |
# as columns on a text terminal. | |
# | |
# Author: Nicholas Humfrey | |
# License: https://unlicense.org/ | |
# | |
require 'io/console' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'net/http' | |
require 'json' | |
require 'uri' | |
options = { | |
new_account: true, | |
new_line: true, | |
api: 'fttp-checker', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Meshtastic < Formula | |
include Language::Python::Virtualenv | |
desc "Python CLI client for use with Meshtastic devices" | |
homepage "https://meshtastic.org/" | |
url "https://files.pythonhosted.org/packages/9c/0b/ba9a21a0580b5da8c7cb67b6a6da5862092dad5eb8be9c942781572b0de7/meshtastic-2.3.11.tar.gz" | |
sha256 "66d2b71fd0b007cf479763a237aa07043518683e1affe440104c8dbe1676133e" | |
license "Apache-2.0" | |
head "https://github.com/meshtastic/python.git", branch: "master" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# | |
# Script to parse the HSBC mortgage rate page | |
# to see if they have chanegd the 2 Year Term Tracker Fee Saver | |
# | |
# Subtracts the Bank of England rate from the HSBC advertised rates | |
# | |
require 'net/http' | |
require 'nokogiri' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# | |
pppd='pppd' | |
pppd+=' debug' | |
pppd+=' logfd 2' | |
pppd+=' nodetach' | |
pppd+=' noauth' | |
pppd+=' noip' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'date' | |
require 'json' | |
today = Date.today | |
start = today - 365 | |
(start...today).each do |date| | |
json = File.read("weather/#{date}.json") | |
data = JSON.parse(json, :symbolize_names => true) |
NewerOlder