Skip to content

Instantly share code, notes, and snippets.

@thebyrd
Last active August 29, 2015 13:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save thebyrd/9490683 to your computer and use it in GitHub Desktop.
Save thebyrd/9490683 to your computer and use it in GitHub Desktop.

#Cookbook

Redis

If you don’t want to spend time setting up redis yourself, just use thebyrd/redis@2.8.6

$ bowery add cache
$ bowery connect
$ bowery ssh cache
root@17e65aa587e8:/# apt-get install -y gcc
root@17e65aa587e8:/# wget http://download.redis.io/releases/redis-2.8.6.tar.gz
root@17e65aa587e8:/# tar xzf redis-2.8.6.tar.gz
root@17e65aa587e8:/# cd redis-2.8.6
root@17e65aa587e8:/# cd deps; make hiredis lua jemalloc linenoise
root@17e65aa587e8:/# cd ..; make; make install
root@17e65aa587e8:/# sed -i ’s/6379/80/‘ redis.conf

in your make file add redis-server --port 80

Ruby on Rails

$ bowery add web
$ bowery connect
$ bowery ssh web
$ apt-get update
$ apt-get -y install build-essential zlib1g-dev libssl-dev libreadline6-dev libyaml-dev make gcc libsqlite3-dev
$ wget http://cache.ruby-lang.org/pub/ruby/2.0/ruby-2.0.0-p353.tar.gz
$ tar -xvzf ruby-2.0.0-p353.tar.gz
$ cd ruby-2.0.0-p353/
$ ./configure --prefix=/usr/local
$ make
$ make install
$ gem install bundler
$ gem install rails

In whatever path your bowery.json file is point to, create a Makefile that looks like:

run:
	rails s
build:
	bundle install

MySQL

$ bowery add db
$ bowery connect
$ bowery ssh db
$ apt-get update
$ sudo debconf-set-selections <<< 'mysql-server mysql-server/root_password password your_password'
$ sudo debconf-set-selections <<< 'mysql-server mysql-server/root_password_again password your_password'
$ sudo apt-get install -y mysql-server mysql-client vim
$ sudo sed -i 's/127.0.0.1/0.0.0.0/g' /etc/mysql/my.cnf
$ sudo sed -i 's/3306/80/g' /etc/mysql/my.cnf
$ sudo service mysql restart

Node.js

$ bowery add web
$ bowery connect
$ bowery ssh web
$ apt-get update
$ apt-get install -y git-core gcc g++
$ git clone https://github.com/joyent/node.git
$ cd node && git checkout v0.10.22-release
$ ./configure && make && make install

MongoDB

$ bowery add database
$ bowery connect
$ bowery ssh database
$ apt-get update
$ sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10
$ echo 'deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen' | sudo tee /etc/apt/sources.list.d/mongodb.list
$ sudo apt-get update
$ sudo apt-get install mongodb-10gen
$ mkdir -p /data/db

Add a Makefile to the path that the bowery.json file is pointing that looks like

start:
	mongod —port 80
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment