Skip to content

Instantly share code, notes, and snippets.

View PlamenHristov's full-sized avatar
🇧🇬

Plamen Hristov PlamenHristov

🇧🇬
View GitHub Profile
@PlamenHristov
PlamenHristov / artifacts...SimpleContract.json
Last active April 9, 2023 11:17
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.8.18+commit.87f61d96.js&optimize=false&runs=200&gist=
{
"deploy": {
"VM:-": {
"linkReferences": {},
"autoDeployLib": true
},
"main:1": {
"linkReferences": {},
"autoDeployLib": true
},
@PlamenHristov
PlamenHristov / aws-token.ts
Last active August 17, 2021 18:50
How to generate a valid auth token for EKS control plane requests
import crypto, { BinaryToTextEncoding } from 'crypto'
const AUTH_SERVICE = 'sts'
const AUTH_COMMAND = 'GetCallerIdentity'
const AUTH_API_VERSION = '2011-06-15'
const URL_TIMEOUT = 60
const TOKEN_PREFIX = 'k8s-aws-v1.'
const CLUSTER_NAME_HEADER = 'x-k8s-aws-id'
const KEY_TYPE_IDENTIFIER = 'aws4_request'