Let’s Make An Animated GIF (With ImageMagick)

Today’s article is just for fun, where we learn how to make an animated gif in the terminal – with ImageMagick. It’s just for fun and not something you’ll likely need unless you’re some sort of content creator. (We don’t know any of those, do we?) Anyhow, let’s go ahead and make an animated .gif in the terminal.

Today, we’ll be using ‘ImageMagick’. As far as I know, imagemagick has one of the longest and most complicated man pages. It’s huge and a capable tool in the right hands. ImageMagick has all sorts of capabilities but a new user isn’t likely to use them because of the complexity involved.

And, ImageMagick is complex… In fact, it defines itself as:

ImageMagick – is a free software suite for the creation, modification and display of bitmap images.

That’s an accurate description, I think… Except, well, it does a whole lot more than that. We’ll be using the .gif format, while the man page description only mentions bitmap. So, there’s a lot to the application.

Thus, without further ado, we make an animated gif in the terminal…

How To Make An Animated GIF:

The ImageMagick application is terminal-based. So, you’re going to need an open terminal. If you want, you can just press CTRL + ALT + T and your default terminal should open.

If you don’t have ImageMagick installed, you’ll need to install it. If you’re using a mainstream distro, it’s possibly installed already. Otherwise, it’ll certainly be in your default repositories as it’s a pretty major tool. For example, an apt user would just use a command like this (adjust for your package manager):

With your terminal now open and imagemagick properly installed, let’s just see how long that man page is:

See? I wasn’t kidding!

Now, here’s what you need to make an animated gif:

  1. A dedicated folder, perhaps in your ~/Pictures directory.
  2. A few images of the same format, we’ll use .jpg in our example.
  3. A terminal opened in the above-mentioned dedicated folder.

The first thing to learn is that this command is going to take those images and turn them into an animated file with the .gif extension. It is going to organize them alphanumerically. So, you should rename the  .jpg files in the order you wish to see them (assuming the order matters to you).

All set? Have you done all those things? Are you 100% prepared? Good!

The command we’re looking for would be:

Alright, so the ‘delay 100’ is how long each image will be shown – in hundredths of a second. The ‘-loop 0’ tells it to loop infinitely, or you can pick your own number of times. The ‘*.jpg’ means use all the .jpg files in that directory. The ‘file_name’ is the name of the file you want to have as your output.

See? Pretty simple. An example command might be something like:

Let the command run, and it is a pretty speedy process unless you have a whole lot of images, and you’ll get an animated gif as a result. As these tend to have smaller file sizes, it’s sometimes a better option than sharing a larger video file. It depends on your circumstances, I suppose.

NOTE: This article has been edited to correct the time delay, the delay between changing images. Thanks @wizardfromoz!

Closure:

There you have it. You have an article that tells you how to make an animated gif with ImageMagick. The ImageMagick application has a ton of options, making it daunting for a new Linux user. So, this is just a tiny bite. This is just one of many ways to use ImageMagick. Instead of learning the whole application at once, you can do so in chunks – learning only what you need.

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 site. If you scroll down, you can sign up for the newsletter, vote for the article, and comment.

How To: Show File Sizes When Listing Files In A Directory

Today we’re going to have an easy article that shows you how to show file sizes when listing files in a directory. It’s a simple set of commands and easy enough for a newbie to learn. Though the title is unwieldy, read on to learn how to show file sizes when listing files in a directory…

We’ll be using the ‘ls’ command for this exercise. Like normal, I’ll go ahead and suggest you read this page about why you shouldn’t parse the output from the ‘ls’ command. There are better ways and that link will explain it, and what you should consider, far better than I can.

Anyhow, the ‘ls’ command defines itself as:

ls – list directory contents

Of course, regular readers will recognize the ls command as we’ve used it numerous times before. Even though you shouldn’t parse the output from the command doesn’t mean it’s not still useful for a variety of other tasks.

Today, we’ll be exploring one of those tasks. We’re going to show you how to show file sizes when listing files in a directory – specifically with the ls command. Don’t worry, you won’t need to install anything. If you’re using any desktop Linux distro, the ls command is certainly available to you by default.

For the record, you should probably view the ls man page (run man ls in the terminal) to learn more about the command. It’s still a useful command – and I do sometimes parse the output from the command, but only when nobody is looking and when the output isn’t all that vital. I use grep with the ls command almost every day! Shh!!!

Show File Sizes When Listing Files In A Directory:

(That’s an unwieldy title!)

Anyhow, it’s the ls command. That’s a terminal-based command. So, of course, you’re going to need an open terminal (like so many of these articles). Press CTRL + ALT + T and your default terminal should open. Tada!

With your terminal now open, we can just use your home folder. To run the basic ls command, it’s just that:

Now, to show file sizes when listing files in a directory, you’d start with the -s flag:

You may find the output from that command is relatively useless without doing a bit of math to go along with it. Fortunately, you can tell the command to show the file size in a ‘human-readable format’. To do that, you’d run this command with the -h flag:

Now, if you wanted to show all the files, including the hidden files in that directory, you’d just add the -a flag. The command would look like this:

And if I was a Linux newbie, that’s the command I’d commit to memory. It doesn’t make a mess. The output is still plenty clear. It’s easy to understand. It’s easy to remember and turn into a habit. This way, when you ran the ls command, you just default to using -ash flags.

If you don’t want columns (and some do not), and you want more information such as file permissions or ownership values, you can just add an -lflag to the above. That’d look like:

So, it’s up to you…

You can remember ‘ash’ or you can remember ‘lash’. You can also not remember either and ignore the flags completely, but I find developing a habit is a good way to remember things. It’s your device, you do what you want!

Closure:

