Skip to content

Instantly share code, notes, and snippets.

@ril3y
ril3y / TG-JSON-ConfigV1.js
Created August 20, 2011 15:22
TinyG Config JSON object
{
"config": {
"XON": true,
"AUTOHOME": false,
"DEBUG": true,
"Motor1": {
"axis": "X",
"deg_per_step": "1.8",
"step_per_min": "500",
"polarity": 1,
@ril3y
ril3y / create_x.509_cert.py
Created August 23, 2011 12:58
Python script that will generate a x.509 certificate
#!/usr/bin/python
from OpenSSL import crypto, SSL
from socket import gethostname
from pprint import pprint
from time import gmtime, mktime
from os.path import exists, join
CERT_FILE = "myapp.crt"
KEY_FILE = "myapp.key"
@ril3y
ril3y / reportCopier.py
Created February 9, 2012 15:24
Cuckoo Report Copier
#!/usr/bin/python
import os
import commands
import random
basedir = "analysis"
if __name__ == "__main__":
@ril3y
ril3y / sr.parse.tinyG.java
Created February 14, 2012 22:06
Parsing JSON Status Responses
if (line.contains("sr\":")) {
//Parse Status Report
this.X_AXIS.setWork_position(Float.parseFloat((json.getNode("sr").getNode("xwp").getText())));
this.Y_AXIS.setWork_position(Float.parseFloat((json.getNode("sr").getNode("ywp").getText())));
this.Z_AXIS.setWork_position(Float.parseFloat((json.getNode("sr").getNode("zwp").getText())));
this.A_AXIS.setWork_position(Float.parseFloat((json.getNode("sr").getNode("awp").getText())));
}
@ril3y
ril3y / android-pseudo-malware.java
Created February 28, 2012 20:09
Android pseudo Malware
package com.synthetos;
import android.telephony.SmsManager;
import android.telephony.TelephonyManager;
import android.util.Log;
import android.app.Activity;
import android.content.Context;
import android.os.Bundle;
import android.provider.Settings.Secure;
import android.view.View;
@ril3y
ril3y / pseudo-malware-decomipled
Created February 29, 2012 03:12
The decompiled version back to java of https://gist.github.com/1934804
package com.synthetos;
import android.app.Activity;
import android.content.Context;
import android.os.Build;
import android.os.Build.VERSION;
import android.os.Bundle;
import android.telephony.SmsManager;
import android.telephony.TelephonyManager;
import android.view.View;
@ril3y
ril3y / Filesendersnip.java
Created April 28, 2012 14:13
Filesender logic for tgFX
while (!tg.getClearToSend()) {
//Not ready yet
Thread.sleep(1);
//We have to check again while in the sleeping thread that sometime
//during waiting for the clearbuffer the serialport has not been disconnected.
//And cancel has not been called
if (!tg.isConnected()) {
console.appendText("[!]Serial Port Disconnected.... Stopping file sending task...");
return false;
} else if (tg.isCANCELLED()) {
//Wrecking Ball Demo
//var feed = 21538
//var axis = "Y"
var calcPendulum = function(zLen){
//Pendulum Movement Equation
//T = 2pi*SQRT(L/g)
var twoPi = 6.2831926
var gravity = 9.8
var VELOCITY_ACCURACY = 1
var calcPen = function(zLen){
//Pendulum Movement Equation
//T = 2pi*SQRT(L/g)
var twoPi = 6.2831926
var gravity = 9.8
var result = twoPi * Math.sqrt(zLen / gravity);
return(result.toFixed(4))
}
@ril3y
ril3y / gen_starfield.py
Last active August 29, 2015 14:11
LaserGlowStarFieldGenerator
#!/usr/bin/python
from random import randint, uniform
from decimal import Decimal
#random file
xmax = 1524
ymax = 1524
shotmax = 30