Linux

8410 readers
154 users here now

Welcome to c/linux!

Welcome to our thriving Linux community! Whether you're a seasoned Linux enthusiast or just starting your journey, we're excited to have you here. Explore, learn, and collaborate with like-minded individuals who share a passion for open-source software and the endless possibilities it offers. Together, let's dive into the world of Linux and embrace the power of freedom, customization, and innovation. Enjoy your stay and feel free to join the vibrant discussions that await you!

Rules:

  1. Stay on topic: Posts and discussions should be related to Linux, open source software, and related technologies.

  2. Be respectful: Treat fellow community members with respect and courtesy.

  3. Quality over quantity: Share informative and thought-provoking content.

  4. No spam or self-promotion: Avoid excessive self-promotion or spamming.

  5. No NSFW adult content

  6. Follow general lemmy guidelines.

founded 2 years ago
MODERATORS
301
23
submitted 5 months ago* (last edited 5 months ago) by [email protected] to c/linux
 
 

Quick background for anyone who doesn't use tmux or screen: both are utilities that run in terminal that provide a bunch of nifty functionality. The big ones are:

  • The ability to disconnect from a remote host and reconnect via software like ssh or mosh, leaving the remote programs running. This also ensures that connection loss doesn't kill off remote programs, making it -- in my opinion, at any rate -- pretty essential for ssh, though mosh has more-limited built-in functionality.

  • The ability to have multiple virtual terminals in one. There are a bunch of ways to do this (the Linux kernel has multiple ttys, X11 window managers or Wayland compositors can provide virtual desktops with different graphical virtual terminal programs running on each, and some virtual terminal programs provide a way to run multiple virtual terminals, usually in a tab or something). I prefer this route, though, because among other reasons, it works everywhere.

But they also provide a lot of other handy functionality, including things like file transfer via the terminal (well, screen does), logging of what the current terminal is receiving, copy-pasting using vi or emacs keybindings, a terminal-level "status bar", and such.

But I was doing work on my tmux config, and thought that I'd go over my ~/.tmux.conf, since it addressed a few things that annoyed me, and I figure that other people might have crashed into. Maybe others could share some of their neat tmux or screen stuff, if they're in the moon:

unbind-key C-b
set-option -g prefix C-o
bind-key C-o send-prefix

