linux

This magazine is from a federated server and may be incomplete. Browse more on the original instance.

canis_majoris, in I have started using fedora silverblue
@canis_majoris@lemmy.ca avatar

Silverblue rocks, I use it for my mission critical laptop.

For gaming it’s hard to beat Arch, still, because of how much active development is being put in by people like Steam.

canadaduane, in Is there such a thing as split-screen grep?
@canadaduane@lemmy.ca avatar

ChatGPT suggests the following:

  1. Run tmux
  2. rsync -naP --exclude-from=rsync-homedir-local.txt /home/$USER/ $BACKUPDIR/ | tee /tmp/rsync_output.txt
  3. Ctrl+B % # splits screen vertically
  4. Ctrl+B right-arrow-key # moves to right split
  5. tail -f /tmp/rsync_output.txt | grep denied

Not quite a one-liner, but I can see how tmux is a big help here.

mkwarman,

I know this isn’t an answer you’re looking for, but I’ll at least say that I find tmux to be infinitely useful and highly recommend checking it out

s38b35M5,
@s38b35M5@lemmy.world avatar

Tmux is also good for long operations, as tmux is running as a server and you can close the terminal while tmux chugs away. Others can also connect to the tmux session through ssh and share screens.

wuphysics87,

Don’t feed the beast.

lemmyvore, (edited ) in Is there such a thing as split-screen grep?

Run rsync, pipe to tee, and redirect the output to a named pipe (mkfifo). Open a second terminal and direct the named pipe into a grep command. Arrange the terminals in whatever way you want.


<span style="color:#323232;">mkfifo mypipe
</span><span style="color:#323232;">rsync | tee mypipe
</span><span style="color:#323232;">grep "denied" < mypipe
</span>
canadaduane,
@canadaduane@lemmy.ca avatar

Elegant and flexible, thank you!

TheAnnoyingFruit, in New Linux user here. Is this really how I'm supposed to install apps on Linux?

I think if you read through this you have pretty much everything you asked about. As for understanding what these sorts of commands do in the future I think ChatGPT is actually really useful for stuff like this with good documentation. Just ask what the commands do and it is usually quite helpful. Someone already said it but you have to want to learn this. If you want something easy to use and you don’t have to learn buy a Mac, you want great software compatibility buy a windows pc. If you want something that is more private and a community effort use Linux but unless you are using steam os on a steam deck it is not even close to being as user friendly as the others. I hope this changes but the current goals and mindsets of people in this community will prevent Linux from becoming easy to use and in the case of steam os you just need lots of money to make it an easy experience. There are a million other reasons that Linux’s current state is this way but this is the gist.

ReversalHatchery,

If you want something easy to use and you don’t have to learn buy a Mac, you want great software compatibility buy a windows pc.

That is very bad advice, as that may well not be a solution. There are people who want to use their computers without the ads, data mining and forced program defaults windows is doing.

That’s true that if people switch OS, they’ll need to learn a lot of new things. But don’t forget that not only sysadmins and adventurous people use Linux.

That being said, there are distros that give you a decent GUI frontend to the package manager, for example openSUSE

TheAnnoyingFruit,

Well what you said is true but this depends on the person you are recommending it. I didn’t know the op and generally can’t determine how interested they are in computers. I have friends who are just so use to their current understanding of using a computer with windows they wouldn’t be willing to learn anything else at all. They didn’t find yast easy to use because yes you have a gui for installing things but they don’t know all the things they need to install and it isn’t the most simplistic gui. Again you aren’t wrong it’s just that I’m hesitant to recommend people to use it unless they want the benefits of using Linux and are willing to learn.

library_napper,
@library_napper@monyet.cc avatar

ChatGPT is garbage in garbage out. It’ll probably tell you to curl a file off the internet and pipe it to bash as root.

TheAnnoyingFruit,

I’m just suggesting he ask ChatGPT to explain what commands he copied off the internet do. I don’t suggest asking it for commands

deathbird,

To translate the second sentence for OP: it’ll probably tell you to run a command to download a sus file and immediately run it as admin.

Critical_Insight,

I made this thread because I try to learn/understand

I have a Macbook, it’s what I use the most. I used to have Win7 on my gaming rig but Steam dropped their support for it so my options was either to go with a newer Windows or try Linux. As all of the games I play seemed to work on Linux with just minor tweaks I thought I’d give it a try. So far I’m really happy with how to OS works once it’s set up but it’s the setting up part that’s really confusing to me.

