Skip to content

Instantly share code, notes, and snippets.

View ScottSturdivant's full-sized avatar

Scott Sturdivant ScottSturdivant

View GitHub Profile
@ScottSturdivant
ScottSturdivant / logs.txt
Created March 15, 2024 21:42
aiosmtpd proxy
# Mail command:
# $ echo "asdf" | mail -S smtp=mail.example.com:25 -s "Hello!" -v me@example.com
Resolving host mail.example.com . . . done.
Connecting to 10.41.58.120:25 . . . connected.
2024-03-15 21:35:45,609 mail.log INFO ('10.41.52.189', 56430) handling connection
2024-03-15 21:35:45,609 mail.log DEBUG ('10.41.52.189', 56430) waiting PROXY handshake
2024-03-15 21:35:45,609 mail.debug DEBUG Waiting for PROXY signature
PIP not found, installing setuptools & pip.
Installing setuptools-46.1.3
Extracting files/setuptools-46.1.3.tar.gz into /tmp/tmp.YLNXOX
setuptools-46.1.3/
setuptools-46.1.3/docs/
setuptools-46.1.3/docs/conf.py
setuptools-46.1.3/docs/history.txt
setuptools-46.1.3/docs/requirements.txt
setuptools-46.1.3/docs/releases.txt
setuptools-46.1.3/docs/_templates/
@ScottSturdivant
ScottSturdivant / Makefile
Last active January 16, 2020 20:32 — forked from xenogenesi/Makefile
create self signed certificates
DOMAIN ?= mydomain.com
COUNTRY := IT
STATE := IT
COMPANY := Evil Corp.
# credits to: https://gist.github.com/fntlnz/cf14feb5a46b2eda428e000157447309
# usage:
import requests
import time
URL = 'https://www.aviationweather.gov/adds/dataserver_current/httpparam?dataSource=metars&requestType=retrieve&format=xml&stationString=kc35,kmke&hoursBeforeNow=2&mostRecentForEachStation=true&fields=flight_category,station_id,raw_text'
def test():
success = failure = 0
while True:
#!/usr/bin/env python
# NeoPixel library strandtest example
# Author: Tony DiCola (tony@tonydicola.com)
#
# Direct port of the Arduino NeoPixel library strandtest example. Showcases
# various animations on a strip of NeoPixels.
import time
from rpi_ws281x import PixelStrip, Color
import _rpi_ws281x as ws
- name: Create a launch configuration
ec2_lc:
name: "{{ lc_name }}"
image_id: "{{ image_id }}" # Created as part of build_ami.yml
key_name: "{{ ec2_keypair }}"
region: "{{ ec2_region }}"
security_groups: "{{ app_sec_group_id.stdout }}"
instance_type: t2.medium
volumes:
- device_name: '/dev/sda1'
dag = DAG(config=config)
class DAGService(service.Service):
def startService(self):
# Something here in the dag.run() ultimately calls 'reactor.stop()' if a fatal error is encountered.
# This winds up raising ReactorNotRunning when it is called.
dag.run()
# This will hold the services that combine to form DAG
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
# You can run this module directly with:
# twistd -ny emailserver.tac
"""
A toy email server.
"""
from functools import partial
from marrow.mailer import Mailer, Message
mailer = Mailer({'transport.use': 'smtp', 'transport.host': 'localhost', 'manager.use': 'immediate'})
msg = Message(author='scott.sturdivant@gmail.com', to='scott.sturdivant@gmail.com')
msg.subject = 'Test Image'
msg.rich = '<b>An image.</b>'
msg.plain = 'An image.'
msg.attach(name='test_img.jpg', data=open('/tmp/test_img.jpg', 'rb').read()
mailer.send(msg)
@inlineCallbacks
def lots_of_requests():
urls = yield get_urls()
deferreds = []
for url in urls:
deferreds.append(get(url))
results = yield defer.gatherResults(deferreds)