Skip to content

Instantly share code, notes, and snippets.

@s3u
s3u / install-pyspark-on-mac.md
Last active August 23, 2017 15:25
Installing pyspark on Mac Sierra
brew install apache-spark
python3 -m venv .venv
source .venv/bin/activate
pip install pyspark

Then update your hostname in /etc/hosts.

@s3u
s3u / vol-agent.py
Created December 31, 2014 02:17
vol-agent
import sys
import subprocess
import requests
import os
# The purpose of this script is to find look for unmounted volumes, and mount them. If a volume is unitialized, it
# will initialize as ext4.
#
# The simplest way to run this is via cron. Use the following crontab entry
#
@s3u
s3u / images.md
Last active August 29, 2015 13:56

Mouting an Image for Modifications

Mount the image. If the iamge is QEMU QCOW2 image, do the following.

sudo modprobe nbd max_part=63
sudo qemu-nbd -c /dev/nbd0 ~/precise-server-cloudimg-amd64
sudo mount /dev/nbd0p1 /mnt/myimage

Then you can change image contents from /mnt/myimage, or through chroot /mnt/myimage. Add a /var/lib/cloud/scripts/per-instance script to this image.

@s3u
s3u / openacademy-projects.md
Last active January 3, 2016 13:09
OpenAcademy OpenStack Project - List of problems
  1. Multi-factor authentication for Keystone
  • Define an API extension to Keystone
  • Inject an API extension into Keystone
  • Create a default implementation
  • Write unit tests
  • Extend the CLI
  • Add an extension to Horizon
  1. Access keys for Keystone including the user experience
  • Define an API extension to Keystone
  • Inject an API extension into Keystone
@s3u
s3u / OpenStack.md
Last active December 27, 2015 15:29

OpenStack

OpenStack is one of the largest and leading open source projects to build and operate public or private clouds. OpenStack provides a set of APIs for provisioning and managing basic cloud constructs like compute (virtual machines), network (shared or private networks, floating IPs, load balancers etc.), and storage (block and object storage) along with additional layers to build and operate on-demand self-service cloud platforms. OpenStack is used now-a-days by several public cloud providers such as Rackspace, HP as well as by many organizations to provide on-premise private clouds.

Contributing to this project will give developers, first, an opportunity to learn the fundamental building blocks of cloud, the challenges of operating at scale, and second, how to collaborate in a distributed setup to build open source software.

Objectives

Short term objective of this project is to to setup a working OpenStack deployment on a virtual machine and then use OpenStack APIs or command-line interfaces

@s3u
s3u / gist:3148816
Created July 20, 2012 05:13
Pipelining settings in Firefox
user_pref("network.http.pipelining", true);
user_pref("network.http.pipelining.aggressive", true);
user_pref("network.http.pipelining.maxrequests", 6);
@s3u
s3u / gist:3078273
Created July 9, 2012 19:07
diffs to cluster2
diff --git a/lib/monitor.js b/lib/monitor.js
index a47bd7e..e4a0f1d 100644
--- a/lib/monitor.js
+++ b/lib/monitor.js
@@ -28,8 +28,7 @@ var Monitor = module.exports = function Monitor(options) {
this.options = options || {port: 8081, stats: {}, path: '/'};
this.stats = this.options.stats;
- var app = express.createServer();
-
@s3u
s3u / gist:2973367
Created June 22, 2012 15:13
Another test for timeout
var http = require('http');
var options = {
host: 'localhost',
port: 3000,
method: 'HEAD',
headers: {
'connection': 'keep-alive'
},
path: '/'
@s3u
s3u / index.html
Created June 15, 2012 05:36
Bottleneck Domains
<html>
<head>
<script type="text/javascript"
src='http://www.google.com/jsapi?autoload={"modules":[{"name":"visualization","version":"1","packages":["corechart"]}]}'>
</script>
<script type="text/javascript" src="http://stevenlevithan.com/demo/parseuri/js/assets/parseuri.js"></script>
<script type="text/javascript">
window.ondragover = function () {
return false;
<div id="events">
</div>
<script type="text/javascript">
uri = 'ws://ql.io';
var wsCtor = window['MozWebSocket'] ? MozWebSocket : WebSocket;
var socket = new wsCtor(uri, 'ql.io-console');
socket.onopen = function () {
var div = document.getElementById('events');