Magic words:
psql -U postgresIf run with -E flag, it will describe the underlaying queries of the \ commands (cool for learning!).
Most \d commands support additional param of __schema__.name__ and accept wildcards like *.*
| #!/bin/bash | |
| ##################################################################### | |
| ## IMPORTANT ## | |
| # Run this script with root (sudo su -), wont work if run as sudo. | |
| # Change the variables as needed. | |
| ###################################################################### | |
| USER=youruser # User that will have ownership (chown) to /usr/local/bin and /usr/local/lib | |
| USERHOME=/home/${USER} # The path to the users home, in this case /home/youruser | |
| PYSHORT=3.6 # The Python short version, e.g. easy_install-${PYSHORT} = easy_install-3.6 | |
| PYTHONVER=3.6.1 # The actual version of python that you want to download from python.org |
| import boto3 | |
| from datetime import datetime, timezone | |
| from functools import reduce | |
| import operator | |
| ec2 = boto3.client('ec2') | |
| cloudtrail = boto3.client('cloudtrail') | |
| def get_events(instanceid): | |
| response = cloudtrail.lookup_events ( |
| [Unit] | |
| Description=supervisord - Supervisor process control system for UNIX | |
| Documentation=http://supervisord.org | |
| After=network.target | |
| [Service] | |
| Type=forking | |
| ExecStart=/bin/supervisord -c /etc/supervisord/supervisord.conf | |
| ExecReload=/bin/supervisorctl reload | |
| ExecStop=/bin/supervisorctl shutdown |
Related Setup: https://gist.github.com/hofmannsven/6814278
Related Pro Tips: https://ochronus.com/git-tips-from-the-trenches/
| upstream example-webpack { | |
| server 127.0.0.1:8080; | |
| } | |
| upstream example-backend { | |
| server 127.0.0.1:3000; | |
| } | |
| server { | |
| listen 80; |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
| """ | |
| >>>pip install PyJWT | |
| >>>import jwt | |
| """ | |
| import jwt | |
| from jwt import exceptions | |
| def jwt_token_decorator(func): | |
| """jwt_token简单验证装饰器 | |
| :param func: |