Skip to content

Instantly share code, notes, and snippets.

$ python port_checker_tcp.py -a 192.168.1.15 -p 80
$ python port_checker_tcp.py -a 192.168.1.15 -p 80 && echo "SUCCESS"
$ python port_checker_tcp.py -a 192.168.1.15 -p 81 && echo "FAILURE"
@seungjin
seungjin / bootstrap.sh
Created June 4, 2011 03:34 — forked from anonymous/bootstrap.sh
Django on Heroku with Celery and Sentry
virtualenv --no-site-packages .
source bin/activate
bin/pip install Django psycopg2 django-sentry
bin/pip freeze > requirements.txt
bin/django-admin.py startproject mysite
cat >.gitignore <<EOF
bin/
include/
lib/
EOF
@seungjin
seungjin / gist:1002677
Created June 1, 2011 16:21
u of a uits is horrible. so I complain..
import httplib, urllib
from datetime import datetime
def send_complain_form() :
current_time = str(datetime.now())
destination = "http://uits.arizona.edu/contact"
@seungjin
seungjin / gist:1000869
Created May 31, 2011 16:53
accessing eucalyptus with boto
import boto
from boto.ec2.connection import EC2Connection
from boto.ec2.regioninfo import RegionInfo
region = RegionInfo(name="eucalyptus", endpoint=hostname)
#conn = EC2Connection('<aws access key>', '<aws secret key>')
connection = boto.connect_ec2(aws_access_key_id=access_key,
aws_secret_access_key=secret_key,
@seungjin
seungjin / add_my_first_line.rb
Created May 27, 2011 17:21
add my first line
my_first_line = "#!/home/seungjin/opt/python-2.6.6/bin/python\n"
ARGV.each do |file|
#file exist?
if ! File.exist?(file)
puts "File #{file} does not exist"
exit
end
#!/usr/local/bin/python
##
## All files that are a part of this project, unless explicitly noted otherwise,
## are covered by the following license:
##
## Copyright (c) 2011, The Arizona Board of Regents on behalf of The University
## of Arizona
##
@seungjin
seungjin / gist:991895
Created May 25, 2011 20:37
for/while statements are for college students
def loop (fnc,n,o=0):
o = o + 1
fnc()
loop(fnc,n,o) if n > o else None
def hi():
print "h"
loop(hi,10)
##
## All files that are a part of this project, unless explicitly noted otherwise,
## are covered by the following license:
##
## Copyright (c) 2011, The Arizona Board of Regents on behalf of The University
## of Arizona
##
## All rights reserved.
##
## Developed by: iPlant Collaborative as a collaboration between participants at
@seungjin
seungjin / license.txt
Created May 21, 2011 21:53
my work license
##
## All files that are a part of this project, unless explicitly noted otherwise,
## are covered by the following license:
##
## Copyright (c) 2011, The Arizona Board of Regents on behalf of The University
## of Arizona
##
## All rights reserved.
##
## Developed by: iPlant Collaborative as a collaboration between participants at
@seungjin
seungjin / atmo_boot.rb
Created May 21, 2011 02:31
atmo_boot script
##
## All files that are a part of this project, unless explicitly noted otherwise,
## are covered by the following license:
##
## Copyright (c) 2011, The Arizona Board of Regents on behalf of The University
## of Arizona
##
## All rights reserved.
##
## Developed by: iPlant Collaborative as a collaboration between participants at