Skip to content

Instantly share code, notes, and snippets.

View Grayda's full-sized avatar
🕹️

David Gray Grayda

🕹️
View GitHub Profile
@Grayda
Grayda / index.js
Created December 4, 2014 04:32
Orvibo AllOne node.js basic example
// Save this file as index.js and put allone.js in the same folder
var OrviboAllOne = require("./allone.js"); // Tell node.js we need to use this file. Store the file in the variable OrviboAllOne
var o = new OrviboAllOne(); // Now we make a new copy of that file and store it in the variable called "o"
// This code is only executed when allone.js reports that it's ready. Think of this slab of code as an event
o.on("ready", function() {
o.discover(); // When we're ready, tell our OrviboAllOne file to start looking or any AllOnes that it can find
});
@Grayda
Grayda / main.go
Created May 13, 2015 04:09
main.go for Ninja Sphere driver
package main
import (
"fmt"
"os"
"os/signal"
)
func main() {
@Grayda
Grayda / error codes
Last active August 29, 2015 14:21
Error codes from recovery.sh
Extracted from https://github.com/ninjasphere/sphere-factory-reset/blob/cba5514d118bd9bf8df8825acd2e380a9deea8e1/ninjapack/root/opt/ninjablocks/factory-reset/bin/recovery.sh using these Regexs:
^((?!progress).)*$
^((?!ERR).)*$
progress "0040" "Writing partition table..."
progress "0043" "Partition table write was successful."
progress "0042" "Partition table update failed - $?."
progress "0044" "Probing '$drive' partition table..."
progress "0047" "Partition table probe of '$drive' completed successfully."
@Grayda
Grayda / index.js
Created July 17, 2016 13:35
Move screenshots to folder based on size
// Run `npm install --save image-size mv` to install mv (for easily moving files) and image-size (for determining image dimensions)
var fs = require("fs")
var mv = require("mv")
var sizeOf = require('image-size');
var dest = 'C:\\Users\\David\\Downloads' // The location of your downloads folder in Firefox.
// Watch the folder and report when an event has happened
fs.watch(dest, (event, filename) => {
// Try block because I'm lazy. This did exactly what I needed.
@Grayda
Grayda / kepler.md
Last active July 2, 2026 03:43
Information about the Orvibo Kepler

These are some rough notes regarding the Orvibo Kepler

The Kepler uses a different protocol to the previous devices (S20, AllOne etc.), but once you get past the changes in protocol, the commands are very much the same.

The Kepler uses UDP on port 9999. The header of the packet is the same (e.g. 646400 ..., but the body is now encrypted JSON. The encryption is AES ECB and the decryption key is stored in the app. Simply decompile the app and look in com\orvibo\lib\kepler\core\AESCoder.java. Use something like http://aes.online-domain-tools.com/ to quickly decrypt and check data. The start of the encrypted data is denoted by 0x09 and runs right to the end of the packet (?).

As mentioned above, the protocol is rather similar to the other devices. Here's a sample packet from the Kepler app, showing discovery:

6864004a706be1d7b623202020202020202020202020202020202020202020202020202020202020202009411a140e9dc338948829f770b2e65d3f9c5e7eedfcb9e552aff1a74e7c6ca6

@Grayda
Grayda / gulpfile.js
Created September 10, 2016 15:48
Gulpfile for effortlessly switching between paid and free building
var gulp = require('gulp');
var gutil = require('gulp-util');
var bower = require('bower');
var concat = require('gulp-concat');
var sass = require('gulp-sass');
var minifyCss = require('gulp-minify-css');
var rename = require('gulp-rename');
var sh = require('shelljs');
var cp = require("child_process")
@Grayda
Grayda / weather-icons.css
Created December 3, 2016 01:23
yr.no weathericon mappings
/*!
* Weather Icons 2.0
* Updated August 1, 2015
* Weather themed icons for Bootstrap
* Author - Erik Flowers - erik@helloerik.com
* Email: erik@helloerik.com
* Twitter: http://twitter.com/Erik_UX
* ------------------------------------------------------------------------------
* Maintained at http://erikflowers.github.io/weather-icons
*
@Grayda
Grayda / getKey.sh
Last active July 2, 2026 03:39
Extract the Kepler key
# This downloads kepler.apk from orvibo.com and uses strings and grep with regex to find the line that contains the key.
echo Downloading the Kepler APK from www.orvibo.com..
wget http://www.orvibo.com/software/android/kepler.apk -qO /tmp/kepler.apk
echo Download complete. Extracting and searching for the key. The key should be displayed below.
echo
unzip -p /tmp/kepler.apk classes.dex | strings | grep -e '^[A-Za-n1-9]\{16\}$'
echo
@Grayda
Grayda / start_of_calendar.ics
Created October 10, 2017 04:29
Timezone demo
BEGIN:VCALENDAR
VERSION:2.0
BEGIN:VTIMEZONE
TZID:Australia/Melbourne
TZURL:http://tzurl.org/zoneinfo-outlook/Australia/Melbourne
X-LIC-LOCATION:Australia/Melbourne
BEGIN:STANDARD
TZOFFSETFROM:+1100
TZOFFSETTO:+1000
TZNAME:AEST
@Grayda
Grayda / usbrelay.js
Last active July 12, 2018 01:11
Control 5v dcttech.com relay using node.js
var HID = require('node-hid');
var _ = require("lodash")
var device
device = setup()
setInterval(function() {
setState(!getState())
console.log("Relay enabled? " + getState())
}, 1000)