Skip to content

Instantly share code, notes, and snippets.

View charlieoleary's full-sized avatar

Charlie O'Leary charlieoleary

View GitHub Profile
const AWS = require('aws-sdk');
const client = new AWS.SecretsManager({});
// Call the AWS API and return a Promise
function getAwsSecret(secretName) {
return client.getSecretValue({ SecretId: secretName }).promise();
}
// Create a async function to use the Promise
@jalaziz
jalaziz / 70-ec2-nvme-devices.rules
Last active March 21, 2024 06:05
AWS EBS NVMe udev rules
# Copyright (C) 2006-2016 Amazon.com, Inc. or its affiliates.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License").
# You may not use this file except in compliance with the License.
# A copy of the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file accompanying this file. This file is
@ixti
ixti / show-indexes.js
Last active May 4, 2021 08:37
Small script that extracts all non-default indexes from MongoDB
rs.slaveOk();
db.getCollectionNames().forEach(function(coll) {
db[coll].getIndexes().forEach(function(index) {
if ("_id_" !== index.name) {
print("db." + coll + ".ensureIndex(" + tojson(index.key) + ")");
}
});
});