HNHacker News
TopNewBestAskShowJobs

mathfailure

313 karma · joined April 27, 2019

submissionscomments
mathfailure··on EU bans the destruction of unsold apparel, clothing, accessories and footwear
What stops them from selling it to an affiliated entity for 1 eurocent and thus evade the ban?
mathfailure··on The Future for Tyr, a Rust GPU Driver for Arm Mali Hardware
Looks believable that they are indeed the devs behind the project, but it's weird to post stuff like that to... reddit? They have a site for the project, why not post there?
mathfailure··on The Future for Tyr, a Rust GPU Driver for Arm Mali Hardware
One can start working on creation of a teleportation device. Doesn't mean we have it.

https://asahilinux.org/docs/platform/feature-support/m3/

What do you see as progress here? Nothing is supported, everything is "to be announced" (i.e. unsupported).

mathfailure··on Start all of your commands with a comma (2009)
They did. Just not explicitly.
mathfailure··on Start all of your commands with a comma (2009)
Not if if you APPEND the dot path to the PATH env: the system traverses the dirs specified in the PATH env from left to right and stops at first match. Your system's sed binary is in the dir that's to the left of your '.' dir.
mathfailure··on Start all of your commands with a comma (2009)
> if you end up in a directory that's not under your control, and you do a "ls", it might execute "./ls" instead of /usr/bin/ls,

Not if if you APPEND the dot path to the PATH env: the system traverses the dirs specified in the PATH env from left to right and stops at first match. Your system's ls binary is in the dir that's to the left of your '.' dir.

mathfailure··on Start all of your commands with a comma (2009)
No, in fact he is correct: system scripts won't pick up your overrides configured via your shell's rc scripts.
mathfailure··on Start all of your commands with a comma (2009)
Because it's useless extra typing. People try to narrow commands down to two fucking chars and you suggest to type the whole goddamn path!
mathfailure··on Start all of your commands with a comma (2009)
Kinda makes no sense to me: so you don't use '--' as a prefix, you use it in the middle of an alias, so you first have to autocomplete, say, 'gi' not to 'git' but to 'git--progress'. What does that alias do? Doesn't it call git with some args? If so - why not just alias it to git?
mathfailure··on Start all of your commands with a comma (2009)
> I prefer giving scripts numbers instead of names

> Something like "[number"

> It contains 100s of short scripts

