Skip to content

Instantly share code, notes, and snippets.

View micdenny's full-sized avatar

Michael Denny micdenny

View GitHub Profile
@micdenny
micdenny / Program.cs
Last active August 29, 2015 14:01
CGMiner Api Test
void Main()
{
var client = new TcpClient("192.168.1.6", 4028);
using (var stream = client.GetStream())
{
using (var reader = new StreamReader(stream))
{
var data = System.Text.Encoding.ASCII.GetBytes("{\"command\":\"summary\",\"parameter\":\"\"}");
stream.Write(data, 0, data.Length);
@micdenny
micdenny / Program.cs
Created June 18, 2014 14:44
CastleWcfFacilityPolicyCatchAsync
using System;
using System.Diagnostics;
using System.ServiceModel;
using System.ServiceModel.Description;
using System.Threading;
using System.Threading.Tasks;
using Castle.Facilities.WcfIntegration;
using Castle.MicroKernel.Registration;
using Castle.Windsor;
@micdenny
micdenny / program.cs
Last active August 29, 2015 14:03
Roll the dice
using System;
using System.Security.Cryptography;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
var r = RollDice(250);
@micdenny
micdenny / TaskHelpers.cs
Created July 14, 2014 10:52
TaskHelpers
using System;
using System.Collections;
using System.Collections.Generic;
using System.Runtime.CompilerServices;
using System.Threading;
namespace System.Threading.Tasks
{
internal static class TaskHelpers
{
@micdenny
micdenny / TopshelfBootstrapper.cs
Last active August 29, 2015 14:13
Bootstrapper sample + Topshelf
using System;
using System.Timers;
using Castle.MicroKernel.Registration;
using Castle.Windsor;
using Topshelf;
namespace TopshelfBootstrapper
{
internal class Program
{
@micdenny
micdenny / Program.cs
Created January 20, 2015 17:53
Rpc does not work anymore with version 0.40.3.351
using System;
using System.Threading;
using System.Threading.Tasks;
using EasyNetQ;
namespace ConsoleApplication5
{
class Program
{
static void Main(string[] args)
@micdenny
micdenny / gist:db05b4d8226876f0a2b0
Last active August 29, 2015 14:15 — forked from SimplyChris/gist:dad867b3f1854528243f
all octupus parameters variables
Octopus.Acquire.MaxParallelism
Octopus.Action[Deploy Cardio API - Host].Azure.CertificateBytes
Octopus.Action[Deploy Cardio API - Host].Azure.CertificateThumbprint
Octopus.Action[Deploy Cardio API - Host].Azure.CloudServiceName
Octopus.Action[Deploy Cardio API - Host].Azure.Endpoint
Octopus.Action[Deploy Cardio API - Host].Azure.Slot
Octopus.Action[Deploy Cardio API - Host].Azure.StorageAccountName
Octopus.Action[Deploy Cardio API - Host].Azure.SubscriptionId
Octopus.Action[Deploy Cardio API - Host].Azure.SwapIfPossible
Octopus.Action[Deploy Cardio API - Host].Azure.UploadedPackageUri
# --- settings ---
$feedUrlBase = "https://www.nuget.org/api/v2/"
# the rest will be params when converting to funclet
$latest = $true
$overwrite = $false
$top = 5000 #use $top = $null to grab all
$destinationDirectory = join-path ([Environment]::GetFolderPath("MyDocuments")) "NuGetLocal"
# --- locals ---
$webClient = New-Object System.Net.WebClient
@micdenny
micdenny / Configuring Windows PowerShell remoting.md
Created March 27, 2015 11:31
Configuring Windows PowerShell remoting

Enabling PowerShell remoting on the server

Open PowerShell console and type the following command to enable PowerShell remoting:

Enable-PSRemoting -Force

Change scripts execution policy to allow remote scripts:

Set-ExecutionPolicy RemoteSigned
@micdenny
micdenny / Program.cs
Created May 12, 2015 13:46
EasyNetQ RPC Deadlock
using System;
using System.Threading;
using System.Threading.Tasks;
using EasyNetQ;
namespace EasynetQ.SubRpc.Deadlock
{
internal class Program
{
private static void Main(string[] args)