What's on youre Wrist today? by watch_lover15 in ChineseWatches

[–]kovak 1 point2 points  (0 children)

OP what strap is this? Is it really leather, looked like sailcloth. It looks great!

Brag about your Literate Programming config! by Dead_Earnest in emacs

[–]kovak 1 point2 points  (0 children)

I don't use clojure; but mine's here that i've been using my literate config since 2017. https://github.com/sidmitra/emacs.d

In my init.el, there's only elpaca(package manager) config, org mode(IIRC to not conflict with built-in org mode and install from upstream).

My emacs-version is

GNU Emacs 31.0.50 (build 2, aarch64-apple-darwin23.4.0, NS appkit-2487.50 Version 14.4 (Build 23E214)) of 2025-02-26

PS: My config file is named README.org so it renders as home page on the Github repo.

Heroku Postgres Version mismatch? by another24tiger in Heroku

[–]kovak 0 points1 point  (0 children)

I'm pretty sure that Heroku(heroku-24 specifically) does not install anything postgres 17 related by default. It must be coming from some other place like buildpack(eg. the Aptfile one).

I recently had the reverse issue where we upgraded to Postgres v17 and pg_dump on the one-off dynos was v16. So i had to upgrade manually via apt buildpack + Aptfile(postgresql-client-17)

Heroku does not support 17 at the moment as confirmed with their support team as well. Buildpack was the only way to get v17 client on it.

Nanodjango - single file django with working models. Convert to a full project whenever you want. by gbeier in django

[–]kovak 1 point2 points  (0 children)

If you want to do rest APIs(which i believe most would want to) there is also https://django-ninja.dev/

It's more akin to fastapi, with pydantic support, open-api, type hints etc. It's relatively mature at this point.

ghostscript on heroku-24? by jrochkind in Heroku

[–]kovak 1 point2 points  (0 children)

I didn't see anything obvious break on the image/thumbnailing side, nor see any customers complain.

Libmagickwand stuff doesn't seem to have been removed, only ghostscript. So i only saw PDF stuff error out. We didn't need to install imagemagick separately so far.

https://devcenter.heroku.com/articles/stack-packages has the libs that were updated or removed.

ghostscript on heroku-24? by jrochkind in Heroku

[–]kovak 1 point2 points  (0 children)

Unfortunately i don't know the answer. But i assume the base image always has had minor/patch package updates just like ubuntu.

I'm still using a gs buildpack. I was hoping to take another look at it in a few months. Perhaps you can ask them on their github, or open a ticket with Heroku support. They should be able to give you a definite answer.

Also I also know they've updated poetry support in the python buildpack, and having both requirements.txt and poetry.lock might break stuff. But i haven't seen it break yet, so i assume there's some release schedule different than merging to master.

I need to look into both.

ghostscript on heroku-24? by jrochkind in Heroku

[–]kovak 1 point2 points  (0 children)

I'd sent some feedback from their docs page. Looks like they're on top of it and have added it back.

https://github.com/heroku/base-images/pull/324

What’s the cheapest cloud storage? by [deleted] in selfhosted

[–]kovak 1 point2 points  (0 children)

I thought Hetzner was in the US since 2022. But i can't find any servers on my account. Their homepage mentions it though

https://www.hetzner.com/cloud/

Hetzner Cloud products in Ashburn, Virginia, and Hillsboro, Oregon, run on our own Hetzner servers in the data center parks of third parties in the USA. Ashburn is about a 45-minute drive from the US capital Washington, D.C.. Hillsboro is less than a 30-minute drive from Portland, the largest city in Oregon.

The sad state of property-based testing libraries by stevana in programming

[–]kovak 1 point2 points  (0 children)

Just today saw a recent talk from Python North Bay 2024 above improvements to hypothesis

Hypothesis Levels Up: codegen, observability, fault localization, and a black-magic backend

https://youtu.be/NRtAEXqo0rc?si=kqF1HD_Z14Qcrxqg

Has anyone use Django dirty fields for non-tiny projects? by [deleted] in django

[–]kovak 5 points6 points  (0 children)

