I hereby claim:
- I am benspaulding on github.
- I am benspaulding (https://keybase.io/benspaulding) on keybase.
- I have a public key whose fingerprint is 20B3 BFB1 AD12 033F 0774 85F5 970F 8167 377B 92A4
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
>>> class Foo(object): | |
... # Immutable objects are fine as class attrs. | |
... mystr = 'a' | |
... myint = 1 | |
... mytpl = (1,) | |
... | |
... # But mutable objects often surprise you. | |
... mylst = [] | |
... mydct = {} | |
>>> foo = Foo() |
The boxfile is simple, setting up only the bare minimum for this test. You will see that the engine is also very simple. I wanted one that didn’t do any magic or sniffing to install system or Python packages.
I wanted to see if I could put all the pip files and Python packages in a custom, cacheable location. For what it's worth, this all seems to work for me. You can run each command below to see the output. But I think, if this actually does work, all of these steps could be put in the Python engine.
#!/usr/bin/env python3 | |
""" | |
Assign file types to be opened by a particular application. | |
Requires the ``duti`` program:: | |
> brew install duti | |
> ./appfiles.py --help | |
TODO |
# This works on macOS, and on some Linux distros. If it is failing you may need | |
# to change the sed option `-E` to `-r`. | |
pipenv lock --requirements | sed -E 's/[[:space:]]+--hash=[a-z0-9]+:[a-z0-9]+//g' |
These are works in progress, but they function for me and my uses.
Note that I wrote one in sh
and one in fish
just for exercise — the sh
one will work fine if you use fish
. The only time you need to pick one to match your own shell is if the files will be sourced, which is not yet supported.
Ideas
# Send nginx server port in host header to upstream only when port is non-standard. | |
# Requires nginx >= 0.9.0 | |
map $server_port $host_port { | |
default $:port; | |
80 ''; | |
443 ''; | |
} | |
server { | |
... |
Sometimes getting caught up in the configuration of gunicorn or uWSGI with the configuration of nanobox can be confusing. If you are not getting what you expect, starting here can be a good way to know if you have ports configured properly.
When running nanobox run
remember that:
/Library/Backblaze.bzpkg/bzdata/bzexcluderules_editable.xml
.bzexclusions
tag:<!-- Exclude node_modules. -->
<excludefname_rule plat="mac" osVers="*" ruleIsOptional="t" skipFirstCharThenStartsWith="users/" contains_1="/node_modules/" contains_2="*" doesNotContain="*" endsWith="*" hasFileExtension="*" />
BSD 3-Clause License | |
Copyright (c) 2020, Ben Spaulding | |
All rights reserved. | |
Redistribution and use in source and binary forms, with or without | |
modification, are permitted provided that the following conditions are met: | |
1. Redistributions of source code must retain the above copyright notice, this | |
list of conditions and the following disclaimer. |