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
param([string]$Directory) | |
get-childitem $Directory | | |
% { $f = $_ ; | |
get-childitem -r $_.FullName | | |
measure-object -property length -sum | | |
select @{Name="Namn";Expression={$f}},@{Name="Sum (Mb)"; Expression={"{0:N1}" -f ($_.sum / 1MB)}}} |
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
MIX_ENV=prod mix compile.protocols | |
MIX_ENV=prod PORT=4001 elixir -pa _build/prod/consolidated -S mix phoenix.server |
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
# On the phoenix node | |
# if production mode | |
MIX_ENV=prod PORT=4001 elixir --name phoenix@127.0.0.1 --cookie 123 --erl "-kernel inet_dist_listen_min 9001 inet_dist_listen_m 9001" -pa _build/prod/consolidated -S mix phoenix.server | |
# if debug mode | |
elixir --name phoenix@127.0.0.1 --cookie 123 --erl "-kernel inet_dist_listen_min 9001 inet_dist_listen_m 9001" -S mix phoenix.server | |
# On the observing node | |
# Terminal 1, start SSH tunnel | |
ssh -N -L 9001:localhost:9001 -L 4369:localhost:4369 pi@192.168.1.31 |
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
type Program<T> = Read<T> | Write<T> | Done<T>; | |
interface Read<T> { | |
kind: "Read"; | |
next: (data: T) => Program<T>; | |
} | |
interface Write<T> { | |
kind: "Write"; | |
valToWrite: string; |
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
#!/bin/bash | |
sudo apt-get update | |
sudo apt-get --assume-yes install wget | |
sudo apt-get --assume-yes install libssl-dev | |
sudo apt-get --assume-yes install ncurses-dev | |
sudo apt-get --assume-yes install m4 | |
# erlang | |
wget http://erlang.org/download/otp_src_18.2.tar.gz | |
tar -xvzf otp_src_18.2.tar.gz | |
cd otp_src_18.2 |
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
;; container - An existing container at the sotrage account | |
;; blob-connection-string - Connectionstring for the strage account | |
;; This is used from environ to have different configurations | |
{:dev {:env {:container "<containerName>" | |
:blob-connection-string "DefaultEndpointsProtocol=https;AccountName=<name>;AccountKey=<key>;EndpointSuffix=core.windows.net"}}} |
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
interface Book { | |
kind: "book"; | |
price: Number; | |
title: String; | |
} | |
interface Chocolate { | |
kind: "chocolate"; | |
taste: String; | |
price: Number; |
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
<# | |
.SYNOPSIS | |
Query a CosmoDb. | |
.DESCRIPTION | |
This command will query a cosmos db and return the results as an object. | |
.PARAMETER EndPoint | |
The endpoint to the CosmosDb Account. |
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
#r "packages/Hopac/lib/net45/Hopac.dll" | |
#r "packages/Hopac/lib/net45/Hopac.Core.dll" | |
#r "packages/Hopac/lib/net45/Hopac.Platform.dll" | |
#r "packages/FSharp.Data/lib/net45/FSharp.Data.dll" | |
#r "packages/Http.fs/lib/net461/HttpFs.dll" | |
#r "packages/System.Net.Http/lib/net46/System.Net.Http.dll" | |
open Hopac | |
open Hopac.Infixes | |
open FSharp.Data |
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
public static string ExportPrivateKey(X509Certificate2 certificateWithPrivateKey) | |
{ | |
var parameterList = RsaParametersToList(certificateWithPrivateKey.GetRSAPrivateKey().ExportParameters(true)); | |
var parameterBytes = SerializeList(parameterList); | |
var base64 = Convert.ToBase64String(parameterBytes); | |
var builder = new StringBuilder(); | |
builder.Append("-----BEGIN RSA PRIVATE KEY-----\n"); | |
for (int i = 0; i < base64.Length; i += 64) |
NewerOlder