NINet.org

Convert XML and XSL to HTML

by on Oct.03, 2013, under Coding/Scripting, Sys Admin

Just a quickie. I have a script that outputs an XML file and I use an XSL file to display it but Management wanted HTML files, the thought of having to re-code the output was disheartening to say the least. I then came across “msxsl.exe” it’s a Microsoft tool that takes a XML file and a XSL file and then generates the resultant rendered output in HTML.

http://www.microsoft.com/en-gb/download/details.aspx?id=21714

Syntax:
msxsl.exe <XMLFile> <XSLFile> -o <HTMLFile>

Leave a Comment :, , , , , more...

Changing TFS 2010 $(sourcedir)

by on Sep.03, 2013, under Sys Admin, TFS, Windows

Seemingly this can be set by editing the TfsBuildServer.exe.config on the build agent machine and changing the value of the following Key:
<add key=”SourcesSubdirectory” value=”Sources” />

On a 2010 build agent this isn’t possible (continue reading…)

Leave a Comment :, , , , more...

TFS queue build from powershell

by on Aug.12, 2013, under Coding/Scripting, powershell, Sys Admin, TFS, Windows

I was doing some testing on TFS and got fed up queuing new builds via right-click -> queue new build -> ok. So here is a powershell script that can be used to kick off a build.

I’ve included some extra assemblies that don’t need to be used as I have other functions that do use them in the same module file. example useage below

Queue-TFSBuild -TFSServer http://tfsserver:8080/tfs/col -Project Project1 -Definition DailyBuild

$arrAssemblies = @(
    "Microsoft.TeamFoundation.Client",
    "Microsoft.TeamFoundation.Common",
    "Microsoft.TeamFoundation.Build.Client",
    "Microsoft.TeamFoundation.Build.Workflow",
    "Microsoft.TeamFoundation.VersionControl.Client"
)
Foreach ($assembly in $arrAssemblies) {
    [void][Reflection.Assembly]::LoadWithPartialName($assembly)
}	
Remove-Variable assembly, arrAssemblies


Function Queue-TFSBuild {
    [CmdLetBinding()]
    Param (
        [Uri]$TFSServer,
        [String]$Project,
        [String]$Definition
    )

    Process {
        [Microsoft.TeamFoundation.Client.TfsTeamProjectCollection]$tfsc = [Microsoft.TeamFoundation.Client.TfsTeamProjectCollectionFactory]::GetTeamProjectCollection($TFSServer)
        $IBS = [Microsoft.TeamFoundation.Build.Client.IBuildServer]

        [Microsoft.TeamFoundation.Build.Client.IBuildServer] $buildserver = $tfsc.GetService($IBS)
        [Microsoft.TeamFoundation.Build.Client.IBuildDefinition] $BuildDef = $buildserver.GetBuildDefinition($Project,$Definition)
        [Microsoft.TeamFoundation.Build.Client.IBuildRequest] $BuildReq = $BuildDef.CreateBuildRequest();
        $buildserver.QueueBuild($BuildReq)
    }
}
Leave a Comment :, , , , , , more...

Flashing eeprom during imaging via PXE

by on Jul.11, 2013, under Coding/Scripting, Linux, Servers, shell, Sys Admin

I had a requirement to flash the eeprom on a FTDI chip while dropping a clonezilla image onto the system which is done via a PXE server

The 1st thing we need to do is get ftdi_eeprom tools on the clonezilla image, we do this by setting up an ubuntu system (I used ubuntu 12.04)

apt-get install squashfs-tools unzip

wget -O Clonezilla-2.1.2-20_amd64.zip http://downloads.sourceforge.net/project/clonezilla/clonezilla_live_stable/2.1.2-20/clonezilla-live-2.1.2-20-amd64.zip?r=http%3A%2F%2Fclonezilla.org%2Fdownloads%2Fdownload.php%3Fbranch%3Dstable&amp;ts=1373475093&amp;use_mirror=heanet

mkdir clonezilla-src clonezilla-sqfs
cd  clonezilla-src
unzip ../Clonezilla-2.1.2-20_amd64.zip
cd ../clonezilla-sqfs
unsquashfs ../clonezilla-src/live/filesystem.squashfs
cd squashfs-root/root

wget http://ftp.de.debian.org/debian/pool/main/f/ftdi-eeprom/ftdi-eeprom_0.3-2_amd64.deb
wget http://ftp.de.debian.org/debian/pool/main/c/confuse/libconfuse0_2.7-4_amd64.deb
wget http://ftp.de.debian.org/debian/pool/main/c/confuse/libconfuse-common_2.7-4_all.deb

rm *.deb

chroot ~/clonezilla-sqfs/squashfs-root
cd root

dpkg -i libconfuse-common_2.7-4_all.deb
dpkg -i libconfuse0_2.7-4_amd64.deb
dpkg -i ftdi-eeprom_0.3-2_amd64.deb

cat > ./eeprom.conf <<@
vendor_id=0x0403
product_id=0x6001
manufacturer="ME"
product="XXXXX"
serial="FTABC123"
@

exit

cd ~/clonezilla-sqfs

