Monthly Archives: April 2013

Uncategorized

Raspberry Pi

I was reading about this project and it’s a really small inexpensive computer called Raspberry PI and I thought to myself for $40 buck shipped how bad can it be, just got it today.  I’m not sure what I’m going to do with it but for it looks pretty cool.RaspberryPi

Uncategorized

Using Powershell to Keep Directories Clean

As an integration engineer I have log files that provide me an audit trail so I can track things down when they go astray.  Now this is fine and well but what happens when you’ve had an integration in place since 2007 and never needed to look at those files?  Yes you’ve got 5 years worth of files that are taking up space on the drive.  To alleviate the issue you can use Powershell to clear the directories of any files over a certain age.  Here is the code on how to do it:

# Delete all Files in the TCC Archives over 60 days old
$Path = "C:\Taleo\TCC\Prod\Export\AirlandRequisition\Archive"
$Daysback = "-60"
$CurrentDate = Get-Date
$DatetoDelete = $CurrentDate.AddDays($Daysback)
Get-ChildItem $Path -Recurse | Where-Object { $_.LastWriteTime -lt $DatetoDelete } | Remove-Item

clear-variable -name Path
clear-variable -name Daysback
clear-variable -name CurrentDate
clear-variable -name DatetoDelete

$Path = "C:\Taleo\TCC\Prod\Export\AppTrackCSW\Archive"
$Daysback = "-60"
$CurrentDate = Get-Date
$DatetoDelete = $CurrentDate.AddDays($Daysback)
Get-ChildItem $Path -Recurse | Where-Object { $_.LastWriteTime -lt $DatetoDelete } | Remove-Item

clear-variable -name Path
clear-variable -name Daysback
clear-variable -name CurrentDate
clear-variable -name DatetoDelete
MSSQL

Nmap to find MS SQL server

I’ve had to install several instance of SLQ Express recently and for the life of me I’m having a devil of a time getting external access to these instances.  Between the firewalls and SLQ networking protocols it’s hard to know if you did everything right and will be able to connect remotely with these installations.  Nmap can help, here is the syntax to look for them:

nmap -p T:1433 -sV pds-web -oG tcp_scan_results.txt