Skip to content

Instantly share code, notes, and snippets.

View Jack-alope's full-sized avatar
🐢

Jack F. Murphy Jack-alope

🐢
View GitHub Profile
@Jack-alope
Jack-alope / pika_backup_borgbase.md
Created December 25, 2021 20:09
Simple setup instruction to use Pika Backup with Borgbase

Install

  • Borg
  • Pika Backup

Create BorgBase account

Open terminal and run

pages:
stage: deploy
script:
- mkdir .public
- cp -r * .public
- mv .public public
artifacts:
paths:
- public
only:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta HTTP-EQUIV="REFRESH" content="0; url=https://mlp.jack.engineering/protocols.pdf">
</head>
<body>
</body>
import PyPDF2
import os
import argparse
def set_password(input_file, user_pass, owner_pass):
"""
Function creates new temporary pdf file with same content,
assigns given password to pdf and rename it with original file.
"""
@Jack-alope
Jack-alope / user_data.sh
Created August 12, 2020 03:57
Digital Ocean Startup Flask
#!/bin/bash
curl -L "https://github.com/docker/compose/releases/download/1.26.1/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose
wget -P ~ https://gist.githubusercontent.com/Jack-alope/f3f97082cb76e6710e01fd10ddbf9ec3/raw/b4a57ca1a428fa0bebf673da3861c7155fcb7f30/docker-compose.yml
docker-compose -f ~/docker-compose.yml up -d
@Jack-alope
Jack-alope / docker-compose.yml
Created August 12, 2020 03:44
Docker Compose (Remote Images)
version: "3.8"
services:
flask:
image: jackallope/docker_and_pycharm:flask
container_name: flask
restart: always
expose:
- 5000
@Jack-alope
Jack-alope / dockerfile
Created August 12, 2020 02:43
dockerfile (nginx)
FROM nginx
RUN rm /etc/nginx/conf.d/default.conf
COPY nginx.conf /etc/nginx/conf.d
@Jack-alope
Jack-alope / nginx.conf
Last active August 12, 2020 02:41
Nginx Configuration
server {
listen 80;
server_name flask;
charset utf-8;
location / {
proxy_pass http://flask:5000;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
@Jack-alope
Jack-alope / docker-compose.yml
Last active August 12, 2020 03:03
Docker Compose nginx-flask-mysql
version: "3.8"
services:
flask:
build: ./flask
container_name: flask
restart: always
expose:
- 5000
@Jack-alope
Jack-alope / dockerfile
Last active August 12, 2020 02:28
Simple Flask Dockerfile (Gunicorn)
# Define the base image
FROM python:3.8.3
# Copy everything into container
COPY . /app
WORKDIR /app
# Install the requirements
RUN python -m pip install -r requirements.txt