Skip to content

Instantly share code, notes, and snippets.

View scarolan's full-sized avatar
🤸‍♂️
In whatever position one is in...one must find balance. -BKS Iyengar

Sean Carolan scarolan

🤸‍♂️
In whatever position one is in...one must find balance. -BKS Iyengar
View GitHub Profile
@scarolan
scarolan / llm_prompts.md
Last active October 3, 2023 20:50
LLM prompts for writing apps

App for endless cat photos

Generate a web application written in Python that will show a random cat photo every ten seconds. Import the time, random, and requests modules, and import Flask and Response classes from the flask module.

Get the photos from the placekitten.com API. The format of the URL should be: https://placekitten.com/width/height for example https://placekitten.com/600/400.

The photos of the cats should be between 400-800 pixels height and width. The app should continue running and log inbound requests for files to the terminal. Do not use an index.html template. The entire app should be in a single file.

@scarolan
scarolan / hangman.py
Created October 3, 2023 20:22
ChatGPT Hangman with snarky replies and emoji
import random
WORD_LIST = ['APPLE', 'BANANA', 'CHERRY', 'DONKEY', 'ELEPHANT',
'FLAMINGO', 'GORILLA', 'HIPPO', 'IGUANA', 'JAGUAR',
'KANGAROO', 'LEMUR', 'MONKEY', 'NYALA', 'OSTRICH',
'PENGUIN', 'QUOKKA', 'RABBIT', 'SQUIRREL', 'TURTLE',
'UGUISU', 'VULTURE', 'WALRUS', 'XERUS', 'YAK', 'ZEBRA']
HANGMAN_PICS = [
'''
+---+
|
@scarolan
scarolan / install_ponysay.sh
Last active September 8, 2023 15:15
Bash script to install ponysay on Ubuntu
#!/bin/bash
echo "Installing ponysay for user $(id)"
cd $HOME
[[ -d $HOME/ponysay ]] && rm -rf $HOME/ponysay
sudo apt -y update && sudo apt -y install texinfo git cowsay fortune-mod
git clone https://github.com/erkin/ponysay && cd ponysay
python3 ./setup.py install --private --freedom=partial
$HOME/.local/bin/ponythink -f rarity "Ponysay was successfully installed at $HOME/.local/bin/ponysay"
echo "Run this command to add ponysay to your PATH:"
@scarolan
scarolan / index.html
Created March 1, 2022 15:23 — forked from arosenkranz/index.html
CSS Lightbox
<a href="#unique-id-of-image">
<img alt="alt text" src="../assets/filename.png" />
</a>
<a href="#" class="lightbox" id="unique-id-value">
<img alt="alt text" src="../assets/filename.png" />
</a>
@scarolan
scarolan / instruqt_style.css
Created December 3, 2021 14:23
Example CSS file
summary { color: cyan; }
hr.cyan { background-color: cyan; }
hr.thick { background-color: cyan; color: cyan; height: 2px; }
h2.cyan { color: cyan; }
@scarolan
scarolan / azure_terraform_example.tf
Created August 27, 2021 22:17
An example snippet of Terraform code for Azure
resource "azurerm_resource_group" "example" {
name = "example"
location = "Central US"
}
@scarolan
scarolan / main.tf
Created January 28, 2021 22:26
Terraform for Lacework AWS Cloudtrail and Config
terraform {
required_providers {
lacework = {
source = "lacework/lacework"
version = "~> 0.2.7"
}
}
}
provider "aws" {}
provider "lacework" {}
@scarolan
scarolan / zsh_stuff.sh
Created August 7, 2020 18:59
zsh_stuff
# Aliases
alias ls='lsd'
alias l='ls -l'
alias la='ls -a'
alias lla='ls -la'
alias lt='ls --tree'
alias e='explorer.exe'
# Useful cd paths
setopt auto_cd
url - https://aws.amazon.com/blogs/security/a-safer-way-to-distribute-aws-credentials-to-ec2/
Finding hard-coded credentials in your code
Hopefully you’re excited about deploying credentials to EC2 that are automatically rotated. Now that you’re using Roles, a good security practice would be to go through your code and remove any references to AKID/Secret. We suggest running the following regular expressions against your code base:
Search for access key IDs: (?<![A-Z0-9])[A-Z0-9]{20}(?![A-Z0-9]). In English, this regular expression says: Find me 20-character, uppercase, alphanumeric strings that don’t have any uppercase, alphanumeric characters immediately before or after.
Search for secret access keys: (?<![A-Za-z0-9/+=])[A-Za-z0-9/+=]{40}(?![A-Za-z0-9/+=]). In English, this regular expression says: Find me 40-character, base-64 strings that don’t have any base 64 characters immediately before or after.
If grep is your preferred tool, run a recursive, Perl-compatible search using the following commands