Is my Internal IP Address Static or Dynamic?

In the days of modern internet connections, you’re almost certainly using a router. Routers are different and may offer you a static or dynamic internal address for use on your LAN. This article will tell you how to tell the difference between a static and dynamic IP address using the Linux terminal emulator.

So, I’m going to assume you know what an IP address is. It’s basically the numbers used to indicate a specific computer, though it’s a bit more complicated and you can read the Wikipedia page on IP addresses if you want a more detailed explanation.

A dynamic IP address is an IP address that changes from time to time. A static IP address is one that doesn’t change. The first one will be different after a set amount of time or events, the second one will always be the same.

The benefits of a static IP address are many, chief among them is consistency. This is true even on a LAN (Local Area Network). If you don’t recall the device name, you can easily access it by IP address. If the device doesn’t have a hostname, you can access it by IP address, and the address doesn’t change.

The benefits of a dynamic IP address are pretty much none, unless you’re a provider who wants to rotate through them because of constantly changing devices. For you my delightful reader, in your realistic use-cases, there are no real benefits to having a dynamic IP address. They’re a great idea when you have more devices than you have IP addresses – which is very unlikely to be true if you’re reading this site for Linux tips! 

NOTE: Your Linux distro probably happily works with .local. So, if you have a dynamic address you can still access it through hostname.local. For example, this computer is ‘kgiii-desktop’ and I can access it with ‘kgiii-desktop.local’ easily enough.

Anyhow, it’s pretty easy to tell. The first thing you need to do is crack open your terminal. You can do this by pressing CTRL + ALT + T. Then, just enter:

Now, just look for ‘valid_lft’ and you’ll have your answer.

If it’s a dynamic IP address you’ll see something similar to this:

If it’s a static IP address, you’ll see something similar to this:

See? I told you that it was pretty easy! Now that you know, you can easily check and act accordingly. As always, thanks for reading. Don’t forget to sign up for the newsletter. You’ll get an email when a new article is published and make an old man happy!

Smash a Button
[Total: 1 Average: 4]
About Me: I'm just some retired dude with a little bit more free time on my hands. If you want to support the site, why not help yourself out too by ordering some inexpensive web hosting so that you can start your own site?


Fixing gdebi. The Ugly Hack!

One of my favorite software installation tools (when using Aptitude) is a little number known as gdebi. It makes installing applications with a .deb a very painless and rapid process. On top of that, you can later click on the original .deb and use gdebi to uninstall it. Best of all, it’ll resolve dependencies when that is a situation it can handle.

You don’t have to mess around with anything – just click and install. It’s lovely, small, and effective. It’s just like a Linux application should be!

This is how the manual describes gdebi:

gdebi lets you install local deb packages resolving and installing its dependencies. apt does the same, but only for remote (http, ftp) located packages. It can also resolve build-depends of debian/control files.

Note the lack of excessive adjectives. It was obviously not written by me. I have oft sung the praises of gdebi and am personally the motivation for hundreds of folks installing it. Seriously… I’ve told countless people to install gdebi! It’s just that awesome. I’ve probably been using gdebi since I first used a distro with the Aptitude package manager.

gdebi installing balena etcher
See? It’s so lovely and simple.

Imagine my dismay when I discovered gdebi was broken!

I’d open gdebi, click on install, gdebi would close without asking me for a password, crash, and not install the software. This is an ugly, ugly hack to fix it. It’s so very ugly – but it works.

Crack open your terminal with CTRL + ALT + T and enter the following:

Find this line:

And change it to:

Then save it. (CTRL + X, Y, and ENTER)

Now for the ugliness. This will fix the problem, but every time you use gdebi a terminal window will open up along with it. Fortunately, the terminal window will close itself after you’re done. It’s an ugly, ugly hack – but it does work when gdebi closes without installing the application.

As always, thanks for reading. Leave a comment below or look to your right where you can sign up to get notifications when new articles are published. If you’re feeling energetic, go ahead and register so that you can write an article or two yourself! If you want to write an article without registering, you can do that too – just click here!

Smash a Button
[Total: 0 Average: 0]
About Me: I'm just some retired dude with a little bit more free time on my hands. If you want to support the site, why not help yourself out too by ordering some inexpensive web hosting so that you can start your own site?


How To: Enable a Swapfile

Yeah, yeah… I have a modern, large SSD. I have more RAM than I’ll ever possibly use. I still want/enable swap, in this case a swapfile. Imagine my dismay when I installed Lubuntu 20.04 and found there’s no swap available during the basic installation? (It’s there in 21.04.)

no swapfile
See? There’s nothing there!

Sure, I could have made a swap partition during the installation, but that didn’t seem like something I wanted to do – besides, I can always add it later. Which, of course, I did.

