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
server { | |
listen 80; | |
location / | |
{ | |
root /usr/share/nginx/html; | |
index index.html index.htm; | |
try_files $uri $uri/ /index.html =404; | |
} | |
} |
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
import boto3 | |
from botocore.exceptions import ClientError | |
session = boto3.Session(profile_name='tsample', region_name='ap-southeast-2') | |
client = session.client('s3') | |
try: | |
all_buckets = client.list_buckets() | |
policy_status = client.put_bucket_lifecycle_configuration( | |
Bucket='sample-compute-optimizer', | |
LifecycleConfiguration={ | |
'Rules': [ |
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
apiVersion: apps/v1 | |
kind: Deployment | |
metadata: | |
name: my-deployment-50001 | |
spec: | |
selector: | |
matchLabels: | |
app: products | |
department: sales | |
replicas: 3 |
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
import boto3 | |
import json | |
import requests | |
from requests_aws4auth import AWS4Auth | |
#Get Temporary Credentials | |
credentials = boto3.Session().get_credentials() | |
service = 'es' | |
region = 'ap-southeast-2' |
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
apt-get update | |
apt-get install telnet -y | |
apt-get install curl -y | |
apt-get install net-tools -y | |
apt-get install procps -y |
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
import jenkins | |
import time | |
# It comes with pip module python-jenkins | |
# use pip to install python-jenkins | |
# Jenkins Authentication URL | |
JENKINS_URL = "https://xxxx" | |
JENKINS_USERNAME = "xxxxx" | |
JENKINS_PASSWORD = "xxxxxxx" |
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
declare -a regions=("eu-north-1" "ap-south-1" "eu-west-3" "eu-west-2" "eu-west-1" "ap-northeast-2" "ap-northeast-1" "sa-east-1" "ca-central-1" "ap-southeast-1" "ap-southeast-2" "eu-central-1" "us-east-1" "us-east-2" "us-west-1" "us-west-2") | |
for region in "${regions[@]}" | |
do | |
echo "+++++++++++++++++++++++++++++" | |
echo "Checking for Region: $region" | |
echo "-----------------------------" | |
echo "Exposed EBS Snapshots" | |
aws ec2 --region $region describe-snapshots --owner-id self --restorable-by-user-ids all --no-paginate --output table | |
echo "Exposed RDS Snapshots" | |
aws rds --region $region describe-db-snapshots --snapshot-type public --no-paginate --output table |
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
sudo apt-get update | |
sudo locale-gen | |
wget -q -O - https://pkg.jenkins.io/debian/jenkins.io.key | sudo apt-key add - | |
sudo sh -c 'echo deb https://pkg.jenkins.io/debian-stable binary/ > /etc/apt/sources.list.d/jenkins.list' | |
sudo apt-get update | |
sudo apt-get install default-jdk | |
sudo apt policy jenkins | |
echo "export LC_ALL=en_US.UTF-8" >> ~/.bashrc | |
echo "export LANG=en_US.UTF-8" >> ~/.bashrc | |
source ~/.bashrc |
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
openssl req -new -newkey rsa:2048 -nodes -out magento-2_3_1_suresh_com.csr -keyout magento-2_3_1_suresh_com.key -subj "/C=IN/ST=Delaware/L=Noida/O=TTN/OU=Admin/CN=magento-2.3.1.suresh.com" | |
openssl x509 -req -days 365 -in magento-2_3_1_suresh_com.csr -signkey magento-2_3_1_suresh_com.key -out magento-2_3_1_suresh_com.crt |
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
#!/bin/bash | |
yum update | |
#Install repo adder | |
yum install -y yum-utils device-mapper-persistent-data lvm2 | |
yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo | |
yum update && yum install docker-ce-18.06.2.ce | |
mkdir -p /etc/docker | |
cat > /etc/docker/daemon.json <<EOF | |
{ | |
"exec-opts": ["native.cgroupdriver=systemd"], |
NewerOlder