Skip to content

Instantly share code, notes, and snippets.

View eduardobc88's full-sized avatar
:octocat:
Working from home

EDUARDO BELTRAN CARBAJAL eduardobc88

:octocat:
Working from home
View GitHub Profile
@eduardobc88
eduardobc88 / git-hooks.sh
Last active March 5, 2021 03:28
Steps to configure the server and client for push git branch into the server side
# 1- (server) create a git repository on server side
git init --bare ~/<projec-name>
# 2- (server) into the directory: '~/<project-name>/hooks/' create a file: 'post-receive' and add this:
!/bin/bash
while read oldrev newrev ref
do
if [[ $ref =~ .*/master$ ]];
then
echo "== GIT HOOKS : Master ref received. Deploying master branch to production... =="
git --work-tree=~/<dir-name>/<dir-name>/ checkout -f master
@jamesmacfie
jamesmacfie / README.md
Created October 22, 2019 02:53
iTerm 2 - script to change theme depending on Mac OS dark mode

How to use

In iTerm2, in the menu bar go to Scripts > Manage > New Python Script

Select Basic. Select Long-Running Daemon

Give the script a decent name (I chose auto_dark_mode.py)

Save and open the script in your editor of choice.

@eduardobc88
eduardobc88 / docker-architecture-services.sh
Last active April 24, 2019 21:09
Docker script to create architecture services and network communication hub
echo "== CREATE DOCKER MICROSERVICES INFRAESTRUCTURE =="
echo "==== creating hub network ====";
sudo docker network create autocom-services-hub-network --subnet=172.1.1.0/24
sleep 5;
wait
echo "==== creating reverse proxy ====";
sudo docker run --name ms-nginx-reverse-proxy-server -d --ip 172.1.1.2 --net autocom-services-hub-network -p 80:80 -v /home/lalo/Docker/AutocomServices/ms-nginx-reverse-proxy-server:/shared --hostname ms-nginx-reverse-proxy-server -i centos:7
sleep 5;
wait
echo "==== creating api gateway ====";
@eduardobc88
eduardobc88 / shell-installations.sh
Last active June 26, 2019 22:40
Shell Scripts for installations
# Python
$sudo yum install centos-release-scl
$sudo yum install rh-python36
$scl enable rh-python36 bash
$python --version
$pip
# NodeJS - NVM
$curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash
$nvm --version # list all versions
# ~/.bash_profile
[[ -s ~/.bashrc ]] && source ~/.bashrc
export CLICOLOR=1
export LSCOLORS=GxFxCxDxBxegedabagaced
function prompt {
local BLACK="\[\033[0;30m\]"
local BLACKBOLD="\[\033[1;30m\]"
@eduardobc88
eduardobc88 / nginx-reverse-proxy.conf
Last active April 25, 2019 06:00
Nginx Reverse Proxy
#### start nginx config
worker_processes 1;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
@evildmp
evildmp / gist:3094281
Last active June 30, 2023 10:55
Set up Django, nginx and uwsgi

This document has now been incorporated into the uWSGI documentation:

http://uwsgi-docs.readthedocs.org/en/latest/tutorials/Django_and_nginx.html

Set up Django, nginx and uwsgi

Steps with explanations to set up a server using: