Print

Shairport

Written by Daniel Mundy on Wednesday, 07 December 2011 14:13.

The Airport Express was reverse engineered to make a program called Shairport. This lets you stream music from a Mac or iOS device to a PC running Shairport.

Linux

Download the tar.gz, extract it, read the INSTALL.md file for instructions: There is an apt-get command to run, then you run make. You can just run ./shareport.pl and it will work. I didn't need to install the PERL modules, I guess Ubuntu already has them.

Windows

There's a Windows port called shairport4w

Print

Difference between a root port and a designated port

Written by Daniel Mundy on Wednesday, 07 December 2011 08:24.

Reading through the CCNA books I was confused about the difference between a root port and a designated port. An article on Cisco's website about how STP / RSTP works cleared it up for me. I've copied the relevant info below.

Root Port Roles

The port that receives the best BPDU on a bridge is the root port. This is the port that is the closest to the root bridge in terms of path cost. The STA elects a single root bridge in the whole bridged network (per-VLAN). The root bridge sends BPDUs that are more useful than the ones any other bridge sends. The root bridge is the only bridge in the network that does not have a root port. All other bridges receive BPDUs on at least one port.

The port that receives the best BPDU is the root port

Designated Port Role

A port is designated if it can send the best BPDU on the segment to which it is connected. 802.1D bridges link together different segments, such as Ethernet segments, to create a bridged domain. On a given segment, there can only be one path toward the root bridge. If there are two, there is a bridging loop in the network. All bridges connected to a given segment listen to the BPDUs of each and agree on the bridge that sends the best BPDU as the designated bridge for the segment. The port on that bridge that corresponds is the designated port for that segment.

A port is designated if it can send the best BPDU on the segment to which it is connected

Print

CISCO Password Reset

Written by Daniel Mundy on Tuesday, 01 November 2011 12:33.

  1. Boot the router and interrupt the boot sequence by performing a break (CTRL+BREAK), which will take the router into ROM monitor mode
  2. Change the configuration register to turn on bit 6 (confreg 0x2142)
  3. Reload the router (reset)
  4. Enter privileged mode (answer "no" to entering setup mode, press ENTER to go into user mode, type enable to go into privileged mode)
  5. Copy the startup-config file to running-config (copy start run)
  6. Change the password (conf t, user admin secret <newpassword>, enable secret <newpassword>)
  7. Reset the configuration register to the default value (config-register 0x2102)
  8. Save the router configuration (copy run start)
  9. Reload the router (reload)

 

Print

How to Save a CISCO Config File

Written by Daniel Mundy on Tuesday, 01 November 2011 12:27.

Using TFTP 

The recommended way to save and load config files is directly to/from a TFTP or FTP server. First you'll need to install a TFTP server program (like tftpd32 for Windows) on your PC. 

To export config: copy startup-configuration tftp

To import config: copy tftp startup-config

 

Using PuTTY to save a log file

A quick and dirty way to save the config is to use the logging feature of PuTTY.

First, configure PuTTY to save a log file: Go to Session > Logging, supply a log file name, and change "Session logging" to "All session output".

Then show the running config. To show the running config without having to acknowledge the "MORE" each time, do this:

in EXEC mode:

terminal length 0
show run

 

    Print

    Setting Password on CISCO Routers

    Written by Daniel Mundy on Tuesday, 01 November 2011 12:24.

    Set enable password: enable secret <password>

    Set user password with highest privileges: username admin priv 15 secret <password>

    BTW, there are two ways to store a password: unencrypted (pass) or encrypted (secret)

    If you typed the command username admin pass <password> and got the following message:

    ERROR: Can not have both a user password and a user secret

    ... then just type the same command using "secret" instead, like this: username admin secret <password>

     

    Print

    Detect Windows Version Number in Scripts

    Written by Daniel Mundy on Monday, 31 October 2011 16:07.

    You can use the "VER" command in your scripts to return the version of Windows that is running.

    This is useful when different syntax is required depending on the version. For example, you may want to only run certain commands on Vista and above, because the commands did not exist in XP and Server 2003. You could use the following methods to get the version number, and then use a statement like "IF %_version% is greater than or equal to 6, run the following Vista commands".

     

    To view the version number on the command line

    For /f "tokens=4 delims=]\ " %G in ('ver') Do echo %G

    To set the version number in a batch file

    For /f "tokens=4 delims=]\ " %%G in ('ver') Do (set _version=%%G)

    Test the Windows version number in a Kaseya script with an IF statement

    In Kaseya scripting you can say "run this step on Vista only" by using the "perform step on" feature. You can select Windows XP, Vista, 7, etc. But you can't say "run this step on Vista and above", which would be very handy! The steps below achieve that. (you can also do things like: run these steps on "Everything before Vista")

    New Step:

    • Step Type: Execute Shell Command - Get Results to Variable
    • Shell Command: For /f "tokens=4 delims=]\ " %G in ('ver') Do echo %G
    • Execute as system account

    New IF:

    • Condition Type: Check Variable
    • Variable name: #global:cmdresults#
    • Is Greater Than or Equal To: 6

    New Step:

    • <stuff to do on Vista and above>

    Toggle Else

    New Step: 

    • <stuff to do on pre-Vista machines>
    Print

    VBScript

    Written by Daniel Mundy on Monday, 31 October 2011 08:01.

    VBscript to call another command

    Set WshShell = CreateObject("WScript.Shell")
    WshShell.Run "C:\Windows\System32\wbadmin.exe delete systemstatebackup -keepversions:4 -quiet", 0, True
    WshShell.Run "C:\Windows\System32\wbadmin.exe start systemstatebackup -backuptarget:D: -quiet", 0, True
    Set WshShell = Nothing

     

    The last argument says to wait until the command completes before continuing execution. To not wait, set it to False:

    WshShell.Run "C:\Windows\System32\wbadmin.exe start systemstatebackup -backuptarget:D: -quiet", 0, False
    Print

    How to add metadata to a folder in SharePoint

    Written by Daniel Mundy on Friday, 28 October 2011 11:26.

    How to add metadata to a folder: http://sharepoint-guru.blogspot.com/2007/06/adding-metadata-to-folder.html

    You can also change existing folders, no need to re-create. Just select the folder and on the Documents tab click Edit Properties.

     

    Print

    Use the old style task bar in Windows 7

    Written by Daniel Mundy on Friday, 28 October 2011 09:16.

    Does anyone actually like the new Windows 7 taskbar? I prefer the old style which 

    You can change it back manually by right-clicking on the taskbar, selecting properties, and ticking the following two options:

    • Use small icons
    • Taskbar buttons: Never combine
    Now you will have the old style taskbar!

    sshot-2011-10-28-1

    What if you want to script it? The change is made in the registry, you can import the registry file by using the following command: reg import settings.reg

     

     

    Put the following into settings.reg:

    Windows Registry Editor Version 5.00
    [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced]
    "TaskbarSmallIcons"=dword:00000001
    "TaskbarGlomLevel"=dword:00000002