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
def reportToInstanceService(arg) | |
instance_service_url = JSON.parse(arg)['atmosphere']['instance_service_url'] token = JSON.parse(arg)['atmosphere']['token'] | |
userid = JSON.parse(arg)['atmosphere']['userid'] | |
uri = URI.parse(instance_service_url) | |
data = {'token'=> token, 'userid'=>userid,'vminfo'=>$instance_info_json} | |
if uri.scheme == "https" | |
http = Net::HTTP.new(uri.host,uri.port) | |
http.use_ssl = true | |
http.verify_mode = OpenSSL::SSL::VERIFY_NONE | |
path = uri.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
def do_it(params) | |
params.collect do |key,val| | |
"#{CGI.escape(key.to_s)}=#{CGI.escape(val)}" | |
end.join('&') | |
end | |
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
"./lib/"+(a = Dir.entries('./lib')).each_index{ |i| if a[i].split(".").last != "jar" then a.delete_at(i) end}.join(";./lib/") |
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
"./lib/"+(a = Dir.entries('./lib')).find_all{|item| item =~ /[(.jar)]$/}.join(";./lib/") |
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/env python | |
import urllib2, re | |
processed_list = [] | |
cond = [('w','m'),('u','n'),('p','d'),('g','b'),('b','q')] | |
for word in filter(lambda x: x != None, map(lambda x: len(x.rstrip().lstrip().lower()) > 0 and x.rstrip().lstrip().lower() or None , urllib2.urlopen('http://www.u.arizona.edu:80/~echan3/539/english-vocab.txt').read().split('\r\n'))): | |
if re.match('^[xolswmunpdbgqz]*$',word) : | |
w = list(word) | |
for i in range(0,len(w)): | |
for j in cond: |
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 java.net.*; | |
import java.io.*; | |
import java.io.File; | |
import javax.xml.parsers.DocumentBuilder; | |
import javax.xml.parsers.DocumentBuilderFactory; | |
import org.w3c.dom.Document; | |
import org.w3c.dom.Element; | |
import org.w3c.dom.Node; | |
import org.w3c.dom.NodeList; |
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 string,cgi,time | |
from os import curdir, sep | |
from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer | |
#import pri | |
class MyHandler(BaseHTTPRequestHandler): | |
def do_GET(self): | |
print "do_GET" | |
self.send_response(200) | |
self.send_header('Content-type', 'text/html') |
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 java.net.*; | |
import java.io.*; | |
public class PostMethodExample { | |
public static void main(String args[]) { | |
try { | |
// Construct data |
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 httplib | |
import urllib | |
from urlparse import urlparse | |
import string | |
import datetime | |
import getpass | |
import json |
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 sys | |
import os | |
import asyncore | |
import pyinotify | |
class EventHandler(pyinotify.ProcessEvent): | |
def process_IN_CREATE(self, event): | |
#print "Creating:", event.pathname | |
#I will use boto to connect amazon / euca2ool or irod?? | |
os.system('scp "%s" "%s:%s"' % (event.pathname, 'seungjin@localhost', '/home/seungjin/mydropbox') ) |