Generate a certificate signing request (CSR) for an existing private key
openssl req -out certificate.csr -key private.key -new -sha256
Check a Certificate Signing Request
>openssl req -text -noout -verify -in certificate.csr
Generate a certificate signing request (CSR) for an existing private key
openssl req -out certificate.csr -key private.key -new -sha256
Check a Certificate Signing Request
>openssl req -text -noout -verify -in certificate.csr
from flask import Flask, g, abort | |
app = Flask(__name__) | |
# This decorator checks the role of the user before allowing entry | |
def check_role(access_level, json=False): | |
def decorator(func): | |
@wraps(func) | |
def wrapper(*args, **kwargs): |
from PIL import Image | |
# open colour image | |
img = Image.open("test_image.jpg") | |
# convert image to black and white | |
img = img.convert("1") | |
# save new image | |
img.save("test_image_grayscale.jpg") |
from PIL import Image | |
# open image | |
img = Image.open("test_image.jpg") | |
# set the maximum width and height for the thumbnail | |
max_thumbnail_size = (200, 200) | |
# applying size for thumbnail | |
img.thumbnail(max_thumbnail_size) |
from PIL import Image | |
img = Image.open("test_image.jpg") | |
img = img.convert("RGB") | |
datas = img.getdata() | |
new_image_data = [] | |
for item in datas: | |
# change all white (also shades of whites) pixels to yellow |
from PIL import Image, ImageDraw, ImageFont | |
# open image to apply watermark to | |
img = Image.open("watermark_test.jpg") | |
img.convert("RGB") | |
# get image size | |
img_width, img_height = img.size | |
# 5 by 4 water mark grid |
from PIL import Image, ImageFilter | |
# blur radius and diameter | |
radius, diameter = 20, 40 | |
# open an image | |
img = Image.open("test_image.jpg") | |
# Paste image on white background | |
background_size = (img.size[0] + diameter, img.size[1] + diameter) |
from PIL import Image, ImageOps | |
# open image | |
img = Image.open("test_image.jpg") | |
# border color | |
color = "green" | |
# top, right, bottom, left | |
border = (20, 10, 20, 10) |
server { | |
listen 80; | |
listen 443 ssl; | |
server_name localhost; | |
root /home/mywebstite/; | |
index index.html; | |
location / { |