technologicalcaveman, in New Linux user here. Is this really how I'm supposed to install apps on Linux?

I know you're on ubuntu, but installing programs depends on your distribution. Some programs are in your software library, some aren't. But there will always be a way to get the program. For instance, I use Gentoo and Mullvad. The way I set it up is with Wireguard so I control it through the terminal, this is because Gentoo has no mullvad app. Otherwise, you can often add new libraries to your system. Again, on Gentoo Steam is not in my repository by default. So, I added the steam repository to my system so I could get it. For Mullvad, I'm pretty sure they offer a deb package, which Ubuntu can use. Otherwise, some other distributions offer a mullvad app in their repository by default. Try other distributions and see what clicks. A lot of linux is experimentation. I personally prefer doing a lot of things fairly manully, so I use Gentoo with essentially only a terminal for control. Linux Mint, Devian, Arch, Void, Nix, Gentoo; there's tons of choices so there's going to be something that you click with.

bjoern_tantau, in Is there such a thing as split-screen grep?
@bjoern_tantau@swg-empire.de avatar

I usually solve this kind of problem by piping to less or a logfile and then just searching in there. You can get it to refresh new content by pressing the End key twice. Or maybe less just needs the -f flag or something similar. I’m too lazy to look it up.

savedbythezsh, (edited )

less can enter a grep-like mode by hitting /

Edit: it’s &amp; for the grep mode, / is search.

caseyweederman,

More info: / only searches from cursor to end of file. ? searches from cursor to start of file.

savedbythezsh,

Oops yeah I just edited my comment, put the wrong symbol!

Atemu, (edited )
@Atemu@lemmy.ml avatar

That’s not at all grep-like. Grep is a line filter, not a character sequence highlighter.

savedbythezsh,

Oops sorry it’s &amp;! / is find

doppelgangmember, in Happy 1704067200 seconds since 1970

This is so Gnu to me!

redcalcium, in New Linux user here. Is this really how I'm supposed to install apps on Linux?

Chance that your Ubuntu version already supports OpenVPN and wireguard (check your settings -> network). If so, just download wireguard/OpenVPN config files from mullvad: mullvad.net/account/openvpn-config?platform=linux

rufus, in Is there such a thing as split-screen grep?

Couldn’t you just check the rsync exit codes? echo $? check if both return 0?

GenderNeutralBro, in New Linux user here. Is this really how I'm supposed to install apps on Linux?

That page lists multiple installation methods, for multiple distros. There simplest one for you is just two steps.

  1. Download .deb installer
  2. Run apt install ~/Downloads/MullvadVPN-*_amd64.deb

It’s not that complicated. That’s just confusingly written. And caters to a wide range of users.

library_napper,
@library_napper@monyet.cc avatar

Its more secure to go through a package manager. Checking signatures is important.

GenderNeutralBro,

You can verify the signature of the manual download as well. Either way, you are trusting the files you download over HTTPS from mullvad.net. There’s no real difference, except that when you use the repo, you are trusting it indefinitely, whereas if you download the deb directly, you are only trusting it once.

Using the repo is less secure, because it opens you to future attacks against the repo itself.

library_napper,
@library_napper@monyet.cc avatar

Https is vulnerable to loads of attack. That’s why we sign packages.

GenderNeutralBro,

You’re downloading the signing key over HTTPS either way, from the same server. That’s the common point of failure.

library_napper, (edited )
@library_napper@monyet.cc avatar

That’s why you download the key from multiple distinct domains from multiple distinct locations using multiple distinct devices and veryify their fingerprints match. If the key/fingerprint is only available on one domain, open a bug report with the maintainer.

GenderNeutralBro,

Agreed.

Unfortunately, Mullvad’s instructions just have you download the key from mullvad.net and add it in with no further validation.

You can also get it from their GitHub page, at least for the individual debs. Not sure if they have the repo key on GitHub.

where_am_i, (edited )

bad advise, OP should use a repo if they have apt

edit: yes, I understand, one day I’ll get rooted by whoever hacked the VPN app’s servers

GenderNeutralBro,

There’s nothing wrong with installing a .deb manually.

Personally, I’d hesitate to add any third-party repos unless there is a very good reason. In this case, the only real difference is that you won’t get the updates automatically with sudo apt update; sudo apt upgrade without the repo. Either way, the desktop app will notify you when updates are available. There’s very little advantage to using the repo.

