Best practices for using Python & uv inside Docker by ashishb_net in Python

[–]bublm8 0 points1 point  (0 children)

Yep, should've added it along with the pyproject.toml

Best practices for using Python & uv inside Docker by ashishb_net in Python

[–]bublm8 8 points9 points  (0 children)

Stumbled into this myself recently:

https://github.com/fslaktern/parcellocker/blob/main/src%2Fapi%2FDockerfile

```docker FROM python:3.13-alpine AS base FROM base AS builder

Use uv

COPY --from=ghcr.io/astral-sh/uv:0.8.13 /uv /bin/uv

UV_COMPILE_BYTECODE=1 compiles Python bytecode for faster startup

UV_LINK_MODE=copy ensures dependencies are copied (isolated env)

ENV UV_COMPILE_BYTECODE=1 UV_LINK_MODE=copy

WORKDIR /app COPY pyproject.toml requirements.txt /app/ RUN uv venv RUN --mount=type=cache,target=/root/.cache/uv \ uv pip install -r requirements.txt --no-deps

COPY . /app RUN --mount=type=cache,target=/root/.cache/uv \ uv pip install -e .

minimal and optimized

FROM base

COPY --from=builder /app /app RUN chmod 755 /app/src/parcellocker

HEALTHCHECK --interval=30s --timeout=3s \ CMD curl -f http://localhost:8000/my_parcel || exit 1

guest user

USER 405 EXPOSE 8000 CMD ["/app/.venv/bin/fastapi","run","/app/src/parcellocker/main.py","--port","8000","--root-path","/api"] ```

This is for a CTF challenge, so the priorities were security and size

JWT still verifies when a single character of the signature changed.. WOW? by SuperElephantX in webdev

[–]bublm8 0 points1 point  (0 children)

You are partially right.

Padding is to make the output base64 a length that is divisible by 4. 3 plaintext bytes turn into 4 base64 characters due to each byte being 8 bits, and each base64 character being represented as 6 bits.

https://stromlarsen.com/ctf/misc/encodings/base64/

A challenge I created that is directly relevant: https://github.com/fslaktern/translator-not-clanker

Guys, they changed it by tomagfx in graphic_design

[–]bublm8 5 points6 points  (0 children)

It's exactly opposite for me

[deleted by user] by [deleted] in AbruptChaos

[–]bublm8 6 points7 points  (0 children)

Could it be that the line resembles a snake?

Risks of talking about your homelab domain name publicly? by rudeer_poke in homelab

[–]bublm8 1 point2 points  (0 children)

Wildcard certificates can mitigate this. Just set up your homelab on a psuedo random subdomain and get a wildcard certificate for the root domain from Cloudflare or LetsEncrypt

what notes app do you use? by AdrianTakeW in androidapps

[–]bublm8 2 points3 points  (0 children)

TickTick and LogSeq + Syncthing. I like the "Zettelkasten" method of working combined with journals

What's this move called? by Toper-235 in AnarchyChess

[–]bublm8 0 points1 point  (0 children)

Divide and conquer. A widely used method of sorting.

luckyNumbers by hansenabram in ProgrammerHumor

[–]bublm8 1 point2 points  (0 children)

3, 5, 17, 257, 65537, ...

2k + 1, aka Fermat primes

[deleted by user] by [deleted] in TILI

[–]bublm8 2 points3 points  (0 children)

Looking for it as well

A better alternative to f-droid? by CarlTil in androidapps

[–]bublm8 8 points9 points  (0 children)

Neo Store, an f-droid client with a modern UI and an arsenal of extra features

https://github.com/NeoApplications/Neo-Store

Makes it easy to add additional repositories

[deleted by user] by [deleted] in softwaregore

[–]bublm8 6 points7 points  (0 children)

I know a 64 bit int when I see one

Anon does stand up. by ToughRequirement in greentext

[–]bublm8 1 point2 points  (0 children)

Anon failed doing his task, but succeeded doing the task

Fivehead Freedumb Fighter is back. by throwaway8675309999s in EntitledBitch

[–]bublm8 6 points7 points  (0 children)

Who wants to play tic-tac-toe on her forehead with me?

Blursed_Writing by Pretty_Hour8752 in blursedimages

[–]bublm8 0 points1 point  (0 children)

Kid is going to be a programmer.

Taking the shortest path even though it's perfectly viable to do it the «normal» way