This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"github.com/prometheus/procfs" | |
"golang.org/x/sys/unix" | |
) | |
func main() { | |
// $ uname --all |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# observe.py | |
from bcc import BPF | |
BPF(text=' | |
int kprobe__tcp_conn_request(struct request_sock_ops *rsk_ops, | |
const struct tcp_request_sock_ops *af_ops, | |
struct sock *sk, | |
struct sk_buff *skb) { | |
bpf_trace_printk("qlen: *sock.sk_ack_backlog"); | |
return 0; | |
}').trace_print() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
TEST_COVERAGE_THRESHOLD=90.0 | |
coverage: | |
@TEST_COVERAGE=$(shell go test -coverpkg ./... | grep coverage | grep -Eo '[0-9]+\.[0-9]+'); \ | |
if (( $(echo "$$TEST_COVERAGE $(TEST_COVERAGE_THRESHOLD)" | awk '{print ($1 > $2)}') )); then \ | |
exit 0; \ | |
else \ | |
echo "Current test coverage $$TEST_COVERAGE is below threshold of $(TEST_COVERAGE_THRESHOLD)."; \ | |
exit 1; \ | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
) | |
// Based off of the Java Optional<T> type. | |
type Optional[T any] struct { | |
value *T | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from Crypto.PublicKey import RSA | |
from Crypto import Random | |
from Crypto.Cipher import PKCS1_OAEP | |
from Crypto.Signature import PKCS1_v1_5 | |
from Crypto.Hash import SHA256 | |
from base64 import b64encode | |
random_generator = Random.new().read | |
key = RSA.generate(1024, random_generator) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from Crypto.PublicKey import RSA | |
from Crypto import Random | |
from Crypto.Cipher import PKCS1_OAEP | |
from Crypto.Signature import PKCS1_v1_5 | |
from Crypto.Hash import SHA256 | |
from base64 import b64encode, b64decode | |
random_generator = Random.new().read | |
key = RSA.generate(1024, random_generator) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from Crypto.PublicKey import RSA | |
from Crypto import Random | |
from Crypto.Cipher import PKCS1_OAEP | |
from base64 import b64encode, b64decode | |
random_generator = Random.new().read | |
key = RSA.generate(1024, random_generator) | |
print(key.exportKey('PEM')) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public_key = '-----BEGIN RSA PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAj4SxR1rxDFg6CR1lnNwY\nKvtjytHkMCcTcbW70OfGgom1O9c+k4+E+44LtVgGRpQToEEw9Jrs+9W2xdvOfWyK\nQOahMT2/FupenEXJi9r7ud/RDTow6BrTgx4N84yb119IQDCJ17UlKg08C4HWK5Yo\nVVRUpTKrpxNGbc4q4RQULgdFO6MWePOW0xMDTWtWwnkjJ5yzrgHMUmvN6+hcnHeG\nb2MKo/TyXA7KGdwESob3tn2ZvrTJ/AARvpme+1HzLT+CPt7tinm3HuLP6k/CnhBq\nfpCTUzeRmwFk5VEWZ700MMV/nxeztQhq9qQGJCV+aU3jX+1fAdek4V5LPPXRqXIp\nyQIDAQAB\n-----END RSA PUBLIC KEY-----' | |
def encrypt_RSA(key, message): | |
from Crypto.PublicKey import RSA | |
from Crypto.Cipher import PKCS1_OAEP | |
import base64 | |
rsakey = RSA.importKey(key) | |
rsakey = PKCS1_OAEP.new(rsakey) | |
encrypted = rsakey.encrypt(message) | |
return base64.b64encode(encrypted) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private_key = '-----BEGIN RSA PRIVATE KEY-----\nMIIEowIBAAKCAQEAwBSXW96/kqvd3FTZP6pWh4xsbgPFtHfxZn1i2mnEuxbxVSPJ\nCq9pEJnmBKEiZJo9UB9124CN9olsRwnpbp7RZpBciyDUozCnfEDZElkbnbJsXiBM\nL002HmDxnQZVf0Q+7wpvrL6Mxrdn9AkrN4Hz08mcyoofMihGiLgc4o/SrqMWevnZ\ni3XEHS6jb+lMNPAYBosDd1vqN8SYrPXVThwvqu7TeXqbH7UYccBZiJA7g1NSF8pO\nA3gDWLI5b5WMvtL2WkRRaMmc4U7CL601/YCRLgEaAXrTuMMIlbVSS02UAV9EsXso\nSFme4+1qBBn7DNhdxB5cTcAeFd4jAklgRhIFpQIDAQABAoIBACm532aK9UFaugu0\n1+vbaEgyYlSk16Q8YRGzX8/UJbNByOPGrhP25oM/d2cejO7fTb3z06G/I7fAgyfM\neKv57sHRzvS/SUn5Fg0pNi6k8lmXyrBI4lvtMTo4s4v5tgV7UROTCA715vV9HqU1\n/7AjeBEULU4XYq797lKhck7qUOl0LaMYto6pyRiTlG8FXCGtQJfUCPOe2H2bUbBV\nyaVvuEjDQZMYWcUCKB3CMncBa5AWhb46l3QTn9/r6TkMHzUr3M0mOgd2Z+ehxMnC\nKFs7RPAoyPqsK8qJyLkBec7JyNMGGVJQ8MGFjDNAFkhJXIhHzSs0jjR8tAAJfrsj\nk82ktOkCgYEAw6y/pUgAquJCiolEiXaAFYkhvPLVfWaC3IWzoscLOIYSR1oVumLc\nRsFMjL7PRQqyweomwBVTLbgHpvVG8v8Rg22IVj6NbH+bnAZfsYQamtWiw3RzaeIY\nX5S0C2w59TjNUehnoicRd4YEZ2M4ddt3u9C3TWk04uQoyr5l/OJF4b0CgYEA+0wq\nFwAo1EzQuFVR27AxlOY96YcBdl76WgCZNx9UAYYyAzH3RxwR7AnT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### Keybase proof | |
I hereby claim: | |
* I am strategicpause on github. | |
* I am strategicpause (https://keybase.io/strategicpause) on keybase. | |
* I have a public key whose fingerprint is 9312 AAB2 B5B7 FA81 99C6 0061 7797 4018 EB1B 19B9 | |
To claim this, I am signing this object: |
NewerOlder