10

I am trying to use find (or a similar tool, I also really like fd)

  • to locate directories matching the query

  • only those directories which are the deepest match

  • the target directories are not all the same depth, so -maxdepth or -mindepth can't do it

  • it would be the opposite of -prune

Given the below directory tree, looking for directories with "red" in the name, the ones with Yes should be the matches:

$ tree
.
├── blue                = n
├── green               = n
│   ├── red-apple       = Yes
│   └── red-book        = n
│       └── red-pen     = Yes
├── red                 = n
│   └── red-strawberry  = Yes
│   └── 
└── yellow              = n
    └── basket          = n
        ├── flag        = n
        │   └── red     = Yes
        └── painted-red = Yes
            └── wagon   = n

So "red-book" does not match because it contains a subsequent match ("red-pen"). But it's OK to have a deeper non-matching directory (like "painted-red").

This is my basic command which finds 2 unwanted items:

$ find . -type d -name "*red*"
./green/red-apple
./green/red-book
./green/red-book/red-pen   # wrong
./yellow/basket/flag/red
./yellow/basket/red
./red                      # wrong
./red/red-strawberry
8
automatic bind mount/unmount (discuss.tchncs.de)
submitted 2 months ago* (last edited 2 months ago) by linuxPIPEpower@discuss.tchncs.de to c/linux4noobs@programming.dev

I have bind mounts configured in my /etc/fstab. The source (i.e. where the files physically exist) is on a removable USB drive.

Right now it works but I have to mount/unmount everything individually when I plug/unplug the drive. I would like to be able to have the bind mounts follow the state of of the USB drive automatically.

Is there a way?

Edit here is relevant section of fstab:

/dev/mapper/external-crypt	/mount/external		auto	nosuid,nodev,nofail,x-systemd.device-timeout=5	0 0
/mount/external/realfolder	/home/user/folder	none	bind,nofail	0 0

So when I run sudo mount "/mount/external" I want sudo mount /home/user/folder to be implied; likewise for umount.

9

I having a hard time updating my arch-based computer because the downloads are so painfully slow. It takes hours and hours. Eventually some kind of error happens and Ive already left my computer to do something else so the task times out. Or download stalls to nothing and the process kills itself.

I have already adjusted the settings in yay to be more tolerant of slow connection, but can hardly ever manage to complete the upgrade. And the longer you wait, the more updates there are.

Does anyone else have this issue? I don't have a great connection but this is ridiculous. I do have a VPN running on router. This could be affecting it as github in particular seems to make downloads a slow trickle on certain VPN endpoints but lately I can't find any that satisfy it.

I start at least 1 upgrade task every day, sometimes multiple attempts but I have only had 1 successful full system upgrade in the past 2 or 3 weeks.

14

cross-posted from: https://discuss.tchncs.de/post/56895639

My friend who uses google wants to share their calendar (read-only). I don't use google. How can they do that?

6

My friend who uses google wants to share their calendar (read-only). I don't use google. How can they do that?

[-] linuxPIPEpower@discuss.tchncs.de 18 points 8 months ago

It’s almost exactly a copy of reddit

The magic of reddit isn't just the structure of the website, it's the fact that there are so many people posting to diverse niche subjects. Although one structural thing lemmy is really lacking is the wiki and post flare components; those help give experts a reason to make effortful contributions as they do not fade into the ether after a few days.

That said, if reddit was new in 2025 or 2020, I don't think it would take off as much. It gained popularity in a previous time of the internet and is now coasting off that.

16
submitted 1 year ago* (last edited 1 year ago) by linuxPIPEpower@discuss.tchncs.de to c/firefox@lemmy.ml

I find Firefox Translator doesn't pick up a lot of pages. The location bar button doesn't appear.

It works if I access via the hamburger menu. It is very slow to have to go via the menu for each individual page. I find no shortcut key or anything.

Sometimes this will correctly guess the original language but often not. It is saying pages are English even when they have little to no english, even using different alphabets.

Is there something the website admins can do to tell firefox what language it is? Encoding? Meta tag?

Can I force the location-bar translate button to persist on all pages regardless of what language it thinks the page is in? Then I could save going through the menu.

Here is an example: https://cn.chinadaily.com.cn/

12
submitted 1 year ago* (last edited 1 year ago) by linuxPIPEpower@discuss.tchncs.de to c/linux@lemmy.ml

I have a lowend netbook with debian-type linux only (no dualboot). Power management should be via XFCE4's xfce4-power-manager-settings.

I'm having weird behavior with suspend and trying to identify/troubleshoot it. It seems to be usually draining power and never charging when the lid is closed for many hours.

I tried explicitly entering power off, hibernate and suspend followed by unplugging then leaving it a few hours but couldn't replicate. It seems to be doing something on its own after being unplugged a long time.

