Skip to content

Instantly share code, notes, and snippets.

View vcsjones's full-sized avatar
㊙️

Kevin Jones vcsjones

㊙️
View GitHub Profile
private readonly Random _random = new Random();
public void ConfigureServices(IServiceCollection services)
{
// Add framework services.
services
.AddMvc()
.AddJsonOptions(options =>
options.SerializerSettings.ContractResolver = _random.Next(0, 2) == 0 ? new DefaultContractResolver() : new CamelCasePropertyNamesContractResolver());
}
const jwt = require('jsonwebtoken');
const privateKey = `-----BEGIN EC PRIVATE KEY-----
MHcCAQEEIA/Hp5bQItOQCKBdgH6sHLZAhTBNID/x8Fb5xwrWrZVQoAoGCCqGSM49
AwEHoUQDQgAEAwTleT8M/rlF8nE/qhY+26axJzFroVz7WciGZYxB1wI/U0jJgyr5
PBdQASFywG+QgGP/xD3eEozUnVOX+1z+9g==
-----END EC PRIVATE KEY-----`;
const publicKey = `-----BEGIN PUBLIC KEY-----
MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEAwTleT8M/rlF8nE/qhY+26axJzFr
oVz7WciGZYxB1wI/U0jJgyr5PBdQASFywG+QgGP/xD3eEozUnVOX+1z+9g==
@vcsjones
vcsjones / headers.conf
Created September 2, 2016 01:54
headers
add_header X-Frame-Options DENY;
add_header Content-Security-Policy "default-src 'none' ; style-src 'self' ; img-src 'self' ; frame-ancestors 'none' ; form-action 'none' ; block-all-mixed-content; reflected-xss block; sandbox; referrer no-referrer";
add_header X-Content-Type-Options nosniff;
add_header X-XSS-Protection "1; mode=block";
add_header Referrer-Policy no-referrer;
@vcsjones
vcsjones / vscode-settings.json
Last active February 4, 2018 00:11
General VSCode settings I use
{
"workbench.colorCustomizations": {
"editor.selectionBackground": "#8C6642"
},
"editor.minimap.enabled": false,
"window.zoomLevel": 1,
"git.confirmSync": false,
"workbench.colorTheme": "Solarized Light",
"workbench.iconTheme": "vs-seti",
"terminal.integrated.fontFamily": "Meslo LG L for Powerline",
# frozen_string_literal: true
begin
require "bundler/inline"
rescue LoadError => e
$stderr.puts "Bundler version 1.10 or later is required. Please update your Bundler"
raise e
end
gemfile(true) do
require 'openssl'
encrypt_me = "what a fine day for coding" # Data to encrypt
@aes_key = (1..16).to_a.pack("C*") # Dummy bad key
@aes_iv = (17..32).to_a.pack("C*") # Dummy bad initialization vector
cipher = OpenSSL::Cipher::AES.new(128, :CBC)
cipher.encrypt # Put it in "encrypt" mode, doesn't actually encrypt
cipher.key = @aes_key
cipher.iv = @aes_iv
ciphertext = cipher.update(encrypt_me) + cipher.final
static function OnBoot() {
var surveyType = FiddlerApplication.Assembly.GetType("Fiddler.Surveys.FiddlerSurveySettings", true);
var surveySettings = System.Activator.CreateInstance(surveyType, true);
var remindDateProp = surveyType.GetProperty("RemindDate", System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.Instance);
var surveySave = surveyType.GetMethod("Save", System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.Instance);
remindDateProp.SetValue(surveySettings, System.DateTime.Now.AddDays(7));
surveySave.Invoke(surveySettings, null);
}
@vcsjones
vcsjones / pem.cs
Last active October 17, 2018 00:16
static void Main(string[] args)
{
var cert = new X509Certificate2("foo.cer"); //Or however you load the certificate.
var octets = cert.Export(X509ContentType.Cert);
var formatted = Convert.ToBase64String(octets);
var builder = new StringBuilder();
builder.AppendLine("-----BEGIN CERTIFICATE-----");
var i = 0;
while(i < formatted.Length)
{
[Serializable]
public class LolSerialization : System.Runtime.Serialization.ISerializable
{
public int Test { get; }
public LolSerialization()
{
Test = 1;
}
protected LolSerialization(SerializationInfo info, StreamingContext context)
TLD $
.movie 306.00
.sucks 282.00
.hiv 254.00
.casino 141.00
.creditcard 141.00
.gold 101.00
.reise 101.00
.adult 100.00