Skip to content

Instantly share code, notes, and snippets.

View fluential's full-sized avatar
💭
¯\_(ツ)_/¯

Mike fluential

💭
¯\_(ツ)_/¯
  • Earth
View GitHub Profile
@fluential
fluential / lambdaAMIBackups.py
Last active March 10, 2018 08:23 — forked from bkozora/lambdaAMIBackups.py
AWS Lambda AMI Backups
# 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;
@fluential
fluential / example.oscap.sh
Created May 16, 2018 12:53 — forked from gregelin/example.oscap.sh
OpenSCAP examples
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
@fluential
fluential / flask_dynamic_form.py
Created December 17, 2018 11:08 — forked from ivanleoncz/flask_dynamic_form.py
Obtaining all data (keys/values) from POST request (form) in Python Flask.
#!/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"
@fluential
fluential / mirroring-ubuntu-ESM-repo.md
Last active March 23, 2024 17:37
How to mirror ubuntu ESM protected repository

Via https://ubuntu.com/esm#faq

"We're mirroring the repository on our internal Landscape server. Can we still get Ubuntu ESM if using Landscape? ESM is just a regular Ubuntu archive, but authenticated and served over HTTPS. Archive mirroring is already available in Landscape and is the only supported mechanism for mirroring the ESM archive."

TL;DR

It seems its just possible to use URI with login:pass

@fluential
fluential / geocoder.py
Last active July 30, 2019 16:05 — forked from scrapehero/geocoder.py
Python script to parse unstructured addresses
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']:
@fluential
fluential / aiohttp_vs_sanic.md
Created March 3, 2020 19:28 — forked from samuelcolvin/aiohttp_vs_sanic.md
comparing aiohttp and sanic performance

Requirements

python 3.6, postgres, pip install aiohttp uvloop ujson asyncpg sanic

aiohttp & uvloop

➤ wrk -d 10 -c 100 -t 12 --timeout 8 http://localhost:8000  # aiohttp
Running 10s test @ http://localhost:8000
map $http_x_forwarded_proto $proxy_x_forwarded_proto {
default $http_x_forwarded_proto;
'' $scheme;
}
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
_ _ _ ____ _ _
| | | | __ _ ___| | __ | __ ) __ _ ___| | _| |
| |_| |/ _` |/ __| |/ / | _ \ / _` |/ __| |/ / |
| _ | (_| | (__| < | |_) | (_| | (__| <|_|
|_| |_|\__,_|\___|_|\_\ |____/ \__,_|\___|_|\_(_)
A DIY Guide
@fluential
fluential / gist:61a5544886746c6dbfbcf44c712da9ec
Created August 24, 2020 15:17
The McAfee central America Travel Guide
The McAfee central America Travel Guide
Posted by: John McAfee , November 24, 2012 @ http://www.whoismcafee.com/the-travel-guide/
As all of my close friends know, I have not always been a teetotalling, drug fighting citizen. Prior to 1983 I was a synthesis of corporate manager and drug dealer. The drug dealer eventually won out, and for a period of time that was my only occupation. Well ….. taking the drugs that I sold also became a principal occupation. This is not a secret, I tell anyone who asks, even the press. Not many in the press reported much about it, until Josh Davis’ eBook came out. I am not ashamed of my past. Our collective pasts make us who we are. In 1983 I joined Alcoholics Anonymous and gave up alcohol and drugs entirely. My exceptions are coffee, which some classify as a drug, and, occassionally, cigarettes. Not proud of the cigarettes, I know thay are bad.
During my drug dealing days I became adept at those talents required of a successful drug dealer: clandestine travel throu