Skip to content

Instantly share code, notes, and snippets.

View Boggin's full-sized avatar
💭
bleep bloop blorp

Richard Bogle Boggin

💭
bleep bloop blorp
View GitHub Profile
@Boggin
Boggin / BitLockerSmartCardYubiKey.md
Created January 17, 2021 10:53
Use YubiKey Smart Card for BitLocker on W10

Use YubiKey Smart Card for BitLocker on W10

Create certificate

The certificate will be an Encrypting File System (EFS) self-signed smart card certificate.

  • Control Panel > User Accounts > Manage your file encryption certificates
    Create new and store locally

YubiKey Manager

@Boggin
Boggin / git-filter-repo.md
Last active September 28, 2022 14:43
Using git-filter-repo to rewrite history and remove secrets

Removing Secrets In Your Git Repository

If you have a code-base under source control that is internal to your company, for instance, it's hosted on premises, you may have checked in some secrets in your configuration files. We all know we should have had those encrypted or kept outside of the checked-in source in some way but perhaps it was just better to accrue some technical debt and worry about it later. Okay, now it's later.

git-filter-repo

@Boggin
Boggin / gist:5649e5873c076060678817eab826d38b
Last active May 10, 2022 13:46
Use Restic to perform backups to Backblaze B2.
We couldn’t find that file to show.
@Boggin
Boggin / CreateConfigurationCommand.cs
Created December 29, 2014 16:17
A workaround Sql Bulk Insert for Entity Framework 6.
namespace Data.Commands
{
using System;
using System.Data;
using System.Data.Entity;
using System.Data.SqlClient;
using System.Diagnostics;
public class CreateConfigurationCommand
{
@Boggin
Boggin / Get-ArchiveSize.ps1
Created March 9, 2021 17:11
Get the monthly average folder size
<#
Given the list of folders and the dates over which to check then this script
will group the files by month for each folder between the given dates and get
the sum of the file sizes. So you will get a calculated property of 'folder',
'month', 'size' (where file size is in MB to two decimal places). Then that
calculated property is grouped by 'folder' and the cumulative file size over the
selected months is averaged. So you will have a calculated property of 'folder',
'monthly' (where 'monthly' is a monthly average in MB).
#>
$archives = @{
@Boggin
Boggin / ApplicationContext.cs
Created October 15, 2013 16:00
Repository pattern infrastructure (with FrameLog auditing).
namespace Demo.Repository.Infrastructure
{
public class ApplicationContext : DbContext
{
public readonly FrameLogModule<ChangeSet, Person> Logger;
public ApplicationContext() : base("name=Demo")
{
Configuration.ProxyCreationEnabled = false;
Database.Initialize(true);
@Boggin
Boggin / Country.cs
Created October 15, 2013 15:48
Lookup tables for code-first Entity Framework (with auditing by FrameLog).
namespace Demo.Repository.Models
{
public class Country : Lookup
{
/// <summary>
/// Gets or sets the issues that link to this.
/// </summary>
/// <remarks>This may be referenced by many issues.</remarks>
public ICollection<Issue> Issues { get; set; }
}
@Boggin
Boggin / IssueByNameSpecification.cs
Created October 15, 2013 16:08
Specification pattern for repository.
namespace Demo.Repository.Specifications
{
public class IssueByNameSpecification : Specification<Issue>
{
private readonly string key;
public IssueByNameSpecification(string key)
{
this.key = key;
}
@Boggin
Boggin / git-tfs.markdown
Last active October 14, 2020 08:22
Git Tfs : HowTo

Git Tfs

If you would like to use git locally against the TFS repositories you can use git-tfs.

You can install git from the Windows installer: http://git-scm.com/downloads.
I prefer to install the bash command line and all the Unix tools. You may still prefer to use the GUI which is installed at the same time.

Then you can install git-tfs via chocolatey.
Note: If you don't have chocolatey goodness yet then see the Chocolatey Install section below.

Git Workflow

Names for branches

  • feature
  • fix
  • hotfix
  • spike

Major branches

  • release (to staging)