Lets take a data frame with multiple columns and rows just like the above table

Now let’s try to get what are vehicles owned by each person in a new data frame. So for that we need basically convert this data frame to a new dataframe. One column will have name and another column will have the vehicle in an array format.

import pandas as pd data_dic = {'Name':['Subhasis', 'Subhasis', 'Keerthan'], 'Vehicle':['Kia','Gixer','Suzuki'] } data_dic df = pd.DataFrame(data_dic) df

We had an issue in AWS ECS cluster while running cloudwatch agent. In recent version of cloudwatch agent a new Iptables rule gets added which prevent the cloudwatch agent to communicate with cloudwatch. To make things working in ECS cluster we have to remove this rule

But Cloudwatch agent starts only after execution of init script in EC2 machine, which follows the exit code. So normal sleep command will not work in the userdata script.

For which we ran below sh file through scheduling a job through “at now” command. put the below command in a sh file.

sudo iptables -S | grep 51678 | sed 's/-A //g' | xargs sudo iptables -D

Keep below command in userdata file.

yum install at -y systemctl start atd at now +3 min < /home/ec2-user/iptable_rule_delete.sh

Originally published at http://theleadcoder.wordpress.com on December 2, 2020.

When We try to create the ECS cluster through the terraform with enabling capacity provider in a new account without any normal cluster created earlier, then we get this error as mentioned below.

Error: error creating capacity provider: ClientException: ECS Service Linked Role does not exist. Please create a Service linked role for ECS and try again.

For Fixing this either we can create a service linked role or create a cluster without capacity provider and delete it after. Both the methods will create a role which will be later used in capacity provider.

resource "aws_iam_service_linked_role" "AWSServiceRoleForECS" { aws_service_name = "ecs.amazonaws.com" }

Originally published at http://theleadcoder.wordpress.com on December 2, 2020.

Origin of Post

We can get to know the PV drivers version for all the Windows instances running in your inventory. For that we first attach the instance to System manager. After that choose below AWS-RunPowerShellScript

Then write below command in the commands box

Get-WmiObject -Class Win32_Product | where Name…

Subhasis Ray

Cloud and Devops Engineer.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store