Farnsworth

u/Farnsworth@lemmy.world
0 posts · 26 comments

Recent posts

No posts.

Recent comments

Screen sharing in video conferencing software (bbb, webex, meetme etc). It just doesn't work consistently. Sometimes (rarely) it just works as expected. Sometimes everybody sees a "black screen with a mouse pointer". Sometimes your screenshare is tiny and squeezed into a quarter of the virtual screen. Sometimes it's enlarged instead and doesn't fit into the virtual screen. Sometimes the popup (Wayland recording bridge???) doesn't show up. It's russian roulette basically, this shit definitely needs more eyeballs.

on Do you use vim? · c/linux · 1 pts · 81d

I like to press"Control-c" instead of ESC. It is more convenient to type and mostly does the same thing.

on Ich💩iel · c/ich_iel · 10 pts · 204d

Gibt es einen wichtigen Grund wieso man morgens kein Koffein zu sich nehmen sollte?

on 15 Signs Linux Is Not For You · c/linux · 7 pts · 238d

Most of these are not about the Linux kernel, but about distro / personal choice. Android tracks you and doesn't make you use the command-line a lot. Fedora / Ubuntu (and others?) like to reboot for every little update.

on GRUB Freezing on Boot · c/fedora · 1 pts · 241d

I'm not using grub anymore, but from my time when I did, I remember there's a "settings" file /etc/default/grub.

Carefully change some timeout-related settings there (for example, add GRUB_TIMEOUT=5). Your change in the settings file becomes effective (on next boot) after you re-generate the grub "config" using the following command: grub2-mkconfig -o /boot/grub2/grub.cfg. Then check if it the problem still persists.

Can you please post that file here? It should not contain any sensitive information.

on Bash scripting question · c/linux · 2 pts · 250d

Start your analysis by doing only the "detection" part:

find ./ -type f \( -iname \*.jpg -o -iname \*.png \)

Now look carefully at the output (or dump it to a file first, by appending something like > /tmp/files.txt). Does it look good to you? Maybe it's empty? See any spaces in filenames or directories?

Here's a sed stub that finds lines with whitespace:

echo -e "line with space\nline_without_space" | sed -E -n '/\s/p'

Get rid of the echo "'$dir'/'$base'", thats's too much to read. Instead, add sanity checks in your loop, like this:

[[ -f $file ]] || echo "file doesn't even exist: $file"

or this:

[[ -f "$dir/$base" ]] || echo "dirbase doesn't even exist: $dir/$base"

There may be other issues, but to handle whitespace in file names correctly, you need more quoting at least here:

dir="$(dirname "$file")"
base="$(basename "$file")"

Very useful for renaming a variable: * to search "word" under cursor. Try this with hlsearch on::set hlsearch. Then cw to change a match. Alternate n and . to quickly rename more occurrences of the word. Do a :noh to get rid of the highlighting. Maybe try :set noinc, some people prefer the traditional "non-incremental" search.

Do all this in normal mode. Vim experts leave insert mode as soon as possible. Almost forgot: Pressing C-c takes you back to normal mode without leaving home row.

Most important advice: Never touch arrow keys. Keep your fingers on the home row. Learn hjkl movement (focus on j and k, they are more important). Then get faster by using b, w, f, o, O, A, I, C-d and all the rest. Learn about J, it's cool. You won't get far without u and C-r though.

Critically important advice for fellow Europeans: If you care about vim, consider learning the US keyboard layout. Default bindings are not convenient in other layouts like qwertz (where is forward slash on qwertz? Hello?), and learning US layout might be easier than learning to customize vim. On a typical modern Linux system, there are US layout variants that still allow typing Umlauts, like EurKey or "DE-US", where you type ä by pressing RightAlt+a, for example.

Never use a && b || c. It is not the same as if a; then b; else c; fi: when a succeeds but b fails, it will run both b and c.

I would not bother with [ unless you absolutely need compatibility with non-bash shells.