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
adjust_timeout () { | |
cat <<EOF | |
if keystatus --shift; then | |
set timeout=-1 | |
else | |
set timeout=0 | |
fi | |
EOF | |
} |
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 | |
import urllib2 | |
from boto.ec2.connection import EC2Connection | |
try: | |
from django.conf import settings | |
except ImportError: | |
class settings: |
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 | |
# simple python script to return your public IP address using whatismyip.com | |
# if executed from command line will display IP | |
def findIP(): | |
''' | |
Returns your IP address. Includes setting the header to match the request | |
see http://www.whatismyip.com/faq/automation.asp | |
''' |
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
from django import template | |
register = template.Library() | |
@register.filter | |
def fileNameClean(file, arg): | |
''' | |
Return the file name without any directory information. | |
''' | |
obj = getattr(file, arg, False) |
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 base64 | |
import httplib | |
import logging | |
import string | |
try: | |
import simplejson as json | |
except ImportError: | |
import json | |
class settings: |
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 base64 | |
import httplib | |
import logging | |
import string | |
try: | |
import simplejson as json | |
except ImportError: | |
import json | |
class settings: |
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 MySQLdb | |
host = 'localhost' | |
user = 'USER' | |
passwd = 'PASSWORD' | |
database = raw_input('Enter database name:') | |
conn = MySQLdb.connect (host=host, user=user, passwd=passwd, db=database) |
NewerOlder