Problem scenario
You want to know some CLI commands of Stack Storm. How do you find what options you have?
Solution
Run this: st2 -h
…
Continue reading “How Do You Find the man Page for Stack Storm?”
A Technical I.T./DevOps Blog
Problem scenario
You want to know some CLI commands of Stack Storm. How do you find what options you have?
Solution
Run this: st2 -h
…
Continue reading “How Do You Find the man Page for Stack Storm?”
Problem scenario
Sometimes the “Read more” or “Continue reading” hyperlink in the page preview of your website (e.g., when you search for a word), is not visible. You know that some of your web page previews on your website don’t have the “Read more” hyperlink at the end. This makes the preview appear to have the entire web page. You need to identify the postings that don’t have the “Read more.” How do you use Python to find the pages that have previews that have no “Read more” hyperlink?
…
Problem scenario
You want a function to tell you if there are three unique characters in a string. For example “ababababa” would have fewer than three unique characters. But “abc” would have three or more unique characters. How do you write a function that does this that solves in linear time?
Solution
variable_to_test = “aaaaaaaaaaaabbbbbb”
def two_unique(s):
flag = “There are only two unique characters in the string!”
dict_a = {}
for string_portion in s:
if string_portion in dict_a:
pass
else:
dict_a[string_portion] = 1
key_counter = 0
for key in dict_a.keys():
key_counter = key_counter + 1; …
Problem scenario
Using a web-based email that is powered by roundcube, how do you change the time zone?
Solution
…
Continue reading “How Do You Change the Time Zone in a RoundCube Email Account?”
Problem scenario
List operations such as .sort() will change previous copies of the list.
String operations such as .replace(“old_pattern”, “new_pattern”, count), will not change the variable or its copies; these operations will return a string after the replace operation has run on the original string.
Why is this behavior happening?
Solution
In-place changes and mutability are factors. Strings are generally immutable whereas copies of lists are usually shallow.
…
Continue reading “Why Are Python List Operations/Methods Unlike Python String Operations/Methods?”
Problem scenario
You are using Chef and the Kitchen command line tool. If a kitchen command fails, how can you find out the root cause?
Solution
With the command that fails, re-run it with this at the end: –log-level=debug
To learn more about the verbosity of kitchen commands, see this: https://docs.chef.io/workstation/ctl_kitchen/#options
…
Continue reading “How Do You Troubleshoot a Kitchen Command?”
Problem scenario
You are running a Python script. You keep getting “SyntaxError: invalid syntax” and a line number. You can find nothing wrong with the syntax on the specified line number. What do you do?
Possible solution #1
Look at the line with code, as opposed to blank line(s), above it. Is there a missing quote, brace, bracket or parentheses?
Possible solution #2
Are you trying to use an “if” statement on one line?
…
Continue reading “How Do You Troubleshoot “SyntaxError: invalid syntax” in Python?”
Problem scenario
You have an iCloud, iTunes, iMessage, FaceTime, or some other Apple account online. You want to cancel your account and destroy or delete the data. What do you do?
Solution
1. Log into your Apple.com account (e.g., https://appleid.apple.com/#!&page=signin).
2. Go here: https://privacy.apple.com/
3. Go to “Request to delete your account”
4. Follow the prompts.
…
Problem scenario
You want to pass more than one subnet to an “aws eks” command.
You tried to delimit the list with commas (or separate two subnet IDs with commas). You received this error message:
An error occurred (InvalidParameterException) when calling the CreateNodegroup operation: The subnet ID ‘subnet-0abcd1234,subnet-zyxw9876’ does not exist (Service: AmazonEC2; Status Code: 400; Error Code: InvalidSubnetID.NotFound; Request ID: Proxy: null)
What should you do?
…
Continue reading “How Do You Pass Two or More Subnets to an “aws eks” Command?”
Problem scenario
You have read about the Google Datastore and Google Firestore. But you do not know the differences. What are they?
Solution
Go here.
…
Continue reading “How Does Google Datastore Compare/Contrast with Google Firestore?”