So you call scripts like [1 [2 [3 [4 ... and remember what each one of them does? If yes - that's nuts, I'd visit a doctor.

mathfailure··on Start all of your commands with a comma (2009)
People tend to want some separation between what's theirs and what's others. Other programs/scripts quite often put something into ~/.local/bin, so it's not yours actually, it's theirs.
mathfailure··on Start all of your commands with a comma (2009)
Ah, I see you're a man of culture as well!
mathfailure··on Start all of your commands with a comma (2009)
I like to follow my own convention where I name files with shell scripts with an extension: .sh for POSIX-compatible scripts, .bash for scripts with bashisms or .zsh for scripts with zshisms.

If I ever wanted to achieve what you initially wanted to achieve - I could use something like

alias -s sh=sh

alias -s bash=bash

alias -s zsh=zsh

Just like I do bind .txt and .conf to 'less', .pdf to 'qpdf', .json to 'ijq', video formats to 'mpv' and so on.

mathfailure··on Start all of your commands with a comma (2009)
One rarely actually needs to shadow binaries. Some cases could indeed be covered by introducing an alias that binds the binary's name to call a different copy of that binary.

You use shadowing to fix issues where you install some software that expects you to have a sane and ~recent version of some tool like git, but you don't as your system provides that binary and unfortunately it is either not sane (not GENERALLY sane [while it could be sane for system scripts]) or not recent enough. In that case the program's function would simply fail if it would call the system's binary and you shadow the binary with your version to fix that.

> adding your script directory in front of the PATH

That's a poor advice for the scripts you call relatively frequently. Instead, (as a general approach, we aren't discussing some particular script) don't use shadowing for scripts: just pick a non-conflicting script name and append the script's dir to $PATH.

mathfailure··on Start all of your commands with a comma (2009)
No, don't do that as a precaution. As others have already answered correctly - it's too late to worry about such things if a malicious agent has write access to your ${HOME} dir.
mathfailure··on Start all of your commands with a comma (2009)
Not really, since if one usually does that - they probably understand the possible consequences and don't shadow whatever they like, but do it carefully.

On MacOS I shadow that way just curl and git binaries to the versions installed from homebrew and nothing has broken (yet). I know that tar on MacOS is also a weirdo that I'd rather shadow with the homebrew's gtar, but their args are different and I of course understand that there's a high probability of something in system to be bound to mac's version of tar, so here I better remember to use 'sane' tar as gtar or use an alias (instead of shadowing the binary) for tar to use gtar (because aliases are for users, not for system scripts/processes).

And on my home desktop's Debian - I don't even use shadowing of binaries at all (never needed it).

Also, I just realized: I change PATH env via my shell's rc script (~/.zshrc), so I probably could worry even less about shadowing system binaries (like tar on MacOS) possibly breaking things.

mathfailure··on Start all of your commands with a comma (2009)
I never knew that what I've known as 'hotstrings' (since the AutoHotKey days) other sometimes also call 'text expanders'.
mathfailure··on Start all of your commands with a comma (2009)
Others have already given valid answers: grep is not ripgrep [their params don't match], so it's a bad idea to alias 'grep' to use ripgrep. But it's okay to alias 'ripgrep' (or 'rg' or whatever) to use ripgrep with some args.
mathfailure··on Start all of your commands with a comma (2009)
I didn't like the idea. I prefer the alternative approach: _I_ decide the order of dirs in the PATH env. If I introduce an executable with a name, that overrides a system one - I probably do that intentionally.

If I introduce an alias (like `grep='grep --binary-files=without-match --ignore-case --color=auto`) that matches the name of a system binary - I probably do that intentionally.

And if I EVER need to call grep without my alias - I just prefix it with a backslash: \grep will search with case sensitivity and no color and will scan binaries.

mathfailure··on LinkedIn checks for 2953 browser extensions
Surely they do! The data is in the public internets, aren't they?
mathfailure··on Show HN: NanoClaw – “Clawdbot” in 500 lines of TS with Apple container isolation
The 2. Thank you.
mathfailure··on Recent discoveries on the acquisition of the highest levels of human performance
This source is shit: it doesn't grant open access.
mathfailure··on ICE Is Going on a Surveillance Shopping Spree
What's the connection between the movie The Matrix and ICE?

Also, did the country truly survive just fine without it before that? Are you familiar with crime stats? Could you share the data on levels of crime carried by illegal immigrants over the years?

mathfailure··on ICE Is Going on a Surveillance Shopping Spree
There's nothing wrong with that if it's justified.
mathfailure··on ICE Is Going on a Surveillance Shopping Spree
You can also not kill any people and that will be absence of murder. That's not what is being discussed.
mathfailure··on Show HN: Hover – IDE style hover documentation on any webpage
It uses LLM under the hood. This is the bad part.
mathfailure··on Show HN: Witr – Explain why a process is running on your Linux system
No, it does not.
mathfailure··on WinApps: Run Windows apps as if they were a part of the native Linux OS
To pass through a GPU - you'd need an extra GPU then..?
mathfailure··on WinApps: Run Windows apps as if they were a part of the native Linux OS
As you can see - running the container doesn't work.
mathfailure··on WinApps: Run Windows apps as if they were a part of the native Linux OS
Does this even work?

podman run mcr.microsoft.com/windows:ltsc2019

Trying to pull mcr.microsoft.com/windows:ltsc2019...

Error: choosing an image from manifest list docker://mcr.microsoft.com/windows:ltsc2019: no image found in manifest list for architecture amd64, variant "", OS linux

← PreviousPage 2 of 10Next →