Category Archives: Technology

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 ( https://habilis.net/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

RESULT CODE: 1

ERROR OUTPUT:

STANDARD OUTPUT:
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

=========================================

Running Byobu by Default on Zsh

To make Byobu default on your local machine

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?

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

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 😀

https://github.com/mikedixson/PSpeakingClock/

SOLVED: Windows does not have enough information to verify the certificate

Problem

When moving from one ADFS server to another I imported a full certificate chain and private key into Machine certs on the new Windows 2016.
The certificate displayed fine and chain is complete.

However viewing the certificate properties via ADFS the certificate information gives the error “Windows does not have enough information to verify the certificate”

Solution

Move the intermediate certificate to the Intermediate Certificate Authorities > Certificates store

It seems stupidly obvious in retrospect but Windows itself could view the cert fine, and the import was done via Machine Certificates so you’d think it would put things in the right place.

[Solved] WDS Driver Filters Not Working

Like many people it seems I’ve been scratching my head as to why  WDS’s Driver Package Filters were not matching my hardware when imaging a machine that I’d created a driver package group for.

After looking at Greg Shields technet post I was convinced I just needed to grab the model name straight off of the machine type beforehand via a powershell WMI get and I’d be laughing. Alas this still did not work.

I found the best way was to enable the Debug log on WDS, then pull the info directly from what WDS was seeing and use that to create the filters.
I’ve also written a powershell script to pull the details from the debug log as otherwise it takes a fair bit of time.
I’ve posted this here:
https://github.com/mikedixson/Get-SMBios-Strings-From-WDS

Powershell list all properties of an object

Some powershell get commands only output a handful of the object properties get-CalendarProcessing being one such command, than returns just one property.

To get all properties of an object you can pipe to format-list *
get-CalendarProcessing -identity [email protected] | Format-List *

If you know the specific attribute you are after you can still access this variable using select-object.
get-CalendarProcessing -Identity [email protected] | Select-Object AllowConflicts