Tuesday, 27 August 2013

Public BTSync Secrets

Following is a list of BitTorrent Sync secrets I am using to share files with colleagues;

SharePoint Support Files
Read only secret: B3XNA62PYSAAH7LGKCIORW536DVG3OME2
This repository hosts information and files related to installing, configuring, maintaining, and developing for Microsoft's SharePoint.

Lync Support Files
This repository hosts information and files related to installing, configuring, maintaining, and developing for Microsoft's Lync Server.

PowerShell Support Files
This repository hosts resources for working with Microsoft Windows PowerShell.

If you would like to get read write access to any of the above repositories to add to the resource, please contact me and I will send you the secret.

This list will expand as I add more repositories.

BitTorrent Sync Thoughts

Update: Don't use BTSync. Checkout SyncThing instead.

As I broaden my usage of BitTorrent Sync (BTSync) I am coming up with more and more ways of making my life easier with this brilliant tool.

Here is a quick list of ways to use BTSync;
  • Sync your photos from your phone to your desktop
  • Sync your music from your desktop to your phone
  • Backup your files
  • Deploy software development solutions such as websites or script files (PowerShell).
  • Share files with family and friends
  • Support your family and friends remotely (screenshots etc.)
  • Share files with customers
  • Sync your installed games to multiple machines

One of the problems I had when first using BTSync was the naming of the folders and where to store them.   After using it for a month I came up with a good name for the root folder where I place all my synchronised folders.   I now have a folder called "Pool" and inside are all of the folders being synchronised.

This Pool folder is used for simple synchronised folders while I have backups and other large synced folders stored elsewhere.

BTSync is only new and I started using it with a little apprehension.   Because of a build up of trust in the stability of BTSync over the last month I decided to start synchronising a large folder on my home file server.   My file server is running on a Raspberry Pi, so I had expectations that the indexing (hashing) process would be rather slow on a 900GB directory of pictures, music, documents and more.   As it turns out, the btsync daemon is crashing often.   It looks like the software package needs more resources than the Pi can deliver which is a real shame.   I am hoping bugs like this will get fixed as the product matures over time.

If you haven't given BTSync a spin yet, give it a go.   You may find it saves you time and gives you access to your files in ways you never thought of.

If you have thought of a unique way to use BTSync, let me know about it in the comments below.

Monday, 26 August 2013

Determine the Active IP Address on a Windows Machine with PowerShell

If you have ever had a need to install multiple NICs onto a Windows machine, or use a Virtual Technology like Virtual Box, it can be difficult to determine your local network IP address because of all the logical network interfaces.   It is easy enough to run the ipconfig /all command and see the results but to determine which IP address is being used to access remote networks by using a script requires a little work.

The best approach I could come up with was to use the Windows routing table.   If you run the "route print" command on a Windows machine you will see the default network interface that is being used to route traffic to remote networks. Using this information you can determine which IP address is being used as the source address when accessing remote networks.

I had a need to detect the local subnet on a Windows 7 machine and came up with the below script. It will return a PSCustomObject populated with the active network interfaces details.

Using three WMI classes being Win32_IPv4RouteTable, Win32_NetworkAdapter, and Win32_NetworkAdapterConfiguration I could determine the information I was after.

Firstly I retrieved the Windows routing table filtered to the default routes. This gets sorted by the metric and I select the route with the lowest metric. This gave me the InterfaceIndex of the active network interface. Using this index number I could retrieve the network adapter and its configuration.

To use this script either copy the text below into a new function or, as I do, copy it into a ps1 file saved in your path and call the file directly. Here is the Gist link: https://gist.github.com/grantcarthew/7000687