This article explains how to find the time interval between two Unix time stamps. The default time format in Unix is like this: “Sun 9 Aug 12:50:08 BST 2020”. It appears in many places on the system and is the default produced by the “date” command.
For example, it might appear in application log files, like this::
Start time: Sun 9 Aug 10:05:00 BST 2020
End Time: Sun 9 Aug 12:51:12 BST 2020
This article explains how to subtract one time from the other in Bash, and obtain the intervening time in seconds.
This article explains how to install Docker on a Raspberry Pi, how to build a simple image, and how to run a container based on it.
Docker provides a mobile execution environment in which to run software. It is a very popular container technology. Docker is useful in the rapid deployment of applications and in application isolation. It is a valuable tool for developers, users and systems administrators. In this procedure, it will be used to install a simple video processing application called “comskip“.
Although the article is entitled Install Docker on Raspberry Pi, this procedure will work unaltered on most Linux distros, which is one of the advantages of Docker.
The above kernel causes previously working CIFS mounts to fail with an “interrupted system call” error. A Linux system which had been using a NAS share for years acquired the new kernel on 17th March 2020 and the mount became unstable thereafter.
Update. Resolved 13th June 2020. The issue was not seen again after an update to kernel version 5.3.0-53.
The raspberry Pi makes a good platform for watching Live TV. Software packages like TVHeadend, OSMC/Kodi, NextPVR and Plex allow you to turn a normal Pi into a powerful media centre.
Recording your favourite TV shows is great, as is being able to skip through commercial breaks on playback. Every time an ad break arrives, just press “fast forward” a few times and hey presto, you are watching the next part of the show. You still have to actually press the button though, and sometimes rewind too, if the break is overshot. However, there are software tools that will skip the breaks for you, and one of these is Comskip.
This procedure explains how to install Comskip on a Raspberry Pi, with examples pertaining to TVHeadend. You might have come here from my earlier article “How to Watch and Record Live TV on a Raspberry Pi“, to which this article is an effective continuation. Or you might have some other existing system to which you want to add comskip. Even if you are using a different backend, like Plex, this article should still be useful.
Connecting a physical USB device to a virtual machine is sometimes tricky. Virtual machines are not really designed for physical interaction. In this case, it was necessary to mount a 1 TB external USB disk to a VMware virtual machine running Linux Mint 19.3. USB errors were seen and the disk would not connect. The fix was very simple.
Connecting the Disk
A USB disk was connected to a Linux laptop running VMware Workstation 15.5.1, and hosting a Linux Min 19.3 guest. When the connection “button” (at the bottom right of the VMware window) was pressed, these errors appeared in the guest’s kernel log:
This brief article explains how to enhance an existing OSMC (or Kodi) installation by the addition of TV channel logos. Anyone who uses OSMC/Kodi for watching live TV might find it useful
A procedure for building your own OSMC server is explained in my accompanying article How to Watch and Record Live TV with a Raspberry Pi. You might have followed that procedure and be looking to add channel logos. Or you might have an existing OSMC setup. The procedure below should apply in either case. Special notes are included below for users who are running straight Kodi rather than OSMC.
The logo packs described are for Freeview and Freesat channels in the the UK. If you are not a Freeview or Freesat user, the installation process is the same, but you will need to source logo packs appropriate to the channels you are receiving.
Kodi is one of the most popular media centre solutions. However, unless you like to sit very close to the TV, the font sizes are a bit small. This article describes a simple procedure to improve legibility. It’s assumed that you are using the default Kodi skin, called “Estuary“. This article was updated 6th April 2020 and tested for Kodi 18.6.
The Kodi user interface is highly customizable, and there are many Internet pages explaining how it all works. But in this procedure, we will just make a few small changes. These instructions were originally written for OSMC running on a Raspberry Pi, but they work for stand alone Kodi too, and should also work for other hardware platforms.
This procedure explains how to turn a Raspberry Pi into a DVR, or “digital video recorder”. A DVR is a box that sits under your television, allowing you to watch digital television and record it to a hard disk. TV and recordings can also be “streamed” to other devices on your network, such as phones, tablets and PCs.
Commercial examples of DVRs are available from manufacturers like Humax and Panasonic, providing access to free digital TV services, which in the UK are called Freeview and Freesat. Other brand names are used in other countries, but the underlying technology is the same. By following the article, you will be able to view, record and stream free digital TV. (You won’t be able to watch encrypted services, like those broadcast by Sky and BT).
Why turn a Pi into a DVR? You might be just curious about the possibilities. You might be looking to move from a paid-for service (eg. BT or Sky) to a free one. You might want to replace older equipment or just get access to more modern services, such as HDTV (high definition TV). I was looking to replace my old Topfield DVR, and the procedure below worked for me.
The Raspberry Pi 4 was launched on 24th June and has been well received, to say the least. The spec is a big step up on previous models. It has 4 CPU cores like the Pi 2, a gigabit port like the Pi 3, plus USB 3, a better SoC, a separated bus architecture, faster memory and more of it.
Over the years, many “home” devices have been launched with Gigabit Ethernet, promising lightning fast network speeds, only to disappoint due to their lack of overall grunt. The Linkstation Live, the Sheevaplug and, to a lesser extent the Pi 3 are all on that category, unable to push their gigabit ports to more than about 14, 8 and 12 megabytes/sec respectively, due to the limitations of the CPU and the board. Is the Pi 4 the same, or can it operate as a serious NAS ?
Short answer: Yes. The Pi 4 is a *serious* NAS contender. Sustained write speeds of over 68 MB/s were obtained, and over 105 MB/s for reading, including saturation of the Gigabit network. Yes, the Pi 4 can push even a 1000 MB/s network to 100%.
An AWS hosted website went offline at 02:00 this morning. It was running on a t2.nano Debian 9 instance. I was unable to log into the affected server, and a reboot was the only available course of action. Logging in and checking the logs afterwards revealed thousands of errors like this in the kernel log file, from 2:00 AM onward:
The cause was a denial of service attack, coming from a couple of IP addresses seemingly in Iran. However, it was a little unusual for a couple of reasons. This article explains more about the attack vector and presents a solution to guard against future attacks. (In summary: block IP addresses, tune the kernel).