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
function trim_to_one_access_key(){ | |
iam_user=$1 | |
key_count=$(aws iam list-access-keys --user-name "${iam_user}" | jq '.AccessKeyMetadata | length') | |
if [[ $key_count > 1 ]]; then | |
oldest_key_id=$(aws iam list-access-keys --user-name "${iam_user}" | jq -r '.AccessKeyMetadata |= sort_by(.CreateDate) | .AccessKeyMetadata | first | .AccessKeyId') | |
aws iam delete-access-key --user-name "${iam_user}" --access-key-id "${oldest_key_id}" | |
fi | |
} |
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 | |
set -euo pipefail | |
: "${GITHUB_USER:?Need to set GITHUB_USER}" | |
: "${GITHUB_PERSONAL_ACCESS_TOKEN:?Need to set GITHUB_PERSONAL_ACCESS_TOKEN}" | |
CREDS="${GITHUB_USER}:${GITHUB_PERSONAL_ACCESS_TOKEN}" | |
URL=https://api.github.com | |
KEY_NAME=foo |
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
FROM ubuntu:18.04 | |
RUN apt-get update && \ | |
apt-get -y --no-install-recommends install \ | |
asciidoc \ | |
ca-certificates \ | |
curl \ | |
gnupg2 | |
RUN bash -o pipefail -c "curl -L https://deb.nodesource.com/setup_10.x | bash" && \ |
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
#!/bin/bash | |
set -u | |
set -x | |
# Clear previous current_manifest_sha value from state.json | |
sed -in 's/^.*current_manifest_sha.*$/"current_manifest_sha": "",/g' ~/deployments/vbox/state.json | |
bosh create-env ~/workspace/bosh-deployment/bosh.yml \ | |
--state ~/deployments/vbox/state.json \ | |
-o ~/workspace/bosh-deployment/virtualbox/cpi.yml \ |
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 requests | |
class GeoWebCacheService(object): | |
"""Class to communicate with the geowebcache api. | |
Api doco here: http://geowebcache.org/docs/current/rest/seed.html | |
""" | |
_url = None | |
_username = None | |
_password = None |