Skip to content

Instantly share code, notes, and snippets.

View geekgonecrazy's full-sized avatar
🚀
Building and Launching!

Aaron Ogle geekgonecrazy

🚀
Building and Launching!
View GitHub Profile
// Gruntfile with the configuration of grunt-express and grunt-open. No livereload yet!
module.exports = function(grunt) {
// Load Grunt tasks declared in the package.json file
require('matchdep').filter('grunt-*').forEach(grunt.loadNpmTasks);
// Configure Grunt
grunt.initConfig({
//pkg: grunt.file.readJSON('package.json'),
//can use <%= pkg.name %> etc to access package.json attributes.
import struct
import SocketServer
from base64 import b64encode
from hashlib import sha1
from mimetools import Message
from StringIO import StringIO
class WebSocketsHandler(SocketServer.StreamRequestHandler):
magic = '258EAFA5-E914-47DA-95CA-C5AB0DC85B11'
import struct
import SocketServer
from base64 import b64encode
from hashlib import sha1
from mimetools import Message
from StringIO import StringIO
# import threading
class WebSocketsHandler(SocketServer.StreamRequestHandler):
@geekgonecrazy
geekgonecrazy / app.py
Last active May 30, 2019 16:36
Leapcast
#!/usr/bin/python
# Python program that emulates ChromeCast device
from twisted.internet import reactor
from twisted.internet.protocol import DatagramProtocol
import tornado.ioloop
import tornado.web
import tornado.websocket
import threading
import java.io.BufferedInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
import javax.net.ssl.HttpsURLConnection;
import javax.net.ssl.KeyManagerFactory;
import javax.net.ssl.SSLContext;
import javax.net.ssl.TrustManagerFactory;
var GCM = require('./gcm');
var gcm = new GCM(<YOUR GOOGLE API KEY>); // https://code.google.com/apis/console
// create the message
var msg = {
registration_ids: [token], // this is the device token (phone)
collapse_key: "your_collapse_key", // http://developer.android.com/guide/google/gcm/gcm.html#send-msg
time_to_live: 180, // just 30 minutes
data: {
@geekgonecrazy
geekgonecrazy / Export2PNG.jsx
Last active December 14, 2015 16:08
Exports whats on artboard to png. illustrator CS5 only
/*
@author: Aaron Ogle
Script to Export Illustrator files as PNG's then make a thumbnail.
Runs in CS5 only
*/
//Disable Alerts. We want this to be as unobtrusive as possible.
app.userInteractionLevel = UserInteractionLevel.DONTDISPLAYALERTS;
@geekgonecrazy
geekgonecrazy / ExportPNGs.jsx
Created March 7, 2013 22:35
From illustrator CS5 and above. It prompts for a folder, then will go through all .ai files in the folder and create's 2 png's from the artboard. One that is 145px and one that is 300px
/*
@author: Aaron Ogle
Script to Export Illustrator files as PNG's then make a thumbnail.
Runs in CS5 only due to a missing function. Haven't found a work around yet.
*/
// Disable Alerts. We want this to be as unobtrusive as possible.
app.userInteractionLevel = UserInteractionLevel.DONTDISPLAYALERTS;
@geekgonecrazy
geekgonecrazy / client.py
Created February 6, 2013 20:09
Node.js -> Python Socket Connection.
import socket, sys
s = socket.socket( socket.AF_INET, socket.SOCK_STREAM )
s.connect( ('127.0.0.1', 8124) )
s.send('test');
s.close
@geekgonecrazy
geekgonecrazy / block-kiddies.sh
Created November 18, 2012 05:56
block script kiddies
## Need to check this more. Could probably automate it and make it an actual script. As is don't run. Could end up banning your self
grep "Failed password for root from" /var/log/auth.log | cut -d " " -f 11 | sort | uniq >> banips
grep "Failed password for invalid user" /var/log/auth.log | cut -d " " -f 13 | sort | uniq >> banips
# Check banips make sure yours isn't there. Could be bad otherwise.
for line in $(cat banips); do echo "iptables -I INPUT -s $line -j DROP" >> iptablesblock; done;
chmod +x iptablesblock