- Log in to console for
root
account as your IAM user[email protected]
- Go to https://console.aws.amazon.com/iam/home
- Add an MFA device to your user
- Generate an access key and store it securely to be added to aws-vault
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
#!/usr/bin/env bash | |
## | |
# Usage: tf_move_state.sh source_directory target_directory source_resource_name <target_resource_name (uses source_resource_name if not provided)> | |
# Provide source and target directories using relative paths. | |
# WARNING: TEST ON AN INCONSPICUOUS AREA AS STAINING MAY OCCUR | |
# Credit to https://github.com/mcalhoun | |
set -e |
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
// WARNING: Don’t mess with gitlab-rails runner unless you REALLY know what you are doing. | |
// It gives root-level access to EVERYTHING at the database level. | |
// Idempotently create a Personal Access Token for a user in GitLab running in Kubernetes | |
// USE AT YOUR OWN RISK | |
resource "null_resource" "set_gitlab_personal_access_token" { | |
triggers = { | |
uuid = uuid() | |
} | |
provisioner "local-exec" { |
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
{ | |
"git.autofetch": true, | |
"git.confirmSync": false, | |
"terminal.integrated.shell.windows": "C:\\Program Files\\PowerShell\\7\\pwsh.exe", | |
"vs-kubernetes": { | |
"vs-kubernetes.helm-path": "/home/pants/.vs-kubernetes/tools/helm/linux-amd64/helm", | |
"vs-kubernetes.minikube-path": "/home/pants/.vs-kubernetes/tools/minikube/linux-amd64/minikube", | |
"vs-kubernetes.draft-path": "/home/pants/.vs-kubernetes/tools/draft/linux-amd64/draft", | |
"vs-kubernetes.draft-path.linux": "/home/tony/.vs-kubernetes/tools/draft/linux-amd64/draft", |
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
# Set AWS credentials and S3 paramters | |
AWS_KEY="" | |
AWS_SECRET="" | |
S3_BUCKET="" | |
S3_BUCKET_PATH="/" | |
S3_ACL="x-amz-acl:private" | |
function s3Upload | |
{ | |
path=$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
def colorize(text, color_code) | |
"\e[#{color_code}m#{text}\e[0m" | |
end | |
def red(text); colorize(text, 31); end | |
def green(text); colorize(text, 32); end | |
# Actual example | |
#puts 'Importing categories [ ' + green('DONE') + ' ]' | |
#puts 'Importing tags [' + red('FAILED') + ']' |
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 translateError(msg) { | |
var newErr = new Error(msg); // placed here to get correct stack | |
return e => { | |
newErr.originalError = e; | |
throw newErr; | |
} | |
} | |
async function asyncTask() { | |
const user = await UserModel.findById(1).catch(translateError('No user found')) |
Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...
// see: https://github.com/chadoe/docker-cleanup-volumes
$ docker volume rm $(docker volume ls -qf dangling=true)
$ docker volume ls -qf dangling=true | xargs -r docker volume rm
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-keygen -t rsa -b 4096 -m PEM -f jwtRS256.key | |
# Don't add passphrase | |
openssl rsa -in jwtRS256.key -pubout -outform PEM -out jwtRS256.key.pub | |
cat jwtRS256.key | |
cat jwtRS256.key.pub |
NewerOlder