Skip to content

Instantly share code, notes, and snippets.

View omushpapa's full-sized avatar

omushpapa

View GitHub Profile
# https://docs.docker.com/engine/admin/systemd/
Many Linux distributions use systemd to start the Docker daemon. This document shows a few examples of how to customize Docker’s settings.
Starting the Docker daemon
Once Docker is installed, you will need to start the Docker daemon.
$ sudo systemctl start docker
# or on older distributions, you may need to use
$ sudo service docker start
If you want Docker to start at boot, you should also:
@omushpapa
omushpapa / rest.py
Created July 14, 2018 09:26 — forked from tliron/rest.py
Simple and functional REST server for Python (2.7) using no dependencies beyond the Python standard library.
#!/usr/bin/env python
'''
Simple and functional REST server for Python (2.7) using no dependencies beyond the Python standard library.
Features:
* Map URI patterns using regular expressions
* Map any/all the HTTP VERBS (GET, PUT, DELETE, POST)
* All responses and payloads are converted to/from JSON for you
@omushpapa
omushpapa / directions.md
Last active August 12, 2022 21:54
Deploy Django App on Heroku

Requirements

Run pip install pipenv to install pipenv

Run pipenv shell to create an environment, if does not exist, and activate it.

Run pipenv install python_decouple whitenoise dj_database_url Pillow gunicorn May take a while.

This should create two files: Pipfile and Pipfile.lock. Keep them in the project root.

@omushpapa
omushpapa / kde_fix.md
Last active March 31, 2018 06:55
Anaconda Fix for Failing KDE Login

After installation of Anaconda3 and rebooting, GUI login fails.

Add this to .bashrc

Find the line

# added by Anaconda3 installer
# export PATH="/path/to/anaconda3/bin:$PATH"

Replace with

@omushpapa
omushpapa / install_python3.6_opensuse42.3.sh
Created March 22, 2018 15:53 — forked from amoilanen/install_python3.6_opensuse42.3.sh
Installing Python 3.6 on OpenSUSE Leap 42.3
# !/bin/bash
# Step 1. Install pyenv
git clone https://github.com/pyenv/pyenv.git ~/.pyenv
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bashrc
echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bashrc
echo -e 'if command -v pyenv 1>/dev/null 2>&1; then\n eval "$(pyenv init -)"\nfi' >> ~/.bashrc
# Step 2. Install missing headers for all the Python modules to be built
@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).

@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 / 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 / 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 / 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