What Should The Permissions of the kubectl File Be on a Linux server?

Problem scenario
You copied the kubectl file. You are not sure what the permissions it should have. When you try to execute it, you get “Permission denied”. What should you do?

Solution
We recommend using this (after you change directories to the one that has the kubectl file): sudo chmod 777 kubectl

When you use conjure-up, it makes kubectl have 777 permissions.

In AWS’ KMS What Is the Difference between Administrative Permissions and Usage Permissions of a CMK?

Question
A CMK is an encryption key. In Amazon Web Services, for CMKs (Customer Master Keys) in KMS (Key Management Service), what is the difference between administrative permissions and key usage permissions?

Answer
Usage permissions enable (either IAM users or roles) to encrypt and decrypt data with the AWS KMS API.

Administrative permissions for a CMK allows either an IAM user or role to give usage permissions to other IAM users or roles through the API (and sometimes the web console).

How Do You Retrieve an Application-Level Secret from AWS?

Problem scenario
You want to obtain a non-database secret from AWS and you know the name of the secret (in Secrets Manager) and the region it is in. What should you do?

Solution
Prerequisites
You have installed and configured the AWS CLI. If you need assistance with this, click on this posting if you can use pip or this posting if you cannot use pip.

How Do You Troubleshoot the Error “Secrets Manager cannot invoke the specified Lambda function.”?

Problem scenario
You try to store a secret, but you see this message:

“Your secret was created successfully but configuring rotation has failed

Secrets Manager cannot invoke the specified Lambda function. Ensure that the function policy grants access to the principal secretsmanager.amazonaws.com. “

What do you do?

Solution
Try this posting.

What is the Default Password with a Raspberry Pi?

Problem scenario
Using Raspberry Pi, you do not know the root / administrator password. For example you go to Menu -System Tools -Root terminal. You are prompted with “Enter the administrative password.” No password works. What should you do?

Solution
We do not know. We suggest you change it if you want to know for certain. Open a regular terminal. Run this:

sudo su –
passwd # enter the password that you want.

Python Tips when Dealing with Lists

Here are some tips when using Python and dealing with lists.

  1. Use snake_case for list variable names. For more information on coding style in Python, see the PEP 8 style guide here.
  2. Never call a variable “list”. (If you are using a variable for a list, use something like small_list or big_list — not “list”.) Any word that is not a reserved word and not a built-in data type will work.

How Do You Get PowerShell to Run Scripts?

Problem scenario
One of the following apply to you.

Problem scenario #1
You try a PowerShell command but you get an error like this “The ‘Login-AzureRmAccount’ command was found in the module ‘AzureRM.profile’, but the module could not be loaded.”

OR

Problem scenario #2
You try a PowerShell command but you get an error like this:

Files\WindowsPowerShell\Modules\AzureRM.profile\5.8.2\AzureRM.Profile.psm1 cannot be
loaded because running scripts is disabled on this system.

In Python How Do You Print Just The Values of The Two-dimensional List without The Quotes, Commas or Brackets?

Problem scenario
In Python your program has a two-dimensional list. It prints out like this:

[’ ‘, ‘X’, ‘ ‘, ‘ ‘, ‘ ‘]
[’ ‘, ‘X’, ‘X’, ‘ ‘, ‘ ‘]
[’ ‘, ‘X’, ‘X’, ‘X’, ‘ ‘]
[’ ‘, ‘X’, ‘X’, ‘X’, ‘X’]

You want it to print out like this:

X
XX
XXX
XXXX

Solution
Assuming that there are n rows of your matrix (aka two-dimensional array),

How Do You Troubleshoot a Java Compilation Error “class fooBar is public, should be declared public class…”?

Problem scenario
You try to compile a java program, but you get this error:

hello.java:1: error: class HelloWorld is public, should be declared in a file named HelloWorld.java
public class HelloWorld {
^
1 error

What is wrong?

Solution
The .java file must have a name of “HelloWorld” like the public class in the error. If the .java file is called something else,