HNHacker News
TopNewBestAskShowJobs

alkh

214 karma · joined March 2, 2023

submissionscomments
alkh··on Uv: Running a script with dependencies
Actually, you might be onto something! If I test with explicit quoting in terminal, BSD and GNU produce the same behavior:(`env 'bash -c "echo hello"'` fails while `env -S 'bash -c "echo hello"'`) works. I wasn't aware of this:

"To test env -S on the command line, use single quotes for the -S string to emulate a single parameter. Single quotes are not needed when using env -S in a shebang line on the first line of a script (the operating system already treats it as one argument)"(from your second link).

This is different for shebang on Mac though:

GNU env works with or without '-S':

#!/opt/homebrew/bin/genv -S bash -v

echo "hello world!"

BSD env works with or without '-S' too:

#!/usr/bin/env -S bash -v

echo "hello world!"

To conclude, looks like adding `-S` is the safest option for comparability sake :).

alkh··on Uv: Running a script with dependencies
Interesting, I guess it is indeed a BSD thing, cause this works for me with or without '-S' on Mac
alkh··on Uv: Running a script with dependencies
Thanks, but the main question is how come the behaviour is still the same whether you pass the flag or not? I would get it if it just failed without "-S" but it works as intended. I am wondering if this is cause I might not be using the GNU version of env, so this is less relevant? Edit: looks to be the version thing indeed, this doesn't work for someone on Ubuntu
alkh··on Uv: Running a script with dependencies
If I may interject, does anyone have any idea why the `-S` flag is required? Testing this out on my machine with a BSD env, `/usr/bin/env -S uv run --python 3.11 python` and `/usr/bin/env uv run --python 3.11 python` do the same thing (launch a Python interactive shell). Man page for env doesn't clarify a lot to me, as the end result still seems to be the same("Split apart the given string into multiple strings, and process each of the resulting strings as separate arguments to the env utility...")
alkh··on French villages have no more drinking water. The reason? PFAS pollution
Do we know if it's possible to filter plasma for PFAS to avoid transfering it to others?
alkh··on Ask HN: What's Your Useful Local LLM Stack?
I only recently switched to uv and previously used pyenv, so this was more relevant to me before. There is a case when pip might not be pointing to the right python version, while `python3 -m pip` ensures you use the same one as your environment. For me it is mostly a habbit :)
alkh··on Ask HN: What's Your Useful Local LLM Stack?
I personally found Qwen2.5 Coder 7B to be on pair with deepseek-coder-v2:16b(but consumes less RAM on inference and faster), so that's what I am using locally. I actually created a custom model called "oneliner" that uses Qwen2.5 Coder 7B as a base and this system prompt:

SYSTEM """ You are a professional coder. You goal is to reply to user's questions in a consise and clear way. Your reply must include only code orcommands , so that the user could easily copy and paste them.

Follow these guidelines for python: 1) NEVER recommend using "pip install" directly, always recommend "python3 -m pip install" 2) The following are pypi modules: ruff, pylint, black, autopep8, etc. 3) If the error is module not found, recommend installing the module using "python3 -m pip install" command. 4) If activate is not available create an environment using "python3 -m venv .venv". """

I specifically use it for asking quick questions in terminal that I can copy & paste straight away(for ex. about git). For heavy-lifting I am using ChatGPT Plus(my own) + Github Copilot(provided by my company) + Gemini(provided by my company as well).

Can someone explain how one can set up autocomplete via ollama? That's something I would be interested to try.

alkh··on Watchfiles: Simple, modern and fast file watching for Python, written in Rust
There is also watchexec[1]. I like the fact that is it shipped as a sinle binary, so it's pretty easy to distribute [1]https://github.com/watchexec/watchexec
alkh··on Timdle – Place historical events in chronological order
TIMDLE Jun 24 30/36 1: 1p 5: 5p 2: 2p 6: 4p 3: 2p 7: 7p 4: 3p 8: 6p Play at https://timdle.com
alkh··on The US is turning into a mass techno-surveillance state
To be fair, getting fingerprints and photo taken is a standard nowadays for many countries in the world, especially if you need to apply for a visa. My guess would be that this is a norm for the majority of people not from the first-world countries. I personally had to do that for Canada, Japan, and EU
alkh··on Show HN: DoubleMemory – more efficient local-first read-it-later app
Oops, missed your reply. I think something that most people use, like Google Drive or Dropbox? I personally try to diversify software-wise as much as possible, even though I only have Apple hardware
alkh··on Interactive MissileMap
It's great that you can choose a launch preset as well; it is much more realistic
alkh··on Show HN: DoubleMemory – more efficient local-first read-it-later app
Agree with with everything, if there was a way to use something besides icloud that would be very appreciated. I have nothing against it but the more options there are, the better.
alkh··on Ollama violating llama.cpp license for over a year
Thanks for the linked article! I was looking for a local vision model to recognize my handwritten notes, and this article provided a good TLDR about doing this in Ollama.

