Skip to content

Instantly share code, notes, and snippets.

Brent Maxwell brentmaxwell

Block or report user

Report or block brentmaxwell

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View better-ssh-authorized-keys-management.md

Better SSH Authorized Keys Management

A seemingly common problem that people encounter is how to handle all of your users authorized_keys file.

People struggle over management, ensuring that users only have specific keys in the authorized_keys file or even a method for expiring keys. A centralized key management system could help provide all of this functionality with a little scripting.

One piece of functionality overlooked in OpenSSH is the AuthorizedKeysCommand configuration keyword. This configuration allows you to specify a command that will run during login to retrieve a users public key file from a remote source and perform validation just as if the authorized_keys file was local.

Here is an example directory structure for a set of users with SSH public keys that can be shared out via a web server:

@brentmaxwell
brentmaxwell / ChangeDoubleStraightQuotesToSmartQuotes.vba
Last active Nov 25, 2019
Swap smart and straight quotes in Microsoft Word
View ChangeDoubleStraightQuotesToSmartQuotes.vba
Sub ChangeDoubleStraightQuotesToSmartQuotes()
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = """"
.Replacement.Text = """"
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
@brentmaxwell
brentmaxwell / GenerateDataDictionary.sql
Created Sep 9, 2019
Generate a simple data dictionary for SQL Server; uses the Description extended property.
View GenerateDataDictionary.sql
CREATE PROCEDURE GenerateDataDictionary
@TableName NVARCHAR(MAX)
AS
BEGIN
SELECT
c.name AS ColumnName,
CASE
WHEN c.max_length = -1 THEN dt.name + '(max)'
WHEN dt.name = 'nvarchar' THEN dt.name + '('+CAST(ISNULL(c.max_length,0)/2 AS NVARCHAR)+')'
WHEN dt.name = 'varchar' THEN dt.name + '('+CAST(ISNULL(c.max_length,0) AS nvarchar)+')'
@brentmaxwell
brentmaxwell / gist:4e0239b214f589cc3d80824a4bef8f34
Created May 4, 2016 — forked from davidnunez/gist:1404789
list all installed packages in android adb shell
@brentmaxwell
brentmaxwell / openpgp.txt
Created Jan 14, 2016
OpenKeychain Linked Identity
View openpgp.txt
This Gist confirms the Linked Identity in my OpenPGP key, and links it to this GitHub account.
Token for proof:
[Verifying my OpenPGP key: openpgp4fpr:48fcfd01403cf2ad5b242924755d89895912d6fa]
@brentmaxwell
brentmaxwell / PEMtoRSAParams
Created Nov 19, 2015
Convert RSA keys from PEM to RSA Parameters
View PEMtoRSAParams
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Globalization;
using System.IO;
using System.Security.Cryptography;
using System.Text;
internal class RSA {
private const string _begin = "-----BEGIN ";
View ObjectDumper.cs
using System;
using System.Collections;
using System.Collections.Generic;
using System.Reflection;
using System.Text;
public class ObjectDumper
{
private int _level;
private readonly int _indentSize;
@brentmaxwell
brentmaxwell / aprs.php
Created Sep 16, 2015
Simple PHP page to post to APRS-IS
View aprs.php
<?php
$aprs_php_ver = "0.1";
$aprs_is_url = "http://srvr.aprs-is.net:8080";
date_default_timezone_set('UTC');
$defaultSSID = "10";
$defaultPath = "APRS,WIDE2-2,TCPIP*";
if($_SERVER["REQUEST_METHOD"] == "POST")
{
@brentmaxwell
brentmaxwell / public-key
Last active Aug 29, 2015
OpenPGP Public Key
View public-key
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v2
mQENBFV1z94BCACsc/WQ3v4OQK2zcTIS1751Pixtlielg8hafGUmu3RPYzB0Qrnu
109TQrfO4Sx+fi9Q4iLzzKbPJ83myaDRCxd0zng6pVbPMSX44fzzgLdQpE7esut6
ptEJtCGPqMoaLuJ5xieG8YmmERJ1lQjk6LWWat7b/wfM7E6NqDBH8YoG5Mb5kDdG
qF55p5/2L07f/7G4M28rLJLBCe4/6q/tjAUzuEVyJO/M0X3cb3bBmySOokHHhfpf
ls5ZgeJjuLAjzPImGDxLDLwBDpcEt4h8XHc65Ir17POV/gu7VSqjn4XuuOVdGed5
Abg0caqgL9u3TzIJur/SkO3fEXMDqDRZ0T0dABEBAAGJATcEHwEKACEFAlV3IZwX
DIABw1qv3cOYCyUeXa9P0c6JaoQB3tICBwAACgkQdV2JiVkS1vrqPwgAn6mD9UrN
View keybase.md

Keybase proof

I hereby claim:

  • I am brentmaxwell on github.
  • I am brentmaxwell (https://keybase.io/brentmaxwell) on keybase.
  • I have a public key whose fingerprint is 48FC FD01 403C F2AD 5B24 2924 755D 8989 5912 D6FA

To claim this, I am signing this object:

You can’t perform that action at this time.