Skip to content

Instantly share code, notes, and snippets.

@hammer
hammer / pysl.py
Created December 7, 2008 09:13
Using the SoftLayer API via XML-RPC with Python
import xmlrpclib
from pprint import pprint
"""
A simple workout for the SoftLayer API as exposed via XML-RPC
"""
# TODO: Make this object-based instead of dictionary-based
# TODO: Read authentication information from a secure location
# TODO: Demonstrate how to call a method that requires a parameter
# Get this information from https://manage.softlayer.com/Administrative/apiKeychain
type sample = {
x : float;
y : float
}
type model = {
theta : float;
beta : float
}
#!/bin/bash
pid=$1
nsamples=$2
sleeptime=$3
for x in $(seq 1 $nsamples)
do
jstack $pid
sleep $sleeptime
done | \
@hammer
hammer / HelloKryo.scala
Created May 4, 2014 23:22
Demonstration of problems with chill-avro (twitter/chill #183)
import com.twitter.bijection.avro.{GenericAvroCodec, GenericAvroCodecs}
import com.twitter.bijection.Injection
import com.twitter.chill._
import org.apache.avro.generic.{GenericRecord, GenericRecordBuilder}
import org.apache.avro.SchemaBuilder
import scala.util.{Failure, Success}
object HelloKryo {
def main(args: Array[String]) {
// Build a schema