Visualize Your Network Traffic With ‘darkstat’

Today’s article is a fun one, an article where you’ll learn how to visualize your traffic with darkstat. It’s a fun little tool that lets you graphically visualize your network traffic in your browser. While it’s likely more of an enterprise-level tool, there’s no reason you can’t use it as a home user.

So, if you’d like to learn how to visualize your traffic with ‘darkstat‘, read on and I’ll do my best to explain it. 

There’s a lot to the tool, but darkstat defines itself in the man page as:

darkstat – network statistics gatherer

We’ll only be using darkstat to visualize your network traffic in the browser, but there are quite a few options available. You’ll want to check the man page after you’ve got darkstat installed and have learned its basic usage.

I’ve previously covered tools like VNstat, which lets you monitor your bandwidth usage. You can even helpfully draw some graphs with the tool. This is quite different. You’ll see…

Visualize Your Network Traffic With ‘darkstat’:

This article requires an open terminal, like many other articles on this site. If you don’t know how to open the terminal, you can do so with your keyboard – just press CTRL + ALT + T and your default terminal should open.

First, you need to install darkstat. It should be in your default repositories for many of you. To save time, I’ll show you how to install it in Debian/Ubuntu-based distros. Just adjust the command to suit your system’s package manager:

With darkstat now installed, you need to start it – so that it monitors your network traffic. To do that, you’ll need to know the name of your network interfaces. It just so happens that I wrote that article last time:

How To: Show Your Network Interfaces

Armed with that data, you want to start darkstat and the format is:

So, for example, you might end up with one of the following commands:

Or maybe this type of command for a wireless connection:

After running that command, you’ll then want to open the following URL with your preferred browser:

http://0.0.0.0:<port_number>

If you used the port above, you’d connect to:

http://0.0.0.0:8080

The results should look something like this:

darkstat in operation
The output of the graph should be easy enough to understand.

You can also opt to see the hosts, those servers you’ve connected to, by simply clicking on the ‘hosts’ link. That’d look something like:

 

darkstat in action, showing the hosts
As you can see, this one shows the hosts you’ve connected to.

The darkstar application will run quietly in the background. It’ll keep running until you tell it not to. One way to kill darkstat would be:

As I mentioned above, darkstat has a number of different options. There’s a bunch more to it, but this is about all your regular user will need to visualize their network traffic. Of course, run man darkstat to view those options.

Closure:

There you go. You have another article, this one less short than the recent articles. I am not well, but I presume I will be. In the mean time, we’ll continue to have articles for as long as I’m able. This time, we learned about how you can visualize your traffic with darkstat. Who knows what the next article will be about.

Thanks for reading! If you want to help, or if the site has helped you, you can donate, register to help, write an article, or buy inexpensive hosting to start your own site. If you scroll down, you can sign up for the newsletter, vote for the article, and comment.

Disable WiFi From The Terminal

In today’s article, we’re going to learn how to disable WiFi from the terminal. It’s going to be a simple enough article, with just a few commands to learn. Read on, my dear readers! There’s information to share!

This is certainly a tool that new Linux users could use, you just need to remember to turn WiFi back on when/if you need wireless access again. So, read on, my dear readers, as we venture into a bit of controlling networking with the Linux terminal.

This will will show you how to completely disable WiFi, rendering you unable to connect to any wireless network. There are those folks who will see this as a security measure, as they distrust wireless connections. There are others who may view this as a battery saving measure, as you no longer will have the wireless radio polling for connections or anything like that.

The tool we’ll be using for this is ‘nmcli’. You can do a lot with this command, but the man page describes ‘nmcli’ as this:

nmcli – command-line tool for controlling NetworkManager

And, if you dig a bit deeper, you’ll see that there’s a man page for ‘NetworkManager’. This is described as:

NetworkManager – network management daemon

So, as you can see, we’re gonna be dealing with the network. That’s what I told you in the title and the introductory paragraph! See? We take this seriously! So very, very seriously!

Disable WiFi From The Terminal:

Yup. You read that right. It’s another article that requires an open terminal, so you should open a terminal now. If you don’t know how to open the terminal, you can do so with your keyboard – just press CTRL + ALT + T and your default terminal should open.

With your terminal now open, let’s learn how to disable WiFi from the terminal itself. So, to disable WiFi, your command would look like:

Next, of course, we’ll learn to turn it back on again. That command looks like:

If you have other radios, such as a mobile/cellular network, you can actually enable and disable all the radios with just one command:

And to turn all the radios back on again:

And there you have it.. You can disable WiFi from the terminal. If you want to know more about ‘nmcli’ (and it’s a bit of a robust command), it’s just:

