Skip to content

Instantly share code, notes, and snippets.

View thecodeite's full-sized avatar

Sam Plews thecodeite

  • Codeite Ltd
  • Cheltenham, UK
View GitHub Profile
@thecodeite
thecodeite / self-signed-certificate-with-custom-ca.md
Created December 5, 2018 18:12 — forked from fntlnz/self-signed-certificate-with-custom-ca.md
Self Signed Certificate with Custom Root CA

Create Root CA (Done once)

Create Root Key

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
javascript:(function(){
var delay=10000, intensity=10, timer;
function resetTimer(){clearTimeout(timer); timer = setTimeout(blur, delay);}
function activity(){document.documentElement.setAttribute('style',''); resetTimer();}
function blur(){document.documentElement.setAttribute('style', 'filter:url("data:image/svg+xml;utf8,<svg xmlns=\'http://www.w3.org/2000/svg\'><filter id=\'blur\'><feGaussianBlur stdDeviation=\''+intensity+'\' /></filter></svg>#blur");-webkit-filter:blur('+intensity+'px);filter:blur('+intensity+'px);');}
['mousemove', 'keypress', 'scroll'].forEach(function(e){document.addEventListener(e, activity, false);});
resetTimer();
})();void(0);
@thecodeite
thecodeite / gist:9322107
Last active August 29, 2015 13:56 — forked from ryansroberts/gist:9249312
HTTP Authorisation module
public class BasicAuth : IHttpModule
{
protected bool IsHeaderPresent
{
get
{
var context = HttpContext.Current;
var authHeader = context.Request.Headers["Authorization"];
return (!string.IsNullOrEmpty(authHeader));
}
@thecodeite
thecodeite / SQL_Tasks.ps1
Last active January 4, 2016 19:09 — forked from tvjames/Vagrantfile
Configuring Server 2008 core for Webdev, Vagrant and Puppet
# Enable TCP - Must be run from SQL powershell
$MachineObject = new-object ('Microsoft.SqlServer.Management.Smo.WMI.ManagedComputer') .
$ProtocolUri = "ManagedComputer[@Name='" + (get-item env:\computername).Value + "']/ServerInstance[@Name='MSSQLSERVER']/ServerProtocol"
$tcp = $MachineObject.getsmoobject($ProtocolUri + "[@Name='Tcp']")
Write-Host "TCP current => $tcp.IsEnabled" -ForegroundColor Green
$tcp.IsEnabled = $true
$tcp.alter()