pip3 install pipenv
pipenv shell
| # -*- coding: utf-8 -*- | |
| ''' | |
| Shotgun thread-safe API call demo for Python 3.x | |
| Requires Shotgun Python API: https://github.com/shotgunsoftware/python-api | |
| Context manager implementation based on concept from ArjanCodes: https://www.youtube.com/watch?v=Rm4JP7JfsKY | |
| All code provided as a single file for ease of testing/demo. Should most definitely be split into |
| #!/bin/bash | |
| echo Provisioning Ruby on Rails... | |
| echo ================================= | |
| echo - Installing dependencies | |
| sudo apt-get update -y -qq > /dev/null | |
| sudo apt-get install curl -y -qq > /dev/null | |
| echo - Installing mysql server | |
| export DEBIAN_FRONTEND=noninteractive |
| import time | |
| import random | |
| # A dummy script which keeps increasing the number of string added to list a | |
| thing = "hi" | |
| a = [] | |
| for i in range(1000): | |
| a.append(thing * random.randint(1000,2000)) | |
| time.sleep(0.1) |
| App configuration in environment variables: for and against | |
| For (some of these as per the 12 factor principles) | |
| 1) they are are easy to change between deploys without changing any code | |
| 2) unlike config files, there is little chance of them being checked | |
| into the code repo accidentally | |
| 3) unlike custom config files, or other config mechanisms such as Java |
| internal interface IExampleService | |
| { | |
| Task VeryImportantWorkAsync(int additionalSecondsToWait); | |
| } | |
| internal sealed class ExampleService : IExampleService | |
| { | |
| private readonly IImportantDataProvider _dataProvider; | |
| public ExampleService(IImportantDataProvider dataProvider) |
| #!/bin/bash | |
| ###################################################### | |
| # AUTO LEMP INSTALLATION # | |
| # Written by Gil Shwartz # | |
| # [email protected] # | |
| ###################################################### | |
| clear | |
| echo "#######################################################" | |
| if (( $EUID != 0 )); then | |
| echo |
| function getSunday($date) { | |
| $dow = strftime("%A", strtotime($date)); | |
| switch ($dow) { | |
| case "Monday"; | |
| $date = date ('Y-m-d', strtotime ("$date - 1 days")); | |
| return $date; | |
| case "Tuesday"; | |
| $date = date ('Y-m-d', strtotime ("$date - 2 days")); | |
| return $date; | |
| case "Wednesday"; |
| #!/bin/bash | |
| ###################################################### | |
| # AUTO LAMP INSTALLATION # | |
| # Written by Gil Shwartz # | |
| # [email protected] # | |
| ###################################################### | |
| clear | |
| echo "#######################################################" | |
| if (( $EUID != 0 )); then | |
| echo "[!] This script requires root privileges in order" |
| AWSTemplateFormatVersion: '2010-09-09' | |
| Metadata: | |
| License: Apache-2.0 | |
| Parameters: | |
| CidrBlocks: | |
| Description: FIXME Remove. The CIDR blocks to use for the subnets in the services VPC. | |
| Default: '10.0.0.0/24,10.0.1.0/24,10.0.2.0/24,10.0.3.0/24,10.0.4.0/24,10.0.5.0/24' | |
| Type: CommaDelimitedList |