Table of Contents
This is the web page of Andy Beverley, where I have put a variety of information that is either difficult to find on the web, or that I want as a handy reference for the future. There are also a couple of other pages at the end that do not fall into these categories! Feel free to email me andy@andybev.com
About me
Please either check out my LinkedIn page.
Build MariaDB with readline support
I've been frustrated with the use of editline (libedit) instead of readline that MariaDB is now built with in Debian 11. I have found editline to be buggy: its implementation of Ctrl-R and editing of wrapped lines do not work well, plus Ctrl-W not being mapping to delete a word by default is infuriating!
As I understand it, Debian is no longer able to distribute MariaDB built against readline as the former is GPL2 and the latter GPL3, and apparently the 2 are incompatible for distribution. So I have written instructions for how to rebuild MariaDB against readline in Debian.
Building packages from later versions of Debian for earlier releases
I had a problem recently whereby a bug was fixed in a testing version of Debian (Bookworm) but had not been released to the current stable version (Bullseye). I decided to build the Bookworm version of the package for Bullseye:
apt-get install dpkg-dev devscripts vim /etc/apt/sources.list # Enable source packages apt-get update apt source chkrootkit apt build-dep chkrootkit cd chkrootkit-0.55 dch --bpo # Update package version so as not to conflict debuild -uc -us
Example: building openarc package from experimental
Add experimental sources to /etc/apt/sources.list
:
deb-src http://httpredir.debian.org/debian/ experimental main contrib
apt-get build-dep openarc apt-get source openarc cd openarc-1.0.0~beta3+dfsg/ # Download additional patches cd debian/patches wget https://github.com/trusteddomainproject/OpenARC/pull/167.patch wget https://github.com/trusteddomainproject/OpenARC/pull/168.patch wget https://github.com/trusteddomainproject/OpenARC/pull/170.patch wget https://github.com/trusteddomainproject/OpenARC/pull/173.patch # Apply cd ../.. patch -p1 < debian/patches/167.patch patch -p1 < debian/patches/168.patch patch -p1 < debian/patches/170.patch patch -p1 < debian/patches/173.patch dch --bpo # Add letter to suggested version dpkg-source --commit debuild -uc -us
References
https://ostechnix.com/how-to-build-debian-packages-from-source/ https://unix.stackexchange.com/questions/112157/
Versioning info: https://www.debian.org/doc/debian-policy/ch-controlfields.html#version
Building Debian packages of Perl modules
On production servers, I much prefer to use Perl modules from Debian repositories, rather than installing from CPAN or using some sort of pinning technique. The advantage is that they are maintained upstream, are more stable, faster to install and easier overall to manage.
Sometimes a Perl module is either not available in the main Debian repositories, or the version is too old (or I need a patch that has not made it upstream yet). In these circumstances I build my own Debian packages of Perl modules. Normally building a package is easy, but sometimes it can be a bit of an art. Read more about building Debian packages of Perl modules.
JSON Web Tokens with Perl
Some examples of how to use JWTs with Perl
Bulk resizing images
# Maximum width 400px and max height 700px mogrify -resize '400x700>' *.png # Maximum width 400px mogrify -resize '400>' *.png
Using Overlay (OpenStreetMap)
Using iptables and PHP to create a captive portal
There are various captive portal software packages available (both free and open source). None of the packages I tried did what I wanted and were not particularly customisable. Therefore I created my own using a few iptables rules and PHP (along with a handful of other standard packages). The page below details the steps taken. Using iptables and PHP to create a captive portal
Set up Guacamole on Ubuntu in order to share the desktop remotely over the web using HTML5
These are a few notes that I made to do the above. It needs testing and writing up properly.
Create a PDF photo slideshow using Latex
This page describes how to use Latex to create a PDF photo slideshow. This is a good halfway house between simply displaying photos using a picture viewer, and creating a Powerpoint-type slideshow with text and so on. The advantage of Latex, of course, is that the whole presentation can be created automatically from a template - no fidgety Powerpoint formatting to worry about.
Fair traffic shaping an ADSL line for a local network using Linux
Traffic shaping a standard ADSL link in order to share it with a couple of hundred users is a common problem. There are dozens of bits of software and firewall scripts out there already to do this. This particular page details a method that I have used successfully for several years. It aims to be as simple as possible, is easily customised, and uses connlimit to identify P2P users. Although the latter is not 100% reliable, it seems to work pretty well and does not fall foul of any new/changed P2P software that happens to some of the other scripts. The page is written as more of a tutorial; if you would like to use this in practice, then I recommend you check out the scripts in the “captive portal from scratch” page below. Fair traffic shaping an ADSL line for a local network using Linux
Setting up a captive portal from scratch using Debian
The link below gives the full details from start to finish of installing the Debian operating system, setting up a captive portal and shaping traffic fairly for dozens of users. Setting up a captive portal from scratch using Debian
PortalShaper - details of the scripts used in the installation above
PortalShaper is a set of scripts to:
- Create a captive portal using iptables and PHP
- Install a set of PHP scripts to manage the captive portal
- Traffic shape the internet connection to optimise its speed
- Create a “splash page” to display adverts to users
- Load share between multiple connections
Installation of the scripts is described in the page above. This page describes how they work
Nwipe Secure Disk Erase
DBAN is a popular and easy to use disk wiping program. I have extracted the dwipe program that it uses and created a new project called nwipe. This is essentially the same as dwipe, but can be compiled and used in most modern Linux distributions. If you are having trouble running or booting DBAN, then nwipe is for you.
MET4PERL Instromet Weather Station Logger
met4perl is a re-spin of the MET4NET software published by Instromet, but implemented in a very simple Perl interface. Currently it is only written for Linux, but it would be easy to add other platforms.
Using backup2l with Debian
Backup2l is an excellent and efficient backup tool. The documentation is sparse though. The following page provides some quick and dirty instructions for getting it working. Setting up backup2l with Debian
Customise live Ubuntu for internet cafe environment
A page with instructions on how to customise a copy of Ubuntu and make it network bootable in order to use within an internet cafe environment. In my opinion this is vastly superior to most arrangements in internet cafes that I use! Customise live Ubuntu for internet cafe environment
Setup SMTP authentication with Postfix running on Debian
The original idea of this page was a quick and dirty howto on how to setup SMTP authentication on Postfix. However, it turned out that there was no quick way to achieve what I wanted (encrypted passwords over an unencrypted link, using Courier IMAP as the password database). It also turned out that I was running a non-standard Postfix (it wasn't chrooted). Therefore, as SMTP AUTH and SASL have always been something of a black art to me, I have written a few things down that I have discovered, as well as a quick and dirty howto on setting up a basic SASL database. SMTP authentication and Postfix
Setup clamav with Postfix on Debian Lenny in a chroot
Some quick steps showing something that's quite easy but not immediately obvious. Setup clamav with Postfix on Debian Lenny in a chroot
Tomatina tomato festival
A page with advice about the Tomatina festival that I attended in 2006. La Tomatina Tomato Festival - photos and advice
andy@andybev.com