Here is a link to a book on programing software in python for kids.
Author: chriseyre2000
Alternatives to the Escape Key in vim
Here is set of alterantives to the escape key in vim.
For the uninitiated the escape key is used to move from edit mode to normal (command mode).
Ctrl-[ is the default alternative. This allows the user to not have to move your hands away from the main keys.
How to create a South Park Like cartoon.
NDesk.Options
NDesk.Options
This is a fluent api for creating command line option tools.
This is great for adding command-line switches without having to reinvent a parser each time.
How to force sql server to use mixed mode authentication in Powershell
$instanceName = get-itemproperty ‘HKLM:SoftwaremicrosoftMicrosoft SQL ServerInstance NamesSQL’ -name MSSQLSERVER
if ($?) {
$i = $instanceName.MSSQLSERVER
set-itemproperty “HKLM:SoftwaremicrosoftMicrosoft SQL Server$iMSSQLServer” -name LoginMode -value 2 -type dword
}
VIM Tree Explorer
NERD Tree
Google Discussion Goes Public
Bazaar
Here is another version control system.
I have not looked at this yet.
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