What logs can I look at to see when my device changes its power modes, what were the triggers, what settings are governing it etc?

I can't tell if it's a software issue or there is some sort of power saving thing going on in the hardware or what.

Just hoping for some investigation tips here, I know its not enough info to solve.

Edit to clarify no dual boot.

21

I want to move a directory with a bunch of subdirectories and files. But I have the feeling there might be some symlinks to a few of them elsewhere on the file system. (As in the directory contains the targets of symlinks.)

How do I search all files for symlinks pointing to them?

Some combination of find, stat, ls, realpath, readlink and maybe xargs? I can't quite figure it out.

22

I have 2 directories which both have stuff in them:

  • /home/user/folderApple

  • /mnt/drive/folderBanana

I want to mount folderBanana onto folderApple like this:

sudo mount --bind "/mnt/drive/folderBanana" "/home/user/folderApple"

But I still want to be able to access the contents of folderApple while this is activated. From what I am reading, binding the original directory to a new location should make it available, like this:

mkdir "/home/user/folderApple-original"
sudo mount --bind  "/home/user/folderApple" "/home/user/folderApple-original"

But this just binds /mnt/drive/folderBanana to /home/user/folderApple-original as well. I tried reversing the order and result is the same.

How do I tell mount to look for the underlying directory?

I am happy to use symlinks or something else if it'll reliably get the job done, I am not wedded to this mechanism.

(The purpose of all this is that when an external drive is connected, I can have the storage conveniently available, but when it is not connected, the system will fallback to internal storage. But then I will want to move files between the fallback and external locations when both are available. So I need to see both locations at once.)

17

Is there anyway to pass terminal colors through a pipe?

As a simple example, ls -l --color=always | grep ii.

When you just run the ls -l --color=always part alone, you get the filenames color coded. But adding grep ii removes the color coding and just has the grep match highlighting.

Screenshot of both examples:

In the above example I would want ii.mp3 and ii.png filenames to retain the cyan and magenta highlighting, respectively. With or without the grep match highlighting.

Question is not specific to ls or grep.

If this is possible, is there a correct term/name for it? I am unable to locate anything.

37

Once again I try to get a handle of my various dotfiles and configs. This time I take another stab at gnu stow as it is often recommended. I do not understand it.

Here's how I understand it: I'm supposed to manually move all my files into a new directory where the original are. So for ~ I make like this:

~
  - dotfiles
      - bash
         dot-bashrc
         dot-bash_profile
      - xdg
            - dot-config
                user-dirs.dirs
      - tealdeer
            - dot-config
                - tealdeer
                       config.toml

then cd ~/dotfiles && stow --dotfiles .

Then (if I very carefully created each directory tree) it will symlink those files back to where they came from like this:

~
  .bashrc
  .bash_profile
   - .config
        user-dirs.dirs
      - tealdeer
          config.toml

I don't really understand what this application is doing because setting up the dotfiles directory is a lot more work than making symlinks afterwards. Every instructions tells me to make up this directory structure by hand but that seems to tedious with so many configs; isn't there some kind of automation to it?

Once the symlinks are created then what?

  • Tutorials don't really mention it but the actual manual gives me the impression this is a packager manager in some way and that's confusing. Lots of stuff about compiling

  • I see about how to combine it with git. Tried git-oriented dotfile systems before and they just aren't practical for me. And again I don't see what stow contributing; git would be doing all the work there.

  • Is there anything here about sharing configs between non-identical devices? Not everything can be copy/pasted exactly. Are you supposed to be making git branches or something?

The manual is not gentle enough to learn from scratch. OTOH there are very very short tutorials which offer little information.

I feel that I'm really missing the magic that's obvious to everyone else.

13

Some packages install in under a minute, while alternatives which seem functionally similar, take hours.

Sometimes there are several available options to fit a use case and I would like to use it now. Is it possible to anticipate which one will likely be the fastest to get rolling?

Generally I like to install via yay.

Searching around here is what I learned. Agree?:

  • AUR will be slower
  • Certain categories of package, like web browser, are inherently slow
  • Selecting -bin will be faster if available

Is there some way to guess beyond that? Certain programing languages take longer than others? Is it in relationship to existing packages on the system? Other characteristic? Some kind of dry-run feature to estimate?

Obviously I don't have the fastest computer. I have added MAKEFLAGS="-j4" to /etc/makepkg.conf so at least all 4 cores can get used.

Once I realize a package is going to take ages to get ready, is it possible to safely intervene to stop the process? I try to avoid it because in general I understand arch-based distros don't like "partial" installs. But is it safe to stop compiling? No changes have yet been made, right?

[-] linuxPIPEpower@discuss.tchncs.de 28 points 2 years ago

