Skip to content

Instantly share code, notes, and snippets.

View omushpapa's full-sized avatar

omushpapa

View GitHub Profile
@omushpapa
omushpapa / dispatch.py
Created October 23, 2016 14:49 — forked from aortbals/dispatch.py
Synchronize two folders using python.
#! /usr/bin/python
# Dispatch - synchronize two folders
import os
import filecmp
import shutil
from stat import *
class Dispatch:
''' This class represents a synchronization object '''
@omushpapa
omushpapa / README-Template.md
Created April 4, 2017 19:46 — forked from PurpleBooth/README-Template.md
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@omushpapa
omushpapa / print_progress.py
Created May 30, 2017 05:32 — forked from aubricus/License
Python Progress Bar
# -*- coding: utf-8 -*-
# Print iterations progress
def print_progress(iteration, total, prefix='', suffix='', decimals=1, bar_length=100):
"""
Call in a loop to create terminal progress bar
@params:
iteration - Required : current iteration (Int)
total - Required : total iterations (Int)
@omushpapa
omushpapa / download-website
Created June 1, 2017 10:52 — forked from datawebbie/download-website
Download/Backup/Sync whole website
wget -p -e robots=off --wait 1 URL
@omushpapa
omushpapa / openerp-Ubuntu-installation
Created September 27, 2017 09:08 — forked from aorborc/openerp-Ubuntu-installation
Install OpenERP 7 on Ubuntu
# copied only the scripts from http://www.theopensourcerer.com/2012/12/how-to-install-openerp-7-0-on-ubuntu-12-04-lts/
sudo apt-get install openssh-server denyhosts
sudo apt-get update
sudo apt-get dist-upgrade
sudo adduser --system --home=/opt/openerp --group openerp
sudo apt-get install postgresql
sudo su - postgres
createuser --createdb --username postgres --no-createrole --no-superuser --pwprompt openerp
#Enter password for new role: ********
@omushpapa
omushpapa / gist:1550da6412422156108f1f2020091b03
Created October 12, 2017 13:26 — forked from Atem18/gist:4696071
Tutorial to seting up a django website in production.

Set up Django, Nginx and Gunicorn in a Virtualenv controled by Supervisor

Steps with explanations to set up a server using:

  • Virtualenv
  • Virtualenvwrapper
  • Django
  • Gunicorn
@omushpapa
omushpapa / git-pushing-multiple.rst
Created October 23, 2017 08:43 — forked from rvl/git-pushing-multiple.rst
How to push to multiple git remotes at once. Useful if you keep mirrors of your repo.

Pushing to Multiple Git Repos

If a project has to have multiple git repos (e.g. Bitbucket and Github) then it's better that they remain in sync.

Usually this would involve pushing each branch to each repo in turn, but actually Git allows pushing to multiple repos in one go.

If in doubt about what git is doing when you run these commands, just

@omushpapa
omushpapa / nginx.conf
Created January 24, 2018 13:12 — forked from micho/nginx.conf
nginx config for http/https proxy to localhost:3000
First, install nginx for mac with "brew install nginx".
Then follow homebrew's instructions to know where the config file is.
1. To use https you will need a self-signed certificate: https://devcenter.heroku.com/articles/ssl-certificate-self
2. Copy it somewhere (use full path in the example below for server.* files)
3. sudo nginx -s reload
4. Access https://localhost/
Edit /usr/local/etc/nginx/nginx.conf:
@omushpapa
omushpapa / letsencrypt_2017.md
Last active April 9, 2018 09:41 — forked from cecilemuller/letsencrypt_2020.md
How to setup Let's Encrypt for Nginx on Ubuntu 16.04 (including IPv6, HTTP/2 and A+ SLL rating)

How to setup Let's Encrypt for Nginx on Ubuntu 16.04 (including IPv6, HTTP/2 and A+ SLL rating)

There are two main modes to run the Let's Encrypt client (called Certbot):

  • Standalone: replaces the webserver to respond to ACME challenges
  • Webroot: needs your webserver to serve challenges from a known folder.

Webroot is better because it doesn't need to replace Nginx (to bind to port 80).

In the following, we're setting up mydomain.com. HTML is served from /var/www/mydomain, and challenges are served from /var/www/letsencrypt.

@omushpapa
omushpapa / letsencrypt_apache_2018.md
Last active February 1, 2024 06:15
How to configure SSL using LetsEncrypt and Certbot on Apache in Ubuntu 16.04

How to setup Let's Encrypt for Apache on Ubuntu 16.04

In the following, we're setting up mydomain.com.

Challenges are served from /var/www/letsencrypt.

Apache snippets

First we create two snippets (to avoid duplicating code in every virtual host configuration).