Here is another version control system.
I have not looked at this yet.
Category: Uncategorized
RabbitMQ in Powershell
I have been trying to work out how to interact with RabbitMQ via Powershell.
I have seen PoshRabbit but that is not quite flexible enough for my purposes. I am looking for simple admin tasks.
The obvious starting point is the excellent RabbitMQ.Client assembly.
The only flaw is that the ConnectionFactory is not common type system safe due to a pair of properties that are not case unique. However with a bit of reflection even this can be overcome. Here is my first draft of the Send example in powershell:
[Reflection.Assembly]::LoadFile(($pwd).Path + “RabbitMq.Client.Dll”)
$factory = new-object RabbitMQ.Client.ConnectionFactory
$hostNameProp = [RabbitMQ.Client.ConnectionFactory].GetField(“HostName”)
$hostNameProp.SetValue($factory, “localhost”)
$createConnectionMethod = [RabbitMQ.Client.ConnectionFactory].GetMethod(“CreateConnection”, [Type]::EmptyTypes)
$connection = $createConnectionMethod.Invoke($factory, “instance,public”, $null, $null, $null)
$channel = $connection.CreateModel()
$channel.QueueDeclare(“hello”, $false, $false, $false, $null)
$message = “Hello, World!”
$body = [System.Text.Encoding]::UTF8.GetBytes($message)
$channel.BasicPublish(“”, “hello”, $null, $body)
Write-Host ” [x] Sent $message”
Now that I can create the connection the rest of the examples should be trivial to port.
Powershell on a new machine
To get powershell scripts to work without signing on a win 7 box:
Run cmd as admin.
Start powershell and run the following
Set-ExecutionPolicy Unrestricted
XML SQL Query
Sample SQL Server XML from database.
select top 10 * from Database.dbo.vwMyView (NOLOCK)
where SomeXml.value(‘declare namespace s=”http://tempuri.com/schema”; (//s:MyXMLTag)[1]’,’int’) = 2
Windows 7 Troubleshooter
This utility is intended to assist in fixing problems with a Windows 7 installation.
It simply a link to a website, which should work most of the time.
The big flaw is when the problem is in the network stack. This means you can’t go online so get left with wonderful suggestions such as “ask friends” or “search the internet”.
More About NuGet
I have been having trouble installing Nuget on my new Windows 7 box.
The first version that I got using the ASP.Net MVC installer was version 1.4
The upgrade tool did continually failed with an error about mismatched checksums.
You need to run visual studio as Administrator to be allowed to uninstall NuGet.
Having uninstalled 1.4 then I was able to install the latest and greatest version (currently 1.6).
Windows 7 Installation
Recently I purchased a new laptop with Windows 7 Premium and a Windows 7 Pro upgrade DVD. It was only during this process that I discovered that you can’t upgrade. The process insists on replacing the entire operating system.
At the end of this I was left with a PC with a VGA display and no network stack. I can’t believe that a modern operating system fails to install a minimal network connection.
Eventually I found that the restore process provides an installer that provides the 5 missing drivers. Why the upgrade process could not have copied them from the previous installation is best put to the developers at microsoft. In addtion could someone explain why a machine needs to reboot 5 times?
Code Training Course
This is a simple tutorial for everyone.
Useful css library
T4 Template Tutorial
http://dnrtv.com/dnrtvplayer/player.aspx?ShowNum=0183
Tangible T4 editor