Linux Archives

Over 80% is running on some form of Linux – so does your Mac and you iPhone. Sometimes we have to get our hands dirty on the command line – it makes you feel like a proper hacker.

Here are some pointers I picked up on my journey.

How to extract files from a bz2 archive in Linux

If you’ve ever tried to decompress a file that ends in tar.bz2 using the tar command with the standard -x option, you’ll have noticed that it doesn’t work. That’s because some versions of tar don’t understand the bzip2 codec used in these archives. However, you can tell tar to use this option by specifying the … Read more

How to remove duplicate packages with yum

I’m working on a handful of servers that all have the same problem: when running yum, an error message appears that tells me a package called ntpupdate needs to be upgraded, but somehow this doesn’t work and the package is being skipped. Then follows a huge list of duplicate packages that are installed on those systems (probably installed by the automatic package updater within Plesk).

Let’s see how we can fix such issues.

Read more

What’s the difference between the Logitech M325 and the M325c

The Logitech M325 and M325c are both wireless USB mice. Their design appears to be identical (except for the many different colourful variations of course), and their prices vary from anything between $12 and $60 – depending the layout and seller. Even the packaging is identical. So what’s the difference between these two models? Is … Read more

How to check which web server is running on a domain

Sometimes we must know what web server is running on a particular domain. Usually web hosts should be able to tell a client this, but if the client is afraid to ask, there is a way to ask the web server directly for this information.

Just to clarify: the web server is the process that serves files (HTML, PHP, ASP, images, etc) from a remote machine to your local web browser. The most likely choices in this day and age (2017) are Apache, NGINX or IIS. The latter is used by Windows servers, and the two former are used by Linux servers. There are other web servers too, such as lighttpd, but they’re used less commonly.

By asking the web server for this information, we can tell exactly who’s serving those files.

How to ask the Web Server

Let’s open a Terminal or Command Line Prompt window and utilise the good old fashioned Telnet protocol. Replace yourserver.com with the actual domain in question:

Read more

How to reset the admin password in Plesk Onyx

It’s not pretty when it happens, but it happens to the best of us: you forget the admin password for your Plesk Onyx installation.

In previous versions there was an option to retrieve this password via the command line, but that special command has been removed in Onyx for security reasons.

So what can we do? Well luckily it’s relatively easy to reset the password to something else, or gain temporary access to the server quickly. Let me show you how.

Read more

How to fix duplicate packages in yum

From time to time, the yum package manager may encounter issues with duplicate packages that are erroneously installed on a system. This manifests in a yum update going awry, telling us something along the lines of this:

yum update
...
--> Finished Dependency Resolution
Error: Package: ntp-4.2.6p5-22.el7.centos.2.x86_64 (@updates)
           Requires: ntpdate = 4.2.6p5-22.el7.centos.2
           Removing: ntpdate-4.2.6p5-22.el7.centos.2.x86_64 (@updates)
               ntpdate = 4.2.6p5-22.el7.centos.2
           Updated By: ntpdate-4.2.6p5-25.el7.centos.x86_64 (base)
               ntpdate = 4.2.6p5-25.el7.centos
 You could try using --skip-broken to work around the problem
** Found 41 pre-existing rpmdb problem(s), 'yum check' output follows:
// huge scary list of packages follows

You may at times install all other packages via yum update –skip-broken, but it will still leave some trouble on the system. Best to take care of it.

Here’s how I’ve managed to do it on many occasions:

Read more