There you have it! You have another article. This one was simple enough and I hope you found it useful. If you’re new and running the ls command is new to you, it’s worth learning some additional flags and gathering more information at a glance. That’s why there’s this relatively simple article that shows you how to show file sizes when listing files in a directory.

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.

Let’s Find A Site’s MX Records

Today’s article is going to be rather specific and brief, as we learn how to find a site’s MX records. This isn’t something everyone is going to need to know, but it’s useful for debugging an email issue when you’re hosting websites. So, some folks are going to find it useful – and will then know how to find a site’s MX records. Read on!

I suppose most of my readers will not know what an MX record is…

In short, an MX (Mail Exchange) record is another DNS (Domain Name System) record. In this case, it is used to route emails to the correct server (via the IP address, basically). From there, your server will route the emails to individual email inboxes.

Basically, you want to know this information when things go pear-shaped with your emails or maybe when you’re using a 3rd party email service provider. There are reasons why people will want this information, they will want to find a site’s MX records.

Additionally, I figured I’d do this article now while ‘dig’ is still fresh in our memory. After all, I’ve used dig in the previous two articles and this is the final dig-related topic that I can think of. Here are the previous two articles, if you’re not reading these articles in order and are unfamiliar with the dig command:

How To: Find A Website’s IP Address
How To: Find A Site’s Nameservers

So, with all that in mind, let’s learn how to find a site’s MX records!

How To Find A Site’s MX Records:

Yes, dig is run in the terminal. Yes, you’ll need an open terminal to follow along. 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, the syntax for this specific dig command is:

For example, you’d find this site’s MX records with:

If you want, as the other dig commands used recently, you can use the +short flag with this, like so:

The output should look like this:

using the dig command to find a site's MX records
There, you can see this site’s MX records. This is public information. So, gawk away!

You can have more than one MX record, should you want failover but the mail protocol already includes some efforts to resend mail when there’s an outage. That’s irrelevant here, but information that I might as well share.

Also, like the other dig commands covered, you can put the flags at the end, like so:

So, that’s an option. I’m not sure why it’s an option. If anyone has a clue as to why it’s an option, do feel free to share. Heck, even if it’s a wild guess, I’ll take it. But, if you want more information about the dig command, run man dig in your terminal.

Closure:

There you have it, it’s another article. I think this is the last dig article, but who knows? This time around, we’ve learned how to find a domain’s MX records. For those that need to know, this will be handy.

For everyone else, you’ll likely forget this by tomorrow – and that’s okay. You don’t have to carry all the tools in your toolbox. If you tried, you’d need a very big toolbox and it’d be hard to carry 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 site. If you scroll down, you can sign up for the newsletter, vote for the article, and comment.

Disable Window Grouping In Lubuntu

Today’s article will only matter if you use Lubuntu and want to disable ‘window grouping’ in Lubuntu. I find window grouping an annoying ‘feature’ and look to turn it off whenever I come across it. If you’re like me and want to disable window grouping in Lubunt, read on ’cause this article is for you!

I’m not sure how well I can format this like a normal article, but let’s start with the basics and see where things end up.

What is ‘window grouping’?

Window grouping is when your desktop groups similar applications together. If you have 3 instances of Firefox open, you’ll only have one instance shown in the panel (taskbar). If you click/highlight that one instance of Firefox, you’re then able to pick which of the Firefox instances you want to bring to the front.

This is an example of window grouping, where I have multiple instances of PCManFM-Qt open:

window grouping
That’s ‘window grouping’. Ugh…

I dislike this feature a great deal. It slows me down. It doesn’t reduce clutter, it adds clutter where I don’t want it. If you like window grouping, by all means, enjoy the feature.

If you are like me and find it to be an annoyance rather than a benefit, I have good news! The good news is that it can be turned off! If you’re using something other than Lubuntu, you can probably also turn it off. If you’re using another distro, a distro that’s using LXQt, you can also follow these directions.

Anyhow…

Disable Window Grouping In Lubuntu:

If memory serves, and it has been a while, if you were using Lubuntu during the LXDE days (no longer supported in any iteration of Lubuntu), you’d disable window grouping through PCManFM. This is not the case with modern Lubuntu. The current Lubuntu, and all supported Lubuntu versions, uses LXQt and it’s a different process to disable window grouping.

You can right-click on the bottom panel and select “Configure Panel” (you may have to mouse around a bit to find an empty place in the panel). From there, you’d click on Widgets (on the left) and then on “Task Manager”.

Alternatively, if you have a nice blank space in the task manager section of your panel (the bit of information at the bottom of the screen), you can skip the above step because you can just pick ‘Configure “Task Manager”‘ from that pop-up.

Either way, you end up at the following screen, at which point it should probably become obvious. Find and disable the window grouping option. It will look like so:

there's an option to disable that window grouping feature
Just un-tick the box and you’re on your way! Hit the close button.

When you’ve done that, the changes will take effect immediately and you can just hit the close button, happily going about your day without that silly window grouping feature. Just for completeness, it’d look like this:

the lubuntu task manager without window grouping enbled
I prefer it this way. I am not a fan of window grouping. It’s pretty easily disabled, thankfully…

If you decide you want to keep the window grouping, it’s easily reversed. You can also adjust other features while you’re there, should you want to do so. If you get there via the “Configure Panel” option, you can go through the “Widgets” and customize them as you see fit. You can also add and remove them while you’re there.

Closure:

Hey! There you go. You have another article! This time we’ve not even used the terminal! This time, we’ve just decided to learn how to disable window grouping in Lubuntu. It’s pretty easy once you know how to do it and what the feature is called. It’s one of the defaults that I change soon after I do a fresh installation.

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 site. If you scroll down, you can sign up for the newsletter, vote for the article, and comment.

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.

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.