You can also check the ‘NetworkManager’ man page with:

Closure:

There it is! It’s another article! This one does what the title says it’s going to do – it shows you how to disable WiFi from the terminal. There’s more to ‘nmcli’ and ‘networkmanager’ so maybe we’ll have another article covering some other options? It could happen!

Thanks for reading! If you want to help, or if the site has helped you, you can donate, register to help, write an article, or buy inexpensive hosting to start your own site. If you scroll down, you can sign up for the newsletter, vote for the article, and comment.

Monitor Bandwidth With nload

Today’s article should be fairly quick and simple, as we learn to monitor bandwidth with nload. It’s a handy tool that’s generally available across the many distros and is something you might find useful in your daily Linux journey.

You may also recall this article:

‘vnStat’ A Tool For Monitoring Your Bandwidth Usage

Well, today we’ll be learning how to monitor bandwidth with nload. You’ll find that nload has some visual similarities with vnStat – but nload doesn’t do logging. It’s a way to monitor your bandwidth in real time and, of course, in the terminal!

We do lots of fun stuff in the terminal! I didn’t actually expect so many articles to be terminal-based when I first started the site. Maybe I just hate taking screenshots?!?

Anyhow, this article will be published on a Sunday. It’s a weekend article, so it’s we can have a little fun with it. I’ll even keep it relatively short. You’re welcome!

So then, let’s just jump into the article…

Monitor Bandwidth With nload:

This article requires an open terminal, like many other articles on this site. If you don’t know how to open the terminal, you can do so with your keyboard – just press CTRL + ALT + T and your default terminal should open.

With your terminal now open, let’s go ahead and install nload. It should be in your default repositories, so it’d be installed with something like:

Fedora:

Debian/Ubuntu:

Etc… Fill in the above for your distro. You’ll find that nload defines itself as:

nload – displays the current network usage

With nload installed, you can simply start it with:

That will load all of your network adapters and you use your arrow keys to navigate between the network adapters. It should automatically find all your network adapters, so you don’t need to configure it to do so.

If you want to see the nload options available, press F2 where you’ll find you have some options available, including how long it takes for the application to find the averages.

If you want to monitor the bandwidth of just a single adapter, that command is actually really simple – it’s just:

For example, and using an an oft used Linux adapter name:

That’s about it, other than learning how to close the application. That may not be obvious to everyone, you can use Q or you can press CTRL + C to close out nload.

Closure:

And that is it, really. The article doesn’t really need more details to show you how to monitor bandwidth with nload. It’s quite a simple program and the output is entirely intuitive for even a rank Linux beginner. Enjoy your weekend!

Thanks for reading! If you want to help, or if the site has helped you, you can donate, register to help, write an article, or buy inexpensive hosting to start your own site. If you scroll down, you can sign up for the newsletter, vote for the article, and comment.

Using The SSH Verbose Mode

That’s right, today’s article is going to be yet another SSH related article, this time it’s about using the SSH verbose mode. It’s handy for debugging SSH connections, plus the information can help you understand more about how SSH works. This is a fine article even for those just starting out with SSH and Linux.

I know, I know… I do a lot of SSH articles. In my defense, they’re fun – and there’s just so much to SSH that many people don’t know. It’s a tool that I use all the time, so it’s only natural that I share articles on the SSH subject. I’m bound to run out of ideas for ’em eventually.

For those that don’t know, SSH stands for “Secure Shell”. It’s a way to remotely control computers within the terminal – though you can actually forward some graphics applications over SSH.

If you’re unfamiliar with SSH, you might try reading some of these articles:

Install SSH to Remotely Control Your Linux Computers
Prevent SSH Root Login
Check Your SSH Server Configuration

Alternatively, you can search for SSH articles and discover quite a few other articles on the subject of SSH. As mentioned in the preamble, and I have gotten pretty formulaic, there are quite a few SSH articles.

There are quite a few SSH articles because there’s a lot to learn. You don’t start off by running, you start by stumbling a few steps and working your way up.

So, with all that in mind, let’s have another SSH-related article…

Using The SSH Verbose Mode:

This article requires an open terminal, like many other articles on this site. If you don’t know how to open the terminal, you can do so with your keyboard – just press CTRL + ALT + T and your default terminal should open.

Of course, you need a computer you can connect to with SSH installed. If you don’t have a remote device, you can enable SSH on your local computer and then just connect to user@localhost and practice all these remote commands.

There are three different modes in SSH verbose mode. They’re indicated with a -v, a -vv, and -vvv. To use them, the command would look similar to the following commanda:

In the first mode, that is -v, you get details about the client-side activities.

