Skip to content

Instantly share code, notes, and snippets.

View masudcsesust04's full-sized avatar
🏣
Working from office

Md Masud Rana masudcsesust04

🏣
Working from office
  • Dhaka, Bangladesh
  • 02:16 (UTC +06:00)
View GitHub Profile
@checco
checco / postgres-owner-grants.sql
Last active June 14, 2023 15:19
How to change OWNER for DATABASE, SCHEMA or TABLE on AWS RDS PostgreSQL. An how to REASSIGN owner for all objects on AWS RDS PostgreSQL
--
-- Change database owner
--
ALTER DATABASE "db_name" OWNER TO user;
--
-- List schemas
--
@lukeburden
lukeburden / nginx_blog.conf
Last active August 20, 2019 10:49
Nginx Reverse Proxy for Wordpress with Caching
proxy_cache_path /var/nginx/cache levels=1:2 keys_zone=blog_cache:1m max_size=100m inactive=60m use_temp_path=off;
server{
listen 80;
server_name example.com;
# prevent forwarding of cookies
proxy_set_header Cookie "";
# prevent passing of WP cookie back to client
@siklodi-mariusz
siklodi-mariusz / Dockerfile
Created January 30, 2018 19:40
Dockerfile example for Ruby on Rails running on Alpine Linux
FROM ruby:2.4-alpine3.7
# Install dependencies:
# - build-base: To ensure certain gems can be compiled
# - nodejs: Compile assets
# - postgresql-dev postgresql-client: Communicate with postgres through the postgres gem
# - libxslt-dev libxml2-dev: Nokogiri native dependencies
# - imagemagick: for image processing
RUN apk --update add build-base nodejs tzdata postgresql-dev postgresql-client libxslt-dev libxml2-dev imagemagick
@SunDi3yansyah
SunDi3yansyah / List-of-Rails-Status-Code-Symbols.md
Created November 28, 2016 17:51
List of Rails Status Code Symbols

1xx Informational

Status Code Status Message Symbol
100 Continue :continue
101 Switching Protocols :switching_protocols
102 Processing :processing

2xx Success

Status Code Status Message Symbol
@zentetsukenz
zentetsukenz / ruby_on_rails_deployment.md
Last active September 22, 2023 18:32
Deploy Ruby on Rails application with Docker Compose and Capistrano with ease

Docker

Files and Folders.

|
|\_ app
|...
|\_ docker
| |
@arteezy
arteezy / puma.service
Last active May 9, 2024 22:22
Manage Puma with systemd and rbenv
[Unit]
Description=Puma Rails Server
After=network.target
[Service]
Type=simple
User=deploy
WorkingDirectory=/home/deploy/app/current
ExecStart=/home/deploy/.rbenv/bin/rbenv exec bundle exec puma -C /home/deploy/app/shared/config/puma.rb
ExecStop=/home/deploy/.rbenv/bin/rbenv exec bundle exec pumactl -S /home/deploy/app/shared/tmp/pids/puma.state stop
@davidderus
davidderus / .dockerignore
Last active March 3, 2024 10:15
Docker + Rails + Puma + Postgres + Nginx
.git
.gitignore
/doc
.yardoc
coverage
jsdoc
/tmp
/log
Dockerfile
Dockerfile.prod
@spalladino
spalladino / mysql-docker.sh
Created December 22, 2015 13:47
Backup and restore a mysql database from a running Docker mysql container
# Backup
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql
# Restore
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE
@joseluisq
joseluisq / terminal-git-branch-name.md
Last active July 4, 2024 15:00
Add Git Branch Name to Terminal Prompt (Linux/Mac)

Add Git Branch Name to Terminal Prompt (Linux/Mac)

image

Open ~/.bash_profile in your favorite editor and add the following content to the bottom.

# Git branch in prompt.

parse_git_branch() {
@traumverloren
traumverloren / doorkeeper.rb
Last active March 10, 2022 10:27
doorkeeper config for redirect back to client app after login with oauth2 provider
#########################
# config/initializers/doorkeeper.rb
#########################
Doorkeeper.configure do
# Change the ORM that doorkeeper will use.
# Currently supported options are :active_record, :mongoid2, :mongoid3, :mongo_mapper
orm :active_record
# This block will be called to check whether the resource owner is authenticated or not.