Skip to content

Instantly share code, notes, and snippets.

View ericpardee's full-sized avatar

ericpardee ericpardee

View GitHub Profile
@ericpardee
ericpardee / check_lambda_credentials.py
Created June 4, 2024 23:55
check for aws creds in lambda
import subprocess
import json
def list_lambda_functions():
result = subprocess.run(['aws', 'lambda', 'list-functions', '--query', 'Functions[*].FunctionName', '--output', 'text'], stdout=subprocess.PIPE)
function_names = result.stdout.decode('utf-8').strip().split()
return function_names
def get_environment_variables(function_name):
result = subprocess.run(['aws', 'lambda', 'get-function-configuration', '--function-name', function_name, '--query', 'Environment.Variables', '--output', 'json'], stdout=subprocess.PIPE)
@ericpardee
ericpardee / pet-snippet.toml
Created June 22, 2022 20:35 — forked from varenc/pet-snippet.toml
description
[[snippets]]
description = "start dev file syncer. uses fswatch to know when to run rsync. does not sync .git file. Sort like a write-through cache network file system with only eventual consistency guarantees."
command = "fswatch -0 --exclude \"\\.git\" --exclude \"\\.xml\" --exclude \"___\" -o /Users/chris/Documents/workspace/lingt_chris_dev_rsync_checkout/myproject | xargs -0 -n 1 -I {} rsync --progress --exclude '*.pyc' --exclude '*.git' --recursive ~/workspace/lingt_chris_dev_rsync_checkout/myproject dev@dev.server:/home/user/webapps/dev_chris/myproject"
output = ""
[[snippets]]
description = "plex find unscanned tv!"
command = "cat <(find /Users/chris/Downloads/media/dbx_mount/tv -type f | sed 's/.*\\///' | grep 'mp4\\|mkv\\|avi') <(unbuffer /Applications/Plex\\ Media\\ Server.app/Contents/MacOS/Plex\\ Media\\ Scanner -c 4 --tree | grep 'mp4\\|mkv\\|avi' | sed 's/.*\\///' | sed 's/\\w*\\[.*\\]$//' | awk '{$1=$1};1') | sort | uniq -u"
output = ""
$ pulumi up
Previewing update (hello-fargate)
View Live: https://app.pulumi.com/ericpardee/hello-fargate/hello-fargate/previews/39d16f8d-43a9-4bb3-a17d-6de535d2d36c
Type Name Plan Info
pulumi:pulumi:Stack hello-fargate-hello-fargate 4 errors; 10 messages
+ ├─ aws:ecs:Cluster default-cluster create
+ └─ awsx:lb:ApplicationLoadBalancer nginx-lb create
# when get
$ mosh proxMac-Pro 130 ↵
zsh:1: command not found: mosh-server
Connection to 192.168.0.94 closed.
/usr/local/bin/mosh: Did not find mosh server startup message. (Have you installed mosh on your server?)
# did you install mosh with homebrew? Then
$ mosh --server=/usr/local/Cellar/mosh/1.3.2_18/bin/mosh-server proxMac-Pro
@ericpardee
ericpardee / README.md
Created May 28, 2022 22:48 — forked from tomdaley92/README.md
Proxmox - SPICE Client setup for MacOS

Proxmox - SPICE client setup for MacOS

  1. Install a working (and compiled) version of virt-viewer. You may view the homebrew package's upstream source on GitHub.

    brew tap jeffreywildman/homebrew-virt-manager
    brew install virt-viewer
  2. Once that's installed should be able make a call remote-viewer with a pve-spice.vv file downloaded from proxmox web interface

@ericpardee
ericpardee / update-all-route53-domains-contacts.py
Created April 23, 2022 13:36 — forked from mvanholsteijn/update-all-route53-domains-contacts.py
update the contacts of all route53 registered domains
import boto3
import json
contact = {
"FirstName": "Mark",
"LastName": "van Holsteijn",
"ContactType": "COMPANY",
"AddressLine1": "Laapersveld 27",
"City": "Hilversum",
"CountryCode": "NL",
@ericpardee
ericpardee / brew.txt
Last active January 17, 2022 16:51
macOS Homebrew (brew installs)
$ brew leaves
arduino-cli
argocd
arping
asciinema
asciiquarium
assh
automake
aws-shell
aws/tap/aws-sam-cli
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>ACPI</key>
<dict>
<key>Add</key>
<array>
<dict>
<key>Comment</key>
---
#
# Required parameters
#
email: craigslist-renew@example.com
password: CooperNetties
notify: craigslist-renew@example.com
#
# Optional parameters
#
# Create EventBridge event alerts when there are CRITICAL severity vulnerabilities in an ECR Image Scan
{
"detail-type": [
"ECR Image Scan"
],
"source": [
"aws.ecr"
],
"detail": {
"finding-severity-counts": {