Skip to content

Instantly share code, notes, and snippets.

@jrothmanshore
jrothmanshore / ip_lookup.ps1
Created May 10, 2012 21:25
Powershell script for performing reverse lookups of IP Addresses
$stop = $args.Count
$inputIP = ""
$inputFile = ""
$knownIPFile = ""
$showUsage = 0
$verbose = 0
for ($i = 0; $i -lt $stop; $i++)
{
if ($args[$i] -eq "-f") {
if ( ($i + 1) -eq $stop) {
@jrothmanshore
jrothmanshore / gist:2346495
Created April 9, 2012 20:56
Powershell script for sending a command to all nodes in a memcached cluster
#
param(
[string] $command = $(throw "command is required. example .\memdata.ps1 ""get SOMEKEYNAME""")
)
#
function readResponse($stream)
{
$encoding = new-object System.Text.AsciiEncoding
$buffer = new-object System.Byte[] 1024