A Go terminal UI for displaying network adapters in real time

Programming Snapshot – termui

Article from Issue 218/2019
Author(s):

Even command-line lovers appreciate a classic terminal UI. Mike Schilli shows how to whip up a Go program that dynamically displays network interfaces and IPs.

Every time I connect my laptop to a router for diagnostic purposes, the question arises: On which dynamically assigned IP address will the router see the laptop? After all, you need to enter a router address on the same subnet to display the router's admin page (Figure 1).

Figure 1: This machine uses an IP address on subnet 192.168.147.1/24 to connect to the router.

To do this, I used to type ifconfig several times in a terminal window and extracted the desired address from the mess of data printed next to:

[...]

Use Express-Checkout link below to read the full article (PDF).

Buy this article as PDF

Express-Checkout as PDF
Price $2.95
(incl. VAT)

Buy Linux Magazine

SINGLE ISSUES
 
SUBSCRIPTIONS
 
TABLET & SMARTPHONE APPS
Get it on Google Play

US / Canada

Get it on Google Play

UK / Australia

Related content

  • Core Technologies

    Prise the back off Linux and find out what really makes it tick.

  • Command Line: Network Diagnostic Tools

    Linux has the right tools to track down network errors and open the way for data packets.

  • Perl: Shell Functions

    Perl gives you better shell scripts. Sysadm::Install, a new module from CPAN, helps shell addicts let go of Bash.

  • IPv6 Pen Testing

    If you have enabled IPv6 on your network without considering basic security issues, you might have opened up a hole for attackers. In this article, we demonstrate a successful attack on a server via IPv6 and explain how the popular security tools handle IPv6.

  • Nmap Scripting

    Nmap is rolling out a new scripting engine to automatically investigate vulnerabilities that turn up in a security scan. We’ll show you how to protect your network with Nmap and NSE.

comments powered by Disqus

Direct Download

Read full article as PDF:

Price $2.95

News