In the second mode, that is -vv, you get details about both the client-side activities and the server-side activities.

With the third mode, that is -vvv, you get even more details, more verbosity, about both the client-side and server-side activities. 

For example, this is some of the text output from a -v SSH verbose mode:

ssh verbose mode displayed
And that’s just some of the information you’ll see when you use the SSH verbose mode.

You’ll get even more verbosity as you go up through the levels of SSH verbose mode. This is useful for debugging your SSH connections – but it’s also useful for those who aren’t sure what’s going on behind the scene. When using SSH’s verbose mode, you can see what’s actually going on behind the curtain. That means you can learn more about what’s going on with your SSH connections.

Closure:

So, yeah… It’s another SSH article. I wrote this one ’cause I was thinking about it. I was thinking about it because I’d recently done another SSH-related article. So, I figured I might as well cover SSH verbose mode while thinking about it. Otherwise, I’d have made a note of it in my files and maybe never bothered with the article. Besides, if you want a different article, you’re always welcome to write it yourself and I’ll (quite likely) publish it.

Thanks for reading! If you want to help, or if the site has helped you, you can donate, register to help, write an article, or buy inexpensive hosting to start your own site. If you scroll down, you can sign up for the newsletter, vote for the article, and comment.

How To: Login To SSH To Run One Command

In today’s article, we’re going to learn how to login to SSH to run one command. Yes, it’s another SSH article! However, this one should be relatively short. I’ve covered SSH a great deal already. This is just one more SSH trick.

SSH stands for Secure Shell and is a way to remotely control other computers. As I said in the opening paragraph, I’ve already covered a lot of SSH articles, because SSH is a tool I use regularly and it’s a tool I really like.

SSH lets me manage computers on the other side of the country without even leaving my chair. I also use SSH to manage various computers around my house. If I need to do something on a computer in another room, I can just SSH into it and do what I needed to do. It’s great!

Well, today’s SSH article is a bit different. We’re going to login to SSH to run one command. That’s all we’re going to do. We’ll login, automatically run the command, and then automatically exit the SSH connection. This is useful if you want to run a script, update, etc…

There are some previous SSH articles that you might want to read:

Install SSH to Remotely Control Your Linux Computers
Prevent SSH Root Login
Show Failed SSH Login Attempts

Alternatively, you can click to search for SSH articles. I’ve covered quite a bit of SSH material, so you can learn quite a bit from those links – even if you’re already familiar with SSH.

Well then, let’s just jump into the article… It really shouldn’t take long.

Login To SSH To Run One Command:

Like oh so many articles, and this one involving SSH, you’re going to need to start off with a terminal. You’ll also need a device that has SSH properly setup and ready to run. You can actually set SSH up on the computer you’re using and just SSH into localhost to practice this.

And, of course, if you don’t know how to open your terminal, just press CTRL + ALT + T and your default terminal should open.

With your terminal now open, the format of the command is something like this:

For example, if I wanted to connect via SSH to run one command, and that command was to list the files in the home directory, the command would look like this:

Note: That device doesn’t face the public internet, so I don’t have SSH keys enabled on the device. So, that means I have to enter my password in the image below. With that in mind, the output of that command would look like this:

login to ssh to run one command
See? It logs into the remote device, runs one command, and exits! Pretty neat, huh?

Of course, you can make it your own and there would be one less step if you had set up SSH keys. You can also make it more complicated if you want. You could try any one of the following commands, adjusting it for your needs:

Go ahead and play around with this. If you want to login to SSH to run one command, that’s how you do it. You can make the command as simple or as complicated as you want. So long as you string it together properly, the sky’s the limit!

Like I said above, you can just install SSH on your single device and practice what you read in these SSH articles. It’s not particularly taxing. There are plenty of articles to help you along the way.

Closure:

See? It’s really not all that hard to login to SSH to run one command and then exit automatically after that command has been run. It’s another handy SSH trick that you can add to your SSH toolbox. Also, the article is longer than I anticipated. Ah well…

What comes next? I have no idea. I try to not write too many consecutive articles on the same subject. Mixing them up seems the best way to go about it, as the site’s meant to be searched and not read like a blog. I do have a bunch of SSH content, but I’ve also covered a whole lot of it already.

Thanks for reading! If you want to help, or if the site has helped you, you can donate, register to help, write an article, or buy inexpensive hosting to start your own site. If you scroll down, you can sign up for the newsletter, vote for the article, and comment.

Subscribe To Our Newsletter
Get notified when new articles are published! It's free and I won't send you any spam.
Linux Tips
Creative Commons License
This work is licensed under a Creative Commons Attribution 4.0 International License.