Here's how to save and load docker images:
Example scenario: To save a docker image from a docker repository and save it as a tar file locally.
- Save the image as a tarball
docker save repositoryname:tag > repotag.tar
- Zip the image
| #!/bin/bash | |
| ## | |
| # File: | |
| # nginx_modsite | |
| # Description: | |
| # Provides a basic script to automate enabling and disabling websites found | |
| # in the default configuration directories: | |
| # /etc/nginx/sites-available and /etc/nginx/sites-enabled | |
| # For easy access to this script, copy it into the directory: |
| #!/bin/python | |
| import os | |
| from flask import Flask, Response, request, abort, render_template_string, send_from_directory | |
| import Image | |
| import StringIO | |
| app = Flask(__name__) | |
| WIDTH = 1000 |
Here's how to save and load docker images:
Example scenario: To save a docker image from a docker repository and save it as a tar file locally.
docker save repositoryname:tag > repotag.tar
| #!/usr/bin/env python | |
| import io | |
| import time | |
| import picamera | |
| import picamera.array | |
| import numpy as np | |
| from PIL import Image, ImageDraw |
Headless reinstall and update https://raspberrypi.stackexchange.com/a/57023
In the following, we assume a working Flask application with the name of SCRIPT_NAME. First we need to install a couple of things:
sudo apt-get update && sudo apt-get upgrade
Installing nginx will fail if apache is running. If your installation breaks half ways, then remove the fragments, stop apache (and I actually suggest removing it in case not needed) and then install nginx again:
sudo apt-get remove nginx* --purge
sudo /etc/init.d/apache2 stop
| Shortcut Description | |
| --------------------------------------------------------------- | |
| C-o Drop to the console | |
| Insert Select/deselect file | |
| * Invert selection on files | |
| + Specify file selection options (including custom pattern) | |
| - The same as above, but for deselecting | |
| F5/F6 Copy/move selected files |
| import cv2 | |
| import numpy as np | |
| import urllib.request | |
| import time | |
| import threading | |
| import math | |
| def getPokemon(start, end): | |
| print("Started worker for range :", start, "to", end) |
| import cv2 | |
| import time | |
| import glob | |
| import multiprocessing.pool as mp | |
| def process_img(image_file): | |
| if '_canny.jpg' not in image_file: | |
| print 'processing', image_file | |
| img = cv2.imread(image_file) | |
| img = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY) |
| #!flask/bin/python | |
| from flask import Flask, jsonify, abort, request, make_response, url_for | |
| from flask.ext.httpauth import HTTPBasicAuth | |
| app = Flask(__name__, static_url_path = "") | |
| auth = HTTPBasicAuth() | |
| @auth.get_password | |
| def get_password(username): | |
| if username == 'miguel': |