How To: Disable The Caps Lock Key

Today’s article is one that I used to scratch my own itch because I really like to disable the caps lock key. Of all the keys on the keyboard, that’s the only one that makes me want to disable it. The rest of the keys are fine, but I have no use for a caps lock key.

NOTE: This is probably not going to work if you use Wayland. I don’t know, I haven’t tested it. If you’re wanting to test it so that you can write paragraphs about how wrong I am, please do. I’m a little curious! I need to learn more about Wayland.

Sure, we could use the destructive (or at least awkward) method and physically rip the key off the keyboard. Some fancy keyboards have easily removed caps, meaning you can just remove them with a little caps-puller tool. Pretty much every time I’ve needed to remove keys, it has been a permanently destructive process, but I know it can be done.

By the way… This is why I’m a wasteful jerk sometimes and I just chuck that keyboard in the trash when I’m done with it. To be fair, I wear the letters off a cheap keyboard.  Where my thumb hits the space bar it wears down the plastic from repeated use. I’m not a ‘hard typer’, I’m a prolific typer. So, here we are…

Those of you with a keen memory may recall this article:

Disable The Caps Lock Key In Linux Mint

That was fine for Mint (Cinnamon)… It’s not a universal thing. I meant to write a more universal thing, so I guess this counts as that…

Disable The Caps Lock Key:

You’re gonna want a terminal window open for this. So, press CTRL + ALT + T and your default terminal should open. Tada!

Now, the tool we’ll be using is called ‘xmodmap’. See that ‘x’ in there? Yeah, that’s what (along with the description) makes me unsure if this is going to work for Wayland users. If you’re using a major distro, especially one using X, you’ve got this tool installed by default.

When xmodmap is not installed, the package name should be ‘x11-xserver-utils’ in Ubuntu and it’s fairly safe for other distros to assume the appropriate package will show up if you search your repositories for it. If you need to install it, say with a distro that uses apt (and you shouldn’t), then the incantation would look like this:

Got it? Is it installed? You can check if it’s installed with this command:

Now that you know you have xmodmap installed, you can just use the following command to disable the caps lock key:

Should you change your mind, which you shouldn’t because caps lock is evil and gets in the way of perfectly good typing technique, then you can undo this. Try this command, it should work:

That right there should get rid of your caps lock key’s functionality. You should be able to press the key and have exactly nothing happen, which is a good thing. 

Closure:

Yes, I know the Internet Wisdom© insists that “caps lock is cruise control for cool” but just don’t… No… Just don’t do that. Really, don’t do that!

Try as I might, I can’t think of a legitimate (for me) reason to use caps lock. I never use it on purpose. If I need a few capital letters, the regular shift key works just fine. I have two hands, after all.

So, if you’re like me and don’t want to be cool (and have fewer hassles) go right ahead and disable that caps lock key. I sometimes press it by accident while typing and not looking. It just makes a mess of things. While I type like a demon on fire, I don’t hold my hands in the correct position and don’t use the right fingers for the right keys. I press that ****ing caps lock key way too often, so disabling it makes my life easier.

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.

A Fun Way To Check If Your Network Devices Are Connected

Today is going to be a fun article, mostly good for lazy people, where we discuss a way to check if your network devices are connected. There are far easier ways to do this, assuming you’re local to the device. If you’re not local to the device, the fact that you’re connecting to it likely means that the network is at least somehow connected!

But, in the spirit of being lazy, let’s head into the world of sheer, unadulterated laziness. I mean, if you want to know if your wireless is connected there’s an icon. Of course, you can see if your ethernet is connected. To check that ethernet connection all you probably have to do is look at the back of the computer and maybe wiggle the cable a little bit.

This, of course, presumes that said network adapters are in working condition. If they’re broken, this tool might give you a bit of debugging information. But, still, this is a command that calls itself a “beat connector”. It’s mostly used to check to see if your network devices are connected – as in physically connected to your computer.

The tool we’ll be using will be ifplugstatus and it defines itself as this:

ifplugstatus – A link beat detection tool

At least as far as I use it and the man page indicates, it checks to see if your network devices are connected. Seeing as that’s what the title suggests, it means we’re probably off to a good start!

Check If Your Network Devices Are Connected:

First things first… You’ll almost certainly find that ifplugstatus is not installed by default. You’ll need to install ifplugstatus if you want to use it. To do that, you’ll need an open terminal – which you’ll need for the rest of the article. To open your terminal, press CTRL + ALT + T and your default terminal should open.

Now, I’ve only ever used this command with Lubuntu and similar. Because of this, I don’t know if it’s the same on other distros. (Feel free to leave a comment.) But, at least in Lubuntu, not only is ifplugstatus not installed by default, that’s not the name of the package you need to install. No, that’s a different name and to install ifplugstatus you will want to run the following command:

You’ll need to adjust that command to match the distro you’re using.

Anyhow, with ifplugstatus installed, you can check if your network devices are connected with just the following command:

But wait! There’s more! You can get a lot more information about your network devices by adding the -v (verbose) flag to the command. That flag automatically assumes the -a (all) flag, so it’s just:

There you have it… Instead of just looking in the status bar section to see if wireless is connected, or even looking around the back to see if the cable is connected, you can just check all that right there in the terminal – without having to move much more than your hands! You’re welcome!

Closure:

Heh… There you have it! You have another article. If you ever want to check for a beat, that is to check if your network devices are connected, you now know how to do so. You can even SSH into another device and check to see which of its network devices are connected (beyond the obvious one you’re connecting with). You don’t even have to leave your seat.

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: Find Local Network Devices

Today’s article will be a bit of a weird one, as I share with you one way to find local network devices using the Linux terminal. I suppose network device discovery is typically seen as a dark art, something a malicious hacker might do, but it’s completely harmless (in and of itself). So, if you want to find local network devices, this article just might be for you!

What we’ll actually be doing is scanning a block of IP addresses to see what responds to our prodding. This is sometimes called IP Scanning or IP Sweeping. It’s also sometimes called Port Scanning, but we won’t be doing any real port scanning. I assure you, I am not secretly trying to turn you into a big bad hacker – but this is a pretty neat ‘hack’ (in the traditional sense of the word).

We will be learning just a single command (with a bit of explanation) with a single flag. It’s a very complicated tool and trying to cover it all would take a giant article or many smaller articles. You can guess which one we’re going to do!

The tool we’re going to use for this is called ‘nmap’. This is available in every major distro. It might be installed by default. It’s just the tool for the task at hand, so you need to install it before you can use it as this article will suggest. (I trust you to know how to do so at this point.)

Did you install nmap? If so, please continue. If not, read the last paragraph.

With nmap installed, you can check the man page to see that it’s described as:

nmap – Network exploration tool and security / port scanner

Now you’re ready…

Find Local Network Devices:

Picture this…

So, for some reason, one of my laptops has stopped answering on the .local domain when I want to connect to it with SSH. I have choices at this point. I could fire up Team Viewer and then connect to the laptop to find the IP address belonging to the said laptop. Another choice would be to get off my lazy butt and walk to the device, but that defeats the point of remotely controlling the device.

I suppose the best choice would be to just figure out why it’s stopped responding on the .local domain. Wouldn’t that be novel?

But, I have another tool! I have a tool that’s reasonably fast, very easy, and likely effective! That tool is, as suggested earlier, nmap.

The first thing I do is crack open a terminal to find my local IP address. That’s easy enough and the link will show you how to find your private (or local) IP address. Though it needn’t be private. Security by obscurity is not security – and it’s trivial to learn. But, that’s an article for another day.

I was able to quickly learn that my local IP address is 192.168.215.88. From this, I realize that the most common configuration will be for everyone to be on the same subnet and so my laptop likely falls within the 192.168.215.1 to 192.168.215.255 range.

We can use the asterisk to represent any of those numbers, as it’s a wildcard. This means the next command is obvious and will be simply:

The -sn flag would mean ‘do not do a port scan’, so it’s checking only for devices that return a ping. Make sense? (It’s a pretty speedy command when not also scanning ports.)

A Picture Of nmap:

I think that this is one of those instances where my text isn’t quite clear enough. So, what I’m going to do is show you a picture. 

The nmap command I ran showed me a list of local network devices. As I already know the IP address of the device I’m using, I can exclude that from the list. The device I’m looking for (my laptop) is then a different IP address.

The process looks something like this (trimmed down to just have one device for simplicity’s sake):

using nmap to find local network devices
As I know my device’s IP address, I can exclude that from the list of possible IP addresses.

As you can see, I first tried to connect with the .local domain and found that it did not work. So, I ran the nmap command and used a wildcard to scan the entire IP address range (1 to 255).

Sure enough, the IP sweep with nmap found another device and showed the IP address. It showed the gateway, which I could also exclude. The process of elimination meant there was one IP address to try (it could have contained more devices). I tried to use SSH with that IP address and, sure enough, that’s my laptop!

See? I saved a trip across the room! I saved opening up a bulky application and waiting for it to do its thing before I could even try using it to connect to the laptop. In fact, I suppose I also saved the effort I could have spent just randomly guessing IP addresses and hoping I got the right one for my laptop eventually!

Closure:

I figure there’s a lesson in nmap in there somewhere. You never know when you’re going to need to find local network devices! Now, when you do need to do so you will know how.

I figured I’d try writing this one in a way that showed you how I benefit from knowing how to do this. I figured that it’d be interesting to show you how the command solves a real problem. There have been a few articles similar to this and they’re fun articles to write. They are articles that come from the real me, the me that is actively using and appreciating Linux (often in the terminal) in my day-to-day life.

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: Encrypt A USB Drive

So, today’s article will be a bit different, as I answer a question posed to me by way of the contact form – which is how to encrypt a USB drive. Being the nice guy I am, I answered the question. As I’m also often busy (or lazy), I also decided to turn this into an article. Why not?

I normally frown on people asking me questions directly. My usual suggestion is that they visit a forum and ask there. I usually direct them to Linux.org, where there’s a good forum filled with all sorts of smart people. That’s usually a sufficient answer, but this time I had a few spare minutes and typed out a response to them.

First of all, this was their question (I’ve removed all the superfluous stuff):

