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 check_time_sync | |
| require 'net/telnet' | |
| time_server = 'time.bora.net' | |
| options = { | |
| "Host" => time_server, |
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
| require 'net/telnet' | |
| TIME_SERVER = 'time.bora.net' | |
| options = { | |
| "Host" => TIME_SERVER, | |
| "Telnetmode" => false, | |
| "Timeout" => 30, | |
| "Port" => "time" | |
| } |
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 | |
| # extended date command for *nix / writtern in python | |
| # Copyright (c) 2011-2012, Seung-jin Kim, All right reserverd | |
| # Twitter: @seungjin | |
| import sys | |
| import time | |
| from time import gmtime, strftime |
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 ruby | |
| require 'socket' | |
| def local_ip | |
| orig, Socket.do_not_reverse_lookup = Socket.do_not_reverse_lookup, true | |
| UDPSocket.open do |s| | |
| s.connect '8.8.8.8', 1 |
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
| name_jar = [ | |
| 'calvin', | |
| 'tom', | |
| 'tomase', | |
| 'justin', |
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 | |
| img_bucket_name='admin_mi_iBEEvm_20110824_171605' | |
| cur_dir=`pwd` | |
| echo $cur_dir | |
| source $cur_dir/odin-admin-x509/eucarc | |
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
| ## | |
| ## 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 |
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
| #sorting in python | |
| #http://www.daniweb.com/software-development/python/code/216689 | |
| # timing 7 different Python sorting algorithms with a list of integers | |
| # each function is given the same list (fresh copy each time) | |
| # tested with Python24 vegaseat 21jan2006 | |
| import random # for generating random numbers | |
| import time # for timing each sort function with time.clock() |
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
| ## {{{ http://code.activestate.com/recipes/577793/ (r1) | |
| #!/usr/bin/env python | |
| import os | |
| import time | |
| username = 'root' | |
| defaultdb = 'postgres' | |
| port = '5433' | |
| backupdir='/www/backup/' | |
| date = time.strftime('%Y-%m-%d') |
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 json | |
| r = """ { | |
| "result" : { | |
| "code" : "success" , | |
| "meta" : "" , | |
| "value" : [{ "image_name" : "", "image_description" : "", "image_tags" : "no tags", "image_id" : "emi-B2711E5D" , "image_location" : "seungjin_mi_atmoboot_test/admin_mi_CBSU_workshop_20110519.img.manifest.xml" , "image_ownerid" : "seungjin" , "image_state" : "available" ,"image_is_public" : "private" ,"image_product_codes" : "[]" ,"image_architecture" : "x86_64" ,"image_type" : "machine","image_ramdisk_id" : "eri-B6B91781","image_kernel_id" : "eki-DB23180A", "image_condition" : "", "image_type" : "" , "image_condition" : "" }, { "image_name" : "", "image_description" : "", "image_tags" : "no tags", "image_id" : "emi-4F911F48" , "image_location" : "admin_mi_CBSU_workshop_20110520_001/admin_mi_CBSU_workshop_20110520.img.manifest.xml" , "image_ownerid" : "admin" , "image_state" : "available" ,"image_is_public" : "private" ,"image_product_codes" : "[]" ,"image_architecture" : "x86_64" ,"image_type" : "machine","imag |