This file contains hidden or 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 { defaultProvider } from "@aws-sdk/credential-provider-node"; | |
import { HttpRequest } from "@aws-sdk/protocol-http"; | |
import { Sha256 } from '@aws-crypto/sha256-js'; | |
import { SignatureV4 } from "@aws-sdk/signature-v4"; | |
import { stringify } from "qs"; | |
async function main(): Promise<string> { | |
const signer = new SignatureV4({ | |
credentials: defaultProvider(), | |
region: process.env.AWS_REGION, |
This file contains hidden or 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
#!/bin/bash | |
#Serves the current directory. | |
test -p .f||mkfifo .f;while :;do cat .f|nc -l ${1:-1234}|(read m u p;echo $u;u=${u#/};{ echo -e 'HTTP/1.0 200 OK\nContent-type:text/html\n';test -d $u&&ls $u|sed "s,.*,<a href=\"$u/&\">&<br>,"||cat $u;}>.f);done |