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 / 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
@stojan211287
stojan211287 / config.py
Last active September 15, 2020 19:26
Configuring Ray as Modin backend
import ray
ray.init(
plasma_directory="/PATH/TO/PLASMA/STORE",
temp_dir="/PATH/TO/TMP/STORE",
object_store_memory=50 * 1024 * 1024 * 1024 # 50 GB
)
# above is to avoid the `Task is a driver task and so the object created by ray.put could not be reconstructed`
# Now you can import Modin as normal
@stojan211287
stojan211287 / CloudBasicSecurityAndWebHosting.md
Last active February 14, 2020 22:16
GCP cheat sheet + Basic VM security
@stojan211287
stojan211287 / CloudLoadBalancing.md
Last active February 14, 2020 22:15
Basic Cloud Load balancing using an HTTP proxy
@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 / 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):