This file contains 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
DROP TABLE IF EXISTS datagrip_bug; | |
CREATE TABLE datagrip_bug | |
( | |
id UUID PRIMARY KEY, | |
name TEXT NOT NULL, | |
created_at TIMESTAMPTZ | |
); | |
INSERT INTO datagrip_bug (id, name) |
This file contains 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
# https://aws.amazon.com/premiumsupport/knowledge-center/troubleshoot-iam-permission-errors/ | |
( echo "Time,Identity ARN,Event ID,Service,Action,Error,Message"; | |
aws cloudtrail lookup-events --start-time "2020-01-01T00:00:00Z" --end-time "2020-01-01T23:59:59Z" --query "Events[*].CloudTrailEvent" --output text \ | |
| jq -r ". | select(.userIdentity.arn == \"your-arn\" and .eventType == \"AwsApiCall\" and .errorCode != null | |
and (.errorCode | ascii_downcase | (contains(\"accessdenied\") or contains(\"unauthorized\")))) | |
| [.eventTime, .userIdentity.arn, .eventID, .eventSource, .eventName, .errorCode, .errorMessage] | @csv" | |
) | column -t -s'",' |
This file contains 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
// https://aws.amazon.com/about-aws/global-infrastructure/regional-product-services/ | |
(() => { | |
const servicesAvailableOnRegion = (region) => Array.from(document.querySelectorAll(`[data-region="${region}"] [data-plc-offer-id]`)).map(node => node.querySelector('a').innerText); | |
const regions = Array.from(document.querySelectorAll('[data-region]')).map(node => node.getAttribute('data-region')); | |
const spr = regions.reduce((acc, region) => ({...acc, [region]: servicesAvailableOnRegion(region)}), {}); | |
console.log(spr['us-east-1'].filter(service => !spr['us-east-2'].includes(service))); | |
})(); |
This file contains 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
document.querySelectorAll('.file-info > button:first-child[aria-expanded="true"]').forEach(node => node.click()); |
This file contains 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 _ = require('lodash'); | |
const devHistory = require('../event_history_dev.json'); | |
const prodHistory = require('../event_history_prod.json'); | |
(async () => { | |
const events = [...devHistory.Records, ...prodHistory.Records]; | |
const policiesByService = {}; | |
for (const event of events) { |
This file contains 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
brew unlink yarn | |
brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/aacaa70e8931b2b005cb8f70703b48604f4a8d2a/Formula/yarn.rb | |
brew switch yarn 1.19.1 |
This file contains 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
ssh -L 9200:url.com:443 -i ~/bastion.pem ec2-user@ip |
This file contains 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 { Lambda } from 'aws-sdk'; | |
const lambda = new Lambda({ region: 'us-east-1' }); | |
async function run() { | |
const { Layers: layers } = await lambda.listLayers().promise(); | |
if (!layers) { | |
console.log('No layers to delete.'); |
This file contains 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
brew unlink yarn | |
brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/aacaa70e8931b2b005cb8f70703b48604f4a8d2a/Formula/yarn.rb | |
brew switch yarn 1.19.1 |
This file contains 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
function queriesInFlight() { | |
// client is your ApolloClient instance | |
const { queryManager } = client; | |
return Object.keys(queryManager.queryStore.getStore()).filter(queryId => | |
queryManager.checkInFlight(queryId), | |
); | |
} |
NewerOlder