Skip to content

Instantly share code, notes, and snippets.

View rcherara's full-sized avatar
💭
Never stop coding

Cherara Reddah rcherara

💭
Never stop coding
View GitHub Profile
@rcherara
rcherara / Test Kitchen.MD
Last active December 21, 2018 05:05
Test Kitchen is an integration tool for developing and testing infrastructure code and software on isolated target platforms.

Introduction

How do I run Kitchen? There are five basic commands to provision platforms and test infrastructure code.

$ kitchen create

$ kitchen converge

$ kitchen setup
@rcherara
rcherara / Dockerfile
Last active December 12, 2018 08:04
Build container with deployment on Kubernetes
FROM jeanblanchard/java:8
LABEL environement="dev" service="book" owner="rcherara"
LABEL Description="This image is used to start the rest-example executable" Vendor="API Books" Version="1.0"
MAINTAINER rcherara
WORKDIR /opt/rest-example/
COPY target/rest-example-0.1.0.jar rest-example-0.1.0.jar
CMD java -jar rest-example-0.1.0.jar
EXPOSE 7680
@rcherara
rcherara / install-aws-codedeploy-agent.sh
Created December 10, 2018 06:10
Install aws-codedeploy-agent on Ubuntu Bionic
# Install aws-codedeploy-agent and required gems
sudo apt-get install -y git
codedeploy_git_url='https://github.com/aws/aws-codedeploy-agent.git'
git clone "$codedeploy_git_url"
sudo gem install bundler
sudo mv aws-codedeploy-agent /opt/codedeploy-agent
cd /opt/codedeploy-agent
bundle install --system
# Setup permissions
@rcherara
rcherara / aws-cli-s3.md
Last active December 10, 2018 06:20
Copy file to s3 with AWS command line interface

AWS cli Configuration

$ aws configure AWS Access Key ID [None]: YOURKEY

AWS Secret Access Key [None]: YOURSECRETKEY

Default region name [None]: us-west-2

Default output format [None]: json

@rcherara
rcherara / ec2-info.sh
Last active December 10, 2018 05:02
Show Id and region of AWS EC2 instance
#!/bin/bash
instanceId=$(curl http://169.254.169.254/latest/meta-data/instance-id)
region=$(curl http://169.254.169.254/latest/dynamic/instance-identity/document | grep region | awk -F\" '{print $4}')
clear
echo " The Id of this EC2 Instance is : $instanceId"
echo " The Region of this EC2 Instance is : $region"