Control Network port bandwidth on Linux

Linux allows you to control the upload and download speed on specific network ports. This post is a follow-up on the wireless access point setup of a Raspberry Pi. When serving a guest Wifi setup, you may want to limit the bandwidth used by clients on the Raspberry Pi access point so that they won’t use up all Internet bandwidth of your main network. Whatever you case maybe I’ll show you how to throttle the eth0 bandwidth of the Raspberry Pi 3B+.

Continue reading “Control Network port bandwidth on Linux”

Setup a Raspberry Pi as a wireless access point

A Raspberry Pi within an Ethernet network can be used as a wireless access point, creating a secondary network. The resulting new wireless network is entirely managed by the Raspberry Pi. This is useful for when you don’t have an extra wireless router available and want to provide an extra wireless access point for your guests. In this post, I’ll detail how to set up the raspberry to be a wireless access point.

Continue reading “Setup a Raspberry Pi as a wireless access point”

Manipulating text with sed

The sed utility can be used to print the contents of a file, substitute a line (or multiple lines), and then save the file. In contrast to grep, sed can substitute a line or multiple lines in a file and perform an in-place update of that file.

The simplest sed invocation when substituting foo for bar is:

$ sed 's/foo/bar/' inputfile
Continue reading “Manipulating text with sed”

How To Simulate Linux Commands

Every Linux command has one or more options and flags to perform different operations. One of the useful and important option allow us to simulate Linux commands but do not actually change the system. For instance, we can simulate the process of installation or removal of a package or program, but without actually installing or removing the intended package from a Linux system.

Continue reading “How To Simulate Linux Commands”

The /etc/shadow File

There are several different authentication schemes that can be used on Linux systems. The most commonly used and standard scheme is to perform authentication against the /etc/passwd and /etc/shadow files.

/etc/shadow is a text file that contains information about the system’s users’ passwords. It is owned by user root and group shadow, and has 640 permissions.

Continue reading “The /etc/shadow File”

Replacing rc.local in systemd Linux systems

Missing rc.local for adding commands to run on startup? Here’s how to set up similar functionality with today’s systemd.

The rc.local file was—and in some cases still is—the place for Linux sysadmins to put commands that need to be run at startup. Use of the rc.local file is not only deprecated but after a couple of hours worth of attempts, was not working in any event. This despite the fact that the systemd documentation mentions the use of a “generator” that generates systemd services from an rc.local file if one exists.

Continue reading “Replacing rc.local in systemd Linux systems”

Using lsof to Recover Deleted Files

If an open file is deleted accidentally, it is possible to use lsof to recreate a copy of the file; provided this is done before the file is closed by the application holding it open.

If you have inadvertently removed a file from the filesystem it is still recoverable if the application using the file it still running. This is because the inode is still open and therefore the data blocks are still on the disk until the application closes the file or exits.

Continue reading “Using lsof to Recover Deleted Files”