This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
@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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
@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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import socket, sys | |
s = socket.socket( socket.AF_INET, socket.SOCK_STREAM ) | |
s.connect( ('127.0.0.1', 8124) ) | |
s.send('test'); | |
s.close |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## 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 |