The use of __main__.py to create executables
myprojectfolder/
|_ __main__.py
|_ __init__.py
Being __main__.py:
print("Hello")
The use of __main__.py to create executables
myprojectfolder/
|_ __main__.py
|_ __init__.py
Being __main__.py:
print("Hello")
Current version of Ansible (1.7.1) does not merge hashes in the include_vars task even if told so via hash_behaviour = merge in your ansible.cfg. ansible/ansible#9116
This action plugin will merge hashes no matter how you have configured your hash_behaviour.
Save include_vars_merged.py to library/plugins/action/include_vars_merged.py
Save include_vars_merged to library/custom/include_vars_merged
| -- taken from http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Appendix.PostgreSQL.CommonDBATasks.html#Appendix.PostgreSQL.CommonDBATasks.PostGIS | |
| create extension postgis; | |
| create extension fuzzystrmatch; | |
| create extension postgis_tiger_geocoder; | |
| create extension postgis_topology; | |
| alter schema tiger owner to rds_superuser; | |
| alter schema tiger_data owner to rds_superuser; | |
| alter schema topology owner to rds_superuser; |
| """Provides a utility to inject environment variables into argparse definitions. | |
| Currently requires explicit naming of env vars to check for""" | |
| import argparse | |
| import os | |
| # Courtesy of http://stackoverflow.com/a/10551190 with env-var retrieval fixed | |
| class EnvDefault(argparse.Action): | |
| """An argparse action class that auto-sets missing default values from env | |
| vars. Defaults to requiring the argument.""" |
| # extracted from http//www.naturalearthdata.com/download/110m/cultural/ne_110m_admin_0_countries.zip | |
| # under public domain terms | |
| country_bounding_boxes = { | |
| 'AF': ('Afghanistan', (60.5284298033, 29.318572496, 75.1580277851, 38.4862816432)), | |
| 'AO': ('Angola', (11.6400960629, -17.9306364885, 24.0799052263, -4.43802336998)), | |
| 'AL': ('Albania', (19.3044861183, 39.624997667, 21.0200403175, 42.6882473822)), | |
| 'AE': ('United Arab Emirates', (51.5795186705, 22.4969475367, 56.3968473651, 26.055464179)), | |
| 'AR': ('Argentina', (-73.4154357571, -55.25, -53.628348965, -21.8323104794)), | |
| 'AM': ('Armenia', (43.5827458026, 38.7412014837, 46.5057198423, 41.2481285671)), |
| # Kernel version and system architecture | |
| uname -a | |
| # Name and version of distribution | |
| head -n1 /etc/issue | |
| # Partitions registered on the system | |
| cat /proc/partitions | |
| # Total RAM seen by the system | |
| grep MemTotal /proc/meminfo |
| """ | |
| Tasks for managing a test server | |
| """ | |
| import os | |
| from fabric.api import cd, env, prefix, run, sudo, task | |
| from fabric.contrib.files import exists, sed | |
| from fabric.context_managers import hide | |
| from fabric.colors import green, red |
I use Namecheap.com as a registrar, and they resale SSL Certs from a number of other companies, including Comodo.
These are the steps I went through to set up an SSL cert.
| #!/bin/bash | |
| # Backs up the OpenShift PostgreSQL database for this application | |
| # by Skye Book <skye.book@gmail.com> | |
| NOW="$(date +"%Y-%m-%d")" | |
| FILENAME="$OPENSHIFT_DATA_DIR/$OPENSHIFT_APP_NAME.$NOW.backup.sql.gz" | |
| pg_dump $OPENSHIFT_APP_NAME | gzip > $FILENAME |
| Shortcut Description | |
| --------------------------------------------------------------- | |
| C-o Drop to the console | |
| * Invert selection on files | |
| A-s Incremental search | |
| A-o Open selected directory in opposite panel | |
| A-. Toggle "Show Hidden Files" feature | |
| A-Enter Put name of the highlighted file on command line |