running:
bash create-vod-hls.sh beach.mkv
will produce:
beach/
|- playlist.m3u8
|- 360p.m3u8
| #!/bin/bash | |
| # This script runs the entire set of steps to authenticate with jumpcloud and | |
| # refresh the temporarily stored AWS credentials. | |
| cd "$HOME/Documents/jumpcloud_mfa/" | |
| # Yes, the local OTP credentials on disk are encrypted with just the username of my user. | |
| ( (sleep 0.3; pkill -f "./otp.sh jumpcloud") & echo "$USER" | ./otp.sh jumpcloud-totp) | |
| # otp.sh puts the current otp in my clipboard, so we get it into a variable using xclip |
| # Take a very large number and pretty print it in triplets of 3 digits, each triplet separated by a space. | |
| def pnum_spc(n): print(' '.join([''.join(list(str(n))[::-1][i:i+3][::-1]) for i in range(0, len(str(n)), 3)][::-1])) | |
| # >>> pnum_spc(32 ** 13) | |
| # 36 893 488 147 419 103 232 | |
| # Print numbers as 32-bit binary numbers w/ spaces giving 4-bit words | |
| def pbin_spc(n): print(' '.join([''.join(list(f'{n:032b}')[::-1][i:i+4][::-1]) for i in range(0, len(f'{n:032b}'), 4)][::-1])) | |
| # >>> "{0:032b}".format(1234) | |
| # '00000000000000000000010011010010' | |
| # >>> pbin_spc(1234) |
running:
bash create-vod-hls.sh beach.mkv
will produce:
beach/
|- playlist.m3u8
|- 360p.m3u8
| # In order to test an upgrade from Motor 1.x to Motor 2.1, we want to have | |
| # automated tests verifying our existing MongoDB scaffolding isn't using any of | |
| # the deprecated/removed features of PyMongo/Motor. Since Python is dynamic, | |
| # and Motor is ESPECIALLY dynamic, using simple static analysis (such as with | |
| # Vulture) can't give us accurate results. So instead, we must write unit tests | |
| # which exercise the methods of common_python.mongo.Client, and by exercising | |
| # them, verify that the fields/methods of the underlying MotorClient are being | |
| # called correctly. | |
| # | |
| # However, we also want our unit tests to be _truly_ idempotent AND to test |
| 0eNqlmc2PojAUwP8V0rMYKP2g3nYOe9pkL3vbTDagHW0GgdCyGWPmf9+io+M6IO1rYmJUeL/33ffkiMqql22naoNWR7SRet2p1qimRiv0a6d0ZF9mJ6Oy0GodGVXJoqxkVBWHpjdR8xIVWst9WR2ifbHeqVrqqNenS16aLiqqKnpV9UYPV1oRMlp3shjEL9ECqXVTa7T6fURabeuiGjQwh1ZatDJyb6+oi/3wqZSFvRS921vqjXxDq/R9MXvTh2Kq3sYfqsXZjQj8/rxAsjbKKHlW4vTh8Kfu96XsLOMqSb61ndQ67u2d3bZr7HtcyspYVttodfbWEVmhhC3pAh3QKs5SvKSWtlGdXJ+vIIuronXbGzTYcMfEEGYexswATJqEMcl9aL9aRa6EJD8Rhujq4VfdSrmJ982mr4aQ2kiOEOg8gYcR2CyBpmEEPk8I9FLuFQcKIIgrQfelNqfaH4vFhcEsoZZquyubvhvqkuDnEbFpElYpCZvOWtvYJtI2/doTTFfUum06M8UUj5hjDBzE4E6MwJoHeo945TMk21Ia1rQTAjKMBYWMOoWMByY8BbTp9LM/2NJdv8aq1rIz9qeHqMGJY9IExAThFJzpEzUJTHWI33Dq7Ldb1ITf8GdHaFUrY9PEZ+1HpGHPtMKfnaDt9+1jicRBnt/JjgE1jql7UvJ71I36bEw2oJLZA8aoi3gQI3Ni5I/H4IdlNhMUMhoU8V+OPp6F8HieZ8mcDDwvI/U6YyD5l2GPFMdCQBBZ4DGWQvYA4jEyA+3yKN2bhEwmYu0zgQMV5qDWm04onHskJ1DhsDP2AvUcgEgSMABhkbu0NJJ6lR0DOI9gr2UFC36/rIixXYVkQd5x2hoICRoPxygOWzwNMsxpVSEs0DAOSmgeNDUC3ZkHQmGmCkCLc8xKmng1PEjNUr+2kEEQOGBgw4I4eSrsxMeCQmJPCWC/O7PGpNHAsweyalEGnnRns2F00qUcsNtN+yx33r+sDIc8El4VBykHlgD2rwtqZv9iaVC |
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script> | |
| <!--<script src="timemachine.js"></script>--> | |
| <!--<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.22.1/moment-with-locales.min.js"></script>--> | |
| <body style="margin: 0;"> | |
| <canvas id='canvas' width='1000' height='1000'></canvas> | |
| </body> |
| #!/bin/bash | |
| # list_all_contributors.sh ROOT_SEARCH_PATH | |
| # | |
| # Usage: Finds all Git repositories in ROOT_SEARCH_PATH and records all | |
| # contributors to each repo, each repo getting one file, with these | |
| # contributor files saved to the current directory. | |
| # Copyright (C) 2021 Leland Batey | |
| # |
| ''' | |
| CLI tool for generating sphinx auto-doc compatible files for all the python | |
| modules in a directory. I'm using this to generate raw Sphinx docs for a big | |
| disorganized, undocumented Python repo. | |
| ''' | |
| # From here: https://stackoverflow.com/a/54323162 | |
| import sys | |
| from setuptools import find_packages | |
| from pkgutil import iter_modules |
The original question was:
But I'm not sure that the library name = "cp-compat-logs-logger" defined in pyproject.toml would work. I tried importing that in my httpclient library and it complained. Also, I see in the log_bridge library the logger is imported as from cp_compat_logs_logger.logger import Logger, but cp_compat_logs_logger is not the library name, so how is that working?
I think you've asked a totally valid question about "what's up with the names here?" The short answer is "Python has messy conventions, so the name you use to poetry install is different than the name you use in code when import name." It's conventional to have the poetry install (let's call this the "distribution name") use dashes as a delimiter. However, actual module names in Python cannot have dashes, so the name used in code during import name (let's call this the "module name") will (usually) use underscores in place of dashes.
| #!/usr/bin/env python3 | |
| # A script which will parse athena-formatted lines to be json. Assumes all | |
| # fields and values are strings. | |
| import json | |
| import sys | |
| import re | |
| def parseathena(line): |