13 October 2008

List Net Apps

Lets say that you want a list of network apps running in windows at a given time. I have written a simple script in Powershell to handle this:
function global:get-netapps
{
$myfile = (& netstat -abno )
$mymatches = $myfile -match "\[(?.*\.exe)\]`$"
$results = ""
foreach ($line in $mymatches)
{
if ($results.Contains($line.Replace('[','').Replace(']','')) -eq 0)
{
$results += $line.Replace('[','').Replace(']','') + "`n"
}
}
$results

}
Set-Alias lsnetapps get-netapps -Scope "global"
just run: get-netapps or lsnetapps

Labels: , ,

07 June 2007

CSS Tip #1

If you have a div that needs to go the height of the entire page the way a body tag can. For instance, if you wanted one background image for the body tag and another for a div tag, like having multiple borders. I ran into this issue when setting:


#bg2
{
height:100%;
width:700px;
margin-left: auto;
margin-right: auto;
}


the height gets ignored on most browsers, make sure to include:

html, body
{
height:100%;
}

body
{
width:800px;
margin-left: auto;
margin-right: auto;
}


so if you have html head../head body div id="bg2" .../div /body /html

Labels: , , ,