ssh-keygen -f ~/.ssh/id_rsa.pub -e -m PKCS8 > ~/.ssh/id_rsa.pem
echo "sometext" | openssl rsautl -encrypt -pubin -inkey ~/.ssh/id_rsa.pem > ~/encrypted-file.txt
#!/usr/bin/env bash | |
get_task_definition_arns() { | |
aws ecs list-task-definitions --region ${AWS_REGION} \ | |
| jq -M -r '.taskDefinitionArns | .[]' | |
} | |
delete_task_definition() { | |
local arn=$1 |
#!/usr/bin/env python3 | |
# | |
# Script to replace EC2 instances in an ECS cluster's auto-scaling group after | |
# changing the AMI or instance type in the launch configuration. It | |
# checks for instances with the incorrect AMI or type, scales up the | |
# auto-scaling group with replacement instances, then drains the tasks | |
# from the old instances. | |
# | |
# Usage: aws-vault exec profile-name -- python3 replace_ecs_cluster_instances.py --group=asg-name --cluster=ecs-cluster-name --count=3 | |
# |
{ | |
"Version": "2012-10-17", | |
"Statement": [ | |
{ | |
"Effect": "Allow", | |
"Action": [ | |
"ssm:DescribeSessions", | |
"ssm:GetConnectionStatus", | |
"ssm:DescribeInstanceProperties", | |
"ec2:DescribeInstances", |
$ git checkout --orphan NEWBRANCH
$ git rm -rf .
--orphan
creates a new branch, but it starts without any commit. After running the above command you are on a new branch "NEWBRANCH", and the first commit you create from this state will start a new history without any ancestry.
You can then start adding files and commit them and they will live in their own branch. If you take a look at the log, you will see that it is isolated from the original log.
sudo add-apt-repository ppa:ts.sch.gr/ppa | |
sudo apt-get update | |
sudo apt-get install oracle-java8-installer |
Install all dependency modules local to the function project
pip install boto3 -t ./
Add permissions (Linux and macOS only)
chmod -R 755 .
Manually build a deployment package
vi /etc/hosts | |
vi /etc/hostname | |
hostnamectl set-hostname stage-vpn-server | |
hostname | |
-------- | |
OPTIONAL | |
-------- | |
service hostname start | |
systemctl restart systemd-logind.service |
let’s list block devices attached to our box: | |
lsblk | |
# install "cloud-guest-utils" if it is not installed already | |
apt install cloud-guest-utils | |
# resize partition | |
growpart /dev/xvda 1 OR growpart /dev/nvme0n1 1 | |
# resize filesystem |