Skip to content

Instantly share code, notes, and snippets.

View rlizzo's full-sized avatar

Rick Izzo rlizzo

  • NVIDIA
  • Morristown, NJ
  • 02:18 (UTC -04:00)
  • LinkedIn in/rlizzo
View GitHub Profile
@rlizzo
rlizzo / script-template.sh
Created December 17, 2020 03:05 — forked from m-radzikowski/script-template.sh
Minimal safe Bash script template - see the article with full description: https://betterdev.blog/minimal-safe-bash-script-template/
#!/usr/bin/env bash
set -Eeuo pipefail
trap cleanup SIGINT SIGTERM ERR EXIT
script_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd -P)
usage() {
cat <<EOF
Usage: $(basename "${BASH_SOURCE[0]}") [-h] [-v] [-f] -p param_value arg1 [arg2...]
@rlizzo
rlizzo / lai-iam-policy-v2.json
Created January 23, 2023 06:48
Lightning AI BYOC IAM policy - 2023-01-23
{
"Version": "2012-10-17",
"Statement": [
{
"Action": [
"autoscaling:*",
"cloudwatch:*",
"codebuild:*",
"ec2:*",
"ecr:*",
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
This script runs indefinitely to verify log ingestion by a Lepton AI job.
On startup, it installs the Lepton client and authenticates. In each
iteration, it prints a unique log and then uses the `lep` CLI to poll the
job's logs, ensuring the unique log appears within a timeout.
It automatically removes the random suffix from the LEPTON_JOB_NAME.