diskutil erasevolume HFS+ 'RAM Disk' `hdiutil attach -nobrowse -nomount ram://XXXXX`
where XXXXX
is the size of the RAM disk in terms of memory blocks.
Notes:
import os | |
import random | |
from PIL import Image, ImageOps | |
def concat_images(image_paths, size, shape=None): | |
# Open images and resize them | |
width, height = size | |
images = map(Image.open, image_paths) | |
images = [ImageOps.fit(image, size, Image.ANTIALIAS) |
Note: This is an update of Will Haley's excellent post to use APFS instead of CoreStorage.
The script can't read the file containing the password on the USB thumb drive. When formatted
as FAT32 as described below, the user/group of the file is unknown/unknown. But I also tried formatting the USB thumb drive in HFS+, unchecking "Ignore permissions on this volume" and changing the file owner to root:wheel
. The file is still not readable to the boot process. Probably something to do with new security restrictions in Catalina. A script running as root reading data from a thumb drive? Makes sense.
class RawPathMiddleware(object): | |
"""Do not let werkzeug silently replace percent encoding. | |
https://github.com/pallets/werkzeug/pull | |
/1419/files#diff-2fd07ed8a4cc8c956ceeca2347ac5376 | |
Usage: | |
app.wsgi_app = RawPathMiddleware(app.wsgi_app) |
npm install dotenv | |
echo "FOO=bar" > .env | |
node -r dotenv/config -e 'console.log(process.env.FOO)' | |
bar |
### Installing global Python & Pip
Use Brew
brew install python
That'll install both Python, PIP and setuptools. If for some reason it didn't install PIP you can do via
curl https://bootstrap.pypa.io/get-pip.py > get-pip.py
sudo python get-pip.py
# These are the standard pip packages | |
# I like to install in my user 'global' space. | |
# They generally do not belong in a project's | |
# requirements.txt file, and are almost always | |
# found in a file like requirement_dev.txt | |
# | |
# pip install --user requirements_user.txt | |
# echo 'export PATH=~/.local/bin:$PATH' >> ~/.bash_profile | |
autopep8>=1.4.3 |
{ | |
"python.pythonPath": "~/.virtualenvs/myvenv/bin/python", | |
"python.venvPath": "~/.virtualenvs", | |
"python.unitTest.pyTestEnabled": true, | |
"files.exclude": { | |
"**/.git": true, | |
"**/.DS_Store": true, | |
"**/*.pyc": {"when": "$(basename).py"}, | |
"**/__pycache__": true | |
} |
Here is the raw output from examining the LambdaContext context object in a AWS Lambda function when called from a CloudFormation stack. More information on the context object can be found here : http://docs.aws.amazon.com/lambda/latest/dg/python-context-object.html
<__main__.LambdaContext object at 0x7fd706780710>
#!/usr/bin/env python3 | |
import base64 | |
import datetime | |
import json | |
import logging | |
import os | |
import sys | |
import time | |
import traceback |