Skip to content

Instantly share code, notes, and snippets.

@vavasilva
vavasilva / Updating an SSL Certificate in AWS ACM.md
Last active May 10, 2023 13:31
Updating an SSL Certificate in AWS ACM with a multi-layer .pem and .key file

If you have a .pem (Privacy Enhanced Mail) and .key file, you can update an SSL certificate in AWS using the AWS Certificate Manager (ACM). Here are the steps you need to follow:

  1. Access the AWS Console and navigate to AWS Certificate Manager.
  2. Select the region where you want to manage your certificate.
  3. On the ACM page, click 'Provision certificates' and then 'Get started' under 'Import a certificate'.
  4. On the import page, you need to fill in three fields: Certificate body, Certificate private key, and Certificate chain.

If your .pem file includes three distinct parts (usually identified by "BEGIN CERTIFICATE" and "END CERTIFICATE" for each certificate), it contains the server certificate (your own certificate), followed by the intermediate certificate chain.

5. In the 'Certificate body' field, copy and paste only the first block of your .pem file, which corresponds to your server certificate.

@vavasilva
vavasilva / bitbucket_to_github.md
Last active June 12, 2018 13:17
Transfer repo from Bitbucket to Github
git clone --mirror https://bitbucket.org/exampleuser/repository-to-mirror.git
# Make a bare mirrored clone of the repository

cd repository-to-mirror.git
git remote set-url --push origin https://github.com/exampleuser/mirrored
# Set the push location to your mirror

git push --mirror
@vavasilva
vavasilva / latest-tag-git.sh
Last active September 19, 2017 18:30
Latest tag git
#!/bin/bash
latesttag=$(git describe --tags `git rev-list --tags --max-count=1`)
git checkout $latesttag