This file contains hidden or 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
#!/bin/bash | |
if [[ -z $2 ]]; then | |
echo "$0 SUBNET PORT" | |
exit -1 | |
fi | |
CLASSC="$1" | |
PORT="$2" |
This file contains hidden or 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 os | |
def all_files(newroot, oldroot): | |
fdtuples = [] | |
for root, dirs, files in os.walk(oldroot): | |
fds = [] | |
for fd in files: | |
if not fd[0] is '.': | |
fds.append(os.path.join(root, fd)) |
This file contains hidden or 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
kernel.panic = 5 |
This file contains hidden or 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 logging | |
RED='\033[0;31m' | |
CYAN='\033[0;36m' | |
GREEN='\033[0;32m' | |
NC='\033[0m' | |
logger = logging.getLogger('myapp') | |
logfile = logging.FileHandler('warnings.log') |
This file contains hidden or 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
self.fadeIn += fadeStep; | |
if(fadeIn < fadeMax) { | |
alarm[0] = fadeSpeed; | |
} |
This file contains hidden or 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 | |
import MySQLdb | |
import csv | |
from boto.s3.connection import S3Connection | |
from boto.s3.key import Key | |
query = "\ | |
select id, name, gross_amt \ | |
from cafeteria \ |
This file contains hidden or 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
DPAD Up -> c | |
DPAD Down -> d | |
DPAD Left -> e | |
DPAD Right -> f | |
L Analog Left -> Left Arrow | |
L Analog Right -> Right Arrow | |
L Analog Up -> Up Arrow | |
L Analog Down -> Down Arrow |
This file contains hidden or 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
#!/bin/bash | |
DEST_DIR="/home/iPod" | |
FULL_PATH="$1" | |
ALBUM=$(basename "$FULL_PATH") | |
NEW_PATH="$DEST_DIR/$ALBUM" | |
echo "Transcoding into $NEW_PATH" | |
mkdir "$NEW_PATH" |
This file contains hidden or 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
#!/bin/sh | |
curl -H 'X-AIO-Key: feedfacedaedbeef' -H 'Content-Type: application/json' -X POST https://io.adafruit.com/api/feeds/myfeedname/data.json -d'{"value": 17}' |
This file contains hidden or 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 sleekxmpp | |
class Jabber(sleekxmpp.ClientXMPP): | |
def __init__(self, username, password, instance_name=None): | |
jid = "%s/%s" % (username, instance_name) if instance_name else username | |
super(Jabber, self).__init__(jid, password) | |
self.instance_name = instance_name | |
self.add_event_handler('session_start', self.start, threaded=False, disposable=True) | |
self.add_event_handler('message', self.receive, threaded=True, disposable=False) |