Skip to content

Instantly share code, notes, and snippets.

From bfa9775fd4c07598ea68557187318b3d727677be Mon Sep 17 00:00:00 2001
From: Ankur Chauhan <ankurcha@dynamic-118-084.usc.edu>
Date: Mon, 14 Sep 2009 20:53:31 -0700
Subject: [PATCH] REVERT: Max's Build of the Locks and Condition Variables
---
threads/synch.cc | 215 ++++++++++++++++++++----------------------------------
threads/synch.h | 13 +--
2 files changed, 84 insertions(+), 144 deletions(-)
@ankurcha
ankurcha / rpm-deployments.md
Created December 9, 2011 10:03
Deploying webapps as a part of a CD pipeline

Assumptions

  • Configs result in a rpm file for each environment that are installed correctly.(rpm.name: appname-config-env : provides appname-config)
  • Servers are assumed to have a tomcat running which was deployed as an rpm (rpm.name: appname-tomcat)
  • Webapp is packaged as a rpm containing only a war with proper startup and shutdown scripts. (rpm.name: appname-war) This depends on appname-tomcat and appname-config.

Deployment

  • Stage the files by pushing them into the yum repositories.
  • Deploy stage involves installing appname-config-env and then appname-war (this may cause appname-tomcat) to be pulled in and installed.
@ankurcha
ankurcha / gist:2919203
Created June 12, 2012 18:24
Getting pushstate <a> tags to work with Emberjs

I am generating urls as

           {{#each Em.subNav.options}}
                <li {{bindAttr class="isActive:active"}}>
                    {{#if isActive}}
                        <div class="active"><a {{bindAttr href="href"}}>{{label}}</a></div>
                    {{else}}
                        <a {{bindAttr href="href"}}>{{label}}</a>
                    {{/if}}
{
"job": {
"thumbnails": [
{
"url": "https://zencoder-live.s3.amazonaws.com/t/20120927/7864415da5e07890d7da419447547352/frame_0000.png?AWSAccessKeyId=AKIAI456JQ76GBU7FECA&Signature=xWP6gj81QibkLYdwP2kUWGuqZ%2FE%3D&Expires=1348870033",
"height": 360,
"group_label": "forth",
"id": 511104899,
"created_at": "2012-09-27T18:07:13-04:00",
"format": "png",
@ankurcha
ankurcha / micro_bosh.yml
Last active December 11, 2015 04:09 — forked from Justin-Yu/Micro_bosh.yml
A working instance of the micro_bosh.yml specification file.
---
name: bosh_micro01
network:
ip: 192.168.83.60
netmask: 255.255.255.0
gateway: 192.168.83.2
dns:
- 192.168.83.2
cloud_properties:
#!/bin/bash
source _variables.sh
### stage bosh_ruby
apt-get -y update
apt-get -y autoremove
apt-get -y install build-essential libssl-dev libcurl4-openssl-dev libreadline-gplv2-dev zlib1g-dev libxslt1-dev libxml2-dev
# install ruby
#!/bin/bash
if [[ $# -eq 0 ]]; then
echo "Schedules a command to be run after the next reboot."
echo "Usage: $(basename $0) <command>"
echo " $(basename $0) -p <path> <command>"
echo " $(basename $0) -r <command>"
else
REMOVE=0
COMMAND=${!#}
@ankurcha
ankurcha / micro_bosh.yml
Created March 28, 2013 16:01
microbosh deployment manifest
---
name: micro01 #the same name as your folder name
#XXX using micro01
network:
ip: 10.118.72.144 #define ip for micro BOSH
netmask: 255.255.255.0
gateway: 10.118.72.253 #10.20.145.1
dns:
- 10.20.145.1
- 10.20.144.1
#!/bin/bash
cd /home/hadoop/
wget http://elasticmapreduce.s3.amazonaws.com/samples/spark/0.7/hive-0.9-bin.tgz
wget http://elasticmapreduce.s3.amazonaws.com/samples/spark/0.7/shark-0.3-bin.tgz
wget http://elasticmapreduce.s3.amazonaws.com/samples/spark/0.7/spark-0.7-bin.tgz
wget http://www.scala-lang.org/downloads/distrib/files/scala-2.9.2.tgz
tar -xvzf scala-2.9.2.tgz
@ankurcha
ankurcha / mesos.md
Last active December 17, 2015 18:19

App/Framework development guide

Note: In this document (and also in the Mesos code base, at least as of Feb 14, 2012), we refer to Mesos Applications as "Frameworks".

See one of the example framework schedulers in MESOS_HOME/src/examples/ to get an idea of what a Mesos framework scheduler and executor in the language of your choice looks like.

Create your Framework Scheduler

You can write a framework scheduler in C, C++, Java/Scala, or Python. Your framework scheduler should inherit from the Scheduler class (see API below). Your scheduler should create a SchedulerDriver (which will mediate communication between your scheduler and the Mesos master) and then call SchedulerDriver.run()