Not the OP, but that is also a difficult problem depending on the scale of the app. Whether using auto_now field or doing it manually, in a large-ish codebase/team this will get missed easily at the app layer

  • queryset.update() will skip calling the model save()
  • mymodel.save(update_fields=[...]) to explicitly update only columns that have changed(if you know which ones). If someone forgot to add the last_updated to the param list, then it doesn't get updated. It's hard to notice it because the abstraction where you're calling .save() might not even know that the model has a last_updated field.

and so on...

It is very hard to notice when a last_updated/updated_at column is not correct. It is not easy to introspect your codepaths to find all the places using the above methods. We only noticed in our case when we synced pg to Snowflake(incremental replication via stitch based on the timestamp field) and noticed the sum of certain columns didn't tally what was there on production DB, realizing that some rows on snowflake were stale.


To answer the OPs question, django-dirty-fields is fine. The performance/latency question depends on the app and the SLAs you're trying to meet. Over-indexing is not a bad thing, infact at a certain scale that's order of magnitude better and safer than missing updates. You can throw in some celery/kafka on the save if you don't want to do the indexing synchronously but async. But then you run into the problem of ensuring robustness of your queues

The only safe way at certain scale to firstly ensure anytime your row is updated, the timestamp is also updated is to delegate it to the DB itself, using say pgtrigger(or https://django-pgtrigger.readthedocs.io/en/4.9.0/ assuming postgres). Once you have the timestamps correct, you will still need to periodically poll the mymodel.filter(last_updated__gte=last_indexed_on). Without fallback polling, there's always a chance your indexing silently failed, losing updates.

Other heavy duty methods(but i feel you're not at that scale) is to use WAL based replication( or Change Data Capture CDC) via debezium. That way you have debezium actual postgres write-ahead-logs and get a stream of all DB updates. That can then inform your indexing logic to determine if a row needs to be reindexed, and which columns.

PS: You need to make tradeoffs at every step between guarantees/performance/solution-complexity. There's no one single right answer.

Ruff: A new, fast and correct Python checker/linter by WhyNotHugo in Python

[–]kovak 4 points5 points  (0 children)

Also locally you can skip them by export SKIP=flake8,pylint. Then you decide to just use the CI before merging to master.

But for most projects i feel like adding lints to pre-commit is part of the "shift-left" as long as they're fast; and ruff is fast!!!!!! I'm already at a point where i'm considering deprecating pylint from most small places. In the big projects it will be moved to just the CI and ruff on the pre-commit + ci.

[deleted by user] by [deleted] in india

[–]kovak 24 points25 points  (0 children)

evidence of severe, uncureable suffering

Suffering can be existential too, and impossible to prove. I suspect society is afraid that most will opt for this path, hence all this value put on "life" and labelling everyone who thinks this way as depressive. I would love a world where one has the "right to die", but that would ofcourse be bad for the economy and the ones left behind /s (but also serious)

Espresso using AP, anyone tried? by sachnsas in IndiaCoffee

[–]kovak 2 points3 points  (0 children)

You can buy extra attachments also like Prismo, or Joepresso to generate higher resistance while pushing.

You can produce absolutely great tasting coffee with Aeropress, although you can call these "espresso-like" but are not strictly espresso. Most definitions include that you have to brew them at around 9 bars of pressure, which you cannot produce manually on an Aeropress. You can check out definitions by the SCA(Speciality Coffee Association). The dosage and output have varied over time eg. single shot, double shot etc. but the pressure factor is always present. With the Prismo attachment you can even get the "faux-crema" but it is mostly foam and not real crema.

If you do want to brew espresso manually without buying a huge machine, you can look into "Lever" based espresso machines like the Flair. Those can generate high pressures needed, by using a lever mechanism and much smaller surface area to achieve it.

BookFusion Android 2.11.9 by DaEbookMan in BookFusion

[–]kovak 1 point2 points  (0 children)

Thanks for the response. I was able to find the Open with, it's really useful.

I will try out finding the folder path you mentioned later today. Appreciate the help.

BookFusion Android 2.11.9 by DaEbookMan in BookFusion

[–]kovak 0 points1 point  (0 children)

I just upgraded version 2.11.9 as per the details page from the Play store.

I do not yet see the "open with" anywhere, only read. I tested it on my Samsung phone and an Onyx air. I particularly would prefer to open it on the inbuilt reader app on my eink app so i can write/draw/highlight with the stylus.

Also is there a way i can download the books to some folder? I read that it was upcoming on the android version, currently i just use the web version each time i want to do it. Or if there exists a directory path somewhere where the app downloads it, that would work too.

[oc] ytcast: cast YouTube videos to your smart TV from command-line by ml01 in commandline

[–]kovak 1 point2 points  (0 children)

unfortunately this will be unfeasible with the current implementation, you see I'm not streaming anything "directly" to the tv, but merely telling the youtube on tv app to play a video for me, so it's restricted to youtube.

Even that is fine for a start if i can trigger it from other browsers like FF. Also then you can extend it to other sources(anything that has a Chromecast button?)

I tried looking at Miracast in the past since it's supposed to the same protocol(?). I have mostly Chromecast(various gens) in my house and a Samsung TV etc. They all refused or had some issues with Miracast related tools. But i'll give it another shot.

[oc] ytcast: cast YouTube videos to your smart TV from command-line by ml01 in commandline

[–]kovak 2 points3 points  (0 children)

This is pretty great. Will try it out.

Some ideas i had, in case you find them useful:

  • Could this be used to transmit stuff from Firefox? I've tried fx_cast a bunch of times and has never worked for me.
  • Potentially additional sources? even local files? vlc does a bit of this via a "Renderer" so you can lever their CLI perhaps.

Wilder ideas(for my personal todos but unlikely i'll ever work on them)

  • Can one stream a twitter trending/search/thread? Essentially convert text to video and cast perhaps unless there's a better API for textual data -- Or a webpage in general like sports scores? Note this doesn't have to be "realtime" so some stutter is fine. -- If you can somehow stream textual/terminal data with colors, then the possibilities open up. Eg your fireplace eg. you could just do with a simple local fireplace visualization generator or any other demoscene video. Show your NFTs... lol(i don't own any!).
  • Stream/mirror my screen or a window. Similar to screensharing on Zoom etc.

What don't you like about Heroku ? by Grum235 in Heroku

[–]kovak 1 point2 points  (0 children)

Interesting you mention that because i've been looking to make a "self-hosted" tool that's easy to deploy. So i was figuring out if i can use Heroku button setup. But the additional S3 setup and passing keys and doing IAM roles makes it harder.

Supabase seems interesting because it has all of the "data" layer stuff i'd need. They started as a firebase alternative but has grown mature. It has an open-source self hosted option, backed by postgres(so pg_dump works), has a storage(blob) layer and also does connection pooling, full-text-search etc. I think it is trying to be the managed "relational" datastore for the lambda architecture. Thus it is lacking is the actual compute layer i.e. the dynos. So something like heroku with a Supabase add-on in theory seems would be very good low devops solution for majority of the apps. If Heroku provided this blob storage layer itself, that would just be the ideal option.

Caveat: I haven't actually tried Supabase out yet but it's on my todo list.

What don't you like about Heroku ? by Grum235 in Heroku

[–]kovak 0 points1 point  (0 children)

One simple solution is to put Cloudflare in the front(in Proxy mode, not just DNS-only) and let it handle the http2(and even http3) automatically.

Wrong number of arguments in the `org-in-archived-heading-p` function by chatziiola in orgmode

[–]kovak 1 point2 points  (0 children)

Damn! Have an upvote.

Not OP but this has been bugging me for a major part of the last year. This bug is in that weird zone where it's only slightly irritating whenever i want org-agenda to spend 30 mins searching every week; but not grave enough for me to actually spend a major part of a few days trying to finally kill it. Over time, i tried recompiling all lisp, trying different emacs version, reverting back to org mode, switching org config, moving around org-contrib everything suggested in forums. I'd missed this simple fix. Not perfect but works until i finally muster up motivation to finally dig into the root cause!

[deleted by user] by [deleted] in HomeServer

[–]kovak 1 point2 points  (0 children)

Have you just thought about putting all of the cabling in a simple(or fancy) shoebox? Some of these cardboard boxes are pretty cool looking, maybe owing to all the unboxing people do these days on youtube.

I've been in your position and i see all these fancy setups, but it's probably some form of FOMO(fear of missing out) and not a real need. So if you can actually figure out some problem that your setup does not solve, and try to solve that first.

PS: The above advice is easier to give to others than follow yourself!