Categories
Bash Java

Public and private PGP keys with Java BouncyCastle, in PEM format

We explain how to generate public and private PGP keys, in Java, using the BouncyCastle library. Then, we store the keys in PEM base64 files, and add the keys to our GPG keyring. Finally, we test the keys by encrypting and decrypting a text file using the Linux gpg command line interface (CLI). 1) BouncyCastle […]

Categories
AWS Bash Linux SQL

Connect MySQL client with private AWS RDS database, from EC2 instance

How to use the MySQL client command line interface with a private AWS RDS MySQL database. Let’s suppose we already have an EC2 instance, with an app that communicates with the database. For instance, the EC2 instance could be part of an Elastic Beanstalk environment (please see here how to setup a private AWS RDS […]

Categories
AWS Bash Linux

SSH to AWS EC2 instance in 2 minutes

How to SSH to an AWS EC2 instance in 2 minutes. We automate most of the process using a bash script, jq and the AWS CLI. 1) Open SSH traffic to the EC2 instance Log into the AWS console and go to the EC2 instances section. Then click on blue Instance ID link of the […]

Categories
AWS Bash

Deploy a docker image from AWS ECR registry to Elastic Beanstalk in 2 minutes

In this tutorial, we will see how to deploy a docker image that is stored in AWS ECR registry to AWS Elastic Beanstalk. We will use automated scripts using the AWS CLI. 0) Prerequisites You need AWS CLI installed on your machine. Follow this tutorial to do it in 30 seconds. Also you need a […]

Categories
AWS Bash

Install the latest AWS CLI v2 on Ubuntu, in 2 minutes

To install the latest version of AWS CLI v2 on your Ubuntu machine, open a terminal and run: cd ~/Downloads curl “https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip” -o “awscliv2.zip” unzip awscliv2.zip sudo ./aws/install To check that everything went well, run: $ aws –version aws-cli/2.2.42 Python/3.8.8 Linux/5.4.0-87-generic exe/x86_64.ubuntu.18 prompt/off We can see that the aws-cli version 2.2.42 is now installed ! […]