I think Ollama can improve TLDR and add more attribution to llama.cpp to their README. I don't understand why there's no reply from ollama maintainers for so long

alkh··on Show HN: Checking Pope's election results with smoke test script for chimney
How much did you end up spending on API credits for Flash 2.0?
alkh··on Show HN: Clippy – 90s UI for local LLMs
Great job! Having ollama support would be useful as well[1]! [1]https://github.com/ollama/ollama
alkh··on Just redesigned my personal site with a TTY-style interface
Black screen in Lynx for me as well (:
alkh··on How to vibe code for free: Running Qwen3 on your Mac, using MLX
Oh, nice, that's actually not bad at all. Thanks, will give it a try on my 36Gb Mac
alkh··on How to vibe code for free: Running Qwen3 on your Mac, using MLX
How much RAM was it taking during inference?
alkh··on Show HN: Infat – Declaritive application assocation manager for macOS
That's great, I've struggled with this problem a lot. To double-check, this essentially allows you to specify a default app that is being opened when you click on a file via Finder or via terminal's `open` program, correct? I haven't seen this exact clarification in README
alkh··on Show HN: Infat – Declaritive application assocation manager for macOS
just is a great command runner[1], not a shell script. Looks like it is needed if you build from source or install from Github releases. Alternatively, use `brew install philocalyst/tap/infat`(haven't done it myself but I bet it has just as a dependency anyway) [1] https://github.com/casey/just
alkh··on Demystifying decorators: They don't need to be cryptic
Thanks for the detailed explanation! I assume that essentially, the same rules as with function decorators apply(in regards to parameterizing them etc.) but the main difference is that we accept the class object and then return the class object vs the function object and that's it?
alkh··on Demystifying decorators: They don't need to be cryptic
Is there any good resource about class decorators specifically? It is more common to see function decorators in the wild, so my knowledge about the class ones is negligible at best
alkh··on Show HN: K(r)ep - A high-performance string search utility
The fact that even in the test example it took ripgrep 0.115 s with 97% CPU usage vs Krep's 0.106 s with 328% CPU usage is a testament of why ripgrep is still preferable. Such a huge tradeoff in resource consumption for such a small speed gain is hard to justify
alkh··on 20 years of Git
Thanks for the useful article! In addition to a lot of interesting info, it lead me to this repo containing an intro to git internals[1]. Would highly recommend everyone to take a look [1] https://github.com/pluralsight/git-internals-pdf
alkh··on Using uv and PEP 723 for Self-Contained Python Scripts
Bonus points for "Bonus: where does uv install its virtual environments?" section! I was wondering the same question for a long time but haven't had a chance to dig in. It's great that venv is not being recreated unless any dependencies or Python version got modified
alkh··on A love letter to the CSV format
The problem with using TSV is different user configuration. For ex. if I use vim then Tab might indeed be a '\t' character but in TextEdit on Mac it might be something different, so editing the file in different programs can yield different formatting. While ',' is a universal char present on all keyboards and formatted in a single way
alkh··on Notetime: Minimalistic notes where everything is timestamped
I agree; being able to export is super important for keeping records, and it's definitely my top request. Having a local app instead of a web app would be great too.
alkh··on Build a Container Image from Scratch
I am surprised that this is working, as I always thought that variables get initialized after the full command is parsed. So, I would assume that $_ would be related to the previous command (defined by a new line) and not this one, because there's no newline character here, but only an ampersand.
alkh··on fd: A simple, fast and user-friendly alternative to 'find'
yeah, that's a problem for me as well. I end up doing koji->gitlint->git commit --amend --edit if there are any width issues
← PreviousPage 2 of 4Next →