Category Archives: Uncategorized

Juniper log analysis – get host names from ip addresses.

import os import re from pprint import pprint import socket import M2Crypto import ssl ipsourcetable={} iptargettable={} ipsourcetargetcounttable={} myfilename=”192.168_logs_2017_05/192.168.96.43_log.txt” myfilename=”examine.log” print myfilename myipnames={”: ”} for line in open(myfilename).readlines(): parts=line.split(“,”) mytarget=parts[3] mytargetname=myipnames.get(mytarget,’notfound’) mytargetcert='””,””‘ if mytargetname == ‘notfound’: print ‘looking up ‘ + … Continue reading

Posted in Uncategorized | Comments Off on Juniper log analysis – get host names from ip addresses.

Python script to analyse Juniper firewall logs

Juniper firewalls create large syslog files showing all connections between internal/external hosts. import os import re from pprint import pprint import socket # IP Addresses rip=re.compile(“([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+)/([0-9]+)[- ]”) #date time 2017-05-06 23:59:59\t rdt=re.compile(“^([0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]) ([0-9][0-9]:[0-9][0-9]:[0-9][0-9])\t”) # description ?? JuniperSRX1500Perth RT_FLOW: RT_FLOW_SESSION_CLOSE: session … Continue reading

Posted in Uncategorized | Comments Off on Python script to analyse Juniper firewall logs

WBAdmin – deleting old backups from the catalogue

Cleaning up the windows server backup catalogue database (server 2012r2). To get a list of backups wbadmin get versions pipe that text to a file and then to get all the backups findstr “identifier” Put all of that into a … Continue reading

Posted in System Administration, Uncategorized | Comments Off on WBAdmin – deleting old backups from the catalogue

Python language and Fibonacci

Spending a bit of time familiarising myself with the Python language. The mathematics libraries are quite amazing. Bit of a change after PHP and Powershell etc. The first use of it was to use beautiful soup to read in some … Continue reading

Posted in Uncategorized | Comments Off on Python language and Fibonacci

Replace the icon lables “Computer” and “This PC” with something more useful.

This script will read the computers name and domain settings and rename the icon in the form computername.domain.local This makes it much easier to be certain which desktop you are working on when using multiple remote RDP , mstsc connections. … Continue reading

Posted in Uncategorized | Comments Off on Replace the icon lables “Computer” and “This PC” with something more useful.

Listing files and folders into a document.

Its always been annoying that it isnt trivial to get a list of documents. This powershell code let you create an excel compatible CSV file listing all the files and folders, one with the newest (by creation data) files first. … Continue reading

Posted in Uncategorized | Comments Off on Listing files and folders into a document.