Archive for the ‘code’ Category

Needing a quick and dirty growl notification to know when a person restarted their computer, so I wrote up this originally one line script. . ‘\libs\growl\Send-Growl 3.1.ps1’; #http://poshcode.org/1464 #Might need to modify the file a little. $str = @(“down”, “up”); $last_ds = $false; while(1) { $new_ds = Test-Connection TargetHost -Quiet -Count 2; if($new_ds -ne $last_ds) […]

For a while now I’ve wanted to make use of PowerShell to do things like what you would use PHP for with Apache, but nothing I found worked, not even cgi-bin stuff. So I figured, why not just build my own? By using stuff like HttpListener, it’s pretty easy to get started and worry more […]

Updates HE public IP records for your tunnel (for instance at the coffee shop), finds the first available interface that is connected and creates a v6v4tunnel using that IP. See script for where you need to edit. function fastpingtest { $ping = New-Object System.Net.NetworkInformation.Ping; $ping.Send(“8.8.8.8”, 1000).status -eq “success”; } $endtime = [datetime]::Now.AddMinutes(1); $mapipv6 = $false; […]

From what I can tell, there aren’t many…if any, IPv6 address range calculators. While I read it is recommended that you use the entire /64 block, I don’t think it’s always necessary to do so. Besides, what happens when you want to route only a portion of the block to one place? Example usage: ipv6range.ps1 […]

Recently I made some configuration changes to Powershell so I could use the latest .Net version (4.0), but it caused errors with a project. The problem turned out to be that the library was trying to load an older version of mscorelib. This is pretty easily fixed thanks to Microsoft packaging a compiler with .NET. […]

Nick asked, “This script looks good. Would you mind adding comments to it to describe its logic? Also, it doesn’t appear to like having colons in MAC addresses even though colons is pretty standard. Thanks for sharing your script!” (link). Well Nick, here you are! I hope it helps! param ( [parameter(Position=0, Mandatory = $true, […]

After many an hour pouring over the code and running tests galore, I think I’ve resolved some of the major issues from version 0.1. Like how it would just randomly crash when the forward lookup hosts decided they had had enough. Now it’ll recover from it and chug along. There is now some simple compression. […]

Tracing stuff with tracert or traceroute you can’t specify a starting TTL. So there will always be routers that show up and waste time. This code is pretty rudimentary. Hopefully I’ll be able to expand on it to include ipv6 and make it faster. param( $targetIP, $BeginHop = 1, $EndHop = 30, $timeout = 1000, […]

Hosts files are great, you can specify any host to IP combination, overriding anything. But what about other types of records? Hosts files can’t do service, text, pointer records, etc? So what to do if you want to test these record types? You could setup your own DNS server, create a new zone, add the […]

I guess people have been looking for subvert! So here’s the last version released. For the security conscious, I’m sorry I lost the source. Feel free to browse the binaries with something like Redgate’s Reflector Subvert 0.4 binaries. I really should finish version 0.4.1 to get the source out there instead of playing Minecraft.