Skip to content

Instantly share code, notes, and snippets.

@massenz
massenz / README.rst
Last active August 8, 2017 22:18
Apache Mesos build and install scripts; optionally runs the Master/Slave locally and executes a demo (C++) framework against it, to validate it all went according to plan

Apache Mesos Build scripts

The Getting started instructions are a good start (no surprise there!) but are somewhat incomplete and currently look a bit outdated (I plan to fix them soon): however, the outcome has been that I have struggled more than I felt necessary in building and running Mesos on a dev VM (Ubuntu 14.04 running under VirtualBox).

Some of the issue seem to arise from the unfortunate combination of Mesos Master trying to guess its own IP address, the VM being (obviously) non-DNS resolvable and, eventually, the Slave and the Framework failing to properly communicate with the Master.

In the process of solving this, I ended up automating all the dependencies installation, building and running the framework; I have then broken it down into the following modules to make it easier to run only parts of the process.

@westwickfarrow
westwickfarrow / es.sh
Created July 13, 2012 10:07
Install ElasticSearch on Ubuntu 12.04
cd ~
sudo add-apt-repository ppa:dlecan/openjdk
sudo apt-get update
sudo apt-get install openjdk-7-jre -y
wget https://github.com/downloads/elasticsearch/elasticsearch/elasticsearch-0.19.7.tar.gz -O elasticsearch.tar.gz
tar -xf elasticsearch.tar.gz
rm elasticsearch.tar.gz
sudo mv elasticsearch-* elasticsearch
sudo mv elasticsearch /usr/local/share
@adaiguoguo
adaiguoguo / extract.sh
Last active June 8, 2016 03:07 — forked from liaoyw/extract.sh
解压小能手
# copy from http://www.tldp.org/LDP/abs/html/sample-bashrc.html
function extract() # Handy Extract Program
{
if [ -f $1 ] ; then
case $1 in
*.tar.bz2) tar xvjf $1 ;;
*.tar.gz) tar xvzf $1 ;;
*.bz2) bunzip2 $1 ;;
*.rar) unrar x $1 ;;
*.gz) gunzip $1 ;;
# copy from http://www.tldp.org/LDP/abs/html/sample-bashrc.html
function extract() # Handy Extract Program
{
if [ -f $1 ] ; then
case $1 in
*.tar.bz2) tar xvjf $1 ;;
*.tar.gz) tar xvzf $1 ;;
*.bz2) bunzip2 $1 ;;
*.rar) unrar x $1 ;;
*.gz) gunzip $1 ;;
@dalang
dalang / yanghui_triangle.py
Created May 11, 2015 17:07
print yanghui triangle
def yanghui_triangle():
def safe_get_value(l, index):
length = len(l)
return 0<= index < length and l[index] or 0
tmp = [1]
while True:
yield tmp
length = len(tmp)
new = []