Collection of useful tools for development
My pre-commit configuration for a Python project:
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.4.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-added-large-files
- repo: https://github.com/psf/black
rev: stable
hooks:
- id: black
language_version: python3.8
- repo: https://github.com/pre-commit/mirrors-mypy
rev: '' # Use the sha / tag you want to point at
hooks:
- id: mypy
Run pre-commit on a folder:
$ git ls-files -- project1 | xargs pre-commit run --files
Add custom env vars to activate script:
$ cat .env
export FOO=bar
$ cat .env >> venv/bin/activate
$ cat .vscode/settings.json
{
"python.formatting.provider": "black",
"python.languageServer": "Jedi"
}
$ certbot certonly --standalone -d foo.bar.com
$ cat renew.sh
docker stop container-on-port-80-and-443
sudo certbot renew
docker start container-on-port-80-and-443
$ sudo crontab -e
0 0 */9 * * bash /dir/renew.sh > /dir/cron.log (check every 9 days for renewal)