By showing how you drew a comic about it them posted it to lemmy ofc

[-] linuxPIPEpower@discuss.tchncs.de 25 points 2 years ago

Not only were the programmers women, but so were the computers.

[-] linuxPIPEpower@discuss.tchncs.de 21 points 2 years ago

why not just add the options to it?

If you are asking me, personally, it's because making any contributions to ls is far beyond my capacities and will remain that way for the forseeable future.

Personal deficiencies aside, would it even be a good idea to modify ls in this way? It seems to me that stability and predictability is a feature, not a bug. Basically you know how ls will work on every linux system. Adding all these features would turn it into something else and potentially introduce chaos. ls is tested on >millions of systems in every context; a known quantity. A feature set which is limited to the necessities avoids introducing bugs, flaws, security issues etc.

And once added, a feature probably shouldn't be removed. In 2024 I love having git status optionally integrated into my ls-type tool. But in 2034 will git still be as ubiquitous? What about 2054? ls is for the ages. eza is for right now.

[-] linuxPIPEpower@discuss.tchncs.de 17 points 2 years ago

in case you don't know, you can discard tabs natively without an extension in FF now by going to URL about:unloads. it's a newish feature in the past year or so. much more rudimentary than Auto Tab Discard but gets the job done with one less extension.

[-] linuxPIPEpower@discuss.tchncs.de 17 points 2 years ago

I like light themes and agree that they can be done well. Overall my problem with dark themes is they are too low contrast everything melts into everything else. Who doesn't want a distinct border around a window?

[-] linuxPIPEpower@discuss.tchncs.de 18 points 2 years ago

Union organizing and intersectionality can only improve things.

[-] linuxPIPEpower@discuss.tchncs.de 14 points 2 years ago

I do not understand the mystique of applications that don't come with a reasonable working config. I don't want to invest hours just to try something and see if it is vaguely suitable. Anyone who wants to delete the default config can easily do so.

I guess people get pulled with sunk costs because by the time you get it working you've spent so much time on it.

[-] linuxPIPEpower@discuss.tchncs.de 13 points 2 years ago

why was Google able to find the answer to questions exactly like this 6+ years ago?

curious if there is any way to know for sure if this is the case? is there documentation of vague google searches over time to track their results? sort of seems like a "don't know what you got til it's gone" sort of thing for the average user. but maybe there is some academic work or industry publications to this effect?

We do have a good 10-20 years of every news story intro containing a line like "a google search for 'spatula' returns 2.5million results". remember when journalists and other writers thought that just putting a single search term into a search engine was the way to conduct online research?

otherwise it is really just your recollection how it felt then vs now. i can't comment on @merc@sh.itjust.works's programing skills but the point about changing expectations is a good one. not to mention that the amount of available data has exploded.

[-] linuxPIPEpower@discuss.tchncs.de 13 points 2 years ago

I had one of the early generation kindles for a while. There was a straighrtforward jailbreak to make it more sociable. The set it up with Calibre which was smooth once properly set up. There was (likely still is) a cool plugin that would get RSS feeds, generate an ebook and sync automatically over wifi per schedule. So then when I went out I would have everything to read fresh with zero effort. Which at the time was pretty impressive. Phone batteries sucked so they were not really viable for reading unless you could have them plugged in all the time. The kindle was magic in comparison.

Anyone who wants to dive into e readers should go to the E-Book Readers section of MobileRead Forums. There people are very serious about ebooks.

I was thinking of buying another ereader a couple years ago. I sort of assumed there would be some open-ish type options. But I didn't find anything that suited me. I really liked eink and wish it was more widely used. I would love one of the phones with dual ekin/LCD displays.

All this to say I hope there is community uptake and participation in the project. I myself do not have a soldering iron and don't really need an ereader. But I think it's a cool contribution.

[-] linuxPIPEpower@discuss.tchncs.de 12 points 2 years ago

@rbn@feddit.ch made a well structured comment using bullet points. It can be read pretty quickly but I guess the tldr is the last line:

There is a lot of uncertainty when using AGPL software in a business context which will - in many cases - lead to the decision not to use the software at all.

if you want to know why you have to spend 20 seconds reading the preceding text.

[-] linuxPIPEpower@discuss.tchncs.de 26 points 2 years ago

If you are being recommended colonoscopy as a regular-risk person on the basis of age, your health system is not serving you well. Compared to colonoscopies, regular FOBT or FIT testing has an insignificant risk of complications (bowel perforations, death etc) and is easily conducted at home without the unpleasant "preparation" required of a scope. If done every 2-3 years they are at least as (and maybe more) effective at detecting cancer compared to a scope.

view more: next ›

linuxPIPEpower

0 post score
0 comment score
joined 2 years ago