Category Archives: Technology

Checking an Certificate Chain

Use the following one liner to check the a certificate chain in detail:

openssl crl2pkcs7 -nocrl -certfile chained.crt | openssl pkcs7 -print_certs -text -noout | less

Use this command to produce a simple list of the chain in order:

echo "" | openssl s_client -connect 2>&1 | grep -A 6 "Certificate chain"

#If your testing a local server which is listening on the same port for different headers use this:
echo "" | openssl s_client -connect -servername 2>&1 | grep -A 6 "Certificate chain"

Solved: RKHunter Useful information in emails

I was trying to get this working by configuring the MAIL_CMD like so: echo -e “Subject: [rkhunter] Warnings found for ${HOST_NAME}\n\n” $(egrep -x “^\[.*\] Warning:.*” /var/log/rkhunter.log) | sendmail
It works but included a little extra part of the egrep command for some reason.

I couldn’t get around this but then I remembered we were going to be calling this using cronic ( )
So I just changed my crontab to: cronic rkhunter –check –rwo –no-mail-on-warning
Now I get the warnings in a beautiful emails like so: ============================================

Cronic detected failure or error output for the command:
rkhunter –check –rwo –no-mail-on-warning



Warning: The file properties have changed:
         File: /usr/bin/mail
         Current inode: 18331    Stored inode: 18308
         Current file modification time: 1574699160 (25-Nov-2019 16:26:00)
         Stored file modification time : 1574686593 (25-Nov-2019 12:56:33)
Warning: The file properties have changed:
         File: /usr/bin/mail.mailutils
         Current inode: 18320    Stored inode: 18297

START TIME: Mon Nov 25 16:28:01 UTC 2019
END TIME:   Mon Nov 25 16:28:34 UTC 2019


blur bright business codes

Running Byobu by Default on Zsh

To make Byobu default on your local machine

Byobu-enable only currently modifies your .bashrc and .bash_profile, to get byobu launching by default with Zsh you need to follow these instruction

Add the following line to the bottom of your ~/.zshrc
_byobu_sourced=1 . /usr/bin/byobu-launch 2>/dev/null || true

To make Byobu default when SSH’ing into a machine

Add the same line to the bottom of ~/.zprofile

Update: I’ve not been able to get this working on AWS. I’m using Ubuntu… anyone got any additional tips

linux tux penguin logo

Favourite Linux CLI Tools

This will be a continually updated list of my favourite Linux CLI tools

  • ZSH with OhMyZsh installed
  • Disk Usage
    • NCurses Disk Usage – CLI graphical and browseable disk space explorer.
    • sudo apt install ncdu
    • Can also write output to a file to explore at a different time to scanning the disk
  • Text Editor
  • Shell Management
    • Byobu
    • Absolutely love how easy this makes running a complex multi-pane, multi-window set up. Makes my life a lot easier and more productive

brass pocket watches

Powershell Speaking Clock

After a phone system upgrade we were unable to get the speaking clock within the office, which started off a conversation about how much it costs to call, presently 50p per call in the UK.

A little conversation and it seemed like it would be fairly easy to knock up a system that provided the same service.
So with about 15 minutes I did 😀