bizdelnick

@bizdelnick@lemmy.ml

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

bizdelnick,

If the license you use is reallu permissive, it does not forbid the change to more restricted (copyleft). You also can use separate licences for code and resourses.

How do I see what pid/process has modified a linux routing table?

Anyone know how to see what pid/process has modified a linux routing table (specifically on Ubuntu )? I have an interesting problem where a route that I have created has been deleted over time, but can’t figure out what. I’ve tried rtmon but seems to only show timestamps of the adds/deletes

bizdelnick,

I guess it can be NetworkManager if it is used to configure the interface but the route is added manually.

bizdelnick, (edited )

There’s nothing special, it can be replaced with any TOTP/HOTP implementation. In particular, oathtool is supplied in most distros (it has only command line interface, probably there are also some GUI tools in your repos). However it does not support JSON key format that is provided as QR code for mobile 2FA apps. You have to copy and paste values from it manually.

However this will likely violate your employer’s security policy. The point of 2FA is that secret key is stored on a separate device, so that it cannot be stealed together with your password.

I recommend to try other Android apps on your phone. I use FreeOTP+ and have no problems with font readability. Some of my collegues use AndOTP and like it.

bizdelnick,

Yes, it is. You can achieve the same usung GUI of course, but this would be more difficult to describe because there are multiple GUIs and they change with new distro versions.

This is more convenient than “downloading and intalling” a file because you don’t have to track updates manually, the package manager will do this for you. You have to read something about what package manager is and how does it work. It is the main concept of all linux distros except LFS.

bizdelnick,

You don’t have to do everything through terminal. You can use synaptic for example. What you have to do is to learn new concepts. If you want to do everything like in windows, use windows.

bizdelnick,

This wiki article contains the information you need. It can seem too long, but I highly recommend to read it.

bizdelnick, (edited )

Lolwhat? It is the same in any distro: adding the repo and installing the app.

bizdelnick,

I don’t recommend using anything new to you unless you are ready to learn it. If you are, welcome aboard!

bizdelnick,

the .deb file would be the equivalent of an .exe file on Windows

Not .exe. If you want to find an equivalent, .msi is the closest.

bizdelnick,

I don’t like the idea of configuring pm (or anything else) using a programming language. So I would try nix first if I feel that I need it. However I don’t.

bizdelnick,

Thank you, I forgot this.

bizdelnick,

TLDR: Companies should be required to pay developers for any open source software they use

You need to read the article yourself before writing TLDR. Spoiler: it is not about payments, it is about source code availability.

bizdelnick, (edited )

Yes, but for a very specific case. I used to write highly portable scripts that could be executed in different environments (various linux distros, including minimal containers, freebsd and even solaris 10). I couldn’t use bash, perl, python and even gawk. Only POSIX shell (I always tested my scripts with dash and ksh93, for solaris 10 compatibility - with its jsh), portable awk (tested with original-awk, gawk and mawk) and portable sed (better forget it if you need to support solaris).

Before that I didn’t understand why should I need awk if I know perl. And awk really sucks. Once I had to replace a perl one-liner with an awk script of ~30 lines for portability.

P.S. I never use awk just for print $1 as many do. It’s an overkill.

bizdelnick, (edited )

I don’t think that formula is the right tool to do this. You need to write a macro.

Try asking at !libreoffice

What would be the best way for me to recover data from my old laptop's hard drive, which seems to have a bad superblock?

I got an external hard drive enclosure for the purpose of recovering some of the files from my old laptops hard drive. The hard drive and all of it’s partitions show up in both disks and gparted but it wont mount. When I tried to mount it manually, it gave the error message stating that it can’t read the superblock. I’ve...

bizdelnick,

Try testdisk. It can copy files from damaged filesystem without touching it. But only if you are lucky enough and the filesystem is not so heavily damaged that testdisk will be unable to find it.

bizdelnick,

Yes, it could find partitions removed long time ago if filesystem headers were not overriden.

My First Regular Expressions

I’ve been reading Mastering Regular Expressions by Jeffrey E.F. Friedl, and since nobody in my life (aside from my wife) cares, I thought I’d share something I’m pretty proud of. My first set of regular expressions, that I wrote myself to manipulate the text I’m working with....

bizdelnick, (edited )

It is a great book, although a bit outdated. In particular, nowadays egrep is not recommended to use. grep -E is a more portable synonim.

Some notes on you script:

  1. You don’t need to escape slashes in grep regex. In the sed s/// command better use another character like s### so you also can leave slashes unescaped.
  2. You usually don’t need to pipe grep and sed, sed -n with regex address and explicit printing command gives the same result as grep.
  3. You could omit leading slash in your egrep regex, so you won’t need to remove it later.

So I would do the same with


<span style="color:#323232;">tar -tzvf file.tar.gz | sed -En '/.(mp4|mkv)$/{s#^.*/##; s#.[.*##; s#[^a-zA-Z0-9()&-]# #g; s/ +/ /g; p}'
</span>
bizdelnick, (edited )

Well, technically it is possible with regex dialect that has lookarounds, but it is overcomplicated. There’s really no reason to do it.

bizdelnick, (edited )

The only one you really need to care about (especially under Linux) is PCRE,

Well, no. sed, grep, awk, vi etc. use POSIX regexes. GNU implementations also provide perl compatible mode via an unportable option. In modern programming languages like go and rust standard regex engines are compatible to RE2 - relatively new dialect developed in Google that is not described in the Friedl’s book (you may think of it as an extension of extended POSIX dialect). Even raku has its own dialect incompatible to perl as well as other ones.

Nowadays it is common to move away from perl-like engines, however they are still widely used in PCRE based software and software written in python, JS etc.

bizdelnick,

GNU grep, the most widespread implementation, does not include egrep, fgrep and rgrep for years. Distributions (not all, but many) provide shell scripts that simply run grep with corresponding option for backward compatibility. You can learn this from official documentation.

Also, my scripts are not full of bashisms, gnuisms, linuxisms and other -isms, I try to keep them portable unless it is really necessary to use some unportable command or syntax.

bizdelnick,

Perl has introduced powerful backtracking regexes that were widely adopted. However they can be damn slow in some cases, that’s why RE2 refused backtracking while using some perl-like elements. Both basic and extended POSIX regexes are also non-backtracking because they are older than perl.

bizdelnick,

It seems you need to read the official documentation yourself.

I did. Debian man page, GNU grep manual.

I’m sorry for your loss, however the egrep deprecation is a fact. Of course you can continue using it as a veteran, but it is not correct to recommend this to beginners.

  • All
  • Subscribed
  • Moderated
  • Favorites
  • localhost
  • All magazines
  • Loading…
    Loading the web debug toolbar…
    Attempt #