There are all sorts of views about whether swap is required in my situation, or in any situation, but I’m of the mind that disk space is cheap and my computer is faster than I am. So, if it has any chance of helping, it’s all good. It should also be mentioned that swap is far more complicated than ‘a place where the kernel sticks stuff when there’s no more RAM left’. In fact, it’s a lot more complicated than that. It’s where the kernel pages content that’s seldom used, and it’ll happily use swap even when there’s plenty of RAM available.

Since it’s lacking, let’s learn how to add a swapfile to Ubuntu (and official flavors) 20.04 and presumably other similarly aged variants. It’s a pretty painless process. 

Like normal, let’s crack open your terminal emulator with CTRL + ALT + T.

Now, let’s check to see if you’ve already got some swap going on.

If it shows nothing but a new line, you have no swap. If it says anything else, you’ve got swap enabled already and probably don’t need this article.

Just so you know, I personally just did this a couple of days ago, after upgrading to Lubuntu 20.04. So, I’m pulling this data from .bash_history.

Let’s make a swapfile.

Why 8 gigabytes when I have ample RAM and an SSD? Because I never, ever want to worry about it again. I want to be able to open up every app I have and leave them open for a month. You do you and decide how big you want it to be!

Now, we need to set some permissions. We don’t want anyone writing to swap, we only want root writing to swap.

Next, we need to let the OS know that’s swap space.

And turn it on with:

And you now have swap in the form of a swapfile and it’s turned on. I suppose we should make this permanent. To do this, we need to edit fstab and nano is a good tool for this.

And add this at the bottom of that document:

Those are the 0 digit, in case the font here makes it confusing. (I think I’ll try messing with the fonts.)

Either way, you should now have a swapfile that gets loaded on reboot and is currently loaded and working. You can next edit the swappiness value. In Ubuntu, it is a default of 60. If you want to edit it, you’ll have to wait for another article.

Like always, thanks for reading. It’s missing at the moment, or not working, or I’d say subscribe and get notifications of new articles. However, I’ll have to work on that. I just haven’t made the time to do so.

Smash a Button
[Total: 0 Average: 0]
About Me: I'm just some retired dude with a little bit more free time on my hands. If you want to support the site, why not help yourself out too by ordering some inexpensive web hosting so that you can start your own site?


How To: Install ‘gedit’ With All The Bells and Whistles

There are many text editors out there, but gedit is a perennial favorite. There are also many plugins to extend gedit, and this is an easy way to install a bunch at once.

gedit, the default editor for the Gnome desktop environment, is a part of the GNOME Core Applications and is available in pretty much every distro. It also doesn’t actually need a lot of additional dependencies, which helps make it useful for most any popular desktop environment.

You can use gedit for anything, from programming to writing markup for your website. You can use it as a plain text editor and there are many ways to extend it, to add functionality not included by default. There are plugins to highlight syntax, to auto-complete words, to auto-close brackets, etc. You can make it do all sorts of things you’d not expect from a plain text editor.

Given that disk space is absurdly cheap these days, I don’t see any reason to not just go ahead and install as many plugins at once as I can. I may not use them all, but I’ll use most of them and I can just not enable those that I don’t want to use. So, how to install it all at once?

Crack open your terminal with CTRL + ALT + T and enter the following:

So, what’s going on there? You can string together applications with aptitude and this is installing gedit first, a pack of common plugins, and then every other plugin that uses the ‘gedit-plugin-*’ format and is in the repositories.

If you don’t already know, the asterisk is known as a wildcard. A wildcard basically means, “any character.” So, foo* is anything from fool to foolish and foob* is anything from foobar to foob-gibberish183742 or whatever. It’s unlike the question mark, which only matches one character, in that it means any and all characters.

It should be noted that this only installs the plugins. You still can’t use them until you enable them. To select them, you need to first open ‘gedit’ (which will almost certainly be called “Text Editor” in your application menu) and click on preferences where you can navigate to the right-most tab and enable them. It looks like this:

gedit preferences
Select plugins ’til you’re satisfied!

If you did this properly,  you should now have a bunch of plugins enabled and not have to hunt them down, one by one, trying to find and install them manually. Is this a bit of overkill? Perhaps, but disk space is cheap and the entire thing takes up less than 19 additional MB on my system.

Like always, thanks for reading. Scroll up and look right. Toss your name and email address in there and you’ll get notified of new articles. I promise, I won’t spam you. You ain’t even gotta use your real name!

 

Smash a Button
[Total: 1 Average: 5]
About Me: I'm just some retired dude with a little bit more free time on my hands. If you want to support the site, why not help yourself out too by ordering some inexpensive web hosting so that you can start your own site?