Skip to content

Instantly share code, notes, and snippets.

View errordeveloper's full-sized avatar

Ilya Dmitrichenko errordeveloper

View GitHub Profile
#include <SPI.h>
#include <Ethernet.h>
#include <HttpClient.h>
#include <Xively.h>
#include <EEPROM.h>
#include "sha1.h"
#include "EEPROMAnything.h"
#include <MemoryFree.h>
//remove these - add programtic definition
@errordeveloper
errordeveloper / xively_request_log.rb
Last active December 17, 2015 23:48
Xively request log subscriber. It takes two arguments: username and a master API key. It requires Ruby version 1.9.3.
require 'json'
require 'socket'
abort "Usage: #{$0} username xi_api_key" if ARGV.size != 2
username = ARGV[0]
xi_api_key = ARGV[1]
xi = TCPSocket.open('api.xively.com', 8081)
xi.puts({
@errordeveloper
errordeveloper / LEIN_GATLING_README.md
Last active December 11, 2015 02:19
Load-test your project with Gatling - the easy way to get started
@errordeveloper
errordeveloper / README.md
Last active December 11, 2015 00:38
Running Gatling with Leiningen
@errordeveloper
errordeveloper / Kconfig
Last active December 10, 2015 10:39
Cosm-connected device activation code generator (kernel-based)
config COSM_PROV_BASIC
tirstate "Cosm-connected product activation code generator"
default y
select CRYPTO_HMAC && CRYPTO_SHA1
#!/bin/bash -xe
if [ -z $1 ]
then
echo "Usage: $0 <product_secret> [<iface>]"
exit -1
fi
if [ -z $2 ]
then
# get default network interface
iface=`/usr/sbin/netstat -rn | /usr/bin/awk '/^default/{print $6;exit}'`
@errordeveloper
errordeveloper / contiki_nginx.md
Last active December 10, 2015 07:39
Contki OS - HTTPS Proxy Configuration (with HTTP Header Modification and URL shortening)

A simple HTTP proxy for connecting to a remote API server using Nginx

Let's consider the following real-world scenario:

  • your ISP doesn't provide IPv6 connectivity
  • you don't have a VPS that could be used for tunnelling
  • you only want to bind a single remote IPv4 address and local IPv6 address
  • what if the API host only accepts HTTPS connections ...
  • what if you can use plain HTTP, though you rather not use it ...
@errordeveloper
errordeveloper / Unicorn_and_Upstart.md
Last active February 9, 2022 09:21
Upstart config for a Rails app using Unicorn HTTP server

Using Unicorn with Upstart

This configuration works with Upstart on Ubuntu 12.04 LTS

The reason why it needs to be done this way (i.e. with the pre-start and post-stop stanzas), is because Upstart is unable to track whever Unicorn master process re-execs itself on hot deploys. One can use it without hot-deploys and run Unicorn in foreground also, it then only needs one exec stanza.

This presumes you are not using RVM, so no voodoo dances.

#include <SPI.h>
#include "etherShield.h"
#include <LiquidCrystal.h>
#include "Sensirion.h"
#include <OneWire.h>
#include <DallasTemperature.h>
// please modify the following two lines. mac and ip have to be unique
// in your local area network. You can not have the same numbers in
@errordeveloper
errordeveloper / .rbenv-version
Created December 12, 2012 11:08
Fake loggers
ruby-1.9.3-p194