Attention: this is the key used to sign the certificate requests, anyone holding this can sign certificates on your behalf. So keep it in a safe place!
openssl genrsa -des3 -out rootCA.key 4096
public class ExcelProcessor | |
{ | |
public Stream Generate<T>(Dictionary<string, IEnumerable<T>> Sheets) | |
{ | |
//Generate Excel Workbook in Memory | |
using (var excel = new ExcelPackage()) | |
{ | |
if (Sheets.Any() == false) throw new Exception("No Sheets were supplied"); | |
foreach (var pair in Sheets) |
public class ImageService : IImageService | |
{ | |
#region Scale Stream | |
public Stream ScaleWidth(Stream imageStream, int maxWidth) | |
{ | |
var output = new MemoryStream(); | |
//Get Image from Stream | |
using (var image = Image.FromStream(imageStream)) | |
{ |
# This starts minikube and configures docker to point to minikube cluster | |
" | |
==================================== | |
Welcome to Minikube Docker Shell | |
==================================== | |
" | |
"- Checking Minikube Status" | |
$isRunning = ((minikube status) -join ' ' ).Contains("Running") |
echo off | |
:: download OpenSSL if you don't have it for the below | |
:: Conver the p7b into PEM format | |
openssl pkcs7 -in mydomain.p7b -print_certs -out mydomain.pem | |
:: Combine this with the crt server certificate and private key into a PFX | |
openssl pkcs12 -export -in mydomain.crt -inkey mydomain.key -certfile mydomain.pem -out mydomain.pfx |
# DANGER - Kills all processes for a specific database | |
-- DECLARE @SQL varchar(max); | |
-- SELECT @SQL = COALESCE(@SQL,'') + 'Kill ' + Convert(varchar, r.session_id) + ';' from sys.dm_exec_requests r left join sys.dm_os_waiting_tasks t | |
-- on r.session_id = t.session_id where r.session_id >= 50 and r.session_id <> @@spid | |
-- EXEC(@SQL) |
public static class Extensions | |
{ | |
[DebuggerStepThrough] | |
/// <summary> | |
/// Update properties with properties of the object Supplied (typically anonymous) | |
/// </summary> | |
/// <typeparam name="T">Type of Source Object</typeparam> | |
/// <param name="destination">Object whose property you want to update</param> | |
/// <param name="source">destination object (typically anonymous) you want to take values from</param> | |
/// <returns>Update reference to same Object</returns> |
/** | |
* Credit http://www.myersdaily.org/joseph/javascript/md5-text.html | |
*/ | |
module MD5 { | |
function md5cycle(x, k) { | |
var a = x[0], | |
b = x[1], | |
c = x[2], | |
d = x[3]; |
REM Migrate Database | |
packages\FluentMigrator\tools\Migrate.exe --db=sqlserver --target=Dumia.Migrations\bin\Debug\Dumia.Migrations.dll --configPath=Dumia.Http\web.config --c=Dumia %* | |
REM Update Database DBML file | |
.\utils\SqlMetal.exe /server:"(local)" /database:dumia /user:admin1 /password:admin1 /dbml:"Dumia.Infrastructure/Database.dbml" |
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Web; | |
using System.Web.Mvc; | |
using System.Web.Routing; | |
namespace System.Web.Mvc | |
{ |