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-Module AWSPowerShell.NetCore | |
| $fileOrHost = Read-Host "Read from terminal[1] or file[2] (1 or 2)?" | |
| if ("1", "2" -notcontains $fileOrHost ) { | |
| $fileOrHost = "1" | |
| } | |
| $text = "" | |
| if ($fileOrHost -eq "1") { | |
| $text = Read-Host "Enter text to be redacted." |
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": "1,2018-03-01 00:01:34,2018-03-01 00:01:43,1,.00,1,N,145,145,2,2.5,0.5,0.5,0,0,0.3,3.8" | |
| } |
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
| module.exports.handler = async (event) => { | |
| console.log(JSON.stringify(event, 2)); | |
| return "Echoing your message: " + event.echo; | |
| }; |
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
| module.exports.handler = async (event) => { | |
| console.log(JSON.stringify(event, 2)); | |
| return { | |
| statusCode: 200, | |
| body: "Echoing your message: " + event.echo | |
| } | |
| }; |
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
| AWSTemplateFormatVersion: "2010-09-09" | |
| Transform: AWS::Serverless-2016-10-31 | |
| Description: Local Library Lambda Layer | |
| Resources: | |
| PetuniaDep: | |
| Type: AWS::Serverless::LayerVersion | |
| Properties: | |
| LayerName: petunia-lib | |
| Description: A bundled local library |
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-Module AWSLambdaPSCore | |
| Import-Module AWSPowerShell.NetCore | |
| $region = 'eu-west-2' | |
| New-AWSPowerShellLambdaPackage -ScriptPath ./rek/DetectLabels.ps1 -OutputPackage DetectLabels.zip | |
| Write-S3Object -BucketName amsxbg-dotnet-eu -File ./DetectLabels.zip | |
| New-CFNStack -StackName DetectLabelsPS -Capabilities @("CAPABILITY_IAM","CAPABILITY_AUTO_EXPAND") -TemplateBody $(Get-Content ./serverless.template.json | Out-String) -Region $region | |
| Wait-CFNStack -StackName DetectLabelPS | |
| Get-CFNStack -StackName DetectLabelsPS -Region $region | Select-Object -ExpandProperty Outputs | Select-Object -Property @{Name='BucketName'; Expression={$_.OutputValue}} | Write-S3Object -File /Users/amsg/Documents/laser.jpg | |
| Get-CFNStack -StackName DetectLabelsPS -Region $region | Select-Object -ExpandProperty Outputs | Select-Object -Property @{Name='BucketName'; Expression={$_.OutputValue}} | Get-S3ObjectTagSet -Key laser.jpg |
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 | |
| if [ -z "$1" ] | |
| then | |
| read -p "Please enter text: " TEXT | |
| else | |
| TEXT=$1 | |
| fi | |
| if [ -z "$2" ] | |
| then |
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
| AWSTemplateFormatVersion: "2010-09-09" | |
| Transform: AWS::Serverless-2016-10-31 | |
| Description: > | |
| devNull | |
| /dev/null as a Service | |
| Parameters: | |
| KMSAliasName: | |
| Type: String | |
| Default: alias/devnull/share |
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
| aws secretsmanager create-secret --name box_config --secre | |
| t-string $(base64 -i ./boxConfig.json) |
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
| box users list | ConvertFrom-Json | select -ExpandProperty "Entries" | select Name,Login,Id,Space_Used | where {($_.Login -Match "AppUser" -and $_.Space_Used -eq 0)} | select Id,Name,Space_Used | Tee-Object -Variable box_users | select Id | ConvertTo-Json; | |
| $box_users | Format-Table |