This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DOMAIN ?= mydomain.com | |
COUNTRY := IT | |
STATE := IT | |
COMPANY := Evil Corp. | |
# credits to: https://gist.github.com/fntlnz/cf14feb5a46b2eda428e000157447309 | |
# usage: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- 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' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@inlineCallbacks | |
def lots_of_requests(): | |
urls = yield get_urls() | |
deferreds = [] | |
for url in urls: | |
deferreds.append(get(url)) | |
results = yield defer.gatherResults(deferreds) |
NewerOlder