Remove all files from a directory in Ubuntu

Following command can be used in the terminal to remove all the file and sub directories of a given folder: rm -r /var/www/myfolder/* Above var/www/myfolder/ is the full path for the directory for which the files are to be deleted.More

This IAM user does not have permission to view Log Groups in this account.

Error: This IAM user does not have permission to view Log Groups in this account.User: arn:aws:iam::…..:user/….. is not authorized to perform: logs:DescribeLogGroups on resource: arn:aws:logs:us-east-1……log-group::log-stream: because no identity-based policy allows the logs:DescribeLogGroups action Solution: Create an IAM policy for accessing CloudWatch Logs resources Go to IAM dashboard. Select Users menu from the left hand side menu. Select the…More

Add column if not exists in MySQL

SET @dbname = DATABASE(); SET @tablename = ‘YourTable’; SET @columnname = ‘YourColumn’; SET @columntype = ‘YourType’ — Example: CHAR(16) binary; SET @command = (SELECT IF( ( SELECT COUNT(*) FROM INFORMATION_SCHEMA.COLUMNS WHERE (table_name = @tablename) AND (table_schema = @dbname) AND (column_name = @columnname) ) > 0, “SELECT 1”, CONCAT(“ALTER TABLE “, @tablename, ” ADD “, @columnname,…More

Create role for MediaConvert job in AWS

Go to IAM dashboard. Go to IAM Roles. Click Create Role button. On next page select the following items Select trusted entity >> Trusted entity type >> AWS service Use case >> Use cases for other AWS services >> MediaConvert Give the name of the job say MediaConvertJobRole in Name, review, and create section. Following rules…More

AWS Cannot exceed quota for PoliciesPerUser: 10

If you are trying to add polcies more than 10 to a single user you will get the following error: Limit exceeded. Your request exceeds one of the limits for this account. Remove one or more existing items and try again. Cannot exceed quota for PoliciesPerUser: 10 The solution is to create a single policy covering…More

AWS user is not authorized to perform: iam: DeleteRole

Go to IAM dashboard. Select Users menu from the left hand side menu. Select the user you want to provide the permission. Select the permissions tab and click on Add Permissions button. Click Create Policy link. On Create Policy page, select the following things: Select IAM service. In Access Level Permissions management, select DeleteRolePolicy Click Next, to review…More

AWS user is not authorized to perform: iam: ListAttachedRolePolicies

Go to IAM dashboard. Select Users menu from the left hand side menu. Select the user you want to provide the permission. Select the permissions tab and click on Add Permissions button. Click Create Policy link. On Create Policy page, select the following things: Select IAM service. In Access Level List, select ListAttachedRolePolicies Click Next, to review poilcy.…More

AWS user is not authorized to perform: iam: ListRolePolicies

Go to IAM dashboard. Select Users menu from the left hand side menu. Select the user you want to provide the permission. Select the permissions tab and click on Add Permissions button. Click Create Policy link. On Create Policy page, select the following things: Select IAM service. In Access Level List, select ListRolePolicies Click Next, to review poilcy.…More

AWS user is not authorized to perform: iam:ListInstanceProfilesForRole

Go to IAM dashboard. Select Users menu from the left hand side menu. Select the user you want to provide the permission. Select the permissions tab and click on Add Permissions button. Click Create Policy link. On Create Policy page, select the following things: Select IAM service. In Access Level List, select ListInstanceProfilesForRole Click Next, to review poilcy.…More