Monday, June 3, 2019

Python Tutorial For Beginners : Section -1


Python Tutorial For Beginners: Section-1 Number ( Integer, Float, Complex, Boolean )



#Python Numbers variable
a=12

#print Variable as define format here define is an integer
print (a)
#output would be
#12

#print Variable as integer convert from define format he a=12 is integer hence will
print (int(a))
#output would be
#12

#print variable as float value from integer as denine
print (float(a))
#output would be
#12.0


#print variable as complex value from integer as denine
#https://docs.python.org/2/library/functions.html#complex

print (complex(a))
#output would be
#(12+0j)


#for float value change to inter will work like as below
b=12.12
print (int(b))
#output would be the integer value as
#12



# How do we find the variable type from definirion of variable
a=12
print (type(a))
#ouput would be
#<class 'int'>


a=12.1
print (type(a))
#ouput would be
#<class 'float'>

a=1+2J
print (type(a))
#ouput would be
#<class 'complex'>


a=True
print (type(a))
#ouput would be
#<class 'bool'>

Thursday, May 30, 2019

Python paramiko.SSHClient() Examples

Python paramiko Example


### RUN INSTRUCTION###PYTHON PROGRAMNAME.PY <HOST_IP> <HOST_PASSWORD> <LINUX_COMMAND>


######################################################################3
import sys, paramiko

if len(sys.argv) < 4:
    print ("args missing")
    sys.exit(1)
hostname = sys.argv[1]
password = sys.argv[2]
command = sys.argv[3]

username = "root"
port = 22

try:
    client = paramiko.SSHClient()
    client.load_system_host_keys()

    client.set_missing_host_key_policy(paramiko.AutoAddPolicy())
  #  client.set_missing_host_key_policy(paramiko.WarningPolicy())
    client.connect(hostname, port=port, username=username, password=password)
    stdin, stdout, stderr = client.exec_command(command)
    print (stdout.read())
finally:
    client.close()
##########################################################

paramiko does not automatically add unknown hosts #11 (Solved)


paramiko SSH connects Error. (Resolved)



usr/lib/python2.7/site-packages/paramiko/client.py:580: UserWarning: Unknown ssh-rsa host key for 10.20.240.13: 98deaed43de39a61905a6ff514d0d2f8
  (key.get_name(), hostname, hexlify(key.get_fingerprint())))

Thursday, May 23, 2019

Terraform Tutorial Video Library

Terraform Tutorial

Terraform is an open-source infrastructure as code software tool created by HashiCorp. It enables users to define and provision a data center infrastructure

Terraform is a tool for building, changing, and versioning infrastructure safely and efficiently. Terraform can manage existing and popular service providers as well as custom in-house solutions. Configuration files describe to Terraform the components needed to run a single application or your entire datacenter.





Get Video Library, click below

Tuesday, May 14, 2019

AWS Solution Architect Examination Preparation Video Library

AWS Solution Architect Examination
Preparation Video Library

The AWS Certified Solutions Architect - Associate examination is intended for individuals who perform a solutions architect role. This exam validates an examinee's ability to effectively demonstrate knowledge of how to architect and deploy secure and robust applications on AWS technologies.

Click Here for Detail video Library

Saturday, April 27, 2019

Install PowerShell and VMware PowerCLI on macOS



Install PowerShell and VMware PowerCLI on macOS

Install Powershell on Mac
brew cask install powershell

Now, to launch a PowerShell session in macOS, enter the following in terminal.
pwsh

Set Repository for Find Vmware module
Set-PSRepository -Name "PSGallery" -InstallationPolicy "Trusted"

Find Vmware module
Find-Module "VMware.PowerCLI" | Install-Module -Scope "CurrentUser" -AllowClobber

Install Vmware PowerCLI
Get-Module "VMware.PowerCLI" -ListAvailable | FT -Autosize

And if you’d like to see all of the VMware installed modules, run the following.
Get-Module "VMware.*" -ListAvailable | FT -Autosize

As new versions of VMware.PowerCLI is released, you can run the following command to update it.
Update-Module "VMware.PowerCLI"

Let’s test connecting to vCenter server…
Connect-VIServer -Server "<Server_Name>"

To bypass this, enter the following command and then enter “Y” when prompted.  This will set the parameter for the current user.

Set-PowerCLIConfiguration -InvalidCertificateAction "Ignore"

Saturday, March 16, 2019

Aws news update

AWS IoT Greengrass Adds New Connector for AWS IoT Analytics, Support for AWS CloudFormation Templates, and Integration with Fleet Indexin

AWS IoT Greengrass now offers a new connector for AWS IoT Analytics and supports AWS CloudFormation templates. Now, you can quickly set up connections between your IoT Greengrass cores and AWS IoT Analytics for analysis of complex IoT data, and you can streamline IoT Greengrass deployments for one or more accounts using familiar CloudFormation templates.

The new IoT Analytics connector can be installed via either the API or console. You can configure the maximum memory footprint and data retention behavior of the connector, and after deployment the connector will consume data via a defined MQTT topic and transmit them to IoT Analytics immediately or in batches. You can get started with this connector by visiting the AWS IoT Greengrass Developer Guide.

IoT Greengrass resource types (groups, cores, devices, functions, subscriptions, and connectors) are now supported in CloudFormation. Now you can write CloudFormation templates that automate setup and configuration for your IoT Greengrass deployments. Getting started is easy - you can build a new template from scratch in CloudFormation or start from an example template available via the IoT Greengrass documentation.

IoT Greengrass devices are now fully integrated with AWS IoT Fleet Indexing, an IoT Device Management service that enables customers to index and search for their devices based on device attributes or state in the cloud. IoT Greengrass devices establish at least one connection where the ClientID is the same as the device's Thing Name, so customers can use device connectivity indexing to quickly discover which IoT Greengrass devices are currently connected or disconnected to AWS IoT.

These features are available to all customers in all regions where IoT Greengrass is available. For more information about IoT Greengrass, visit https://aws.amazon.com/greengrass/.

Top ChatGPT Prompts for DevOps Engineers

  As a DevOps engineer, your role involves juggling complex tasks such as automation, infrastructure management, CI/CD pipelines, and troubl...