8. Performance?
• Sorry no picture.
• Benchmarks gives some indication, but hard to
make it really objective and useful.
• Location. DO has no Asia servers.. yet.
10. Experience with DO
• I have a website: www.dilegno.sg
• Some parts of Shoppink use Digital Ocean
• Plus my random stuff I’m going to share with you
17. Recipe
• A personal website.
• Simply get a web server running (apache or nginx)
• My website uses Sinatra.
• We then need to get nginx talking to Sinatra.
18. Sinatra
• Sinatra is a Ruby micro-framework
• require 'sinatra'
get '/hi' do
"Hello World!"
end
19. Unicorn
# set path to app that will be used to configure unicorn,
# note the trailing slash in this example
@dir = "/home/sockmister/personal-website/"
worker_processes 1
working_directory @dir
timeout 30
# Specify path to socket unicorn listens to,
# we will use this in our nginx.conf later
listen "#{@dir}tmp/sockets/unicorn.sock", :backlog => 64
# Set process id path
pid "#{@dir}tmp/pids/unicorn.pid"
# Set log file paths
stderr_path "#{@dir}log/unicorn.stderr.log"
stdout_path "#{@dir}log/unicorn.stdout.log"
20. Nginx
• sudo apt-get install nginx
• We can start, stop, restart by
o sudo service nginx restart|start|stop|status
• We then write the config files.
21. The Idea
• The apps we are running today run behind nginx.
Nginx
App1
App2
App3
Incoming Requests
Outgoing Replies
25. Recipe
• Setup GitLab
o Install dependencies
o Setup new user
o Clone and install GitLab shell
o Setup database (postgresql or mysql)
o Setup GitLab itself
• Hook up with Nginx
26. Dependencies
• Python 2
o Sudo apt-get install python
• Ruby
o Ubuntu repositories are outdated
o I use rvm to handle ruby versions.
• Gem
o gem install bundler
27. Adduser
• We need to create a new user called ‘git’.
o sudo adduser --disabled-login --gecos 'GitLab' git
28. GitLab Shell
• Clone
o sudo -u git -H git clone https://github.com/gitlabhq/gitlab-shell.git
• Git checkout the right version
o sudo -u git -H git checkout v1.7.1
• Edit config file
o sudo -u git -H editor config.yml
• Run a script
o sudo -u git -H ./bin/install
29. Database
• Install postgresql
o sudo apt-get install -y postgresql-9.1 libpq-dev
• Login
o sudo -u postgres psql -d template1
• Create user and database
o CREATE USER git WITH PASSWORD '$password';
o CREATE DATABASE gitlabhq_production OWNER git;
30. GitLab
• Clone
o sudo -u git -H git clone https://github.com/gitlabhq/gitlabhq.git gitlab
• Git checkout
o sudo -u git -H git checkout 6-1-stable
• Configure
o Copy and change GitLab config file
o Mkdir for logs, tmp, public
o Copy and change unicorn config file
• Install required Gems
o gem install charlock_holmes --version '0.6.9.4'
o bundle install --deployment --without development test mysql aws
• Initialize DB
o sudo -u git -H chmod o-rwx config/database.yml
o bundle exec rake gitlab:setup RAILS_ENV=production
• Run as service
31. Nginx
• This time GitLab has supplied the Nginx config file.
• The idea though, is really the same.
38. Dropbox
• I run calibre on my laptop as well.
• Need a simple way to sync the books both ways.
• Trivia: NUS won Dropbox space race a while ago
and all NUS students have 25 GB extra space.
39. Dropbox
• Download & install
o wget -O dropbox.tar.gz http://www.dropbox.com/download/?plat=lnx.x86
o tar –xzvf dropbox.tar.gz
• Run
o ~/.dropbox-dist/dropboxd
• Link to your Dropbox account
o This client is not linked to any account…
• Control Dropbox
o wget -O ~/.dropbox/dropbox.py
"http://www.dropbox.com/download?dl=packages/dropbox.py"
44. Otherwise…
• Setup nginx
o http://ruby-journal.com/how-to-setup-rails-app-with-puma-and-nginx/
o http://recipes.sinatrarb.com/p/deployment/nginx_proxied_to_unicorn
• GitLab
o https://github.com/gitlabhq/gitlabhq/blob/6-1-
stable/doc/install/installation.md
• Calibre server
o http://manual.calibre-ebook.com/cli/calibre-server.html
• Dropbox daemon
o http://ubuntuservergui.com/ubuntu-server-guide/install-dropbox-ubuntu-
server
So I noticed most people start their talk with an introduction. I’m going to do likewise.I’m not really sure if there’s much to intro about me, but I’m PohChiat.
I realised that my title was really cryptic. I was kind of chatting with bryan about what I wanted to talk about. A couple of ideas, but I found out what I have really been doing was simply fooling around with what $5 could give me.So today, I’m going to share with you the kind of stuff I got running on my droplet at this moment. I certainly didn’t invent any of this stuff,