
Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
expand_more
expand_more
format_list_bulleted
Question
Write a script to find and print your local IP address
Use the following code:
import socket
hostname = socket.gethostname()
local_ip = socket.gethostbyname(hostname)
print(local_ip)
Expert Solution

This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution
Trending nowThis is a popular solution!
Step by stepSolved in 2 steps

Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Similar questions
- Step 1: Write a script to find and print your local IP address Use the following code: import socket hostname = socket.gethostname() local_ip = socket.gethostbyname(hostname) print(local_ip) Step 2: Write a script to find and print your OS platform and release (for example, "Windows version 10") Use the following code: import platform print(platform.system ()) print(platform.release ()) Step 3: Write a script to find and print a "ping sweep"? Use the following code: import os my_ip="192.168.10.103" # sub your ip address os.system('ping -n 4 {}'.format(my_ip)) Step 4: Write a script to find and print current day and time import time now = time.localtime() print(time.strftime("%m/%d/%Y %I:%M:%S %p", now)) Extra Credit: Add code to Step#4 which prints a greeting, either "good morning", "good afternoon", "or good evening", depending on the current time.arrow_forwardTest IPs that your system has recently contacted to see if they are still reachable. # Loop over the output of ip n # Use $(echo | cut) to parse just the IP address # Ping the IP once to see if it is alive # Test the exit code and report that the IP is "UP" or "DOWN" 3. Optionally, clean up the output # Using /dev/null, hide the output of ping so that only your IP UP/DOWN is displayedarrow_forwardWhich of the following characteristics below are associated with a UDP socket? Check one or more that apply. when contacted, the server will create a new server-side socket to communicate with that client socket(AF_INET, SOCK_DGRAM) creates this type of socket socket(AF_INET, SOCK_STREAM) creates this type of socket data from different clients can be received on the same socket provides reliable, in-order byte-stream transfer (a "pipe"), from client to server provides unreliable transfer of a groups of bytes ("a datagram"), from client to server a server can perform an accept() on this type of socket the application must explicitly specify the IP destination address and port number for each group of bytes written into a socket ICarrow_forward
- use nodejs to create a server that URL with hostname, port, path foxtrot and route parameter value kilo Request message URL: 0.0.1:3000/foxtrot/kilo Response message: “SUCCESS! Received kilo via foxtrot” where the value kilo must be retrieved via the route parameter Invalid/unexpected URL Request message URL: 0.0.1:3000/<any other value> Response message: “FAILED! Fix your URL.”arrow_forwardAssume Host C is running a Web server on port 80. Assume that Hosts A and B are currently submitting requests to this Web server, which supports persistent connections. Is Host C using the same socket to send all of the requests? If they're being sent over different sockets, does each one have port 80? Discuss it and give an explanation.arrow_forwardPlease written by computer source Write a Snort rule to detect a connection attempt on the telnet server which has an IP address 192.168.32.129 and generate alerts for packets with content ‘Telnet!’ directed to the server.arrow_forward
arrow_back_ios
arrow_forward_ios
Recommended textbooks for you
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education

Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education

Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON

Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON

C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON

Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning

Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education