You want to create a script that will send an email from a Linux server. You want it to use telnet. How do you automatically send an email using telnet?
You want to install Grails on a Linux server. What do you do?
Your server has access to the internet.
Run these commands:
sudo curl -s https://get.sdkman.io | sudo bash
sudo su –
sdk install grails
# We know this isn’t a best practice to install things as root,
You try to use PuTTY to connect to a Linux CentOS 6.x server. You get the message “Network error: Connection refused.” What should you do?
This assumes that there is no software or hardware firewall blocking port 22. You may want to use nmap or a Windows PowerShell port tester to verify port 22 is open.
You are using Linux. You want to send emails from your server directly (e.g., from the command prompt using telnet and helo commands) with a customized “Reply-To” email address. How do you do this so the recipient clicks “reply” the “To:” field will be pre-populated.
You are using Postfix. You are trying to send emails directly from the Postfix server. After you use telnet and helo commands, you enter a recipient like this:
rcpt to: firstname.lastname@example.org
But you get this error:
“550 5.1.1 email@example.com: Recipient address rejected: User unknown in local recipient table”
What should you do?
If you change the /etc/postfix/main.cf file to have emails use a “reply-to” of example.com,
You want to print three integers. You do not want to convert them to be part of a string. You want a space to separate each integer. How do you do this in Python?
Assuming your variables are x, y, and z, and they are integers, use a line like this:
print(x, y, z)
Here is a complete program that proves it works:
x = 5
y = 3
z = 100
print(x, » Read more..
You want to download pictures (e.g., .png, .jpeg etc.) from websites. How do you use Python to download such files?
Use this program with a subdirectory in the directory that this program resides to receive the picture files.
Downloads all the images on the supplied URL, and saves them to the
specified output file (“/test/” by default)
python dwldimages.py http://example.com/ /tmp/test/ # where /tmp/test/ is the directory you want to save the image files to. » Read more..
A Groovy program is returning an incorrect value for an integer variable. What is wrong?
Possible solution #1
Check the logic of your program. Use the println command to see the earliest point when this variable is assigned an incorrect value. This helps you pinpoint the problem.
Possible solution #2
Is the variable being assigned a number in quotes like this?
In AWS you manually added a Security Group rule for the source of a given IP address. This IP address is either the internal or external IP address. You can ping one of them (either the internal or external IP address). Why cannot you ping each IP address?
Check to see if a firewall is running on the Linux server.
You want to run an Ansible playbook to push configuration changes down (e.g., transfer files to managed nodes). How do you do this?
This assumes that you have set up Ansible. If you need directions for deploying an Ansible control server, see this posting. If you need directions for deploying a managed node after the central Ansible server has been set up,