When using saml2aws to assume AWS roles from a single-sign-on account, you'll need to get new credentials every workday (if not hourly). And users who use multiple accounts need to manage multiple sessions. It becomes hard to track which sessions you have active, and which sessions are expired.
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
import * as Base64 from 'https://deno.land/[email protected]/encoding/base64.ts'; | |
async function toDataUrl(resp: Response): Promise<string> { | |
const contentType = resp.headers.get('content-type') ?? 'application/octet-stream'; | |
const buffer = await resp.arrayBuffer(); | |
return `data:${contentType};base64,`+Base64.encode(buffer); | |
} | |
const gifUrl = 'https://matthews.sites.wfu.edu/misc/jpg_vs_gif/testImage.gif'; | |
console.log(await fetch(gifUrl).then(toDataUrl)); |
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
// In a Unix pipe, accepts 'tableized' input with many spaces between fields, | |
// and outputs the data as a traditional CSV. | |
// Does not handle input where fields contain their own spaces. | |
import { BufReader, BufWriter } from "https://deno.land/[email protected]/io/bufio.ts"; | |
import { TextProtoReader } from "https://deno.land/[email protected]/textproto/mod.ts"; | |
const input = new TextProtoReader(new BufReader(Deno.stdin)); | |
while (true) { |
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
export const commands = [ | |
{ | |
name: 'coinbase', | |
args: | |
script: 'https://......../command.js', | |
allow: { | |
net: ['api.coinbase.com'], | |
}, | |
}, |
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
export default fetch |
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 ( | |
"log" | |
// "time" | |
"github.com/google/nftables" | |
nftexpr "github.com/google/nftables/expr" | |
) |
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
import Kubernetes from './kubernetes.js' | |
const kubectl = new Kubernetes({namespace: process.env.KUBE_NAMESPACE}); | |
const logMinutes = 30; | |
(async () => { | |
// Tally IP addresses that hit us | |
const ipHits = new Map; | |
for (const pod of await kubectl.listPods({app: process.env.KUBE_APP_LABEL})) { | |
console.log(`Checking ${logMinutes}m of`, pod.metadata.name) |
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 golang:1.14 AS build-go | |
WORKDIR /src | |
# cache deps | |
ADD go.* /src/ | |
RUN go mod download | |
# build module | |
ADD * /src/ | |
RUN go build -o /bin/hello-sts | |
# pack into minimal image |
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
=> App running at: http://localhost:3000/ | |
I20191124-22:57:41.292(-8)? Preparing to install package conduit | |
I20191124-22:57:41.364(-8)? Fetching package contents for conduit | |
I20191124-22:57:41.536(-8)? Parsing package | |
I20191124-22:57:41.599(-8)? Creating new package resources | |
I20191124-22:57:41.839(-8)? Injecting sass:Compile | |
I20191124-22:57:41.842(-8)? Using builtin | |
I20191124-22:57:41.870(-8)? Injecting coffeescript:Compile | |
I20191124-22:57:41.870(-8)? Using builtin | |
I20191124-22:57:42.189(-8)? Done installing package conduit !! |
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" | |
"image" | |
"io" | |
"log" | |
"os" | |
"github.com/nareix/joy4/av/avutil" |