This sets tmux to use "Control-o" as the "prefix key", which it uses before all other keybindings. Out-of-box, both screen and tmux grab keybindings which conflict with very-common emacs keybindings, C-a (beginning of line) and C-b (previous character), respectively. Control-o is only used by (what I'd call) a fairly-obscure emacs feature, which you can still access by hitting Control-o twice. If you use vi keybindings (including in bash and other programs that use readline, which default to using emacs-style keybindings), probably not necessary. Been using this for many years, ever since screen; it's apparently a very common problem for new tmux and screen users.

set-option -g status-bg black
set-option -g status-fg cyan

By default, tmux uses black text on a bright green background for the status bar; while this shows up well, for me, at least, this is kind of overwhelming. I prefer light text on a black background, or "dark mode", as it's popularly called these days. On some terminals, blue is hard to read out-of-box, and while I generally try to tweak my terminals to get it readable, cyan (bright blue) avoids this.

set-option -g status-left '#I|#H #(cut -d " " -f 1-4 /proc/loadavg)'
set-option -g status-right ""
set-option -g window-status-format ""
set-option -g window-status-current-format ""

The default tmux configuration follows a convention where, for each "window" one opens, there's a visual indicator showing a per-window entry. This is a common convention that many GUI programs use (opening a tab per window). Emacs traditionally has not done this, the idea being that you should be able to have many buffers open, that screen space is a limited resource and that if you want to switch the content that you're looking at, you're better-off bringing up a full-screen, scrollable list. tmux can do this with prefix-key w out-of-box. If you have, say, ten open, there isn't gonna be space to show 'em all. So I pull that out.

I do want to see the host, to ensure that I don't confuse a tmux instance running on Host A running ssh in a window with sshing to Host B and running tmux there.

Tmux defaults to showing a clock, which I get rid of with the above. I already have a clock on my desktop, and I don't see much sense in throwing them elsewhere in each terminal. Tmux even defaults to showing a large one if you hit prefix-key t, though I can't imagine that many people use that.

The current loadavg isn't essential, but it's a useful bit of status that tells one immediately whether some program is either still doing work or running away.

I don't use window names: just numbers; so I hide names. It's normally obvious from looking at a virtual termainal what something is, and switching by number is faster by keystroke.

set-option -g update-environment "DISPLAY WAYLAND_DISPLAY SWAYSOCK SSH_AUTH_SOCK"

This updates the environment variables in a tmux session when re-attaching. Various programs don't do well if you detach from one session, log out of a graphical session, and then log in again; this fixes those. DISPLAY is for X11, WAYLAND_DISPLAY for Wayland, SWAYSOCK for the Wayland Sway compositor (if you use that), and SSH_AUTH_SOCK for ssh-agent, which remembers a password to unlock an ssh key for a while.

bind-key H pipe-pane -o "exec cat >>$HOME/'tmux-#I.log'" \; display-message "Toggled logging to $HOME/tmux-#I.log"

This sets up tmux to provide functionality that screen has out-of-box -- if you trigger it, it will start logging the output of the current console to a logfile in your home directory. Useful when you've already started a program and it's spitting out information that you need a copy of, or if you want it to not disable color output (something that many programs do when they detect that their output is connected to a pipe rather than a tty); with my settings, Control-o H will toggle logging for a given window.

# emacs-style keys
bind-key C-n next-window
bind-key C-p previous-window
set -g mode-keys emacs
set -g status-keys emacs

I like emacs-style keys rather than vi-style.

bind-key C-c new-window -c "#{pane_current_path}"

While tmux has a default keybinding (prefix-key c) to create a new window at the current working directory that tmux was started at, it has no binding to start a new window at the current working directory being viewed in a window at the moment, something I frequently want to do -- this makes prefix-key Control-c open a new shell at that point.

set -g visual-bell on

Beeping is obnoxious and in an open environment, can be disruptive to other people; many people switched to having their terminal flash rather than beep years back; many programs supported "visual bell", which is just flashing rather than playing a sound. It's not so bad these days, as Linux machines aren't typically playing irritating beeps out of on-motherboard speakers, but in general, I don't like having things beep.

Anyone else got useful snippets that they'd like to share that they use with tmux or screen?

302
29
submitted 5 months ago* (last edited 5 months ago) by sharpiewater to c/linux
 
 

I’ve been daily driving arch Linux as my main distro for quite a while now, as a replacement for windows 11 (I refuse to use windows 11 for longer than it takes to download a Linux iso and format it into a usb). Installing it on my laptop wasnt my first time ever using it, but it was my first time really getting into any Linux distro beyond the Arch install that I did on a VM on my old desktop forever ago.

I’ve heard a lot of people say that arch is like super hard, but honestly after actually learning it I disagree. I think its difficulty is overstated. Of course it took getting used to, and I definitely had problems, but once I changed my outlook on how to handle problems (for one reading the wiki instead of going on forums) I found solutions much faster, and within a week of using it, I was already using the terminal for most tasks, to the point of it probably being excessive (for example when I tried hyprland I would launch programs that I didn’t have hot keys for with “example & disown ; exit”, instead of just using dmenu which I did have installed.

While browsing forums for solutions before my whole shift in how I approach problems, I noticed people being quite rude to beginners, telling them to run commands that would brick their installs (thank god I didn’t fall for that) and outright telling people to give up on Arch just because people would ask beginner questions on forums. I understand how it can be annoying to have to listen to the same beginner questions all the time, but I think we should just be POLITELY telling people to use the wiki and maybe some some wiki page related to their problem, instead of just being douchebags. It’s a bad mindset to treat beginners like that because we all started somewhere.

Ultimately while Arch does have a great community there are a couple of bad eggs in there. I also think the overhyping of how difficult arch is and how some people actually do think they are unironicaly better than the ubuntnoobs is a very bad thing, and I have seen it dissuade people I know who I think would love arch from even trying it.

I tried several windows managers, such as XFCE, KDE Plasma, Gnome, i3, and Hyprland. I think KDE looks nice and all but it uses too many system resources compared to XFCE to justify it for me (I don’t actually have resource problems but it bothers the optimiser in me), Gnome feels like a shitty tablet to me, i3 was great and I really enjoyed how lightweight and efficient it was to use (until I broke my config file), hyprland was heavenly to use (until I broke that Config file too) despite my slight annoyance over how it uses more resources than i3 (which makes sense all things considered). Right now I’m using XFCE as my main which I really enjoy. I got it looking very nice looking and it runs very well on my computer. I actually do prefer the tiling windows managers so I think I will experiment more with Hyprland and i3 before I fully settle on that.

As for other Distros, I did try out others after the fact on other computers. I installed mint on a laptop I had bought for my little sister, and honestly going from arch to having to use that to troubleshoot it for her, I found it to be inferior from the perspective of my personal tastes. When I experimented more with it on my old desktop, I found it to be bloated and it had a lot of programs I just didn’t need. I had the same issue with Ubuntu. I also tried putting Debian on my old desktop which so far I quite like much more than Ubuntu and Mint. I still prefer arch though as I think it has many advantages to Debian such as Pacman, the AUR, the amazing wiki, it’s fast updates, and the real sense I get that I’m building my system from the ground up. So I think I will continue to stick with arch as my main distro.

Would I reccomend arch to other Linux noobs as their first distro? Absolutely yes, but only if you are a specific type of person. If you just hate how bad Microsoft is , how bad windows 11 is, and you’re just looking for a simple out of the box alternative that works well, I would say use like Ubuntu or mint or something. But if you are a person who really likes technology, who wants to get good with computers, who really wants to understand linux, who enjoys tinkering, who enjoys solving problems (which the amount of problems arch has is overstated anyway), then I would say absolutely use arch as your first distro, but please read the wiki before you go to stack exchange or something lol. As a side note, I would discourage using an install script because I think that the install process for arch is a tutorial that will teach you a lot of skills and habits that will prepare you to handle problems you might have while using arch.

With that, thanks for reading my long rant, what do you all think?

Edit: reworded some things, improved grammar and sentence structure

303
 
 

A while ago I installed Arch on my new laptop, as an alternative to windows. I managed to get everything i needed to work on arch work with the exception of some programs that do have debian support. So, I deleted windows from my old desktop, and I am installing Debian on that. In other words I will now be daily driving Arch and Debian on two different computers. I have escaped the windows hell.

304
 
 

Hey all, sorry for the low level question, but basically I'm looking for the easiest way to set up something like a Windows AD. This would be for something like 10 computers at a local church where I do a lot of their infrastructure work. Is also be interested in sound something similar on my home network, but a while directory is probably overkill. And any suggestions on learnings or other suggestions appreciated!

305
 
 

I just have to say, after having booted into Windows, that Linux is so much nicer than Windows when it comes to doing system "updates."

So, here I am, sitting in my chair for about 20 minutes looking at a mostly black screen and a highly dubious looking percentage number going up very slowly. It tells me that Windows is "updating" and that I should keep the computer turned on. Good thing I have the computer turned on or I wouldn't know that I shouldn't have it turned off, right?

Anyway, I start to think about how this experience goes in Linux. In my experience, I do "system" updates about once a month, and I can see each individual package being installed (if I glance away from my browser session, that is). In Windows, I have no choice but to sit here and wonder if the system will even work again.

Windows decides that it wants to update drivers, apparently (I honestly have no idea what it's doing, which is part of what pisses me off), because it reboots the computer. Then it reboots again. Then, eventually, everything goes back to the familiar Windows desktop. WTF?

How anyone could prefer Windows to Linux is truly a mystery to me.

306
 
 

cross-posted from: https://feddit.nl/post/18702221

307
20
Polybar Scripts (github.com)
submitted 5 months ago by [email protected] to c/linux
 
 

I recently created a handful of scripts for polybar, to add some missing functionality that I wanted.

  • VPN status
  • dual battery info
  • connected bluetooth devices
  • available package updates

Thought I might share, in case anyone finds them useful or wants to modify them for other use cases.

Cheers!

308
 
 

Currently running Nobara, and having audio annoyances.

Any time any app loads anything new, it will switch my audio device back to default. For example, if I open a playlist in VLC and choose my speakers as the output device, when it's done playing one file, it will open the next one and start playing audio through the headphones.

If I'm watching a video on Youtube and choose speakers, as soon as I leave the page it goes back to headphones.

Is there a way to prevent the device in use from switching back? If I switch device, I just want it to stay on that device until I choose to switch back. I literally never want it to switch on its own. ATM, the only way is to manually go it and change the default every time instead of just clicking the checkbox in the volume popup.

309
 
 

cross-posted from: https://infosec.pub/post/15386345

Hi everyone,

This is my CONTAINERFILE for Bind9:

FROM debian

ENV LC_ALL C.UTF-8

# Update and upgrade system
RUN apt-get update -y && apt-get upgrade -y && apt-get dist-upgrade -y

# Install BIND 9 and sudo (for debugging if needed)
RUN apt-get install -y bind9 bind9-dnsutils bind9-libs bind9-utils sudo

# Configure permissions for BIND directories
RUN mkdir -p /var/cache/bind /var/lib/bind /var/log/bind
RUN chown -R bind:bind /var/cache/bind /var/lib/bind /var/log/bind
RUN chmod 664 /var/cache/bind /var/lib/bind /var/log/bind
RUN chmod -R 664 /var/cache/bind /var/lib/bind /var/log/bind

# Create and configure log files
RUN touch /var/log/bind/default.log /var/log/bind/update_debug.log /var/log/bind/security_info.log /var/log/bind/bind.log
RUN chown -R bind:bind /var/log/bind
RUN chmod 644 /var/log/bind/*.log

# Define volumes
VOLUME ["/etc/bind", "/var/cache/bind", "/var/lib/bind", "/var/log/bind"]

# Set the entrypoint to the named executable
ENTRYPOINT ["/usr/sbin/named"]

# Set the default command arguments for the named executable
CMD ["-g"]

I keep getting this error when I run it with podman:

26-Jul-2024 03:18:21.328 loading configuration from '/etc/bind/named.conf'
26-Jul-2024 03:18:21.328 directory '/var/cache/bind' is not writable
26-Jul-2024 03:18:21.332 /etc/bind/named.conf.options:2: parsing failed: permission denied

As you can see from the CONTAINERFILE, the bind user should be able to read and write to /var/cache/bind but for some reason it doesn't.

I have been at this for a while and I'm at my wits end. Your help is appreciated!

310
 
 

cross-posted from: https://tinkerbetter.tube/videos/watch/7a8dcd81-eae4-408c-8a42-7a1f6b89b49a

Has the internet told you Linux' "find" command is too scary to use? Well, they're wrong. Linux' "find" command - also found in lots of other *NIX systems - is a critical tool to learn. > > In today's Lil' Linux Lesson, I'll be demystifying the "find" command, and covering how it works with the "-exec" option, which I promise will make your life easier as a sysadmin, Linux user, or just any nerd who likes to play with the terminal. > > Lastly, this video wouldn't be possible without my monthly sustaining supporters on Patreon and Ko-Fi. Members get a bunch of cool perks- if my unsponsored videos help you, I appreciate your consideration! > > https://patreon.com/VeronicaExplains > https://ko-fi.com/VeronicaExplains > > 0:00 I say "greetings" and tell you why the find command is important > 1:24 Basic use of find, both GNU and BSD variants! > 2:46 Performing magic in the terminal with find -exec > 4:56 Some other parameters for find: -iname, -type, -user, -group, -perm, -size > 6:53 Why does find -exec end with a plus?

311
21
submitted 5 months ago* (last edited 5 months ago) by [email protected] to c/linux
 
 

The Linux ecosystem is vast and diverse, offering a multitude of distributions to suit every need and preference. With hundreds of distros to choose from, it’s a pity that most are rarely mentioned while the popular ones are constantly being regurgitated.

This thread aims to celebrate this diversity and shine a light on smaller projects with passionate developers. I invite you to pitch your favorite underappreciated distro and share your experiences with those lesser-known Linux distributions that deserve more attention.

While there are no strict rules or banlists, I encourage you to focus on truly niche or exotic distributions rather than the more commonly discussed ones. Consider touching upon what makes your chosen distro unique:

  • What features or philosophies set it apart?
  • Why do you favor it over other distros, including the popular ones? (Beyond “It just works.”)
  • In what situations would you recommend it to others?

Whether it’s a specialized distro for a particular use case or a general-purpose OS with a unique twist, let’s explore the road less traveled in the Linux landscape. Your insights could introduce fellow enthusiasts to their next favorite distribution!

312
313
4
Linux Myths (linux-myths.pages.dev)
submitted 5 months ago* (last edited 5 months ago) by [email protected] to c/linux
 
 
Linux Myths

A compilation of linux myths and misconceptions, busted and explained

Purpose

To catalog and provide useful responses to common linux misconceptions and myths. To serve as a useful reference for new and old users alike.


I'm not affiliated with the website or its creator(s).

314
 
 

Since upgrading from Plasma 6.0 to Plasma 6.1 my journald.service takes a longtime to boot.
systemd-journald.service takes 7-8 seconds. Even on a freshly installed system.

systemd-analyze:

Startup finished in 9.534s (firmware) + 6.112s (loader) + 3.281s (kernel) + 9.271s (userspace) = 28.200s

systemd-analyze critical-chain systemd-journald.service:

systemd-journald.service +7.853s └─systemd-journald.socket @428ms

systemd-analyze blame:

7.853s systemd-journald.service 2.152s systemd-modules-load.service 1.147s \x2esnapshots.mount 715ms NetworkManager.service 229ms dev-nvme1n1p2.device

how can I now further troubleshoot and maybe find a solution? has someone experienced same/similar? I can provide further info if needed, would appreciate very much if someone has an idea...

Edit: after working through it I came to the conclusion, that maybe Plasma isn‘t the issue here (since the „error“ happens way before graphical ui shows up), but more kernel related. Trying right now to get an older kernel running to see, if it confirms my assumption, but failed yet to do so…

315
316
 
 

OpenSuse leading the development in regards to boot security, an area in which Linux Distros are lagging behind other operating systems.

Full Disk Encryption is designed to protect data in cases of device loss, theft or unauthorized booting into an alternative operating system. Depending on the hardware configuration of a system, Aeon’s encryption will be set up in one of two modes: Default or Fallback.

Default Mode:

This mode utilizes the Trusted Platform Module(TPM) 2.0 chipset […], Aeon Desktop measures several aspects of the system’s integrity. These including:

  • UEFI Firmware
  • Secure Boot state (enabled or disabled)
  • Partition Table
  • Boot loader and drivers
  • Kernel and initrd (including kernel command line parameters)

These measurements are stored in the system’s TPM. During startup, the current state is compared with the stored measurements. If these match, the system boots normally.

317
 
 

Is it possible to expose the android media player when running an app in Waydroid? I'd like to be able to use my keyboard's physical media keys for controlling songs in a music app.

I'm running on Manjaro and using Wayland if that matters. Even better if it could work with KDE Connect as well.

318
319
320
 
 

I personally watch Linux User Space. No drama, no politics only Linux :D

https://www.youtube.com/channel/UCMePQAfCxotiG_2B5qYv4aQ

321
11
submitted 6 months ago by [email protected] to c/linux
322
 
 

I was looking for a TUI modern podcast manager, with support for syncing with the gpodder API, therefore allowing synchronization with Android clients such as AntennaPod. shellcaster was unmaintained and relatively easy to extend (huge thanks to the original author), therefore I aimed at fixing known bugs and adding the features that seemed more important. There is a TODO in the repo, which should be done as soon as I get some feedback from the community.

As far I know I am the only one using hullcaster as a daily driver (for archlinux people, AUR package hullcaster-git). Still, it should work as is in most linux environments.

For people coming from shellcaster, unfortunately I had to make too many breaking changes, therefore it is better to just make a clean install.

Feel free to try it and submit the issues you find. This is my first project using rust therefore there is surely space for improvements in many places.

323
324
 
 

Does immutable distros something significant over btrfs snapshots?

Beacuse if you set up grub or refind to auto-load new snapshots, immutable distros starts to look like over-engineered complexity.

So, am I missing something here?

325
 
 

A signal handler race condition was found in OpenSSH's server (sshd), where a client does not authenticate within LoginGraceTime seconds (120 by default, 600 in old OpenSSH versions), then sshd's SIGALRM handler is called asynchronously. However, this signal handler calls various functions that are not async-signal-safe, for example, syslog().

view more: ‹ prev next ›