How would you encrypt a USB drive?

There were several sentences, a preemptive thanks, and some commentary about reading the site regularly. I decided to tackle this question but I was limited strictly to text because I was using email as my format.

But, if we start with the question, we can see an immediate problem. The question was ‘how would you’… Well, I’d crack open the terminal and use a tool called cryptsetup. That’s what I’d do. It’s a great tool and I’m familiar with its use.

However… That’s not what I’d suggest to the person asking the question. I did mention this to them in my reply, leaving the door open for more questions or for them to hit up their favorite search engine. Instead, I detailed another way to encrypt a USB drive. Yes, they used the word ‘drive’ and not ‘thumbdrive’. That doesn’t matter.

How To Encrypt A USB Drive:

The first thing you’re going to need for this is ‘Gnome Disks’. So, let’s go ahead and ensure you’ve got that installed, open your terminal by pressing CTRL + ALT + T and install the application. If you’re using apt you’d use the following command, but you’ll need to edit it for your package manager. (It’s almost certainly available in your default repos.)

Using Gnome Disks is a good idea. It’s fairly ubiquitous, easy to install, and doesn’t pull in a ton of dependencies when you install it. That means you can easily use Gnome Disks with pretty much any desktop environment out there with ease and very little fanfare.

Now, insert the USB drive. Don’t worry if it automatically mounts. Gnome Disks is smart enough to deal with that. Any data on this disk will be lost. It will be irrevocably lost. There’s no ‘oops’ button involved.

With Gnome Disks now installed (do not ask me why the command to open the application is different than the command to install the application), you can open it with the following:

There you go, you’re in a GUI now. You won’t need the terminal for anything else. (This would be easier with images, but I couldn’t really include images in the email reply without a lot of work and them potentially never even seeing the images due to reading the email in plain text format.)

On the lefthand part of the Gnome Disks window, pick the USB drive you want to encrypt.

On the right-hand part of Gnome Disks, click on the ‘gears’ icon and select the ‘Format Partition’ option.

Add a name for your encrypted USB drive in the next window. Then, say it is an internal disk (it’s all good) and tick the button to password-protect the volume.

In the next window, you will type your password twice. You’ll type it once and then type it again below that. This is to make sure you typed it properly. It’s a good idea to remember this password, ’cause this isn’t something you can just back out of and still have your data.

At this point, Gnome Disks will give you a warning about data loss. In the upper right, click the ‘Format’ button. Be certain about what you’re doing because this will erase data. Gnome Disks doesn’t care if the drive contained the only copies of your child’s birthday pictures.

Gnome Disks is kinda like a wolverine. Approach it with caution because it does not give a crap about your feelings.

Assuming the winds are in your favor, you should now have an encrypted USB drive. Test this by unplugging your USB drive and plugging it back in. When you plug it back in, it should ask you for a password. Enter your password to ensure you typed it properly in an earlier step. If all goes well, enjoy your encrypted USB drive.

Closure:

By the way, happy Mother’s Day (for those who qualify).

And so, that was more or less my answer to the inquisitive user. I don’t mind questions. I just don’t always have time for that, and often don’t know the answers. Of course, I did make a few changes. The actual reply I sent them was worded a bit differently in places. I think the above reads better and is more concise.

In this case, I think I got it right and they were able to encrypt their USB drive. I haven’t heard back from them since. It’d be nice if they let me know but they left me hanging. Ah well… If it’s wrong, someone will leave me a comment!

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: Tell If You Are You Using UEFI or BIOS

Today’s article will be another short-form article, where we quickly learn how to tell if you’re using UEFI or BIOS with your Linux computer. Making a few short-form articles seems like a fun idea, so why not? There’s room for all sorts of stuff and now that I’ve done this for a couple of years.

In short, when you boot your computer there’s a bunch of stuff you don’t see, but the hardware needs to interact with the software. We used BIOS for many years, but the new and improved method is UEFI (which stands for Unified Extensible Firmware Interface). 

UEFI is meant to improve on some BIOS limitations and to help increase your security. If you have a modern computer, it’s capable of UEFI but might have BIOS available. If BIOS is available, it may be referred to as ‘Legacy’ if you want to go mucking about to change it.

Linux supports both UEFI and BIOS booting. If you installed Linux yourself, you may already know if you’re using UEFI or legacy booting. However, if your Linux installer notices that it is in either mode, it will default to installing in that mode. So, I suppose it’s possible for some folks to not actually know if they’re using UEFI or BIOS.

This leads me to today’s article…

Are You Using UEFI or BIOS:

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 new terminal open, type the following command (or cut and paste the command, if that’s easier):

If it lists an output, you’re using UEFI. You’re using BIOS if you get an output that’s something similar to:

It really is that simple. 

Closure:

Well, this is the shortest article I’ve written. At least I’m pretty sure that it’s the shortest article I’ve ever shared. Brevity is not my strong point, but at least now you know how to tell if you’re using UEFI or BIOS. So, you didn’t come away empty-handed – unless, of course, you already knew that.

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.

Linux Tips
Creative Commons License
This work is licensed under a Creative Commons Attribution 4.0 International License.