| if DEBUG : | |
| #local_static | |
| STATIC_URL = '/static/' | |
| STATICFILES_DIRS=(os.path.join(BASE_DIR, 'static_local'),) | |
| #local_media | |
| MEDIA_ROOT = os.path.join(BASE_DIR, 'uploads') | |
| MEDIA_URL = '/userphoto/media/' | |
| else : | |
| STATICFILES_DIRS=(os.path.join(BASE_DIR, 'static_local'),) | |
| AWS_S3_CUSTOM_DOMAIN = '%s.s3.amazonaws.com' % AWS_STORAGE_BUCKET_NAME |
This is a collection of the most common commands I run while administering Postgres databases. The variables shown between the open and closed tags, "<" and ">", should be replaced with a name you choose. Postgres has multiple shortcut functions, starting with a forward slash, "". Any SQL command that is not a shortcut, must end with a semicolon, ";". You can use the keyboard UP and DOWN keys to scroll the history of previous commands you've run.
http://www.postgresql.org/download/linux/ubuntu/ https://help.ubuntu.com/community/PostgreSQL
| #!/bin/bash | |
| EMAIL=john.doe@example.com | |
| DOMAINS=example.com,www.example.com,foo.example.com,example.org.example.net,www.example.org,www.example.net | |
| git clone https://github.com/letsencrypt/letsencrypt | |
| cd letsencrypt/ | |
| mkdir -p /var/lib/letsencrypt/global-webroot | |
| # Setup the global alias |
| const I = x => x | |
| const K = x => y => x | |
| const A = f => x => f (x) | |
| const T = x => f => f (x) | |
| const W = f => x => f (x) (x) | |
| const C = f => y => x => f (x) (y) | |
| const B = f => g => x => f (g (x)) | |
| const S = f => g => x => f (x) (g (x)) | |
| const S_ = f => g => x => f (g (x)) (x) | |
| const S2 = f => g => h => x => f (g (x)) (h (x)) |
This documented is a slightly adapted version to this one: https://gist.github.com/jsuwo/9038610 by Jeff Shantz. He has a fantastic video series on setting up Jenkins on AWS EC2 here: https://www.youtube.com/watch?v=1JSOGJQAhtE&feature=youtu.be&ab_channel=JeffShantz
- Choose 1-2GB Ubuntu Server
- Create new security group and Enable HTTP (& leave SSH open)
- Launch!
Picking the right architecture = Picking the right battles + Managing trade-offs
- Clarify and agree on the scope of the system
- User cases (description of sequences of events that, taken together, lead to a system doing something useful)
- Who is going to use it?
- How are they going to use it?
Basic RESTful API with Symfony 3 + FOSRestBundle (JSON format only) + FOSUserBundle + FOSOauthServerBundle
The API we are creating in this gist will follow these rules :
- The API only returns JSON responses
- All API routes require authenticationu
- Authentication is handled via OAuth2 with
passwordGrant Type only (no need for Authorization pages and such). - API versioning is managed via a subdomain (e.g.
v1.api.example.com)
The API will be written in PHP with the Symfony 3 framework. The following SF2 bundles are used :
| #!/usr/bin/env bash | |
| # https://developers.supportbee.com/blog/setting-up-cucumber-to-run-with-Chrome-on-Linux/ | |
| # https://gist.github.com/curtismcmullan/7be1a8c1c841a9d8db2c | |
| # https://stackoverflow.com/questions/10792403/how-do-i-get-chrome-working-with-selenium-using-php-webdriver | |
| # https://stackoverflow.com/questions/26133486/how-to-specify-binary-path-for-remote-chromedriver-in-codeception | |
| # https://stackoverflow.com/questions/40262682/how-to-run-selenium-3-x-with-chrome-driver-through-terminal | |
| # https://askubuntu.com/questions/760085/how-do-you-install-google-chrome-on-ubuntu-16-04 | |
| # Versions | |
| CHROME_DRIVER_VERSION=`curl -sS https://chromedriver.storage.googleapis.com/LATEST_RELEASE` |