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

Upgrade Trouble: when WordPress is asking for FTP details, but there’s no FTP server on your system

I was working on a CentOS 7 server the other day that had a LAMP stack installed. It was used to host only a single instance of WordPress. Upgrading themes and plugins from the admin interface worked fine, but curiously, WordPress core upgrades did not. Instead, WordPress was asking for FTP details every time, which also … Read more

How to install Python 3 from source in CentOS

python-logoCentOS 6 comes with Python 2.6 installed, and CentOS 7 comes with Python 2.7. But right now, Python 3.5 is all the rage, so I thought I’d install it alongside Python 2.x on the same machine.

Here’s how I did it.

I’m using a CentOS 6 32 bit system here, but I’ve tried the same on a CentOS 7 64 bit rig. You need to be root or have superuser privileges to do this successfully.

Read more

How to extract tar.xz files on CentOS

I’ve recently come across a tarsal files that used xz compression (namely the Python source code). This means that my usual way of extracting a tarsal via the command line using the following command did not work: tar -zxvf Python* gzip: stdin: not in gzip format tar: Child returned status 1 tar: Error is not … Read more

How to fix problems with Logitech Unifying Receivers

screen-shot-2016-11-04-at-17-12-10I’ve recently bought a new Logitech K360 keyboard for my HP Z600 workstation. I also had a Logitech M325 mouse, both of which came with Unifying USB receivers. I could plug both receivers in, and both devices would work great.

However, I heard good things about these little receivers and wanted to free up a USB port, and thought I’d connect both devices to the same receiver. Apparently you can connect up to 6 devices to one receiver and store any spare ones inside the mouse or keyboard. Being an all-efficient belt-and-braces kinda guy, I tried my luck.

Turns out it was relatively easy to pair both devices to the same receiver, thanks to a small piece of software that can be found here, along with instructions on how to use it:

It all worked fine on my Windows 10 machine, until I wanted to use the mouse (not the keyboard) with my Mac. I know, it’s exotic, and perhaps I should have just bought another mouse. But there’s only so much space on my desk, and I really don’t need more clutter in front of me for just an occasional switch.

I regretted pairing both devices to the same receiver and wished I hadn’t done that, for this very eventuality. So now I had to figure out how to UN-pair both devices again and put them back to how things used to be (before I started messing with them).

Read more