Skip to content

Instantly share code, notes, and snippets.

View errordeveloper's full-sized avatar

Ilya Dmitrichenko errordeveloper

View GitHub Profile
/* ============================================
I2Cdev device library code is placed under the MIT license
Copyright (c) 2012 Jeff Rowberg
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
@errordeveloper
errordeveloper / setup.md
Created November 11, 2012 20:41 — forked from 17twenty/gist:2712354
Setting-up Yocto for MACHINE=beaglebone

Checkout repositories

  1. Poky
git clone git://git.yoctoproject.org/poky && cd poky
  1. OE metadata layers
http://arduino.cc/forum/index.php/topic,64256.msg593736.html#msg593736
@errordeveloper
errordeveloper / pre-commit
Created September 19, 2012 15:53
puppet/.git/hooks/pre-commit
#!/bin/bash -e
PUPPET=${PUPPET:-puppet}
MANIFESTS=`git ls-files | grep '\.pp$'`
echo "[pre-commit syntax checker] validating `echo $MANIFESTS | wc -w | tr -d ' '` manifests."
for ENVIRONMENT in dev etm production
do $PUPPET parser validate --color --environment=$ENVIRONMENT $MANIFESTS
done
import com.excilys.ebi.gatling.core.Predef._
import com.excilys.ebi.gatling.http.Headers.Names._
import com.excilys.ebi.gatling.http.Predef._
import com.excilys.ebi.gatling.http.check.HttpCheck
import org.glassfish.grizzly.http.util.HttpStatus._
import com.excilys.ebi.gatling.http.request.builder.AbstractHttpRequestWithBodyBuilder
import com.excilys.ebi.gatling.core.structure.ChainBuilder
import jodd.util.StringUtil
import com.ning.http.client._
property LogToPachube : true -- Boolean switch to enable/disable logging
property MyKey : "your Pachube key goes here" -- from Pachube
property FeedId : "your Feed ID goes here" -- from Pachube
property DataStream : "your datastream name goes here" -- from Pachube
property Tlast : 0 -- variable to store last reported value (°C)
property Ttol : 0.1 -- tolerance threshold for a new Pachube report (°C)
-- Handler to round a number to the specified number of decimals (no error checking, beware)
to round_decs given a_number:the_no, decimals:n_decimals
return (round (the_no * (10 ^ n_decimals))) / (10 ^ n_decimals)
@errordeveloper
errordeveloper / using_wget.sh
Created August 17, 2012 11:13
Cosm shell script examples
#!/bin/sh
FEED_ID=12345 # replace with the real Cosm Feed ID
API_KEY=Abc12 # replace with the real Cosm API Key
DS=1 # Set datastream name (needs to be present in the target feed)
TARGET=http://api.cosm.com/v2/feeds/$FEED_ID/datastreams/$DS/datapoints.csv
V1=1.000
@errordeveloper
errordeveloper / minitest.sh
Created August 16, 2012 13:04
Miniature test wireframe for shell scripts
#!/bin/bash
[ -n "$DEBUGME" ] && set -x
p=0
f=0
step="$0"
FAIL_MSG="\033[1;35m ✘ FAIL\033[1;0m"
PASS_MSG="\033[1;32m ✔ PASS\033[1;0m"
#!/usr/bin/perl -w
use strict;
use warnings;
use Data::Dumper;
use FindBin;
use lib "/usr/lib/vmware-vcli/apps/";
@errordeveloper
errordeveloper / _notes.md
Created July 8, 2012 14:14
Building Rowboat (ICS) for BeagleBone on Mac OS X 10.7

Initialising

A case-sensitive volume is required:

hdiutil create -type SPARSE -volname 'Rowboat' -fs 'Case-sensitive Journaled HFS+' -size 40g rowboat.dmg.sparseimage
hdiutil attach ~/rowboat.dmg.sparseimage

To avoid some extra/unnecessary patching, make sure you have GNU versions of tar and sed ahead of your path.