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.

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

How to use variables in a BASH shell script

Here’s how to use simple variables in BASH shell scripts. It appears there are no data types, and everything’s a string (correct me if I’m wrong). We can define a variable by first setting it to a value, then later refer to that value with a dollar sign in front of the variable name. Here’s … Read more

How to install PHP from source on CentOS

I have recently installed PHP 7 from source on a fresh minimal CentOS 7 box. No previous version of PHP was installed, and I thought I’d give 7 a spin. There were a few pitfalls I hadn’t come across before, so here’s what worked for me. Downloading and extracting the source code It sounds crazy, … Read more