Skip to content

Instantly share code, notes, and snippets.

View schappim's full-sized avatar
💤
Sleeping . +10GMT

Marcus S schappim

💤
Sleeping . +10GMT
View GitHub Profile
@schappim
schappim / update_inventory.rb
Created June 20, 2012 22:34
update_inventory.rb
#!/usr/bin/env ruby
# Version 00002
# Added notify script
# Version 00001
# Initial commit
require 'rubygems'
@schappim
schappim / mk802setup.sh
Created July 11, 2012 10:51
MK802 Setup Script
#!/bin/bash
# Run this script as root ie:
# sudo -s
# bash <(wget -q -O - https://raw.github.com/gist/3089611)
bold=`tput bold`;
normal=`tput sgr0`;
# Setup the timezone
@schappim
schappim / sdcards.sh
Created July 26, 2012 06:52
Burning Commands
# Unmount the Disks
diskutil unmount /dev/disk1s1
diskutil unmount /dev/disk2s1;
diskutil unmount /dev/disk3s1;
diskutil unmount /dev/disk4s1;
diskutil unmount /dev/disk5s1;
diskutil unmount /dev/disk6s1;
diskutil unmount /dev/disk7s1;
diskutil unmount /dev/disk8s1;
@schappim
schappim / gist:3311100
Created August 10, 2012 04:34
Ninja Blocks Authentication Example
$ curl -H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-d '{"email":"[email protected]","password":"correctpassword"}' \
-i https://a.ninja.is/signin | json
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
Date: Thu, 02 Aug 2012 01:05:59 GMT
X-Powered-By: Express
Content-Length: 124
@schappim
schappim / response.json
Created October 12, 2012 01:09
List Devices Response
{
"result": 1,
"error": null,
"id": 0,
"data": {
"1712BB000774_3_0_0": {
"vid": "0",
"gid": "3",
"did": "0",
"meta": {
@schappim
schappim / GetDevices.sh
Created October 12, 2012 01:11
Get a list of your devices
curl "https://api.ninja.is/rest/v0/devices\?user_access_token\=-XXXX-XXXX-XXXX-XXXXXX-XXXXXXX"
@schappim
schappim / GetSensorReading.sh
Created October 12, 2012 03:43
Get Sensor Reading
curl "https://api.ninja.is/rest/v0/device/1012BB013302_3_0_9/heartbeat?user_access_token=XXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXXXX"
@schappim
schappim / heartBeatResponse.sh
Created October 12, 2012 03:45
Heart Beat Response
{"result":1,"error":null,"id":0,"data":{"G":"3","V":0,"D":9,"DA":24.1,"GUID":"1012BB013302_3_0_9","timestamp":1350005477869}}
@schappim
schappim / GetHistoricalData.sh
Created October 12, 2012 03:47
Get Historical Data from Sensor
curl "https://api.ninja.is/rest/v0/device/1012BB013302_3_0_9/data?user_access_token=XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX"
@schappim
schappim / historicalDataResponse.js
Created October 12, 2012 03:53
Historical Data Response
{
"result": 1,
"error": null,
"id": 0,
"data": [
{
"t": "2012-10-12T01:46:00.000+0000",
"v": 24.1
},
{