Skip to content

Instantly share code, notes, and snippets.

View dsoprea's full-sized avatar
💭
Head in yesterday. Hands in today. Heart in tomorrow.

Dustin Oprea dsoprea

💭
Head in yesterday. Hands in today. Heart in tomorrow.
View GitHub Profile
@dsoprea
dsoprea / mssql_encryption_backup_restore_encrypt_test.sql
Last active May 28, 2020 15:13
SQL Server: Backup and Restore Credentials, and Test Encryption
-- To run this script more than once, make sure to delete c:\temp\test.dmk,
-- c:\temp\test.smk, c:\temp\test.crt, and c:\temp\test.crt.key .
DECLARE @ExpectedSignature VARBINARY(8000);
DECLARE @ActualSignature VARBINARY(8000);
DECLARE @Encrypted VARBINARY(8000);
DECLARE @Decrypted VARBINARY(8000);
DECLARE @TestString VARCHAR(100) = 'protected string';
@dsoprea
dsoprea / Program.cs
Last active October 17, 2016 17:31
C# code for the properties that can retrieve the version embedded in the executable: http://wp.me/p3Uuaw-Hj
class Program
{
private string executableVersion = null;
private string ExecutableVersion
{
get
{
if (executableVersion == null)
{
@dsoprea
dsoprea / build.targets
Last active October 17, 2016 17:31
build.targets file for injecting version from a text-file to the AssemblyInfo.cs file: http://wp.me/p3Uuaw-Hj
<?xml version="1.0" encoding="utf-8" ?>
<Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<!-- Inject a version from a text-file into AssemblyVersion.cs . We do this
so that it's easier for the application to know its own version [by
reading the text file].
-->
<Import Project="$(ProjectDir)..\packages\MSBuildTasks.1.5.0.196\tools\MSBuild.Community.Tasks.Targets" />
<Target Name="InjectVersion" BeforeTargets="BeforeBuild">
<!-- Read the version from our text file. This appears to automatically
@dsoprea
dsoprea / Vagrantfile
Created August 2, 2016 15:24
Importing fully-qualified "appengine" package causes unsafe/syscall errors
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
$script = <<SCRIPT
apt-get update
apt-get install -y unzip git
wget -nv https://storage.googleapis.com/appengine-sdks/featured/go_appengine_sdk_linux_amd64-1.9.40.zip