$ rails g model User
belongs_to
has_one
| // jQuery.naturalWidth / jQuery.naturalHeight plugin for (already-loaded) images | |
| // Triple-licensed: Public Domain, MIT and WTFPL license - share and enjoy! | |
| (function($) { | |
| function img(url) { | |
| var i = new Image; | |
| i.src = url; | |
| return i; | |
| } |
| # -*- mode: ruby -*- | |
| # vi: set ft=ruby : | |
| Vagrant::Config.run do |config| | |
| # Base box to build off, and download URL for when it doesn't exist on the user's system already | |
| config.vm.box = "wagtail-base-v0.1" | |
| config.vm.box_url = "http://downloads.torchbox.com/wagtail-base-v0.1.box" | |
| # You can also build from a vanilla precise32 box, although it'll take longer |
| #!/bin/bash | |
| DJANGO_VERSION=1.4 | |
| VENV="django$DJANGO_VERSION" | |
| # create virtualenv: "django<version>" e.g. django1.4 | |
| mkdir lib | |
| cd lib | |
| virtualenv --system-site-packages $VENV | |
| cd $VENV |
| - name: set swap_file variable | |
| set_fact: | |
| swap_file: /mnt/{{ swap_space }}.swap | |
| - name: check if swap file exists | |
| stat: | |
| path: "{{ swap_file }}" | |
| register: swap_file_check | |
| - name: create swap file |
1.- Get into the src folder, download & extract nginx source
cd ~/srccurl -O http://nginx.org/download/nginx-1.7.0.tar.gztar -xzvf nginx-1.7.0.tar.gzcd nginx-1.7.02.- Configuring the source
./configure --prefix=$HOME/local/nginx \
| #! /usr/bin/python | |
| """ | |
| This simple script makes it easy to create server certificates | |
| that are signed by your own Certificate Authority. | |
| Mostly, this script just automates the workflow explained | |
| in http://www.tc.umn.edu/~brams006/selfsign.html. | |
| Before using this script, you'll need to create a private |
| [unix_http_server] | |
| file=/tmp/supervisor.sock ; path to your socket file | |
| [supervisord] | |
| logfile=/var/log/supervisord/supervisord.log ; supervisord log file | |
| logfile_maxbytes=50MB ; maximum size of logfile before rotation | |
| logfile_backups=10 ; number of backed up logfiles | |
| loglevel=error ; info, debug, warn, trace | |
| pidfile=/var/run/supervisord.pid ; pidfile location | |
| nodaemon=false ; run supervisord as a daemon |
Packer
Packer is used to build image from a base image, perform provisions and store (commit) the final image.
We use provisioners and Packer templates to do the actual work to create the final image.
We use Ansible for provisioning.
| # sudo su and run the following | |
| sudo aptitude update | |
| # install all dependencies | |
| sudo aptitude -y install \ | |
| python-pip \ | |
| python2.7-dev \ | |
| libssl-dev \ | |
| libcurl4-openssl-dev \ |