Skip to content

Instantly share code, notes, and snippets.

View parikshit223933's full-sized avatar
Exploring

Parikshit Singh parikshit223933

Exploring
View GitHub Profile
@ysmood
ysmood / nginx.minimal.conf
Last active February 23, 2024 03:01
nginx minimal reverse proxy config
events {}
http {
server {
listen 8080;
server_name a.com;
location / {
proxy_pass http://127.0.0.1:8888;
}
@lorenadl
lorenadl / rails_autocomplete.md
Last active March 21, 2022 12:25
[Rails] Autocomplete
@syafiqfaiz
syafiqfaiz / how-to-copy-aws-rds-to-local.md
Last active February 21, 2024 06:00
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
@soheilhy
soheilhy / nginxproxy.md
Last active March 22, 2024 08:54
How to proxy web apps using nginx?

Virtual Hosts on nginx (CSC309)

When hosting our web applications, we often have one public IP address (i.e., an IP address visible to the outside world) using which we want to host multiple web apps. For example, one may wants to host three different web apps respectively for example1.com, example2.com, and example1.com/images on the same machine using a single IP address.

How can we do that? Well, the good news is Internet browsers