This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rabbitmqctl add_user test test | |
rabbitmqctl set_user_tags test administrator | |
rabbitmqctl set_permissions -p / test ".*" ".*" ".*" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
db.currentOp().inprog.forEach(function(op) { | |
if (op.progress) { | |
var remaining = op.progress.total - op.progress.done; | |
var running_for = op.secs_running / 60 / 60; | |
print(op.ns, op.opid, 'running for', running_for.toPrecision(4), 'hours') | |
print('job "'+ op.insert.name +'" running in background?', op.insert.background ? 'yes' : 'no'); | |
print(op.msg) | |
print('Remaining records', remaining, 'finished', op.progress.done, 'docs') | |
print('Estimated', ((running_for / op.progress.done) * remaining).toPrecision(4), 'hours remaining') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.IO; | |
using System.Collections; | |
using System.Collections.Generic; | |
using System.Globalization; | |
using System.Security.Cryptography; | |
using System.Linq; | |
using System.Text.RegularExpressions; | |
using System.Net; | |
using System.Web; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Original author Mark Renoden (http://au.linkedin.com/in/markrenoden) | |
Get-AzureVM | | |
ForEach-Object { | |
$vm = $_.name; | |
Write-Output "$vm VM Properties"; | |
Write-Output "---------------"; | |
Format-List -InputObject $_ -Property *; | |
Write-Output "$vm VM Endpoints"; | |
Write-Output "---------------" ; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Requires -Version 5.0.9814.0 | |
if(!($PSVersionTable.PSVersion.Major -ge 5 -and $PSVersionTable.PSVersion.Build -ge 9814)) { | |
"Sorry you need PSVersion 5.0.9814.0 or newer" | |
$psversiontable | |
return | |
} | |
Add-Type -AssemblyName presentationframework |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Thought experiment: | |
Listened to eight .NET Rocks episodes yesterday while driving. One episode was about C# 6.0 with Bill Wagner | |
(http://www.dotnetrocks.com/default.aspx?showNum=1029), another about DDD with Steve Smith and Julie Lerman | |
(http://www.dotnetrocks.com/default.aspx?showNum=1023) where they specifically also discussed DDD's notion of | |
an anti-corruption layer, which aims to provide a neutral zone between different domains. The combination of | |
the two episodes gave me the following idea which I'll jot down here quickly. | |
Don't go "you dont do that in DDD, because .." since that's not the point. The point is efficiency and avoiding | |
data copies. Also, I'm not planning on doing anything further with it, so if anyone wants to take this somewhere, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using logv.http; | |
using logv.ws.core; | |
using System; | |
using System.Collections.Concurrent; | |
using System.Threading.Tasks; | |
using MongoDB.Bson; | |
using logv.ws.core.data; | |
namespace logv.host | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Function Test-Url { | |
[CmdletBinding()] | |
param ( | |
[Parameter(Mandatory=$true)] | |
[String] $Url | |
) | |
Process { | |
if ([system.uri]::IsWellFormedUriString($Url,[System.UriKind]::Absolute)) { | |
$true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ProcessesById = @{} | |
foreach ($Process in (Get-WMIObject -Class Win32_Process)) { | |
$ProcessesById[$Process.ProcessId] = $Process | |
} | |
$ProcessesWithoutParents = @() | |
$ProcessesByParent = @{} | |
foreach ($Pair in $ProcessesById.GetEnumerator()) { | |
$Process = $Pair.Value |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.IO; | |
using System.Net; | |
using System.Net.Http; | |
using System.Net.Http.Formatting; | |
using System.Net.Http.Headers; | |
using System.Text; | |
using System.Threading.Tasks; | |
using Newtonsoft.Json; |
NewerOlder