serhii.net

In the middle of the desert you can say anything you want

27 May 2021

Day 877

Docker DEBIAN_FRONTEND=noninteractive

Setting it in Dockerfiles is discouraged (even by the official Docker FAQ 1) because it’s mainly cosmetic & may create unwanted side effects.

For me, tzdata wanted input and waited for it:

[17:01:56][Step 1/3] debconf: falling back to frontend: Readline
[17:01:56][Step 1/3] Configuring tzdata
[17:01:56][Step 1/3] ------------------
[17:01:56][Step 1/3] 
[17:01:56][Step 1/3] Please select the geographic area in which you live. Subsequent configuration
[17:01:56][Step 1/3] questions will narrow this down by presenting a list of cities, representing
[17:01:56][Step 1/3] the time zones in which they are located.
[17:01:56][Step 1/3] 
[17:01:56][Step 1/3]   1. Africa      4. Australia  7. Atlantic  10. Pacific  13. Etc
[17:01:56][Step 1/3]   2. America     5. Arctic     8. Europe    11. SystemV
[17:01:56][Step 1/3]   3. Antarctica  6. Asia       9. Indian    12. US

Fixed this by adding this command specifically before the one requiring it:

RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y

vaex - faster panda-like lib

TODO: Vaex: Pandas but 1000x faster - KDnuggets

Looks interesting. Why is it faster?

python subprocess run

subprocess.run() is the newer version of ..call(). Can run a string like this:

subprocess.run("echo  one two three", shell=True)

Qutebrowser throwaway email and password generatorr userscripts

Generate password, paste it into a textfield, and xclip the output:

#!/usr/bin/python3
import os
import string
import secrets
from subprocess import run
alphabet = string.ascii_letters + string.digits
password = ''.join(secrets.choice(alphabet) for i in range(8))

run(f"echo {password} | xclip -selection c", shell=True)
with open(os.environ['QUTE_FIFO'], 'w') as f:
    f.write(":insert-text {}".format(password))

Generate a throwaway email with email based on domain (so if I were to run it on google.com, it’d generate google@wildcard.mydomain.net:

#!/usr/bin/python3
import os
import tldextract
import argparse
import sys

argument_parser = argparse.ArgumentParser()
argument_parser.add_argument('--subdomain', '-s', default='t',
                             help='subdomain ("t" would do "@t.email_host.net")')
argument_parser.add_argument('--email_host', '-d', default='email_host.net',
                             help='main domain where you\'ll get the emails')
argument_parser.add_argument('--username', '-u', default=None,
                             help='the name used for email username (name@...)')
def main(args):
    my_domain = args.email_host
    subdomain = args.subdomain
    if args.username is not None:
        username = args.username
    else:
        url = os.environ['QUTE_URL']
        extract_result = tldextract.extract(url)
        username = extract_result.domain

    address = f"{username}@{subdomain}.{my_domain}"

    with open(os.environ['QUTE_FIFO'], 'w') as f:
        f.write(":insert-text {}".format(address))

if __name__ == '__main__':
    arguments = argument_parser.parse_args()
    sys.exit(main(arguments))

Use-case for both - quick easy registration in pointless places.

Nel mezzo del deserto posso dire tutto quello che voglio.
comments powered by Disqus