create or edit /etc/docker/daemon.json
and add this:
{
"insecure-registries" : ["myregistrydomain.com:5000"]
}
create or edit /etc/docker/daemon.json
and add this:
{
"insecure-registries" : ["myregistrydomain.com:5000"]
}
# suits for large files | |
def reverse_readlines(file_path, buffer_size=8192): | |
"""Generator that yields lines from the end of a file.""" | |
with open(file_path, 'rb') as f: | |
# Start at the end of the file | |
f.seek(0, 2) | |
file_size = f.tell() | |
buffer = bytearray() |
# from official docs and this hint | |
# Hint: https://github.com/encode/starlette/issues/874#issuecomment-1027743996 | |
# Docs: https://fastapi.tiangolo.com/tutorial/middleware/ | |
# Note: in my case response is `starlette.responses.StreamingResponse`. in error logs it is `_StreamingResponse` | |
from fastapi import FastAPI, Request | |
from starlette.concurrency import iterate_in_threadpool | |
app = FastAPI() |
// array method to return unique items in new array | |
Array.prototype.unique = function() { | |
let a = this.concat(); | |
for(let i=0; i<a.length; ++i) { | |
for(let j=i+1; j<a.length; ++j) { | |
if(a[i] === a[j]) | |
a.splice(j--, 1); | |
} | |
} |