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
using System; | |
using System.IO; | |
using System.Web; | |
using System.Web.Mvc; | |
using Stripe; // you need this library https://github.com/jaymedavis/stripe.net | |
using System.Net; | |
namespace StripeSampleMVC.Controllers | |
{ | |
public class StripeWebhookController : Controller |
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
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
Application app = new Application(); | |
app.Run(); | |
} | |
} | |
public class Application |
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
@echo off | |
@echo. | |
@echo Description: Uses OpenSSL to create a 521 bit EC certificate (PEM). Also creates the PKCS#12 file to export the cert as well as the private key (AES256 encrypted) | |
@echo. | |
if [%1]==[] goto usage | |
SET paramFile=%1-param-key.pem | |
SET keyFile=%1-param-key.pem | |
SET reqFile=%1-req.pem |
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
USE [TestDb] | |
GO | |
SET ANSI_NULLS ON | |
GO | |
SET QUOTED_IDENTIFIER ON | |
GO | |
CREATE TABLE [dbo].[CreditCard]( | |
[CreditCardID] [int] IDENTITY(1,1) NOT NULL, | |
[CardType] [nvarchar](50) NOT NULL, |
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
USE TestDb | |
; | |
--If there is no master key, create one now. | |
IF NOT EXISTS | |
(SELECT * FROM sys.symmetric_keys WHERE symmetric_key_id = 101) | |
CREATE MASTER KEY ENCRYPTION BY | |
PASSWORD = 'WeakPassword1234' | |
GO | |
CREATE CERTIFICATE Sales09 |
This file has been truncated, but you can view the full file.
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
[Tue Dec 10 23:42:47 2013] [notice] SELinux policy enabled; httpd running as context unconfined_u:system_r:openshift_t:s0:c3,c667 | |
[Tue Dec 10 23:42:47 2013] [error] (2)No such file or directory: mod_mime_magic: can't read magic file /var/lib/openshift/52a7ece65973ca24cf000026/mono/conf/magic | |
[Tue Dec 10 23:42:47 2013] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec) | |
[Tue Dec 10 23:42:47 2013] [error] (2)No such file or directory: mod_mime_magic: can't read magic file /var/lib/openshift/52a7ece65973ca24cf000026/mono/conf/magic | |
[Tue Dec 10 23:42:48 2013] [notice] Digest: generating secret for digest authentication ... | |
[Tue Dec 10 23:42:48 2013] [notice] Digest: done | |
[Tue Dec 10 23:42:48 2013] [warn] pid file /var/lib/openshift/52a7ece65973ca24cf000026/mono/run/httpd.pid overwritten -- Unclean shutdown of previous Apache run? | |
[Tue Dec 10 23:42:48 2013] [notice] Apache/2.2.22 (Unix) mod_mono/2.10 DAV/2 configured -- resuming normal operations | |
Listening on: /tmp/mod_mono_server_global | |
Root directory: |
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
// Copyright 2013, Sid Shetye | |
// | |
// Licensed under the Apache License, Version 2.0 (the "License"); | |
// you may not use this file except in compliance with the License. | |
// You may obtain a copy of the License at | |
// | |
// http://www.apache.org/licenses/LICENSE-2.0 | |
// | |
// Unless required by applicable law or agreed to in writing, software | |
// distributed under the License is distributed on an "AS IS" BASIS, |
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
-- Outline https://confluence.atlassian.com/display/JIRA/Connecting+JIRA+to+SQL+Server+2012 | |
-- Create the database | |
CREATE DATABASE jiradb; | |
GO | |
ALTER DATABASE jiradb COLLATE SQL_Latin1_General_CP437_CI_AI; | |
GO | |
ALTER DATABASE jiradb | |
SET READ_COMMITTED_SNAPSHOT ON | |
WITH ROLLBACK IMMEDIATE; |
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 class Entropy | |
{ | |
private const long Prime = 179426549; | |
private const long Prime2 = 46633; // another prime | |
public static long GetEntropySeed() | |
{ | |
return Ticks ^ ProcessInfoKey() ^ MemorySizeKey() ^ EnvironmentKey(); | |
} |
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
# Call this from inside a startup task/batch file as shown in the next two lines (minus the '# ') | |
# PowerShell -ExecutionPolicy Unrestricted .\HardenSsl.ps1 >> log-HardenSsl.txt 2>&1 | |
# EXIT /B 0 | |
# Credits: | |
# http://azure.microsoft.com/blog/2014/10/19/how-to-disable-ssl-3-0-in-azure-websites-roles-and-virtual-machines/ | |
# http://lukieb.blogspot.com/2014/11/tightening-up-your-azure-cloud-service.html | |
$nl = [Environment]::NewLine | |
$regkeys = @( |
OlderNewer