- How the browser renders the document
- Receives the data (bytes) from the server.
- Parses and converts into tokens (<, TagName, Attribute, AttributeValue, >).
- Turns tokens into nodes.
- Turns nodes into the
DOM
tree.
- Builds
CSSOM
tree from thecss rules
.
This file contains hidden or 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
'Update or create a stack given a name and template + params' | |
from __future__ import division, print_function, unicode_literals | |
from datetime import datetime | |
import logging | |
import json | |
import sys | |
import boto3 | |
import botocore |
This file contains hidden or 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 boto3 #Calling Boto3 library | |
ec2 = boto3.resource('ec2', region_name='us-west-2') | |
sgs = ec2.security_groups.all() # Fetching all security groups in AWS account | |
all_sgs = set([sg.group_name for sg in sgs]) # Creating a list of only security group names | |
instances = ec2.instances.all() # Getting all instances in AWS account |
This file contains hidden or 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
#!/usr/bin/env bash -eux | |
function usage(){ | |
cat<<USAGE | |
NAME | |
add_ip_to_ipset - Add a single IP to a WAF IP Set | |
SYNOPSIS | |
add_ip_to_ipset IP IP_SET_NAME |
This file contains hidden or 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
#!/bin/bash | |
ACLS=$(aws waf list-web-acls | jq -r ".WebACLs[] | .WebACLId") | |
for acl in $ACLS; do | |
TOKEN=$(aws waf get-change-token | jq -r .ChangeToken) | |
RULE=$(aws waf get-web-acl --web-acl-id $acl | jq ".WebACL.Rules[0]") | |
aws waf update-web-acl --cli-input-json '{"WebACLId": "'$acl'", "ChangeToken": "'$TOKEN'", "Updates": [{"Action": "DELETE", "ActivatedRule": '"$RULE"'}]}' |
This file contains hidden or 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 boto3 | |
import sys | |
import fileinput | |
client = boto3.client('waf') | |
app_name = sys.argv[1] | |
acl_action = sys.argv[2] | |
rule_action = sys.argv[3] | |
ip_set = '' |
This file contains hidden or 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
#! /usr/bin/python | |
""" | |
This simple script makes it easy to create server certificates | |
that are signed by your own Certificate Authority. | |
Mostly, this script just automates the workflow explained | |
in http://www.tc.umn.edu/~brams006/selfsign.html. | |
Before using this script, you'll need to create a private |
This file contains hidden or 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
#!/usr/bin/python | |
from OpenSSL import crypto | |
import os | |
import sys | |
import datetime | |
import whois | |
#Variables | |
TYPE_RSA = crypto.TYPE_RSA | |
TYPE_DSA = crypto.TYPE_DSA |
This file contains hidden or 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
event_name="ConsoleLogin" | |
aws cloudtrail lookup-events --lookup-attributes \ | |
AttributeKey=EventName,AttributeValue=$event_name --query \ | |
'Events[*].{Ev:CloudTrailEvent,User:Username}' | | |
jq '.[]| "Username: " + .User, " " + (.Ev| fromjson | "EventTime: " + .eventTime, "SourceIP: " + .sourceIPAddress) ' | |
for event_name in AuthorizeSecurityGroupEgress AuthorizeSecurityGroupIngress CreatePolicy \ | |
CreateSecurityGroup DeleteTrail ModifyVpcAttribute PutUserPolicy PutRolePolicy \ | |
RevokeSecurityGroupEgress RevokeSecurityGroupIngress UpdateTrail; do |
This file contains hidden or 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
''' | |
@author Bommarito Consulting, LLC | |
@date 20120622 | |
Identify and, if requested, remove orphaned snapshots from an EC2 account. | |
''' | |
# Imports | |
import boto |