Skip to content

Instantly share code, notes, and snippets.

View jordanst3wart's full-sized avatar
🏠
Working from home

Jordan Stewart jordanst3wart

🏠
Working from home
View GitHub Profile
import contextlib
import OpenSSL.crypto
import os
import requests
import ssl
import tempfile
# mostly from another gist
import boto3
from email.mime.text import MIMEText
from email.mime.image import MIMEImage
from email.mime.multipart import MIMEMultipart
from email.mime.application import MIMEApplication
from botocore.exceptions import ClientError
def send_message(from_email, to_emails, subject, images=[], attachments=[]):
@jordanst3wart
jordanst3wart / wanted-in-shell.md
Created February 15, 2019 03:00
Improvements I'm braining storming for shell based on (zsh/bash)

trade offs slightly more verbose, for being easier to understand

if statement

current




@jordanst3wart
jordanst3wart / about.md
Created January 29, 2020 02:34
example gist

Riley smells

#!/Library/Frameworks/Python.framework/Versions/3.7/bin/python3
from jinja2 import Environment, FileSystemLoader
import yaml
import os
env = Environment(loader = FileSystemLoader(os.getcwd()), trim_blocks=True, lstrip_blocks=True)
template = env.get_template('somefile.j2')
config_data = yaml.load(open('vars.yml'))
@jordanst3wart
jordanst3wart / install-aws-session-manager-plugin.md
Last active June 25, 2024 12:50
install aws cli session manager plugin on fedora silverblue
cd /tmp
curl "https://s3.amazonaws.com/session-manager-downloads/plugin/latest/linux_64bit/session-manager-plugin.rpm" -o "session-manager-plugin.rpm"
sudo dnf install -y session-manager-plugin.rpm # fails
sudo rpm-ostree install session-manager-plugin.rpm # fails

alternative

@jordanst3wart
jordanst3wart / Portfolio.md
Created February 5, 2021 05:47
Some pieces of work i have done.
@jordanst3wart
jordanst3wart / network_down.sh
Last active February 27, 2021 01:35
Test if the network is down
#!/bin/bash
path="/tmp" # /home/pi/Documents
if [ -f "$path/pid.txt" ]; then
echo "pid file found. Exiting..."
exit 0
fi
echo "running" > "$path/pid.txt"
@jordanst3wart
jordanst3wart / Reactive web flux spring notes.md
Last active October 22, 2021 00:32
Spring Reactive stack notes

Reactive spring notes

  • basically just wrap things in Mono, like Mono.just("someString"), flux is like a stream
  • spring data reactive repositories main concern and still in incuberator, has good support for SQL, and some NoSQL, DynamoDB might be hard at the moment. Is better performing that JDBC (see 3.) it's largely based around R2DBC (see 1.), had issues with h2-console, and schema.sql/data.sql seems to be handled differently
  • can apparently handle 1.5 times the number of requests of Servlet stack (see 2.) with a small server, has lower memory, and cpu footprint
  • JSON isn't really streamed but Flux is useful for that
  • code can look really similar to what you are used to (link code)
  • reactive means basically non-blocking
  • using RouterFunctions routing is an option, but maybe not a good one (https://spring.io/guides/gs/reactive-rest-service/)