Skip to content

Instantly share code, notes, and snippets.

View allenmichael's full-sized avatar

Allen-Michael Grobelny allenmichael

  • Amazon Web Services
  • Austin, TX
  • X @amsxbg
View GitHub Profile
#!/bin/sh
random_string() {
STR_LENGTH=${1:-20}
INCLUDE_SYMBOLS=${2:-0}
FILTER='A-Za-z0-9'
SYMBOLS=${3:-'!@#%^&*'}
if [ $INCLUDE_SYMBOLS -eq 0 ]; then
FILTER="$FILTER$SYMBOLS"
fi
# citing sources: https://trac.ffmpeg.org/wiki/CompilationGuide/Centos
# citing sources: https://gist.github.com/felipecsl/cecfece3075312174e92592d4231e971
sudo yum install autoconf automake bzip2 bzip2-devel cmake freetype-devel gcc gcc-c++ git libtool make mercurial pkgconfig zlib-devel -y
mkdir ~/ffmpeg_sources
# nasm
cd ~/ffmpeg_sources
curl -O -L https://www.nasm.us/pub/nasm/releasebuilds/2.14.02/nasm-2.14.02.tar.bz2
tar xjvf nasm-2.14.02.tar.bz2
@allenmichael
allenmichael / DaemonWorker.csproj
Created March 22, 2023 21:31
All the resources needed to create a .NET worker app to run on Amazon Linux through systemd
<Project Sdk="Microsoft.NET.Sdk.Worker">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net7.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<PublishSingleFile>true</PublishSingleFile>
<SelfContained>true</SelfContained>
<PublishTrimmed>true</PublishTrimmed>
@allenmichael
allenmichael / HttpClient.ts
Created April 14, 2023 16:21
Generic HTTP Client in Node/Browser
export interface ClientResponse {
statusCode: number,
headers: Headers,
body: any
}
export const Methods = {
GET: "GET",
POST: "POST",
PUT: "PUT",
@allenmichael
allenmichael / main.ts
Created August 30, 2023 23:24
Upload in memory data direct to S3
import { randomUUID } from "crypto";
import { S3Client } from "@aws-sdk/client-s3";
import { Upload } from "@aws-sdk/lib-storage";
import { PassThrough } from "stream";
const s3Client = new S3Client({});
(async () => {
const passThrough = new PassThrough();
for (const person of ["person-1", "person-2", "person-3"]) {