python 3.6, postgres, pip install aiohttp uvloop ujson asyncpg sanic
➤ wrk -d 10 -c 100 -t 12 --timeout 8 http://localhost:8000 # aiohttp
Running 10s test @ http://localhost:8000
| # Automated AMI and Snapshot Deletion | |
| # | |
| # @author Robert Kozora <bobby@kozora.me> | |
| # | |
| # This script will search for all instances having a tag with "Backup" or "backup" | |
| # on it. As soon as we have the instances list, we loop through each instance | |
| # and reference the AMIs of that instance. We check that the latest daily backup | |
| # succeeded then we store every image that's reached its DeleteOn tag's date for | |
| # deletion. We then loop through the AMIs, deregister them and remove all the | |
| # snapshots associated with that AMI. |
| # Automated AMI Backups | |
| # | |
| # @author Robert Kozora <bobby@kozora.me> | |
| # | |
| # This script will search for all instances having a tag with "Backup" or "backup" | |
| # on it. As soon as we have the instances list, we loop through each instance | |
| # and create an AMI of it. Also, it will look for a "Retention" tag key which | |
| # will be used as a retention policy number in days. If there is no tag with | |
| # that name, it will use a 7 days default value for each AMI. | |
| # |
| #!/usr/bin/perl -w | |
| # recover rsyslog disk queue index (.qi) from queue files (.nnnnnnnn). | |
| # | |
| # See: | |
| # runtime/queue.c: qqueuePersist() | |
| # runtime/queue.c: qqueueTryLoadPersistedInfo() | |
| # | |
| # kaiwang.chen@gmail.com 2012-03-14 | |
| # | |
| use strict; |
| echo "oscap xccdf eval --profile usgcb-rhel6-server" | |
| oscap xccdf eval --profile usgcb-rhel6-server \ | |
| --results /var/www/govready-html/usgcb-rhel6-server.xml \ | |
| --report /var/www/govready-html/usgcb-rhel6-server.html \ | |
| --cpe /usr/share/xml/scap/ssg/content/ssg-rhel6-cpe-dictionary.xml \ | |
| /usr/share/xml/scap/ssg/content/ssg-rhel6-xccdf.xml ; true | |
| #!/usr/bin/python3 | |
| """ Obtaining all form fields (dynamically) from a POST request. | |
| $ curl http://127.0.0.1:8000/post -d "name=Nemo&country=Norway" | |
| $ curl http://127.0.0.1:8000/data -d "company=Axos Inc.&business=IT Outsourcing" | |
| """ | |
| from flask import abort, Flask, jsonify, request | |
| __author__ = "@ivanleoncz" |
| from requests import get | |
| from pprint import pprint | |
| from json import dump | |
| from csv import QUOTE_ALL, DictWriter | |
| API_KEY = 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' | |
| def address_resolver(json): | |
| final = {} | |
| if json['results']: | |
| data = json['results'][0] | |
| for item in data['address_components']: |
| _ _ _ ____ _ _ | |
| | | | | __ _ ___| | __ | __ ) __ _ ___| | _| | | |
| | |_| |/ _` |/ __| |/ / | _ \ / _` |/ __| |/ / | | |
| | _ | (_| | (__| < | |_) | (_| | (__| <|_| | |
| |_| |_|\__,_|\___|_|\_\ |____/ \__,_|\___|_|\_(_) | |
| A DIY Guide | |
| ########################################################################################### | |
| # Liquidsoap Radio System - built by GeekBrony, based from Liquidsoap. # | |
| ########################################################################################### | |
| # Primary Features: | |
| # - AutoDJ that crossfades between songs and has a 1/10 chance of landing on a Station ID/Jingle/Ad. | |
| # - AutoDJ also selects tracks from "High Priority", "Low Priority" and "New Songs" playlists randomly. | |
| # - Live Shows (that automatically dump to a directory) | |
| # - Mic to speak over the stream. | |
| # - Requests via Telnet/Web Interface, which have a 80-90% chance of queuing up when a song ends. |
| # This is a GitLab CI configuration to build the project as a docker image | |
| # The file is generic enough to be dropped in a project containing a working Dockerfile | |
| # Author: Florent CHAUVEAU <florent.chauveau@gmail.com> | |
| # Mentioned here: https://blog.callr.tech/building-docker-images-with-gitlab-ci-best-practices/ | |
| # do not use "latest" here, if you want this to work in the future | |
| image: docker:18 | |
| stages: | |
| - build |