Skip to content

Instantly share code, notes, and snippets.

View indyarocks's full-sized avatar
💭
I may be slow to respond.

Chandan Jhunjhunwal indyarocks

💭
I may be slow to respond.
View GitHub Profile
@indyarocks
indyarocks / Dockerfile
Created September 23, 2023 06:08 — forked from rajeevkannav/Dockerfile
Deploy com Mina, Docker e Docker Compose
FROM rails:4.2.3
MAINTAINER Renato Filho <renatosousafilho@gmail.com>
ENV HOME /home/app
ENV RAILS_ENV development
RUN useradd -m -s /bin/bash app
RUN gem install -N bundler
@indyarocks
indyarocks / ruby_on_rails_deployment.md
Last active September 22, 2023 18:32 — forked from zentetsukenz/ruby_on_rails_deployment.md
Deploy Ruby on Rails application with Docker Compose and Capistrano with ease

Docker

Files and Folders.

|
|\_ app
|...
|\_ docker
| |
@indyarocks
indyarocks / the % notation in ruby.md
Created June 4, 2023 08:49 — forked from jakimowicz/the % notation in ruby.md
%Q, %q, %W, %w, %x, %r, %s, %I, %i

%Q, %q, %W, %w, %x, %r, %s, %i

Perl-inspired notation to quote strings: by using % (percent character) and specifying a delimiting character.

Any single non-alpha-numeric character can be used as the delimiter, %[including these], %?or these?, %~or even these things~.

Strings

% or %Q

@indyarocks
indyarocks / how-to-copy-aws-rds-to-local.md
Created May 25, 2019 09:22 — forked from syafiqfaiz/how-to-copy-aws-rds-to-local.md
How to copy production database on AWS RDS(postgresql) to local development database.
  1. Change your database RDS instance security group to allow your machine to access it.
    • Add your ip to the security group to acces the instance via Postgres.
  2. Make a copy of the database using pg_dump
    • $ pg_dump -h <public dns> -U <my username> -f <name of dump file .sql> <name of my database>
    • you will be asked for postgressql password.
    • a dump file(.sql) will be created
  3. Restore that dump file to your local database.
    • but you might need to drop the database and create it first
    • $ psql -U <postgresql username> -d <database name> -f <dump file that you want to restore>
  • the database is restored
@indyarocks
indyarocks / server.md
Created April 11, 2017 18:59 — forked from jtadeulopes/server.md
Server setup with ubuntu, nginx and puma for rails app.

Update and upgrade the system

sudo apt-get update && sudo apt-get upgrade && sudo apt-get dist-upgrade && sudo apt-get autoremove
sudo reboot

Configure timezone

@indyarocks
indyarocks / 0002_sidekiq_initial.config
Created September 23, 2016 17:36 — forked from bnhansn/0002_sidekiq_initial.config
AWS Sidekiq Restart Configuration
---
restart_sidekiq: &RESTART_SIDEKIQ
mode: "000755"
content: |
#!/bin/bash
initctl restart sidekiq || initctl start sidekiq
ln -sf /var/app/current/log/sidekiq.log /var/app/containerfiles/logs/sidekiq.log
mute_sidekiq: &MUTE_SIDEKIQ
mode: "000755"
content: |