Skip to content

Instantly share code, notes, and snippets.

View omkarkhair's full-sized avatar

om omkarkhair

View GitHub Profile
@omkarkhair
omkarkhair / rinken
Created May 24, 2017 07:00
Rinkenby Testnet Address
0x7dF20Af045869764f94a54eDF9b00e5c1Fef3244
@omkarkhair
omkarkhair / SelfSignedCert.ps1
Last active December 12, 2016 07:36
Create a self-signed certificate using PowerShell 'New-SelfSignedCertificate'
$dns = "<ENTER_FULLY_QUALIFIED_DOMAIN>"
$pwd = "<ENTER_STRONG_PASSWORD>"
$exportPath = "<ENTER_PATH_TO_EXPORT_CERTIFICATES_TO>"
$certPath = "Cert:\LocalMachine\My\"
$cert = New-SelfSignedCertificate -CertStoreLocation $certPath -DnsName $dns
$certPath = "$($certPath)\$($cert.Thumbprint)"
Write-Host 'Cert path: ' $($certPath)
Export-Certificate -cert $certPath -FilePath $exportPath'\lab.cer'
$p = ConvertTo-SecureString -String $pwd -Force -AsPlainText
Export-PfxCertificate -cert $certPath -FilePath $exportPath'\lab.pfx' -Password $p
@omkarkhair
omkarkhair / SetupController.cs
Created June 18, 2016 19:05
OWIN Open ID Connect
using Microsoft.IdentityModel.Clients.ActiveDirectory;
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Threading.Tasks;
using System.Web;
using System.Web.Mvc;
namespace PUGWebApp.Controllers
@omkarkhair
omkarkhair / Startup.Auth.cs
Created June 18, 2016 18:09
OWIN Open ID Connect
using Owin;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Microsoft.Owin.Security.Cookies;
using Microsoft.Owin.Security;
using Microsoft.Owin.Security.OpenIdConnect;
using System.IdentityModel.Claims;
using System.Threading.Tasks;
@omkarkhair
omkarkhair / Startup.cs
Last active June 18, 2016 17:49
OWIN Open ID Connect
using Owin;
using Microsoft.Owin;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
[assembly: OwinStartup(typeof(PUGWebApp.Startup))]
namespace PUGWebApp
@omkarkhair
omkarkhair / cvtrack
Last active May 13, 2017 14:17
OpenCV checker track
#include <opencv2/core/core.hpp>;
#include <opencv/cv.h>;
#include <opencv2/highgui/highgui.hpp>;
using namespace cv;
using namespace std;
int main()
{
@omkarkhair
omkarkhair / hexstr2float.html
Last active October 8, 2015 09:47
Hex string to Float (32bit) IEEE 754
<html>
<head>
<script>
/*
Converts a 32bit HEX string (42883EFA) to Float 68.1229476928711
Complies to IEEE 754 Standards.
Tested with a range of sample inputs. Feel free to report a bug.
*/