What Does MSK Stand For in I.T./DevOps?

Question
You have seen "MSK" in an article on the public cloud. Does the "K" stand for "Key"? What does MSK stand for?

Answer
MSK stands for "Managed Streaming for Kafka". It is an Amazon product.

"Amazon Managed Streaming for Apache Kafka (Amazon MSK) is a fully managed service that enables you to build and run applications that use Apache Kafka to process streaming data. Amazon MSK provides the control-plane operations, such as those for creating, updating, and deleting clusters." (Taken from https://docs.aws.amazon.com/msk/latest/developerguide/what-is-msk.html.)

How Do You Get the Voicemail Indicator Icon to Work on an Android Phone?

Problem scenario
You are using an Android phone. When you get new voicemails, there is no indication. What should you do?

Possible solution
Go to the settings in your phone (possibly through a sprocket/gear symbol). Go to Apps -> Voicemail. Click on "Force stop" in the lower right hand corner. Allow it to stop. Then click "Open." This may work.

What Can Cause an Application to Run Slowly?

Problem scenario
You support an existing application and its servers. It is experiencing slowness as the users are complaining about its performance. What are some potential root causes of this slowness?

Possible Solutions

  • The slowness is caused by the client. A user's workstation has something wrong with it (e.g., malware, or it is trying to run too many applications at once).
  • Network congestion between the client and the server.
  • The server's disk IO activity, CPU activity or RAM utilization is too high.
  • Overloaded application; there is a spike in application's demand (e.g., a temporal business reason is causing the application to be heavily utilized beyond normal conditions). Scaling horizontally with load balancers could help remedy this.
  • There is a DNS configuration issue. DNS cacheing and or new misconfigurations can cause an application to be slow.
  • A change to a load balancer (e.g., HAProxy, an F5 load balancer or an AWS application load balancer) introduced a misconfiguration which is potentially causing the slowness.
  • There could be a denial of service attack. Malware or hackers could be the culprit.
  • If the server was moved, there may be a lack of caching. Some web server accelerators could have been the basis of a highly performant server. A sever being in a new geographic location could put it in a suboptimal region for the users.
  • A relevant database tier could have a backup routine, stored procedure or other maintenance job could be running. Was there an email about an outage? Poorly crafted SQL statements can cause problems. For tips on tuning a relational database, see this posting.
  • Check the logs of the application and other components. There may be something obvious.

What Is The Difference between a VPC and a Subnet?

Question
You have heard about VPCs and subnets. What are the differences between these two?

Answer
A subnet is a subdivision of a network. Internal to an enterprise network, you may divide the network into different addresses with gateways, routers, bridges and subnet masks. The subnet mask (in CIDR (classless inter-domain routing) notation may be /28, /24, /10 etc.

A VPC ordinarily has its own NACLs and firewalls associated with it; these are usually part of the public cloud's built-in features. For AWS the firewall is called a Security Group. In AWS you can configure a VPC's availability zone, give the VPC a name, add service endpoints, add route tables, configure peering connections (with other VPCs) and select a hardware tenancy type (either shared or dedicated). In AWS a VPC will have a public subnet. VPCs also exist in IBM's public cloud, Azure, and GCP.

How Do You Write a Python Program without the import Statement That Palindromically Tests a String in Four Lines of Code?

Problem scenario
You want to avoid importing any modules in Python. You want to have a way to test if a string is a palindrome is four lines of code. What do you do?

Solution

def is_palindrome_pythonic(s):
    return all(a == b for a, b, in zip(
        map(str.lower, filter(str.isalnum, s)),
        map(str.lower, filter(str.isalnum, reversed(s)))))

# The above four lines of code were taken from page 78 of Elements of Programming Interviews in Python.

print(is_palindrome_pythonic("aaaabaabaa"))

To buy the cited book, click here.

What Are Guardrails in I.T.?

Question
What are guardrails in the I.T. industry?

Answer
A measure, technology or authentication policy in place to prevent problems in an enterprise network or with a application. With guardrails, a server or web application is protected from hackers or accidental misuse. It is a common metaphor based on highway guardrails. To learn more, see this posting:
https://devops.com/building-great-cloud-security-guardrails/

There is a specific product called GUARDRAILS that detects, fixes and prevents "security issues in your applications, open source dependencies and cloud platforms." taken from https://docs.guardrails.io/docs/en/what-is-guardrails

How Do You Use Python to Retrieve Information about Bitcoin Transactions?

Problem scenario
You want to use Python to get data from BTC transactions. You do not want to use "import requests". What do you do?

Solution
Prerequisite

This assumes you have installed the Bitcoin pypi package: pip install bitcoin
If you need assistance installing pip, see this posting for Ubuntu or this posting for a Red Hat derivative. (You may need to use pip3 instead of pip.)

Procedures

  1. Enter the Python command line (with running the "python" or "python3" command).
  2. Run these two commands (but substitute the "3N8PfUXqXZzzFDxoPPgRiaiepziXpvYrpb" with the Bitcoin address of your choice**):
from bitcoin import *
history("3N8PfUXqXZzzFDxoPPgRiaiepziXpvYrpb")

** To find more Bitcoin addresses, go here and look for hyperlinks of similar alphanumeric strings:
https://www.blockchain.com/btc/address/3N8PfUXqXZzzFDxoPPgRiaiepziXpvYrpb

How Do You Use an Amazon API Gateway?

Problem scenario
You want to use the AWS PaaS offering for exposing an API and having it be able to scale and handle lots of users easily. How do you use Amazon API Gateway?

Solution
Overview: This is a proof-of-concept. You could use different API types (e.g., web socket APIs for persistent applications like a chat window).

Prerequisite
This assumes you have a working Lambda function configured and you know its name.

Procedures

  1. Log into the AWS Console.
  2. Go here: https://console.aws.amazon.com/apigateway/main/
  3. Go to HTTP API and click on "Build".
  4. For "Integrations", choose "Lambda". Find your desired lambda for the "Lambda function" drop-down menu.
  5. For "API name", enter whatever name you want. Click "Next".
  6. For "Configure routes", you may want to accept the defaults and click "Next".
  7. For "Define stages", you may want to keep the defaults and click "Next".
  8. Review and click "Create".
  9. Copy the "Invoke URL" hyperlink.
  10. Copy it into a Notepad or text edit (e.g., https://abcd1234.execute-aps.us-west-2.amazonaws.com/ ). Append the Lambda's name to this URL (e.g., append "foobar" to the URL).
  11. Open a web browser and go to the URL that you constructed in step #10. (The output in the browser should match what happens when you test the Lambada via the "Test" tab's "Invoke" button. When you click "Invoke" in the web console, that should show you a result in the AWS Console; you may need to expand "Details" to see it completely.)

How Do You Troubleshoot Discrepant nmap Results Based on The sudo Command?

Problem scenario
You are using nmap. You try the exact same command with sudo and without sudo. Why are these commands providing different results?

Here are examples of running the exact same command, once with "sudo" and once without:

jdoe@ciserver:~$ sudo nmap -p 9090 192.168.2.25
Starting Nmap 7.80 ( https://nmap.org ) at 2022-01-05 09:56 EST
Nmap scan report for 192.168.2.25
Host is up (0.00056s latency).

PORT     STATE  SERVICE
9090/tcp closed zeus-admin
MAC Address: 08:00:27:32:27:2C (Oracle VirtualBox virtual NIC)

Nmap done: 1 IP address (1 host up) scanned in 0.25 seconds
jdoe@ciserver:~$ nmap -p 9090 192.168.2.25
Starting Nmap 7.80 ( https://nmap.org ) at 2022-01-05 09:56 EST
Note: Host seems down. If it is really up, but blocking our ping probes, try -Pn
Nmap done: 1 IP address (0 hosts up) scanned in 0.07 seconds

Why is there a discrepancy in the output?

Solution/Answer
Use the -vv flag and you will learn that the difference is that with sudo the nmap command uses an "ARP Ping Scan" as opposed to a regular "Ping Scan." To learn why these are so different, see https://nmap.org/book/man-host-discovery.html.

See also this posting or Possible Solution #4 and the "**" at the end of this posting.