First create a Ubuntu 13.04 x64 droplet on DigitalOcean Control Panel
Then ssh with root account, run this in termianl:
$ wget -qO- https://raw.github.com/progrium/dokku/master/bootstrap.sh | sudo bash
#!/bin/bash | |
# | |
# Script to create and download a database backup on Heroku | |
# Written by Chris Stefano (https://github.com/virtualstaticvoid) | |
# | |
# See http://devcenter.heroku.com/articles/pgbackups for details | |
# | |
appname=$1 | |
filename=${appname}_db_$(date +%Y%m%d)_$(date +%H%M).pg_backup |
# Additional translations at https://github.com/plataformatec/devise/wiki/I18n | |
el: | |
devise: | |
confirmations: | |
confirmed: 'Ο λογαριασμός σας επιβεβαιώθηκε με επιτυχία.' | |
send_instructions: 'Σε λίγα λεπτά θα λάβετε οδηγίες για το πώς θα επιβεβαιώσετε το email σας.' | |
send_paranoid_instructions: 'Αν το email σας υπάρχει στη βάση δεδομένων μας, θα λάβετε email με οδηγίες για την επιβεβαίωση του λογαριασμού σας.' | |
failure: | |
already_authenticated: 'Είστε ήδη συνδεδεμένος.' |
/* Flatten das boostrap */ | |
.well, .navbar-inner, .popover, .btn, .tooltip, input, select, textarea, pre, .progress, .modal, .add-on, .alert, .table-bordered, .nav>.active>a, .dropdown-menu, .tooltip-inner, .badge, .label, .img-polaroid { | |
-moz-box-shadow: none !important; | |
-webkit-box-shadow: none !important; | |
box-shadow: none !important; | |
-webkit-border-radius: 0px !important; | |
-moz-border-radius: 0px !important; | |
border-radius: 0px !important; | |
border-collapse: collapse !important; | |
background-image: none !important; |
# RSpec's subject method, both implicitly and explicitly set, is useful for | |
# declaratively setting up the context of the object under test. If you provide a | |
# class for your describe block, subject will implicitly be set to a new instance | |
# of this class (with no arguments passed to the constructor). If you want | |
# something more complex done, such as setting arguments, you can use the | |
# explicit subject setter, which takes a block. | |
describe Person do | |
context "born 19 years ago" do | |
subject { Person.new(:birthdate => 19.years.ago } | |
it { should be_eligible_to_vote } |
sudo apt-get update | |
sudo apt-get install python3-pip python3-dev libpq-dev postgresql postgresql-contrib nginx | |
sudo -u postgres psql | |
- paste this code in postgres console: | |
CREATE DATABASE django_project; | |
CREATE USER username WITH PASSWORD 'pass1234'; | |
ALTER ROLE username SET client_encoding TO 'utf8'; | |
ALTER ROLE username SET default_transaction_isolation TO 'read committed'; |
require 'carrierwave/processing/mini_magick' | |
class ImageUploader < CarrierWave::Uploader::Base | |
include CarrierWave::MiniMagick | |
IMAGE_EXTENSIONS = %w(jpg jpeg gif png) | |
DOCUMENT_EXTENSIONS = %w(exe pdf doc docm xls) | |
def store_dir | |
"files/#{model.id}" |
sudo su postgres | |
psql | |
update pg_database set datistemplate=false where datname='template1'; | |
drop database Template1; | |
create database template1 with owner=postgres encoding='UTF-8' | |
lc_collate='en_US.utf8' lc_ctype='en_US.utf8' template template0; | |
update pg_database set datistemplate=true where datname='template1'; |
app.filter('capitalize', function() { | |
return function(input, scope) { | |
if (input!=null) | |
input = input.toLowerCase(); | |
return input.substring(0,1).toUpperCase()+input.substring(1); | |
} | |
}); |