Skip to content

Instantly share code, notes, and snippets.

@keithrozario
keithrozario / Azure.txt
Last active April 23, 2020 01:26
Azure notes
How many tenants can a user in Azure Active Directory belong to?
What are characteristics of Azure Paired Regions?
Azure Information protection == ~Macie
Network Security Group == Security Group
Application Gateway == Application Load Balancer
Azure Support Plans
Service Trust Portal == Artifact
Resource Group == ~Tags
App Services??
Azure Firewall
@keithrozario
keithrozario / memory.py
Last active August 28, 2023 10:43
Read file from s3.download_fileobj into memory
s3 = boto3.client('s3')
## Reading a JSON file in memory
with tempfile.TemporaryFile() as data:
s3.download_fileobj(bucket_name, 'tests/s3/key.json', data)
data.seek(0)
status = json.loads(data.read().decode('utf-8'))['status']
## Reading a CSV file in memory
with tempfile.TemporaryFile() as package_file:
@keithrozario
keithrozario / exe
Last active April 7, 2020 04:33
exe
https://sdadadsazxzxvwr6t3676jnvcxzvcz.s3-ap-southeast-1.amazonaws.com/model.txt
@keithrozario
keithrozario / on_delete.yml
Last active November 8, 2023 19:15
Get branch name on branch delete github actions
name: Serverless Delete example
on:
delete:
branches:
- actions-**
# Specify what jobs to run
jobs:
deploy:
@keithrozario
keithrozario / main.yml
Created February 25, 2020 13:13
Getting the Branch Name from GitHub actions
steps:
- uses: actions/checkout@v1
- name: Set Branch name to $STAGE env var
run: |
BRANCH="$(echo ${GITHUB_REF#refs/heads/} | sed 's/\//_/g')"
echo "BRANCH is $BRANCH"
echo "::set-env name=STAGE::$BRANCH"
@keithrozario
keithrozario / serverless.yml
Created February 23, 2020 23:36
Simple Serverless
name: Simple Serverless
# Triggers
on:
push:
branches:
- master
# Jobs
jobs:
@keithrozario
keithrozario / policy.json
Created February 9, 2020 09:50
VPCe Policy
{
"Version": "2012-10-17",
"Id": "VPCe and SourceIP",
"Statement": [{
"Sid": "VPCe and SourceIP",
"Effect": "Deny",
"Principal": "*",
"Action": "s3:*",
"Resource": [
"${aws_s3_bucket.test_endpoint.arn}/*"
@keithrozario
keithrozario / link to models
Created January 2, 2020 14:33
link to model
@keithrozario
keithrozario / links
Last active November 18, 2019 23:58
models
@keithrozario
keithrozario / 512MB.txt
Last active October 3, 2019 14:40
procinfo of a lambda function
processor : 0
vendor_id : GenuineIntel
cpu family : 6
model : 62
model name : Intel(R) Xeon(R) Processor @ 2.50GHz
stepping : 4
microcode : 0x1
cpu MHz : 2500.010
cache size : 33792 KB
physical id : 0