SSH Certificates with step-ca

DateTagsca / tls / ssh

Installation

Follow instructions on the previous post or the step readme

Setup

Create required root and SSH signing keys:

$ step ca init --ssh
✔ What would you like to name your new PKI? (e.g. Smallstep): Whatsdoom
✔ What DNS names or IP addresses would you like to add to your new …
more ...



Creating Airgapped keys for Yubikey

Introduction

Before you begin, it would probably be a good idea to have three flash drives and a Yubikey.

  1. Your first USB stick will be a Live USB that will boot the airgapped system.
  2. The second will store the packages that you will need to install on the newly booted …
more ...

Restricting rsync access with SSH

DateTagsssh / rsync

SSH public keys can be added to ~/.ssh/authorized_keys on a typical system to allow the holder of the private key to access the system. Sometimes however you might want to restrict the access a particular key has.

In my case, I wanted my CI system to be able to …

more ...

Getting better feedback from sinon stubs

Sinon is an extremely powerful tools for writting unit tests. It helps to create standalone spies, stubs and mocks to isolate functionallity.

Setting up Sinon

The documentation suggests you can, for example, create a spy like so:

it('calls the original function', function () {
    var callback = sinon.spy();
    var proxy = once …
more ...

Extending Supertest

I have an express app running behind an Apache reverse proxy with mod_auth_mellon used to authenticate users via SAML.

As a result of relying on headers for auth, I have lots of mocha tests that look like:

it("should add a comment with a user", (done) => {
    let expectedUser = "a User …
more ...

View git diff by word

DateTagsgit

By default, git diff will highlight differences by line.

Differences highlighted word by word:

$ git diff --word-diff

Differences highlighted character by character:

$ git diff --word-diff-regex=.

Differences highlighted word by word without extra characters:

$ git diff --color-words

Differences highlighted character by character without extra characters:

$ git diff --color-words=.

More information can …

more ...

Pretty printing of git commit history

DateTagsgit

Helpful git logging aliases

Helpful aliases for viewing git commit history: logg, logga, loggs, loggsa, logd, logda, logdr, and logdra.

The aliases combine to utilize the same set of flags in different combinations:

--color:show colored
--graph:text-based graphical representation of the commit history
--date-order:show no parents before all …
more ...

Pretty Printing from the Commmand Line

JSON

The python standard library provides a json library that can be used to pretty print json.

$  echo '{"this": ["that"]}' | python -m json.tool
{
  "this": [
      "that"
  ]
}

XML

$  echo '<root><foo a="b">lorem</foo><bar value="ipsum" /></root>' | xmllint --format -
<?xml version="1.0"?>
<root>
  <foo a="b">lorem</foo …
more ...