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
| [cmdletbinding()] | |
| param( | |
| [Parameter(mandatory=$true)] | |
| [string] $StorageAccountId, | |
| [Parameter(mandatory=$true)] | |
| [string] $LogAnalyticsWorkspaceId, | |
| [Parameter(mandatory=$true)] | |
| [string] $ResourceGroupName |
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
| [cmdletbinding()] | |
| param( | |
| $filePath, | |
| $ResourceGroup, | |
| $NSGName | |
| ) | |
| function New-NSGRule { | |
| [cmdletbinding()] | |
| param( |
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
| <# | |
| .SYNOPSIS | |
| A brief description of the function or script. This keyword can be used only once in each topic. | |
| .DESCRIPTION | |
| A detailed description of the function or script. This keyword can be used only once in each topic. | |
| .PARAMETER | |
| The description of a parameter. Add a ".PARAMETER" keyword for each parameter in the function or script syntax. |
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
| #! python3 | |
| import boto3 | |
| def make_tags_dict(b3_client, lb_arn): | |
| lb = b3_client.describe_tags(ResourceArns=[lb_arn]).get('TagDescriptions')[0] | |
| tags = {x['Key']: x['Value'] for x in lb.get('Tags', [])} | |
| if not tags: |
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
| BUCKET = 'your-bucket-here' | |
| import boto3 | |
| s3 = boto3.resource('s3') | |
| bucket = s3.Bucket(BUCKET) | |
| bucket.object_versions.delete() |
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
| cd \\cifspath\users | |
| Get-Childitem \\cifspath\users\ | % { | |
| $current_folder = $_.BaseName | |
| # Remove inheritance | |
| $acl = Get-Acl $_ | |
| $acl.Access | % { | |
| $FileSystemRights = $_.FileSystemRights | |
| $IdentityReference = $_.IdentityReference |
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
| data "aws_vpc" "vpc_name" { | |
| filter { | |
| name = "tag:Name" | |
| values = ["${var.vpc_level}-VPC"] | |
| } | |
| } | |
| data "aws_subnet_ids" "selected" { | |
| vpc_id = "${data.aws_vpc.vpc_name.id}" |
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
| #! python3 | |
| from urllib.parse import quote_plus | |
| def create_aws_relay_state(idp, target): | |
| ''' | |
| Provided an identity provider url as a string and a target url as string, | |
| we will create an ADFS relay state. I don't know why we need to run the | |
| quote_plus funciton twice, other than we need to re-encode all of the % |
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 | |
| # List all VPCs, their names, and their CIDR blocks. If no name tag is specified, output "None" | |
| aws ec2 describe-vpcs --query 'Vpcs[].[VpcId,CidrBlock,Tags[?Key==`Name`].Value[]]' --output text | sed 's/None$/None\n/' | sed '$!N;s/\n/ /' | |
| # Output all route tables for a specific VPC with the following format: | |
| # | |
| # table id | |
| # table name tag value | |
| # route list |
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 | |
| echo "apGroup,apMacAddr,browser,bssid,chWidth,class,controllerIp,createdAt,dnsHostname,essid,ipAddress,is5ghzCapable,isActive,isDfsCapable,isOnDualBandAp,isWireless,lastUpdated,macAddress,model,network,os,osAndVersion,osVersion,protocol,radioChannel,radioNumber,radioTechType,rfBand,source,userAgent,userName,uuid" > /vagrant/Code/tmp/output.csv | |
| for f in *; do | |
| cat $f | | |
| jq '.data.deviceList.clients[] | [.apGroup, .apMacAddr, .browser, .bssid, .chWidth, .class, .controllerIp, .createdAt, .dnsHostname, .essid, .ipAddress, (.is5ghzCapable | tostring), (.isActive | tostring), (.isDfsCapable | tostring), (.isOnDualBandAp | tostring), (.isWireless | tostring), .lastUpdated, .macAddress, .model, .network, .os, .osAndVersion, .osVersion, .protocol, .radioChannel, .radioNumber, .radioTechType, .rfBand, .source, .userAgent, .userName, .uuid ] | join(",")' | | |
| sed -e s/\"//g >> /vagrant/Code/tmp/output.csv | |
| done |
NewerOlder