Anti-Virus Scanning a Linux installation

ClamAV is a good tool for virus scanning linux workstations and servers.

It can be installed using the command:

sudo apt-get install clamav

The definitions can be updated with:

sudo freshclam

The whole system can be scanned using:

clamscan -r --bell -i /

This will only display infected files and rings a bell if any are found during the scan.

If lots of output is produced, or you need to store a log the output can be redirected to file…

clamscan -r --bell -i / > ~/scan.log

VBA Macro to find distinct items in an Excel spreadsheet column and count number of times found

Just in case of use to anyone, a quick macro that loops through a column on an excel spreadsheet looking at each different value found, and getting the count of the number of times found…

Sub countValuesInColumn(column As Integer, startRow As Integer)

'Get the frequency of distinct items found in a column
'Assumes fewer than 100 different distinct values
'@author: David Boyce 
'@created: 2015-09-24

Dim activeRow, foundTotal As Variant
Dim activeValue, itemsArray(100, 1), msgTxt As String

activeRow = startRow

Do While NotFound = False
  If ActiveWorkbook.ActiveSheet.Cells(activeRow, column) = "" Then Exit Do
  activeValue = ActiveWorkbook.ActiveSheet.Cells(activeRow, column)
    For n = LBound(itemsArray) To UBound(itemsArray)
      If itemsArray(n, 0) = "" Then
        itemsArray(n, 0) = activeValue
        itemsArray(n, 1) = 1
        Exit For
        If itemsArray(n, 0) = activeValue Then
          itemsArray(n, 1) = itemsArray(n, 1) + 1
          Exit For
        End If
      End If
    activeRow = activeRow + 1

For n = LBound(itemsArray) To UBound(itemsArray)
  If itemsArray(n, 0) = "" Then Exit For
  msgTxt = msgTxt & itemsArray(n, 0) & " : " & itemsArray(n, 1) & vbCrLf
  foundTotal = foundTotal + itemsArray(n, 1)

msgTxt = msgTxt & foundTotal
MsgBox msgTxt

End Sub

Kindle and Calibre

I’ve always said I would never buy an ebook reader, as I dislike reading from a screen – possibly as a result of having jobs for the past 10 years that mean I’ve spent much of the day looking at multiple monitors on my desk. But since buying a Kindle back in 2012 I’m somewhat of a reluctant convert. I say reluctant because I haven’t always agreed with Amazon’s business practices, and it doesn’t make a lot of sense that many books have been more expensive to buy in the ebook format, than getting the printed version (even with the additional postage costs).

However I’ve found the contrast of the Kindle’s “e ink” display is really just as good as any printed book, so that’s one stumbling block gone, and being able to access a book from your Mobile Phone/Kindle/PC/Laptop – in fact from any internet connected web browser using Kindle Cloud Reader really does mean you can take your library everywhere; So when you do find yourself with 5 spare minutes, you can take the opportunity to read a chapter of your latest book. Comparing books I’ve either bought, or borrowed from the library, I’ve had much more success with the ones read on the Kindle.

One piece of software I would recommend to any Kindle owner is Calibre. It has many features, but the one I find most useful is it’s ability to access a news / blog source on a scheduled basis, process all the latest articles and generate an ebook which it can send to your kindle by email. It’s very easy to set-up, with a lot of news sources (eg BBC news and sport) to choose from, and it will happily just take the url to an RSS feed for a blog.

The fact it automatically sends the data is great because when you find the time to have a read, you’ll find it’s already downloaded for you. You could access all the same stories from browsing the web, but on the Kindle it just seems more organised, plus with all the adverts stripped and other distractions taken out, which is a definite bonus.