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
"use strict"; | |
var Shim = require("collections/shim"); | |
var ArcSet = require("./arc-set"); | |
var GenericCollection = require("collections/generic-collection"); | |
var GenericMap = require("collections/generic-map"); | |
var PropertyChanges = require("collections/listen/property-changes"); | |
module.exports = ArcMap; |
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 java.lang.reflect.Type; | |
import org.apache.commons.codec.DecoderException; | |
import org.apache.commons.codec.binary.Hex; | |
import com.google.gson.Gson; | |
import com.google.gson.GsonBuilder; | |
import com.google.gson.JsonDeserializationContext; | |
import com.google.gson.JsonDeserializer; | |
import com.google.gson.JsonElement; |
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
def prettify(x): | |
return json.dumps(x, sort_keys = True, indent = 2, separators = (",", ": ")) |
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 sys, socket, paramiko | |
if len(sys.argv) < 2: | |
print "args: host ..." | |
exit(1) | |
for host in sys.argv[1:]: | |
s = socket.socket() |
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 subprocess, time, re | |
devices = [ "vda", "vdb" ] | |
space = re.compile(" +") | |
cmd = [ "iostat", "-dky" ] | |
cmd.extend(devices) | |
cmd.append("1") |
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 urllib, xml.etree.ElementTree as et | |
ns = { "pingdom" : "http://www.pingdom.com/ns/PingdomRSSNamespace" } | |
rss = et.fromstring(urllib.urlopen("https://www.pingdom.com/rss/probe_servers.xml").read()) | |
for ip in rss.iterfind("channel/item/pingdom:ip", namespaces = ns): | |
print ip.text |
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
<h3 id="image-scaling-example">image scaling example</h3> | |
<p><img src="https://www.ersa.edu.au/sites/default/files/danland_logo.png" alt="ersa logo" style="max-width: 200px; height: auto;" /></p> |
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 java.util.concurrent.Callable; | |
import javax.ws.rs.WebApplicationException; | |
public class Wrap { | |
public static <T> T webApplicationException(Callable<T> callable) { | |
try { | |
return callable.call(); | |
} catch (Exception e) { throw new WebApplicationException(e); } | |
} |
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/env python | |
import sys, os, time, socket, argparse, random, urllib2 | |
from novaclient.v1_1 import client | |
default_image = urllib2.urlopen("https://swift.rc.nectar.org.au:8888/v1/AUTH_6f3b184bcf194672a55d258620e732db/deploy/nectar-zfs-image").read().strip() | |
default_setup_script = None | |
default_security_group = "default" | |
default_auth_url = "https://keystone.rc.nectar.org.au:5000/v2.0/" |
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/env python | |
import json, os | |
from novaclient.v1_1 import client | |
auth_url = "https://keystone.rc.nectar.org.au:5000/v2.0/" | |
nectar = client.Client(username = os.environ["OS_USERNAME"], api_key = os.environ["OS_PASSWORD"], project_id = os.environ["OS_TENANT_NAME"], auth_url = auth_url) |
OlderNewer