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 | |
# | |
# Generates client and server certificates used to enable HTTPS | |
# remote authentication to a Docker daemon. | |
# | |
# See http://docs.docker.com/articles/https/ | |
# | |
# To start the Docker Daemon: | |
# | |
# sudo docker -d \ |
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
#jenkins_user=Admin/admin | |
#Password=cloud | |
sudo add-apt-repository -y ppa:openjdk-r/ppa | |
sudo apt-get update | |
sudo apt-get install -y apt-transport-https ca-certificates openjdk-8-jdk unzip | |
sudo apt-key adv --keyserver hkp://ha.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D | |
echo "deb https://apt.dockerproject.org/repo ubuntu-xenial main" | sudo tee /etc/apt/sources.list.d/docker.list | |
sudo apt-get update | |
sudo apt-get install -y linux-image-extra-$(uname -r) linux-image-extra-virtual |
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
echo deb http://get.docker.com/ubuntu docker main > /etc/apt/sources.list.d/docker.list | |
apt-key adv --keyserver pgp.mit.edu --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9 | |
apt-get update | |
apt-get install -y lxc-docker-1.3.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
sudo apt-get purge docker-engine | |
sudo apt-get autoremove --purge docker-engine | |
rm -rf /var/lib/docker |
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
Login-AzureRmAccount | |
Select-AzureRmSubscription -SubscriptionName 'my-subscription-name' | |
$rgName = 'my-resource-group-name' | |
$vmName = 'my-vm-name' | |
$vm = Get-AzureRmVM -ResourceGroupName $rgName -Name $vmName | |
Stop-AzureRmVM -ResourceGroupName $rgName -Name $vmName | |
$vm.StorageProfile.OSDisk.DiskSizeGB = 1023 | |
Update-AzureRmVM -ResourceGroupName $rgName -VM $vm | |
Start-AzureRmVM -ResourceGroupName $rgName -Name $vmName |
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
$ami_id = Read-Host 'AMI-ID' | |
$instance_type = Read-Host 'Instance type' | |
$instance_name = Read-Host 'Tags_Name' | |
$count = Read-Host 'Instance count' | |
$region = Read-Host 'Region' | |
$key_pair = Read-Host 'Ker-Pair name' | |
$security_group = Read-Host 'Security-Group name' | |
#$security_group_id = Read-Host 'Security-Group-ID' | |
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
instance_id=$(aws ec2 run-instances --region us-east-1 --key $USER --instance-type t1.micro --image-id ami-d9a98cb0 --output text --query 'Instances[*].InstanceId') | |
echo instance_id=$instance_id | |
while state=$(aws ec2 describe-instances --instance-ids $instance_id --output text --query 'Reservations[*].Instances[*].State.Name'); test "$state" = "pending"; do | |
sleep 1; echo -n '.' | |
done; echo " $state" | |
ip_address=$(aws ec2 describe-instances --instance-ids $instance_id --output text --query 'Reservations[*].Instances[*].PublicIpAddress') | |
echo ip_address=$ip_address | |
aws ec2 get-console-output --instance-id $instance_id --output text | | |
perl -ne 'print if /BEGIN SSH .* FINGERPRINTS/../END SSH .* FINGERPRINTS/' | |
ssh ubuntu@$ip_address |
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
#!/usr/bin/env python | |
# Simple [boto3](https://github.com/boto/boto3) based EC2 manipulation tool | |
# | |
# To start an instance, create a yaml file with the following format: | |
# | |
# region_name: | |
# - subnet-id or subnet_tag_name: | |
# - type: t2.micro | |
# image: image-tagname or AMI-Id |
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 boto | |
import boto.iam #**************Importing the Identity and access management**** | |
import win32com.client as win32 #******Importing windows application module*** | |
import random | |
import string | |
import time | |
#******************for SMTP integration************************** | |
import smtplib | |
from email.mime.multipart import MIMEMultipart |
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 sed -i 's/PermitRootLogin prohibit-password/#PermitRootLogin prohibit-password/g' /etc/ssh/sshd_config | |
sudo sed -i 's/PasswordAuthentication no/#PasswordAuthentication no/g' /etc/ssh/sshd_config | |
sudo sed -i '$ a PermitRootLogin yes' /etc/ssh/sshd_config | |
sudo sed -i '$ a PasswordAuthentication yes' /etc/ssh/sshd_config | |
sudo sed -i '$ a PermitRootLogin without-password' /etc/ssh/sshd_config | |
echo PASSWORD | sudu passwd | |
sudo service ssh restart (ubuntu) | |
sudo service sshd restart (rhel) |
OlderNewer