Skip to content

Instantly share code, notes, and snippets.

View statik's full-sized avatar
😎
happily working! I may be slow to respond

Elliot Murphy statik

😎
happily working! I may be slow to respond
View GitHub Profile
@statik
statik / post-checkout.sh
Created July 18, 2025 15:25
git post-checkout hook to copy .envrc files from main worktree
#!/bin/bash
# if we are checking out a new git worktree, then copy over the
# environment files
if [[ "$1" == "0000000000000000000000000000000000000000" ]]; then
basePath=$(git rev-parse --path-format=absolute --git-common-dir | xargs dirname)
# Use glob to find all files starting with .env
echo "running git post-checkout hook to copy .env* files to new worktree"
for envFile in "$basePath"/.env*; do
@statik
statik / testbedrock.py
Last active July 17, 2025 21:52
chatlas bedrock test
# !pip install anthropic[bedrock] boto3 chatlas
from chatlas import ChatBedrockAnthropic
chat = ChatBedrockAnthropic(
model = "us.anthropic.claude-3-5-sonnet-20241022-v2:0"
)
chat.chat("What is the capital of France?")
@statik
statik / passwordpolicy-generated.yaml
Last active June 24, 2025 14:31
CDK managed AWS Account Password Policy
Resources:
AccountPasswordPolicyC318930E:
Type: Custom::AWS
Properties:
ServiceToken:
Fn::GetAtt:
- AWS679f53fac002430cb0da5b7982bd22872D164C4C
- Arn
Create:
service: IAM
@statik
statik / README.md
Last active May 7, 2025 15:13
setup git-lfs on Posit Workbench for a single user

This script will download git-lfs and install it into a user home directory. It also adjusts the path in .bashrc to look for files in $HOME/.local/bin. This will allow git to find the git-lfs plugin.

After restarting the terminal, git-lfs should be functional and git clone of datasets from huggingface will work as expected.

If you have already cloned the hugging face repo before installing git-lfs, you can run git lfs fetch and it should download the files using git-lfs.

@statik
statik / README.md
Last active April 12, 2025 19:35
image crop tool

Here is the prompt I used in VSCode Agent mode on April 12, 2025

make a bash script in this file that follows the best practices from https://bertvv.github.io/cheat-sheets/Bash.html #fetch .
The bash script should use the convert tool from the ImageMagick program to process the input image and create an output image.
Give a helpful error message if the convert tool is not available, with instructions for common ways to install the program 
with homebrew or apt. The script should take a single argument as the source image, and create an output file that is named
the same as the source image but with "-output" added as a suffix to the basename of the input file. Keep the output file
extension the same as the input file extension. Validate that the input file is a valid PNG file with 1920x1080 dimensions.
The processing of the image should be to -crop the image starting at Y coordinate offset pixel 1304 and continuing to
#Placeholder to change the name of the gist
@statik
statik / waf.ts
Last active October 16, 2024 02:36
WAF with CDK examples
import * as cdk from "@aws-cdk/core";
import * as wafv2 from "@aws-cdk/aws-wafv2";
// This extends the base cdk stack properties to include a tag name input.
export interface StackProps extends cdk.StackProps {
tag: string;
applicationName?: string;
}
export class WAFStack extends cdk.Stack {
@statik
statik / convert-to-prores
Created April 7, 2020 19:06
convert video file to prores
#!/usr/bin/env bash
set -eo pipefail
USAGE='convert-to-prores inputfile [outputfile] [prores setting 1 to 5, default 3]'
DESCRIPTION='
Converts a video file to ProRes for playback on HyperDeck or NLE
The outputfile is optional, if not provided it will be based on the input file name
The profile switch takes an integer from -1 to 5 to match the ProRes profiles
@statik
statik / h2rnotify.py
Last active July 17, 2023 15:26
apprise custom notifications for h2r experiments
#!/usr/bin/env python3
# include the decorator
from apprise.decorators import notify
from apprise.logger import logger
import requests
import re
import json
import sys
@statik
statik / gist:981961
Created May 19, 2011 22:34 — forked from jtimberman/gist:548261
preseed.cfg for automated installations with chef from apt.opscode.com
# This is the entire preseed config file used on an example Lucid system. See the preseed
# documentation for more information on the options here. This will use US English by default.
#
# https://help.ubuntu.com/10.04/installation-guide/amd64/preseed-contents.html
#
# This preseed will automatically install Ubuntu 10.04 with default options. Understand what
# it is doing before you use it.
#
# Boot Options line:
#