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
sudo sh -c " | |
wget -nv -O - https://packagecloud.io/gpg.key | apt-key add - | |
echo 'deb https://packagecloud.io/dokku/dokku/ubuntu/ trusty main' | tee /etc/apt/sources.list.d/dokku.list | |
apt-get update -qq > /dev/null | |
apt-get install sigil -t trusty # We're using the Ubuntu 14.04 package ;) | |
apt-mark hold sigil | |
wget https://raw.githubusercontent.com/dokku/dokku/master/bootstrap.sh | |
bash bootstrap.sh | |
" |
Using gem aws-sdk for a ror application for uploading images to s3 | |
Uploading images to a fixed bucket with different folders for each object or application. | |
The s3 keeps a limitation on the number of buckets creattion whereas there is no | |
limitation for content inside a bucket. | |
This code will upload image for a user to s3 using aws-sdk gem. The bucket and the image uploaded are made public | |
so that the images uploaded are directly accessible. The input it takes is the image complete path | |
where it is present, folder in which it should be uploaded and user_id for whom it should | |
be uploaded. |