This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pip3 install django-storages |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$path = "Path\to\your\ssh_key.pem" | |
#Get current ACL to file/folder | |
$acl = Get-Acl $path | |
#Disable inheritance and remove inherited permissions | |
$acl.SetAccessRuleProtection($true,$false) | |
#Remove all explict ACEs | |
$acl.Access | ForEach-Object { $acl.RemoveAccessRule($_) } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
list_1 = ["a", "b", "c", "d"] | |
list_2 = [1, 2, 3, 4] | |
dict_from_lists = dict(zip(list_1, list_2)) | |
# dict_from_lists will be {'a': 1, 'b': 2, 'c': 3, 'd': 4} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def createStack(): | |
return [] | |
def isEmpty(stack): | |
if len(stack)==0: | |
return True | |
else: | |
return False | |
def push(stack, element): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import psycopg2 | |
from psycopg2 import Error | |
import psycopg2.extras | |
from psycopg2.extras import RealDictCursor | |
try: | |
# connect to the database | |
connection = psycopg2.connect(host=os.environ['db_endpoint'], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#mysql-deployment.yaml | |
apiVersion: apps/v1 | |
kind: Deployment | |
metadata: | |
name: wordpress-mysql | |
labels: | |
app: wordpress | |
spec: | |
selector: | |
matchLabels: |