mksquashfs squashfs-root filesystem.squashfs -comp xz -Xbcj x86 -b 1024k

Replace the Fields above with the values you want to use most important is the two _id fields as they tell ftdi_eeprom which device to attempt to flash, you can get these by running the command “lsusb” and identifying the device.

Copy the file “filesystem.squashfs” that has just been created and overwrite the one on the PXE server used to deploy the image. When you next PXE boot the target machines you will find ftdi_eeprom is available to use.

Now during the deployment run the command
ftdi_eeprom –flash-eeprom /root/eeprom.conf

Leave a Comment :, , , , , , , , , more...

Get Numeric Values from an Enum in powershell

by on Jul.10, 2013, under Coding/Scripting, powershell, Sys Admin, TFS

I needed to get the values for a enum in order to generate the correct flags for a function call here’s how to do it.

[Enum]::GetValues(<enumType>) will return a list of all the values

<enumType>::<value>.value__ will return the numeric value enum

[Enum]::GetValues([Microsoft.TeamFoundation.Build.Client.BuildStatus]) | foreach {
$Name = $_
$Value = ([Microsoft.TeamFoundation.Build.Client.BuildStatus]::$_).value__
Write-Output "$Name = $Value"
}
Leave a Comment :, , , , more...

Puppeteering with Puppet

by on Mar.20, 2013, under Linux, Puppet, Servers

So I’ve been a very naughty sysadmin recently, one of the things I intended to do early on in my new employment was setup some form of System Management as we have several Linux hosts. However truth be told I have never had a System Management system for Linux hosts (due to a lack of time to implement one) and due to a number of tight deadlines I’ve had to put this on the back burner and spin up servers for additional roles.

This road however will lead to ruin so I have put a stop to the random spinning up of hosts for anything other than testing until I get something in place to mange all the configurations centrally. The question for me was what to use, I’ve heard of both Puppet and Chef, but I have no experience of them. So after doing a bit of reading I figured I’d go with Puppet as it seems to have most of the bases I am interested in covered.

(continue reading…)

Leave a Comment :, , , , , more...

SCCM CDP to WMI version 0.0.0.3 out

by on Jan.06, 2013, under C++, CDP to WMI, Cisco, Coding/Scripting, Projects, SCCM SMS, Sys Admin, Windows

Sorry for the lack of progress until recently but I’ve recently had a lot of more important priorities in life so working on this had to go on hold for a little while. I am hoping in the next few months to release version 1.0 but as on now this is still experimental so should only be used in a lab environment.

Please use the ticketing system on sourceforge to report any issues and add feature requests.

You can get it here: http://sourceforge.net/projects/cdptowmi/

ToDo:

See here: https://sourceforge.net/p/cdptowmi/wiki/ToDo%20List/ (work in progress)

(continue reading…)

3 Comments :, , , , , , , , , , , , more...

Setting up a Cisco network for video developers Part 2

by on Dec.04, 2012, under Cisco, Linux, Routing, Servers, Switching, Sys Admin, VLANs

Introduction

Welcome to Part 2, this part will provide the background and current topology that is to be replaced, the real fun will start in Part 3. I know you are all impatient to get started configuring switches, routers and servers but I think that the design and the reasons behind the design are as important (if not more so) than the actual configuration. As always I know I am not perfect and all knowing so if from the background and the following tutorials you think I have missed something or could have done something better then please speak up, send me a message via the contact page or leave a comment.

Background

NINet has grown since the last series and now has a floor of approximately 40 developers developing video solutions. The current solution was put together in bits and pieces and is resulting in poor performance and frequent outages. It must be stressed that this is a development network and as such cannot be locked down developers need to be able to connected unmanged switches (much to my irritation) and connect devices at will.

(continue reading…)

Leave a Comment :, , , , , , , , , , , more...

Setting up a Cisco network for video developers Part 1

by on Dec.04, 2012, under Cisco, Linux, Routing, Switching, Sys Admin, VLANs

Introduction

This series of tutorials will be similar to my posts on a wireless setup, where I take a real world requirement of mine and fit it to a tutorial about NINet.org.

Summary

This series will take an existing flat topology with mixed switches running in L2 and convert it to a Cisco Switch Topology mixing L3 and L2. Then we’ll take a bit of step into the sysadmin side of things where we setup infrastructure servers to support the end users. At the time of this writing, in the real world, this network is up and running however the supporting infrastructure is a lower priority than other work items so it may take a while to filter through to here.

(continue reading…)

Leave a Comment :, , , , , , , , , , , more...

TFS Warehouse Cube Status via SOAP and Powershell

by on Oct.31, 2012, under Coding/Scripting, powershell, Sys Admin, TFS, Windows

Well I’ve just been put in charge of managing our TFS infrastructure so here is the first of hopefully many posts around automating and managing TFS.

The attached script runs a SOAP query against the TFS Warehouse Cube and returns the jobs and their status and then either generates an HTML file or sends an HTML email with the results.

I recommend creating a directory called Scripts on the C:\ drive and setting the permissions so that only the System Administrator & User the script runs as can access the contents of the directory.

(continue reading…)

2 Comments :, , , , , , more...