Skip to content

Instantly share code, notes, and snippets.

import asyncio
import logging
import os
import signal
from aiohttp import web
log = logging.getLogger(__name__)
import asyncio
import aiohttp
async def download(session):
async with session.get('http://localhost:8080/') as resp:
while True:
chunk = await resp.content.read(1024)
# print(chunk)
if not chunk:
@startuml
title Ansible Roles Distribution Diagram
node nasa.internal {
actor "nasa Ansible Roles admin" as nasa_admin
}
cloud nasa.pulp.org {
storage "university A Ansible Roles" as content_a
storage "university B Ansible Roles" as content_b
@bmbouter
bmbouter / download_collection.dot
Created September 28, 2018 20:16
A call sequence diagram of downloading Ansible Collection content from Galaxy which stores it using Pulp
@startuml
autonumber
title Collection Download
participant Mazer
box "galaxy.example.com"
participant Nginx
participant "Pulp's Webserver"
@bmbouter
bmbouter / collection_upload.dot
Created September 28, 2018 20:11
A call sequence diagram of uploading Ansible Collection content from Mazer to Galaxy and stored in Pulp
@startuml
autonumber
title Collection Upload and then Fetch
participant Mazer
box "galaxy.example.com"
participant Nginx
participant "Galaxy's WSGI Process"
import asyncio
import aiohttp
async def my_download():
with open('/tmp/somefileintmp', 'wb') as the_file:
async with aiohttp.ClientSession(auto_decompress=False) as session:
async with session.get('https://repos.fedorapeople.org/pulp/pulp/fixtures/python-pypi/packages/shelf_reader-0.1-py2-none-any.whl') as resp:
while True:
// Example testing sketch for various DHT humidity/temperature sensors
// Written by ladyada, public domain
#include <Adafruit_Sensor.h>
#include <Homie.h>
#include <DHT.h>
#define DHTPIN 2 // what digital pin we're connected to
// Uncomment whatever type you're using!
{
"swagger": "2.0",
"info": {
"title": "Pulp3 API",
"version": "v3"
},
"host": "localhost:8000",
"schemes": ["http"],
"basePath": "/pulp/api/v3",
"consumes": ["application/json"],
@bmbouter
bmbouter / manytests.sh
Created October 20, 2017 19:17
Pulp Download Performance Testing
#!/bin/bash
rm perf_data.txt
for i in {1..10}
do
./perftest.sh
done
@bmbouter
bmbouter / mirrorlist.py
Created September 19, 2017 21:50
An example of an asyncio MirrorDownloader
import asyncio
from collections import namedtuple
import os
import socket
import time
from urllib.parse import urlparse
import aiohttp
import django