Skip to content

Instantly share code, notes, and snippets.

Dockerize your application

Sample rails application Dockerfile

FROM ruby:2.6.4

RUN apt-get update -o Acquire::CompressionTypes::Order::=gz -qq && apt-get install -y build-essential libpq-dev nodejs

Recover Lost Password in Ubuntu

- mount -rw -o remount / #enable read write mode for root
- ls /home #to get list of usernames
- passwd <username> #press enter key & set password
- exit terminal & restart
@manojkumararyan
manojkumararyan / configure-ec2-instance.md
Last active January 13, 2024 12:09
Complete guide for deploying rails application to aws ec2 instance, using capistrano as deploying tool with nginx & puma server

Deploy Rails Application to AWS EC2

Creating AWS EC2 Instance

- login to 'AWS Management Console' (https://aws.amazon.com/console/)
- from 'Services'(in navbar) choose 'EC2'
- from 'Create Instance' section, click on 'Launch Instance'
- then select 'AMI' (Amazon Machine Image), we will be using 'Ubuntu Server 16.04 LTS (HVM)' as example
- select 'Instance Type' as per your requirement
- then click 'Next:Configure Instance Details' to continue
  change 'Configure Instance Details' or used as default settings

Install imagemagick in ubuntu

- sudo apt-get update
- sudo apt-get install build-essential checkinstall libx11-dev libxext-dev zlib1g-dev libpng-dev libjpeg-dev libfreetype6-dev libxml2-dev
- sudo apt-get build-dep imagemagick
- wget http://www.imagemagick.org/download/ImageMagick-6.9.10-8.tar.gz #change version as per requirement
- tar -xzvf ImageMagick-6.9.10-8.tar.gz
- cd ImageMagick-6.9.10-8
- ./configure

Install elasticsearch in ubuntu

Install java dependency for elasticsearch

- sudo apt-get update
- sudo apt-get install default-jre
- sudo apt-get install default-jdk

Install elasticsearch

Setup FTP server (VSFTPD) on AWS EC2

Install vsftpd

sudo apt-get update
sudo apt-get install vsftpd

Update vsftp.config file