document.cookie.match(/noflush_awscnm\s*\=\s*([^;]*)(;|$)/)[1]
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
| const fs = require('fs') | |
| exports.handler = (event, context, callback) => { | |
| module.paths.concat('/var/runtime/node_modules') | |
| .forEach((path) => { | |
| if (!fs.existsSync(path)) | |
| return; | |
| const d = fs.readdirSync(path); | |
| console.log(path, d); |
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
| # Delete buckets tagged with a key | |
| for bucket in `aws --profile mojintegration s3api list-buckets --query "Buckets[].Name" --output text` ; doecho -n "Bucket: [${bucket}]: " ; [ "$(aws --profile mojintegration s3api get-bucket-tagging --bucket "${bucket}" --query 'TagSet[?Key==`pm` && Value==`works`].Key' --output text 2>/dev/null)" == "pm" ] && echo -e "\033[31mdelete\033[0m" || echo -e "\033[32mkeep\033[0m" ; done | |
| # Delte old logstreams from a logGroup | |
| LOG_GROUP=a | |
| for streamName in $(aws --profile mojintegration logs describe-log-streams --log-group-name "${LOG_GROUP}" --query 'logStreams[?lastIngestionTime <= `1502092833000`].logStreamName' --output text) ; do aws --profile mojintegration logs delete-log-stream --log-group-name "${LOG_GROUP}" --log-stream-name "${streamName}" ; done | |
| # Delte log grouos which name starts with <LOG_GROUP> | |
| for logGroup in $(aws --profile mojintegrations logs describe-log-groups --query "logGroups[?starts_with(logGroupName, \`${LOG_GROUP}\`)].logGroupName" --output text) ; d |
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
| R_GROUP=a | |
| # Delete all VMs in a group | |
| az vm list --resource-group "${R_GROUP}" | jq '.[] .id' | xargs az vm delete --yes --ids |
I hereby claim:
- I am pmarques on github.
- I am pmarques (https://keybase.io/pmarques) on keybase.
- I have a public key whose fingerprint is FFC5 303F 47F1 89C8 515A D807 D67D B7CB 1472 CB5B
To claim this, I am signing this object:
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
| # How to install, tested in Windows Server R2012 | |
| # Write the functions in file %HOMEPATH\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1 | |
| # | |
| function checkPort { | |
| New-Object System.Net.Sockets.TcpClient($args[0], $args[1]) | |
| } | |
| # Test it | |
| # C:\> checkPort "127.0.0.1" 80 |
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
| --- | |
| Resources: | |
| SecurityGroup: | |
| Type: AWS::EC2::SecurityGroup | |
| Properties: | |
| GroupDescription: Allow http to client host | |
| VpcId: "vpc-1" | |
| SecurityGroupIngress: | |
| - IpProtocol: tcp |
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
| const Octokit = require('@octokit/rest') | |
| const octokit = new Octokit({ | |
| auth: "<my github access token", | |
| userAgent: "pmarques 1.0" // tried with and without | |
| }) | |
| octokit.repos.getContents({ | |
| "owner": "ansible", | |
| "repo": "ansible", | |
| "path": "README.rst", | |
| "ref": "devel" |
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 | |
| Parameters: | |
| ResourceName: | |
| Type: String | |
| MinLength: 1 | |
| Resources: | |
| DummyResource: | |
| Type: AWS::CloudWatch::Dashboard |
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
| --- | |
| Description: > | |
| Create a simple encrypted S3 bucket | |
| Parameters: | |
| BucketName: | |
| Type: String | |
| Default: pmarques1234567890-x-account-replication | |
| SourceAccount: | |
| Type: String | |
| Resources: |