How Do You Get WordPress Preview Postings to Show “>> Read more…”?

Problem scenario
You are using WordPress to host your website. Some post previews show a hyperlink ">> Read more…" but others have no hyperlink. Some post previews (e.g., when you search the website for a pattern) are not updating. Older versions of the post are previewing. How do you get the ">> Read more…" hyperlink to show in the preview and how do you get the post to be up-to-date?

Possible Solution
Try copying the content of the old posting and posting it again. With new postings we cannot reproduce the problem.

What Do You Do when Your Internet Speed Is Slow?

Problem scenario
You are at home and your internet is slow. What should you do?

Possible solution #1
Reboot the cable router and any intermediate routers (i.e., any network device such as an IDS or firewall).

Possible solution #2
Log into your router's interface to view the connected devices. To do this, find the default gateway IP address of your computer. If you are using a Windows machine, hold the Windows key, tap the "r" key, then type: cmd

Then type ipconfig and press enter.

Open a web browser and go to this IP address. Enter credentials. Is there a networked or wireless device you do not recognize? Maybe there is a tablet computer or cell phone connected to your router.

Possible solution #3
Reboot your computer.

Possible solution #4
Go here to verify your bandwidth speed: https://www.speedtest.net/

How Do You Find Words That Match a Pattern and Not the Line with Bash?

Problem
You want to search a file for words that include a given pattern. You want to use grep to return the word that matches a pattern, and you do not want to return the entire line that matches a pattern. You want to return the exact word without the leading space or trailing space. What do you do?

Solution
Try this command:

cat foobar.txt | tr "//" "\n" | grep "coolpattern"

The above, specifically the tr command and flags, will introduce new lines for every space. You may need to pipe the output to an awk (e.g., | awk '{print $2}' ).

How Do You Troubleshoot the Adaware Antivirus Problem of “Definitions could not be updated”?

Problem scenario
You are using Adaware Antivirus. You try to download the latest definitions, but you get this error message: "Definitions could not be updated Something prevented the definitions from updating. Please try again at a later time."

How do you update Adaware Antivirus?

Solution
Try a different internet connection. Some public WiFi spots may block certain ports. VPN tunnels may not help solve the problem. A cell phone's hotspot (e.g., slinging internet service) may produce a better result.

How Do You Change the Time Zone in a Horde Email Account?

Problem scenario
Using a web-based email that is powered by Horde Mail (e.g., version 5), how do you change the time zone?

Solution

  1. Log in
  2. Click the gear symbol, go Preferences -> Global Preferences -> Locale and Time
  3. Change the time zone to your desired preference.

How Do You Find the Underlying Component in AWS for a Given URL Endpoint?

Problem scenario
You have been given a URL endpoint that is supported by some AWS service or services. How do you find out what the underlying service is?

Solution

  1. Determine the IP address. Ping the hostname. If you have a URL like this, https://acme.com/path/to/file.html, extract the domain name; you can deduce it is acme in the example. Open a command terminal and ping acme.
  2. Now that you have the IP address go to AWS console. Go to EC2 -> Instances and search for the IP address. If you cannot find it there, go to Reserved Instances, Spot Instances and finally Network Interfaces. Eventually you should find it.
  3. If you still have not found it, from a command prompt use "nslookup x.x.x.x" where x.x.x.x is the IP address. This may give you a clue of what to look for.

How Do You Fix a Python Program that Returns “Killed”?

Problem scenario
You are trying to write a Python program. It returns "Killed" on a Linux terminal. How should you fix this?

Possible Solution #1
"Aside from running time, the memory space occupied by a program is a principal cost." (Taken from The Mythical Man-Month, page 238.)

Refactor your code. There is a programming method called "brute force" which is a reference to creating an exhaustive number of possibilities and processing those possibilities. This method will not work for certain problems because the input size is too large. You may want to read https://www.quora.com/I-am-a-brute-force-developer-how-do-I-improve-my-algorithms-skills. A program can still solve the problem, but you will have to be clever.

Is there a way to represent a string or data type symbolically without creating so many permutations? Can you calculate what you need to find without having every a string or bit of non-string data exist in memory? Sometimes arithmetic can be performed without creating the string in your program. You may be able to find a solution without putting the data in memory.

A sample pattern of a repeating string or larger data type can be processed as long as the pattern is representative of the whole. Then the result could be mathematically computed to determine the full size. This can reduce the amount of memory used.

You may be too mentally focused on one solution. There may be an alternative solution achievable with rewriting your code. For large input sizes, certain computational complexity will exhaust memory. Examine the logic, use Google, and try to find a way to solve the problem with Python without creating such large strings or putting so many variables/objects into memory.

Some sorting algorithms can solve your sorting needs in n(log(n)) time or better than this (if they do not involve comparisons).

Publilius said "[p]ractice is the best of all instructors" according to The Mythical Man-Month, page 87. Keep practicing, and eventually you will be able to create elegant solutions without writing to disk or adding memory. To see a list of Python books, click here.

Possible Solution #2
Run "dmesg" from the Linux terminal. This may show you what is wrong. You may need to add memory; to add memory, see this posting. To add swap space, see this posting. It could be that you need to refactor your program to use less memory.

Possible Solution #3
Sometimes writing to disk, if you have the disk space, is one way to solve a Python coding quiz. But these are not very performant solutions. This method uses less memory and can prevent your program from being killed by the Python interpreter.

How Do You Troubleshoot the Ansible Error “This task includes an option with an undefined variable”?

Problem scenario
You have a playbook, and your variables are defined. But you get an error "FAILED => {'msg": 'The task includes an option with an undefined variable. The error was 'dict object' has no attribute 'Name'…"

What do you do to solve this?

Solution
The variable's source could be blank. With "ec2_instance_info" the module will connect to AWS. If an EC-2 server has not been named in the web console, the item.tags.Name variable in Ansible will be blank. This error message may give you the idea that something else is wrong. The playbook may be fine, it just relies on EC-2 servers having a name in the web console (as opposed to a hostname at the OS level). Give the EC-2 instance a name in the AWS web console.