Skip to content

Instantly share code, notes, and snippets.

View stojan211287's full-sized avatar
🎯
Focusing

Stojan Jovanovic stojan211287

🎯
Focusing
  • Oxford
View GitHub Profile
@stojan211287
stojan211287 / monad.py
Last active May 26, 2019 21:26
Simple Writer monad demo in Python3
class Writer:
def __init__(self, value, log: str = ""):
self._value = value
self._log = log
# For decorating individual functions with messages
@staticmethod
def explain(message: str):
def decorator(modification: callable):
@stojan211287
stojan211287 / blockchain.go
Created July 13, 2019 10:29
A simple blockchain in golang
package main
import (
"crypto/sha256"
"encoding/hex"
"encoding/json"
"io"
"log"
"net/http"
"os"
@stojan211287
stojan211287 / CentralizedSSHCredsChecklist.md
Created February 23, 2020 20:37
How to setup a server with secure SSH access and a centralized public key store

Checklist

  • Turn off password access in /etc/ssh/sshd_config
  • Turn off GSS API access in /etc/ssh/sshd_config
  • Change AuthorizedKeysPath in /etc/ssh/sshd_config to /ssh_keys/%u/authorized_keys
  • Place public keys in /ssh_keys/%u/authorized_keys
    • NOTE: The sysadmin needs to do this manually for every user, after the user executes ssh-copy-id
  • sudo chown root:root -R /ssh_keys
  • sudo chmod 711 /ssh_keys
  • sudo chmod 711 /ssh_keys/%u