Skip to content

Instantly share code, notes, and snippets.

View ndeto's full-sized avatar
💭
GraphQL

Martin Ndeto ndeto

💭
GraphQL
View GitHub Profile
@linuxdevops-34
linuxdevops-34 / configure-ec2-instance.md
Created July 17, 2020 09:20 — forked from manojkumararyan/configure-ec2-instance.md
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
a = [1,2,3,4,5]
# 2 new arrays
left,right = a.each_slice( (a.size/2.0).round ).to_a
# left == [1, 2, 3]
# right == [4, 5]
# make array 2-dimensional
a.each_slice( (a.size/2.0).round ).to_a
# a == [[1, 2, 3], [4, 5]]