Debian has been installing Exim4 as the default MTA since at least Debian Stretch. When I tried to use it to send service messages (specifically fail2ban ban reports including whois information) on a new bookworm server, the messages would bounce with an Exim “message has lines too long for transport” error. Most modern MUAs like […]
Checking for APT Upgrades at Bootup
I recently switched my desktop from Gnome to Xfce. Xfce does not have a panel update notifier like Gnome. You can roll your own using apt commands and cron. Normally I would use the cron parameter @reboot but this may not work correctly to send mail depending on how long it takes to establish your […]
Access a device on another subnet connected to your current network
Use a Raspberry Pi to change default IP Addresses on newly installed devices in a remote Control Panel We have many control systems out in the field connected to our office using IPSEC VPNs. Each control system needs its own subnet (usually a 192.168.x.x/24) to make this work. So, a problem arises if a new […]
Adding Non-Free Drivers to a Debian Installation
When you install a new version of Debian from scratch, you may need “non-free” drivers for things like a Wireless Network Adapter. If these drivers are not GPL-licensed, then Debian will not include them in the installation image. You can work around this by installing the non-free image from a location such as http://cdimage.debian.org/cdimage/unofficial/non-free/cd-including-firmware/10.7.0+nonfree/amd64/iso-cd/ for […]
Simple Linux Port Scanner
It is often necessary to check a remote device to see if certain ports are open. For a quick & dirty test, use netcat (nc) in Terminal. If you want to automate things a bit to reduce typing, add the following bash function to your ~/.bashrc file portscan() {echo ‘Stealthed ports will timeout instead of […]
Fix Incorrect MP4 Duration in Linux
I recently used a screen capture program to record a video of some actions in Firefox. When the video was complete, the Duration was incorrect. Windows Media Player doesn’t seem to mind and happily played the entire video even though the duration property was 16 seconds and the actual duration was 31 seconds. When I […]
Splitting Text Files in Linux
Check the number of lines in a text file using the wc command, which stands for “word count”. $ wc -l access.log146330 access.log We’re way over our limit. We’ll need to split this into 3 segments. We’ll use the split utility to do this. $ split -l 60000 access.log $ ls -l total 79124 -rw-rw-r– […]
Exclude Packages from apt-get upgrade
If you need to prevent a package from upgrading during ‘apt-get upgrade’, you need to put that package on hold: $ sudo apt-mark hold package_name When you run ‘apt-get upgrade’ with a package on hold, the output will look like this: $ sudo apt-get upgrade Reading package lists… Done Building dependency tree Reading state information… […]
Remove Old Kernels from Debian
You should always leave the current kernel and one previous kernel in place on your system. The previous kernel is needed if an update to the current kernel leaves your system unable to boot. You will be able to boot the previous kernel using the advanced options of the grub boot menu. Show current kernel […]
How To Find The Largest Top 10 Files and Directories On a Linux System
The du (i.e., disk usage) command reports the sizes of directory trees inclusive of all of their contents and the sizes of individual files: -h, –human-readable print sizes in human readable format (e.g., 1K 234M 2G) -s, –summarize display only a total for each argument -x, –one-file-system skip directories on different file systems The sort […]