Archive for September, 2010

What Port am I plugged into??

Something that’s always handy to know is what switch port you’re plugged into. What’s even better is being able to find out without getting out of your chair.

If you’re on a nix based system with tcpdump then just turn the following:

tcpdump -nn -v -i eth0 -s 1500 -c 1 'ether[20:2] == 0x2000'

On Windows you’ll need to grab WinDump and WinPCap from

Once installed run

windump -D

To list the interfaces on your system. Then just run the same as above but with windump:

windump -nn -v -i eth0 -s 1500 -c 1 'ether[20:2] == 0x2000'
Read more

7Zip with Powershell

7-Zip is something I use on a daily basis not only for creating or extracting various archive formats but for extracting ISOs. I love this feature of 7-Zip.

Something I’ve wanted to do for a while was figure out if it was possible to use 7-Zip from Powershell and indeed it is.

There is a C# wrapper for 7-Zip available at that makes this all a lot easier. You’ll need to download the SevenZipSharp.dll as well as the native 7-Zip dlls (they’re in the Other Available Downloads section).

I’ve extracted SevenZipSharp.dll, 7z.dll and 7z64.dll to a directory called SevenZipSharp.

First up you’ll need to load the Assembly:

Add-Type -Path "D:\Tools\Assemblies\SevenZipSharp\SevenZipSharp.dll"

Then simply create an extractor and extract the archive, simply:

$extractor = New-Object SevenZip.SevenZipExtractor('D:\Data\')

Note for x64 users
When I first tried this I got an error when attempting to create an SevenZip.SevenZipExtractor object: New-Object : Exception calling “.ctor” with “1″ argument(s): “Can not load 7-zip library or internal COM error! Message: failed to load library.”

This is because the SevenZipSharp.dll looks for 7z.dll in the same directory and the 7z.dll in that directory is the x86 Dll. You have two options, rename 7z64.dll to 7z.dll or run the following after loading the assembly:

Read more

FTP 7 for IIS 7

When trying to add an FTP component to an IIS 7 website I got lost looking for how to add a new FTP site. Turns out there is new FTP service available as an extension to IIS 7 that boasts enhanced functionality and several new features. Some summary points:

  • Built as an extension to IIS 7 and integrates into the IIS Manager.
  • Supports FTP over SSL as well as UTF8 and IPv6.
  • Adds new membership based authentication system.
  • Allows for users to enable an existing website for FTP without the need to create a separate FTP site.
  • Virtual hostname support (Host headers but for ftp).
  • And much, much more.

Head on over to for a deeper look. Or download using the Web Platform Installer.

If you have the Windows Firewall enabled (and you should) it is worth looking at Configuring FTP Firewall Settings to ensure you have the correct firewall settings

Read more