Category Archives: Tech Solutions

Solution: libpam-radius-auth: Sends out 127.0.0.1 as NAS-IP-Address

Symptom

When authentication linux to radius using libpam-radius-auth: Sends out 127.0.0.1 as NAS-IP-Address

Cause

/etc/hosts file contains the local machine’s hostname with 127.0.0.1

Solution

Either remove the offending line, or before this line place the correct ip address with the hostname (note that order is important).
10.0.0.5 computerName
127.0.0.1 computerName

Powershell Script to Check if a Website is Up and if Not Restart a service

The below PowerShell script check the website is responding AND doesn’t returns a certain string, if either test is failed then a Windows service is restarted, forcefully if necessary after a grace period.

Please note that I have modified this script to make it more easily customisable and not had the opportunity to test with the strings switched out for the variables. The logic is sound and works.

Also note that this is one code block (word press isn’t a fan of it being one though :-/
You can download the file here CheckWebsiteIsUp.ps1

$webClient = new-object System.Net.WebClient
$webClient.Headers.Add("user-agent", "PowerShell Script")


#Initialising
$webClient = new-object System.Net.WebClient
$webClient.Headers.Add("user-agent", "PowerShell Script")

#Variables to modify
$output = "" #Define output variable
$serviceName = "confluence" #Short windows service name
$smtpServerName = "smtp.website.com" #SMTP Server name
$fromEmailAddress = "servername@website.com" #Email address for mail to come from/reply address
$stringToCheckFor = "The service is unavailable" #String to check for. Note that this will be searched for with wildcards either side
$startTime = get-date
$output = $webClient.DownloadString("http://www.website.com/") #Modify this url to be the url you want to test
$endTime = get-date

#Main workload
#The below checks for the string "The service is unavailable" from your website and if found forcefully restarts the defined service
if ($output -And $output -notlike "*$stringToCheckFor*") {
"Site Up`t`t" + $startTime.DateTime + "`t`t" + ($endTime - $startTime).TotalSeconds + " seconds"
} else {
"Fail`t`t" + $startTime.DateTime + "`t`t" + ($endTime - $startTime).TotalSeconds + " seconds"
stop-service $serviceName -force
"Stop Service Command Sent"
$svc = Get-Service $serviceName
$svc.WaitForStatus('Stopped','00:05:00') #Waits for service to enter stopped state or 5 mins has passed, whichever is first
get-service $serviceName | where-object {$_.Status -eq "Stopped"} | restart-service #Belt and braces but only restarts the service if it's stopped.
$svc.WaitForStatus('Running','00:01:00') #Waits for service to enter Running state or 1 minute to pass, whichever is first
Send-MailMessage -From “intranet@rave.ac.uk” -To “$fromEmailAddress” -SmtpServer “$smtpServerName” -Subject "$serviceName Service Restarted" -Body "$serviceName Service Restarted" #Sends an email alert that the service was restarted
}

Solution: Wacom Intuos Pen and Touch Pressure Sensitivity in Photoshop

So in order to use pressure sensitivity in Photoshop you MUST have Use Windows Ink enabled.

Wacom Control Panel use Windows Link
Wacom Control Panel use Windows Link

But without it no pressure sensitivity at all and in Brush Dynamics the pen control option just gives you an exclamation mark next to it.

Update: I’ve upgraded one of my machines to Windows 10 and Windows Ink doesn’t seem necessary on that one for pressure sensitivity.

Weekend Project: Battery Powered Sonos Play:1

Following this video guide and the step up booster converter from ebay below I’m going to make a Sonos Play:1 battery powered so I can enjoy some lovely music on the balcony over the summer.

http://www.ebay.co.uk/itm/XL6009-DC-DC-Voltage-Step-Up-Boost-Converter-replace-LM2577-3-32v-input-UK-Fast-/400858208676