Skip to content

Instantly share code, notes, and snippets.

@tmeers
tmeers / gist:8358012
Created January 10, 2014 16:56
howsmyssl.com check dump
{"given_cipher_suites":["TLS_RSA_WITH_RC4_128_MD5","TLS_RSA_WITH_RC4_128_SHA","TLS_RSA_WITH_3DES_EDE_CBC_SHA","TLS_RSA_WITH_DES_CBC_SHA","Some unknown cipher suite: 0x64","Some unknown cipher suite: 0x62","TLS_RSA_EXPORT_WITH_RC4_40_MD5","TLS_RSA_EXPORT_WITH_RC2_CBC_40_MD5","TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA","TLS_DHE_DSS_WITH_DES_CBC_SHA","Some unknown cipher suite: 0x63"],"ephemeral_keys_supported":true,"session_ticket_supported":false,"tls_compression_supported":false,"unknown_cipher_suite_supported":true,"beast_vuln":true,"able_to_detect_n_minus_one_splitting":false,"insecure_cipher_suites":{"TLS_DHE_DSS_WITH_DES_CBC_SHA":["uses keys smaller than 128 bits in its encryption"],"TLS_RSA_EXPORT_WITH_RC2_CBC_40_MD5":["uses keys smaller than 128 bits in its encryption"],"TLS_RSA_EXPORT_WITH_RC4_40_MD5":["uses keys smaller than 128 bits in its encryption"],"TLS_RSA_WITH_DES_CBC_SHA":["uses keys smaller than 128 bits in its encryption"]},"tls_version":"TLS 1.0","rating":"Bad"}
@tmeers
tmeers / gist:8701826
Last active August 29, 2015 13:55
Rules for generating Pinewood Derby Race Heats in a "Chaotic-Rotation Method"
Get number of heats based on LaneCount and RacerCount: totalHeats
Add a Race per Den
For each Heat found above:
Select random racers for the lineup based on a "Chaotic-Rotation Method"
Each Racer must race at least 3 times
Each racer must race the same number of times
Racers should be held in a race through as many heats as possible
Racers cannot compete against themselves
Racers should compete against as many different opponents as possible
@tmeers
tmeers / gist:ae3d53e3b5990765a23b
Created October 24, 2014 18:22
Sorta Random Strings
internal static string MakeString(int numChars)
{
string random = string.Empty;
string[] chars = { "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "*", "!", "<", ">", "^", "$", "@", "+", "-" };
Random rnd = new Random();
for (int i = 0; i < numChars; i++)
{
random += chars[rnd.Next(70)];
}
@tmeers
tmeers / A: info
Last active August 29, 2015 14:13
ColdFusion CreateObject
I'm hosting multiple (near identical) applicaitons under the ./applications/ folder.
For this example I'm using [testing] to represent the individual applicaitons.
I need to replace this:
<cfset variables.employeeObj = CreateObject("component","applications.psctest.includes.employee")>
with something less unique to the application. Perhaps basing the string literal:
"applications.[testing].includes.employee"
with an application setting in application.cfc in the root of each applicaiton?
Or creating the instance of these different "variables.employeeObj" objects in the applicaiton.cfc?
The objective: write a query that selects all Leagues that a given user has access to.
The standard SQL query for a JOIN and a WHERE clause on the table you joined.
SELECT *
FROM League
OUTER JOIN LeagueUser ON LeagueUser.League_Id = League.Id
WHERE LeagueUser.User_Id = [passed id]
And the proposed EF query.
@tmeers
tmeers / Get-LoggingDetails.ps1
Created July 17, 2019 13:18
Returns script line number and file name for debugging
# Thanks to this post for showing how to find the current line number and file when called in a script
# https://poshoholic.com/2009/01/19/powershell-quick-tip-how-to-retrieve-the-current-line-number-and-file-name-in-your-powershell-script/
# Slightly extented with __WHERE__ to shorten everything up a bit
#
# Calling __WHERE__ will format the output while still returning the correct values.
function Get-CurrentLineNumber {
$MyInvocation.ScriptLineNumber
}
function Get-CurrentFileName {