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 queue | |
from confluent_kafka import Producer, Consumer, TopicPartition, OFFSET_END, OFFSET_BEGINNING | |
from multiprocessing import Queue | |
from threading import Thread | |
import time | |
import string | |
import random | |
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
const express = require('express') | |
const bodyParser = require('body-parser') | |
var redis = require('redis'); | |
const app = express() | |
app.use(bodyParser.urlencoded()); | |
app.use(bodyParser.json()); | |
var ptrn = 'sess*' | |
var redisClients = {} |
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
<!DOCTYPE html> | |
<meta charset="utf-8" xmlns="http://www.w3.org/1999/html"> | |
<html> | |
<head> | |
<title>Scatter plot coordinates</title> | |
<style> | |
.content { | |
/*text-align:center */ | |
} |
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 libcloud.security, time | |
from libcloud.compute.types import Provider | |
from libcloud.compute.providers import get_driver | |
from libcloud.common.exceptions import BaseHTTPError | |
uname = 'dummy' | |
pwd = 'foo' | |
tenant = 'dummy' |
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
some html xhixhile | |
http://hakim.se/experiments |
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
Host axel07 maia01 | |
HostName %h.doc.ic.ac.uk | |
User gtato | |
ProxyCommand ssh -q docgate /bin/nc -q0 %h %p | |
Host docgate | |
User gtato | |
HostName shell2.doc.ic.ac.uk | |
ControlMaster auto | |
ControlPath ~/.ssh/ssh_control_%h_%p_%r |
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
# save docker image in glance | |
docker save conpaas-director-squeeze | glance image-create --is-public=True --container-format=docker --disk-format=raw --name conpaas-director-squeeze | |
# start a vm on a particular network | |
nova boot --flavor m1.small --image conpaas-director-squeeze --security-groups demo-secgroup --key-name demo-keypair --nic net-id=e0afdf0f-a081-48ab-935b-67694d15e7fb --user_data=conpaas_director.rc director-squeeze | |
# associate floating IPs to a VM | |
nova floating-ip-associate fc353186-8d2c-46e4-afe7-2e1b125d29f5 10.13.0.102 | |
# download user data |
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
#/dev/loop0 and /dev/loop1 are assumed to be free, otherwise use 'losetup -f' and store the result | |
losetup /dev/loop0 disk.img | |
kpartx -as /dev/loop0 | |
losetup /dev/loop1 /dev/mapper/loop0p1 | |
mkdir disk | |
mount /dev/loop1 disk |
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
exposed_functions_http_methods = {} | |
def expose(http_method): | |
def decorator(func): | |
exposed_functions_http_methods[id(func)] = http_method | |
def wrapped(self, *args, **kwargs): | |
return func(self, *args, **kwargs) | |
return wrapped | |
return decorator | |