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
# A bunch of simple functions to expand and use to query the MongoDB Atlas API. | |
export TOKEN="[create your mongodb atlas api token and enter it here]" | |
export GROUPID="[enter groupid or project id]" | |
export API="https://cloud.mongodb.com/api/atlas/v1.0" | |
export USERNAME="[enter user]" | |
# groupid = projectid | |
# https://cloud.mongodb.com/v2/$GROUPID#clusters | |
# ideally python and jq is required. |
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
#!/bin/bash | |
echo "get-current-k8s-quotas.bash " | |
echo "... Outputs daily quotas hard limits and actual usage" | |
echo "... Requires kubectl, jq and access to k8s clusters and kubectl already" | |
echo "..." | |
export DATE=`date '+%Y-%m-%d-%H'` | |
for i in namespace1 namespace2 namespace3 namespace4 | |
do |
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
-- show running queries (pre 9.2) | |
SELECT procpid, age(query_start, clock_timestamp()), usename, current_query | |
FROM pg_stat_activity | |
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%' | |
ORDER BY query_start desc; | |
-- show running queries (9.2) | |
SELECT pid, age(query_start, clock_timestamp()), usename, query | |
FROM pg_stat_activity | |
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%' |