Skip to content

Instantly share code, notes, and snippets.

View pasztorpisti's full-sized avatar

István Pásztor pasztorpisti

  • London, UK
View GitHub Profile
@pasztorpisti
pasztorpisti / github_known_hosts.py
Created November 9, 2020 22:45
Generate a known_hosts entry for github from the IP ranges returned by the github meta API
#!/usr/bin/env python3
# SPDX-License-Identifier: MIT-0
"""
This script prints a line that can be added to the ~/.ssh/known_hosts file.
The required information (github server IPs and RSA key + fingerprint)
is queried from the github servers.
"""
import base64
import hashlib
import json
@pasztorpisti
pasztorpisti / event.go
Last active August 23, 2019 23:34
Go/Golang AtomicBool and Event (event = atomic bool + signal chan)
// SPDX-License-Identifier: MIT-0
package whatever
import (
"fmt"
"sync/atomic"
)
// AtomicBool must be initialised to 0 or 1 to function properly.