Skip to content

Instantly share code, notes, and snippets.

@ieb
ieb / BME280.js
Last active Jan 22, 2022
Test Code for eBay BME280 order number 21-08080-91109 item 353751582230 from seller fiee-ki
View BME280.js
var i2c = require('i2c-bus');
// Also works with BMP280 but returns 0 for humidity since that chip doesnt have humidity
// http://www.adafruit.com/datasheets/BST-BME280-DS001-11.pdf
var BME280 = function(options) {
options = options || {};
this.bus = (options.bus===undefined)?1:options.bus;
this.debug = options.debug || false;
@ieb
ieb / RedirectResolver.java
Last active Jan 31, 2020
RedirectResolver proposal
View RedirectResolver.java
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
@ieb
ieb / README.md
Created Sep 29, 2017
Configuring OAK-6575
View README.md

This Gist contains information on how to Configure OAK-6575 to serve binary content direct from Oak via CloudFront, where the content is hosted in S3.

The provisioning model oak.txt in this Gist shows configuration.

Pre-requsites.

  • The deployment will be TarMK or MongoMK with a S3 DataStore.
  • Whoever is configuring needs root access to the AWS subscription to manage the keys in AWS.

Steps

@ieb
ieb / mongodb.conf
Created Jan 31, 2017
Modified Ganglia MongoDB WT configuration.
View mongodb.conf
modules {
module {
name = "mongodb"
language = "python"
param server_status {
value = "mongo --quiet --eval 'printjson(db.serverStatus())'"
}
param rs_status {
value = "mongo --quiet --eval 'printjson(rs.status())'"
}
@ieb
ieb / mongodb.py
Created Jan 31, 2017
Modifed Ganglia Python module for MongoDB WT
View mongodb.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# MongoDB gmond module for Ganglia
#
# Copyright (C) 2011 by Michael T. Conigliaro <mike [at] conigliaro [dot] org>.
# All rights reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
@ieb
ieb / README.md
Created Jul 29, 2016
Sling Configuration spec
View README.md

Sling Configuration Bundle.

This bundle provides a service API that may be used by components to interact with configuration. The bundle merges the work started in http://wcm.io/config and AEM Config Manager. For information on the API see sub projects contained within this source code tree. This file documents the semantic structure of configuration giving examples of how that configuration is persisted in the repository and in files.

Purpose

This document has been created to clarifiy and define precisely what is meant by various configuration related concepts. It is a live document, intended to be changed to support a shared understanding and eliminate confusion. It does not attept to define the Java APIs. For more detail on Java APIs or implementation look at the source code.

@ieb
ieb / ais.py
Last active Mar 24, 2021
Displaying AIS Data on Google Maps using the Google Maps API
View ais.py
#!/usr/bin/env python
#
# A Python AIVDM/AIVDO decoder
#
# This file is Copyright (c) 2010 by the GPSD project
# BSD terms apply: see the file COPYING in the distribution root for details.
#
# This decoder works by defining a declarative pseudolanguage in which
# to describe the process of extracting packed bitfields from an AIS
# message, a set of tables which contain instructions in the pseudolanguage,
@ieb
ieb / gist:1374825
Created Nov 17, 2011
Dumb Simple Slow Luhn Test.
View gist:1374825
// A very simple Luhn check that only accepts sequence of digits as input.
// it scans the entire string with windows of 14,15,16 in width looking for a sequence that passes
// the luhn check. If it finds one it prints the original and the masked sequence, returning the
// masked sequence. If none are found, the original is returned.
// This is a dumb, slow, checker only intended to validate test sequences more quickly than doing
// manually. It outputs the progress to allow human validation.
public static String dumbSlowChecker(String test) {
char[] c = test.toCharArray();
@ieb
ieb / workflow.xsd
Created Aug 1, 2011
Example XSD for transformation
View workflow.xsd
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema targetNamespace="http://www.wfmc.org/2002/XPDL1.0"
xmlns:xpdl="http://www.wfmc.org/2002/XPDL1.0"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsd2hbm="http://www.tfd.co.uk/2006/xsd2hbm.xsd"
elementFormDefault="qualified" attributeFormDefault="unqualified">
<xsd:element name="Activities" xsd2hbm:action="set" xsd2hbm:targetclass="Activity" >
<xsd:complexType>
<xsd:sequence>
<xsd:element ref="xpdl:Activity" minOccurs="0" maxOccurs="unbounded"/>
@ieb
ieb / xsd2hbm.xsl
Created Aug 1, 2011
Transform to generate HBM files from a XSD
View xsd2hbm.xsl
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
xmlns:xpdl="http://www.wfmc.org/2002/XPDL1.0" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsd2hbm="http://www.tfd.co.uk/2006/xsd2hbm.xsd"
exclude-result-prefixes="xpdl xsd2hbm xsd xsl">
<xsl:output doctype-public="-//Hibernate/Hibernate Mapping DTD 3.0//EN"
doctype-system="http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd" />
<xsl:param name="tableprefix">wf</xsl:param>
<xsl:param name="package">uk.co.tfd.wf.api.model.design</xsl:param>
<xsl:variable name="lcletters">abcdefghijklmnopqrstuvwxyz</xsl:variable>