apt-add-repository: command not found on Ubuntu

Following a tutorial where you’re supposed to add a repository with apt-add-repository but the command isn’t found? You can install it by doing the following:   sudo apt-get install software-properties-common python-software-properties   Then re-run the apt-add-repository command and it should work!

How to protect Ubuntu against the Shellshock exploit

Shellshock is quite a serious security hole found a couple of days ago in Bash; to check whether your Ubuntu server is vulnerable run the following in a terminal:   env VAR='() { :;}; echo Shellshock vulnerable!‘ bash -c “echo Bash Testing”   If your system is vulnerable, you will see:   Shellshock vulnerable! Bash […]

How to cache yum repositories on CentOS using apt-cacher-ng on Debian or Ubuntu

  If you have a lot of virtual (or real) machines running Debian or Ubuntu and a limited internet connection, it can make a lot of sense to use apt-cacher-ng to create a local cache of the packages you use so that they are only downloaded once. The current version of apt-cacher-ng can also help […]

Ubuntu: How to see information about your system’s CPU

  To find out information about the CPU used in the system, we can use the following command:   lscpu   This gives us useful information about the CPU, such as the number of physical cores, virtual threads, virtualization support and more. An example output from a Haswell Xeon system looks like:   Architecture:          x86_64 […]

Ubuntu: Viewing all available block devices or hard drives, their mount point and their filesystems

  To list the available hard drives (to be specific, available block devices) we use the following command:   lsblk   This will provide output in the following format: NAME    MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT xvda    202:0    0     8G  0 disk ├─xvda1 202:1    0     7G  0 part / ├─xvda2 202:2    0     1K  0 part […]

Ubuntu: Viewing past dmesg outputs from previous sessions

  Sometimes you may want to check the output of dmesg from a previous session. This can provide some useful information – for example, whether an error has only just started appearing or whether it was present during previous sessions. Ubuntu archives old dmesg outputs in the following location:   /var/log   We can see […]

Ubuntu: How to use multiple cores with tar gzip compression

  One thing you may have noticed when using the z switch with tar is that the compression can take some time! If you look at your CPU usage, though, you’ll notice that only one core is being utilised to compress the files. In a modern system 4 or 8 cores are common, meaning that […]

Ubuntu: Using tar to span a backup across multiple tapes

  Following on from the article on writing files to a tape backup, what happens if you want to back up more than what fits on a single tape? Here we want to use the –multi-volume switch, or -M. Use it so:   tar -cvMf /dev/[path-to-tape] [backup folder or files]   As a working example: […]

Mediawiki 403 forbidden errors after upgrading to Ubuntu 13.10

  A customer upgraded from 13.04 to 13.10 and their internal wiki was broken afterwards; for a simple Apache install where the wiki was installed at the web root and all access was via the LAN (thus they were happy with not restricting the access), the fix was to add:   <Location /> Require all […]