Skip to content

Instantly share code, notes, and snippets.

View deverton's full-sized avatar

Dan Everton deverton

View GitHub Profile
@deverton
deverton / fronius_load_management_status.py
Created September 13, 2022 08:48
Simple Python script to fetch the Fronius Load Management status from web interface and post it to Home Assistant
#!/usr/bin/env python3
import requests
import http.client as http_client
import logging
import hashlib
import os
import re
import threading
@deverton
deverton / humble-bundle-download-all.sh
Last active October 5, 2019 22:29
Download All Humble Bundle Packages and Trove
#!/bin/bash
# TODO: Generate md5sums file to verify quicker
##
# Script to download everything you own from Humble Bundle.
# Writes to the current directory in folders named after the
# internal bundle name and product type. For example, Humble
# Bundle 1 product Aquaria would be under `hib1/aquarria`.
#
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x8 pc=0xdafff1]
goroutine 15935279 [running]:
github.com/hashicorp/vault/physical.(*S3Backend).List.func1(0xc423da5200, 0xc448911400, 0x7f1142ff6f01)
/gopath/src/github.com/hashicorp/vault/physical/s3.go:217 +0x81
github.com/hashicorp/vault/vendor/github.com/aws/aws-sdk-go/service/s3.(*S3).ListObjectsV2PagesWithContext(0xc42000c330, 0x7f1142ff6f20, 0xc420012390, 0xc46b4e0a00, 0xc48711f708, 0x0, 0x0, 0x0, 0xc43bfc6601, 0x26be630)
/gopath/src/github.com/hashicorp/vault/vendor/github.com/aws/aws-sdk-go/service/s3/api.go:4093 +0x174
github.com/hashicorp/vault/vendor/github.com/aws/aws-sdk-go/service/s3.(*S3).ListObjectsV2Pages(0xc42000c330, 0xc46b4e0a00, 0xc43bfc6708, 0x2, 0x2)
/gopath/src/github.com/hashicorp/vault/vendor/github.com/aws/aws-sdk-go/service/s3/api.go:4066 +0x9a
@deverton
deverton / acme-synology-cloudflare.md
Last active June 30, 2017 11:05
Installing acme.sh on Synology using Cloudflare DNS API

This works on DSM 6.1 with a custom TLD for NAS (split-horizon DNS), e.g. nas.example.com.

ssh [email protected]
sudo -i
git clone https://github.com/Neilpang/acme.sh
cd acme.sh
./acme.sh  --install --nocron --home /usr/local/acme.sh --accountemail [email protected]
cd /usr/local/acme.sh
export CF_Key="examplekey"
@deverton
deverton / gargoyle-host-override.md
Last active January 5, 2018 01:13
Host Overrides in Gargoyle/OpenWRT
  1. SSH to router
  2. uci add_list dhcp.@dnsmasq[0].addnhosts=/etc/override.hosts
  3. echo 'fqdn.example.com 127.0.0.1' >> /etc/override.hosts
  4. /etc/init.d/dnsmasq restart

Should result in

  $ nslookup fqdn.example.com
 Server: 127.0.0.1
@deverton
deverton / jdk17-verify.xml
Created July 29, 2015 23:22
Snippet to verify only JDK7 APIs are used
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>animal-sniffer-maven-plugin</artifactId>
<version>1.7</version>
<executions>
<execution>
<id>signature-check</id>
<phase>verify</phase>
<goals>
<goal>check</goal>
curl -v 'http://www.expedia.com.au/Gold-Coast-Hotels-Mantra-Crown-Towers.h2679146.Hotel-Information' -H "Pragma: akamai-x-get-client-ip, akamai-x-cache-on, akamai-x-cache-remote-on, akamai-x-check-cacheable, akamai-x-get-cache-key, akamai-x-get-extracted-values, akamai-x-get-nonces, akamai-x-get-ssl-client-session-id, akamai-x-get-true-cache-key, akamai-x-serial-no, akamai-x-feo-trace, akamai-x-get-request-id" -H 'Host: www.expedia.com.au' -H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:37.0) Gecko/20100101 Firefox/37.0' -H 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8' -H 'Accept-Language: en-US,en;q=0.5' --compressed -H 'Referer: http://www.expedia.com.au/Gold-Coast-Hotels-Mantra-Crown-Towers.h2679146.Hotel-Information?chkin=23/...&' -H 'Cookie: MC1=GUID=70c99433eb514ceeb242e0663f6a4d09; JSESSION=57c4097c-74d8-4a59-be43-bb585a661b54; tpid=v.1,25; iEAPID=0,; linfo=v.4,|0|0|255|1|0||||||||3081|0|0||0|0|0|-1|-1; eid=-1; s_fid=402ECBAB3BC6A4B4-2EA19B5B87B14AFB; s_cc=
@deverton
deverton / keybase.md
Created October 15, 2014 22:26
Keybase Proof

Keybase proof

I hereby claim:

  • I am deverton on github.
  • I am deverton (https://keybase.io/deverton) on keybase.
  • I have a public key whose fingerprint is C1C5 EF8B EAA0 6FFB 432F 1C64 0092 9E66 11CE D822

To claim this, I am signing this object:

import java.util.Random;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.LinkedBlockingQueue;
public class Demo {
private static final Random R = new Random();
static class Producer implements Runnable {
@deverton
deverton / gist:7743979
Created December 2, 2013 02:22
Customising Jackson to use new lines between root objects and also customise the serialization of a list. Useful when talking to Elasticsearch _msearch endpoint.
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.core.util.MinimalPrettyPrinter;
import com.fasterxml.jackson.databind.JsonSerializer;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.SerializerProvider;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import java.io.IOException;