Skip to content

Instantly share code, notes, and snippets.

View omushpapa's full-sized avatar

omushpapa

View GitHub Profile
@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 / 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 / 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 / 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
# 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:
# 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 / new-window.sh
Created November 21, 2018 09:47
Opens an incognito Chrome window that has a temporary and isolated profile. Useful for debugging sessions with different user accounts.
#! /usr/bin/env bash
nohup google-chrome --temp-profile --user-data-dir=/tmp/google-chrome.$RANDOM --incognito --no-first-run --disable-extensions --disable-default-apps --disable-infobars &>/dev/null &
@omushpapa
omushpapa / consumer.py
Created May 3, 2019 17:09
Sample Consumer-Publisher
from collections import OrderedDict
from concurrent.futures import ThreadPoolExecutor
import pika
import datetime
import logging
import json
from logging import StreamHandler
from time import sleep
from random import randint
@omushpapa
omushpapa / docker_dedicated_filesystem.md
Created June 14, 2019 15:34 — forked from hopeseekr/docker_dedicated_filesystem.md
Putting Docker on its own pseudo filesystem

Docker on BTRFS is very buggy and can result in a fully-unusable system, in that it will completely butcher the underlying BTRFS filesystem in such a way that it uses far more disk space than it needs and can get into a state where it cannot even delete any image, requiring one to take drastic actions up to and including reformatting the entire affected BTRFS root file system.

According to the official Docker documentation:

btrfs requires a dedicated block storage device such as a physical disk. This block device must be formatted for Btrfs and mounted into /var/lib/docker/.

In my experience, you will still run into issues even if you use a dedicated partition. No, it seems it requires a standalone

@omushpapa
omushpapa / workflow.md
Created June 19, 2020 20:30
Versioning and Git Workflow

Semantic Versioning

Details:

Versions are denoted using a standard triplet of integers: MAJOR.MINOR.PATCH. The basic intent is that MAJOR versions are incompatible, large-scale upgrades of the API. MINOR versions retain source and binary compatibility with older minor versions, and changes in the PATCH level are perfectly compatible, forwards and backwards.