Adding a repo is very rarely required. It has deeper consequences than simply installing an app, and requires a higher level of trust. If you don’t understand the security implications of adding a repo (and its associated key), then my advice is: just don’t.

library_napper,
@library_napper@monyet.cc avatar

Yes, there is. You’re risking downloading malicious software.

BoneALisa,
@BoneALisa@lemm.ee avatar

What are you on about? If you are using the 3rd party repo, you are just as likely to get malware than if you download the deb directly from the wbsite. Its literally the same thing, just adding the repo means that the malware could get installed automatically and without you knowing where it came from.

library_napper,
@library_napper@monyet.cc avatar

No, you’re confusing two vectors of attack. I’m saying that if you fan trust the vendor, then you’re still at risk from downloading malicious software that was manipulated between the vendor and you (man in the middle attack), unless you verified a signature using a key stores offline (note https is still vulnerable because the keys are stored online)

BoneALisa,
@BoneALisa@lemm.ee avatar

Not untrue, and I don’t think that the possibility should be glossed over, but honestly, what do you think is more likely: this specific person getting specifically MitM’ed by a bad actor, or a bad actor taking control of a repo that hundreds of people blindly trust. I have a sneaking suspicion that OP’s threat model isn’t sophisticated enough to need to really, truly, be worrying about that.

library_napper,
@library_napper@monyet.cc avatar

This sort of thing happens dragnet. And mullvad users are definitely a group to be targeted. Dont assume OP isnt a refugee or journalist and give them bad advice that could get them killed

BoneALisa,
@BoneALisa@lemm.ee avatar

If OP is a journalist or refugee at risk of being targeted and killed, my advice is don’t use a VPN, use TOR lol.

Falcon,

The Deb and ppa will have the same content, the ppa is just automatic, assuming the owner maintains it.

flashgnash, in Terminal Utility Mega list!

I love that the terminal based browser depends on firefox

skillful_garbage, in New Linux user here. Is this really how I'm supposed to install apps on Linux?

Download the .deb from their downloads page and run it, just like you would either a .exe on Windows. Their instructions list that as an option further down on the page. Should be higher up imo

library_napper,
@library_napper@monyet.cc avatar

They probably lowered it became mullvad is a security company and downlaoing .deb files from the Internet ia a vector for attack

ikidd, in Terminal Utility Mega list!
@ikidd@lemmy.world avatar

I’ve been playing with SSHwifty for a centralized browser based terminal gateway. You set up the docker and can then use it as a central gateway for ssh servers in your networks.

The setup is a bit opaque but the maintainer looks really helpful in the Issues pages.

bfg9k, (edited ) in Is there such a thing as split-screen grep?
@bfg9k@lemmy.world avatar

Funnily enough Astrogrep on Windows is great for this

notabot, in Is there such a thing as split-screen grep?

Tmux is a very helpful terminal multiplexer, meaning it can split your terminal into multiple panes. So, create two side by side panes, then one way of doing it is:

  • on the left, run your cmd | tee >(grep ‘denied’ > error.log)
  • on the right, run tail -f error.log

The tee process takes it’s standard in, and writes itbto both standard out, so you see all the lines, and the path it’s been given. The >(…) operator runs the grep in a subprocess, and returns the path to it’s standard input pipe, so grep receives every line, and writes the denied lines to a log file which you display with tail in the other pane.

Rather than using a file for error.log you could also use a named pipe in much the same way.

canadaduane,
@canadaduane@lemmy.ca avatar

Thanks! I’m curious if there is a way to do this as a one-liner?

notabot,

Sorry for th slow answer, I’ve been away. There is a way, if it’s still useful to you:

First, create a named fifo, you only need to do this once:


<span style="color:#323232;">mkfifo logview
</span>

Run your rsync in one pane, with a filtered view in the second:


<span style="color:#323232;">tmux new 'rsync ...options... |& tee logview' ; split-window -h 'grep "denied" logview'
</span>

Replace …options… with your normal rsync command line.

That should give you a split view, with all the normal messages on the left, and only messages containing ‘denied’ on the right.

The |& makes sure we capture both stdout and stderr, tee then writes them to the fifo and displays them. split-window tells tmux to create a second pane, and display the output of grep.

canadaduane,
@canadaduane@lemmy.ca avatar

Thanks!

  • All
  • Subscribed
  • Moderated
  • Favorites
  • linux@lemmy.ml
  • localhost
  • All magazines
  • Loading…
    Loading the web debug toolbar…
    Attempt #