Skip to content

Instantly share code, notes, and snippets.

View SajidK25's full-sized avatar
🏠
Working from home

Sajid Khan SajidK25

🏠
Working from home
View GitHub Profile
@ismailyenigul
ismailyenigul / nginx-traefik-v2-docker-compose.yml
Last active May 4, 2024 22:59
nginx and traefik v2 deployment with docker-compose
1. create a network with docker network create NETWORKNAME
2. Create letsencrypt directory for acme.json ie /docker/letsencrypt directory or somewhere else mkdir -p /docker/letsencrypt
3. I configured http -> https redirect
# cat docker-compose.yml
version: '3.3'
services:
traefik2:
image: traefik
@stancl
stancl / deploy.sh
Last active June 11, 2024 21:53
Deploy using GitHub actions and SSH to a VPS
#!/bin/sh
set -e
vendor/bin/phpunit
npm run prod
git add .
(git commit -m "Build frontend assets for deployment to production") || true
(git push) || true
Install Postgresql-10 with bucardo sync on centos 7
#install util
yum install epel-release
yum update
yum install wget htop zip unzip
#install portgresq 10
yum install https://download.postgresql.org/pub/repos/yum/reporpms/EL-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm
yum update
yum install postgresql10 postgresql10-server postgresql10-contrib postgresql10-plperl
@adamscharf
adamscharf / installing_python.md
Last active June 28, 2024 09:17
Managing Python using pyenv, virtualenv, and pyenv-virtualenv

Managing Python using pyenv, virtualenv, and pyenv-virtualenv

Problem: You want to maintain multiple different versions of python and keep packages separated based on projects that you're working on.

Solution: Use the pyenv, virtualenv tools along with the pyenv-virutalenv plugin to manage multiple versions of python and seamlessly integrate them with your projects' virtual environments.

Installation

@grimzy
grimzy / git-pull-all
Created September 15, 2017 02:15
Git pull all remote branches
#!/usr/bin/env bash
git branch -r | grep -v '\->' | while read remote; do git branch --track "${remote#origin/}" "$remote"; done
git fetch --all
git pull --all
@IronistM
IronistM / setup-elementary.sh
Last active May 8, 2023 18:52 — forked from floriancourgey/setup-elementary.sh
Things to do after installing elementary OS Loki 0.4
#Start with a dist upgrade
sudo apt dist-upgrade
# Get chrome
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
sudo dpkg -i ./google-chrome*.deb
sudo apt-get install -f
# dev (php, docker, git, node, bower, electron, composer)
sudo apt install -y \
@carmark
carmark / gist:4aa32cacd4d041448c39ad8deb87135f
Last active March 7, 2024 02:03
A sample Docker workflow with Nginx, Node.js and Redis

For this example, I have a very simple Node.js applications that increments a counter stored on Redis. I want to run Redis and the node application independently as I want to have the ability to scale the node application depending on the load. To start off, I have 3 instances of the node server running the application. I have an Nginx server in front of node for load balancing the node instances.

Let’s now talk in terms of containers, specifically Docker containers. Simple; 1 container for each service/process!

  • 1 Redis container
  • 3 Node containers
  • 1 Nginx container So, the overall picture looks something like this: