Skip to content

Instantly share code, notes, and snippets.

View mezbahalam's full-sized avatar
🏠

Mezbah Alam mezbahalam

🏠
View GitHub Profile
@mezbahalam
mezbahalam / pg.md
Created December 20, 2022 20:29
install postgresql on ubuntu 22.04

To install PostgreSQL on Ubuntu 22.04, follow these steps:

Update the package manager's package list by running the following command:

sudo apt update

Install the PostgreSQL package by running the following command:

sudo apt install postgresql
@mezbahalam
mezbahalam / git-auto-deploy.md
Created October 17, 2019 18:57 — forked from yosukehasumi/git-auto-deploy.md
Setting Up Git-Auto-Deploy on Digital Ocean

Install software-properties-common

sudo apt-get install software-properties-common

Add Repo

sudo add-apt-repository ppa:olipo186/git-auto-deploy
upstream app {
# Path to Puma SOCK file, as defined previously
server unix:/home/deployer/fastfood/shared/tmp/sockets/puma.sock fail_timeout=0;
}
server {
listen 80;
server_name localhost;
root /home/deployer/fastfood/current/public;
  1. Nginx (/etc/nginx) totally remove kore only Openresty dia server run kora jabe ?

  2. certificate gula create hoe tar location koi ?( /etc/resty-auto-ssl folder e certificate khuje pai na)

  3. current status of my server config https://gist.github.com/mezbahalam/ad4ff7450cecbd0239d44f26a025c874

  4. folder structure & .conf file er kono best practice ase ?

  5. custom certificate kivabe generate kore ?

@mezbahalam
mezbahalam / 1. nginx.conf
Last active August 13, 2021 11:37
ruby on rails multiple custom domains over Https using Openresty and lua (https://www.babar.im/blog/sysadmin/serve-your-saas-customer-domains-over-https-for-free.html)
## /etc/openresty/nginx.conf
user www-data;
events {
worker_connections 1024;
}
http {
lua_shared_dict auto_ssl 1m;
@mezbahalam
mezbahalam / 1. nginx.conf
Created October 1, 2019 14:02
conflict for multidomain ssl
## /etc/openresty/nginx.conf
user www-data;
events {
worker_connections 1024;
}
http {
lua_shared_dict auto_ssl 1m;
lua_shared_dict auto_ssl_settings 64k;
@mezbahalam
mezbahalam / install_rabbitmq.md
Created August 9, 2019 10:03
install rabbitmq on ubuntu 18

Install RabbitMq on Ubuntu 18

sudo apt-get update
sudo apt-get install erlang  
sudo apt-get install rabbitmq-server  
sudo systemctl enable rabbitmq-server  
sudo systemctl start rabbitmq-server
sudo systemctl status rabbitmq-server  
sudo rabbitmq-plugins enable rabbitmq_management
@mezbahalam
mezbahalam / rspec_model_testing_template.rb
Created May 15, 2019 09:50 — forked from SabretWoW/rspec_model_testing_template.rb
Rails Rspec model testing skeleton & cheat sheet using rspec-rails, shoulda-matchers, shoulda-callbacks, and factory_girl_rails. Pretty much a brain dump of examples of what you can (should?) test in a model. Pick & choose what you like, and please let me know if there are any errors or new/changed features out there. Reddit comment thread: http…
# This is a skeleton for testing models including examples of validations, callbacks,
# scopes, instance & class methods, associations, and more.
# Pick and choose what you want, as all models don't NEED to be tested at this depth.
#
# I'm always eager to hear new tips & suggestions as I'm still new to testing,
# so if you have any, please share!
#
# @kyletcarlson
#
# This skeleton also assumes you're using the following gems:
require 'rails_helper'
RSpec.describe TodosController, :type => :controller do
describe "GET #index" do
#describe "POST #create" do
#describe "GET #show" do
#describe "PATCH #update" do (or PUT #update)
#describe "DELETE #destroy" do
#describe "GET #new" do
@mezbahalam
mezbahalam / docker-destroy-all.sh
Last active November 11, 2018 18:55 — forked from JeffBelback/docker-destroy-all.sh
Destroy all Docker Containers and Images
#!/bin/bash
# Stop all containers
docker stop $(docker ps -a -q)
# Delete all containers
docker rm $(docker ps -a -q)
# Delete all images
docker rmi $(docker images -q)
# Delete all volume / data
docker volume rm $(docker volume ls -q)