Skip to content

Instantly share code, notes, and snippets.

View davad's full-sized avatar

David Landry davad

View GitHub Profile
@HaleTom
HaleTom / print256colours.sh
Last active May 2, 2024 14:43
Print a 256-colour test pattern in the terminal
#!/bin/bash
# Tom Hale, 2016. MIT Licence.
# Print out 256 colours, with each number printed in its corresponding colour
# See http://askubuntu.com/questions/821157/print-a-256-color-test-pattern-in-the-terminal/821163#821163
set -eu # Fail on errors or undeclared variables
printable_colours=256

Goals

Syncthing devices that store data in encrypted format. Such a device can participate fully in a cluster, but the information on the device is not directly usable.

Assumptions and Definitions

  • There exists a secret key per folder, known only by devices that can access the unencrypted data. We call these "secure devices".

  • Devices that do not know the secret key can only access encrypted data. We call these "insecure devices".

@sivel
sivel / better-ssh-authorized-keys-management.md
Last active May 3, 2024 14:20
Better SSH Authorized Keys Management

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:

@rfay
rfay / .gitconfig
Created April 12, 2011 04:12 — forked from schacon/.gitconfig
insteadOf Example for git.drupal.org
# Put this in your .gitconfig
[url "http://git.drupal.org/project/"]
insteadOf = "do:"