linux

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

kanzalibrary, in Linux Containers From Scratch in C

I just found myself that C is the worst programming language as many people say, but the security and simplicity is more than any language in security. Thank you so much for this!

TimeSquirrel, (edited )
@TimeSquirrel@kbin.social avatar

Nobody:

C: "Lemme just accept anything the user gives me, write beyond the input buffer, glitch out, and start executing whatever the fuck the user injects in there."

Still a decent language though, but like an oxy-acetylene torch, it's powerful tool, but you better know what you're doing.

krash,

How is C more secure than Rust? Doesn’t it lack features such as safe memory handling?

kanzalibrary,
LeFantome,

In that talk he called C “the worst language” and said he chose it to troll the industry. How does that support your point?

He also said that you should choose “least privilege” whenever possible. That is precisely the value that Rust brings over C. So how does that talk support the idea that C is more secure than Rust?

kanzalibrary,

I think you misunderstood or… don’t get the point “worst language” part from what he said. My point come from his point who’s more expert. If you think like that, what can I say? and I’m not trying convience you to understand too…

Back to your knowledge and understanding. But at least for me, I agree with him that rust is ‘hype-like’ or ‘pop culture’ thing. Like cyrpto (he said in ask session), but from technical perspective, that I personally understand. I just lost the source to explain this, but it’s up to you…

promitheas, in Messed up my fonts
@promitheas@iusearchlinux.fyi avatar

What is the process/commands you did to install the fonts?

toastal, in Flakes aren't real and cannot hurt you: a guide to using Nix flakes the non-flake way

I dunno, I don’t trust a guides still recommending flake-utils. You can make the same four loop in like 4 lines of Nix which is a smaller diff & doesn’t pollute your downstream consumers with a useless dependency. Flakes also don’t eliminate pointless builds, fileset or filtering the src can & the only tool with file tracking on by default is the Git VCS specifically (which also involves the intent to add flags which is the other side of annoying).

hallettj,
@hallettj@beehaw.org avatar

I sometimes write a flake with those 4 lines of Nix code, and it comes out just messy enough that tbh I’m happier adding an input to handle that. But I recently learned that the nixpkgs flake exports the lib.* helpers through nixpkgs.lib (as opposed to nixpkgs.legacyPackages.${system}.lib) so you can call helpers before specifying a system. And nixpkgs.lib.genAttrs is kinda close enough to flake-utils.lib.eachSystem that it might make a better solution.

Like where with flake-utils you would write,


<span style="color:#323232;">flake-utils.lib.eachSystem [ "x86_64-linux" "aarch64-darwin" ] (system:
</span><span style="color:#323232;">let
</span><span style="color:#323232;">  pkgs = nixpkgs.legacyPackages.${system};
</span><span style="color:#323232;">in
</span><span style="color:#323232;">{
</span><span style="color:#323232;">  devShells.default = pkgs.mkShell {
</span><span style="color:#323232;">    nativeBuildInputs = with pkgs; [
</span><span style="color:#323232;">      hello
</span><span style="color:#323232;">    ];
</span><span style="color:#323232;">  };
</span><span style="color:#323232;">})
</span>

Instead you can use genAttrs,


<span style="color:#323232;">let
</span><span style="color:#323232;">  forAllSystems = nixpkgs.lib.genAttrs [ "x86_64-linux" "aarch64-darwin" ];
</span><span style="color:#323232;">  pkgs = forAllSystems (system:
</span><span style="color:#323232;">    nixpkgs.legacyPackages.${system}
</span><span style="color:#323232;">  );
</span><span style="color:#323232;">in
</span><span style="color:#323232;">{
</span><span style="color:#323232;">  devShells = forAllSystems (system: {
</span><span style="color:#323232;">    default = pkgs.${system}.mkShell {
</span><span style="color:#323232;">      nativeBuildInputs = with pkgs.${system}; [
</span><span style="color:#323232;">        hello
</span><span style="color:#323232;">      ];
</span><span style="color:#323232;">    };
</span><span style="color:#323232;">  });
</span><span style="color:#323232;">}
</span>

It’s more verbose, but it makes the structure of outputs more transparent.

toastal,

Saving the dependency is pretty big since each flake you import will bring along its jungle of dependencies now in your downstream project. I can’t think of a use case where < 10 lines is worth a dependency—especially since as you noted, lib has the glue right there for you to put it all together.

Grass, in Is there any way to emulate aegis authenticator (fdroid) on an ubuntu based computer?

There are surely native totp apps for this on Linux and I haven’t used Ubuntu in a million years but if you really want to do specifically this maybe waydroid.

ElectroLisa, in Thoughts on this?
@ElectroLisa@lemmy.blahaj.zone avatar

Isn’t Linux about choice? If you don’t like Wayland/SystemD etc. then you can just not use it lol

zagaberoo,

Well of course, but some of us want to be well-informed on the tradeoffs we’re making.

Mango,

Performance isn’t about choice. It’s about the best choice.

ngn,
@ngn@lemy.lol avatar

it is but if 20 years later there are no apps that support xorg… well, you wont have the choice of running xorg

frazorth, (edited )

Isn’t Linux about choice?

No it isn’t.

www.islinuxaboutchoice.com

Jumuta, in Did deep sleep broke for anyone else recently or is it just me?

specs?

Tushta,

It’s 2021 Lenovo ThinkBoot 15 G2 Intl with Intel i3-1115G4, 8GB onboard ram, integrated GPU and two NVME slots.

Here are some lines from dmidecode if they mean anything to anyone:


<span style="color:#323232;">Getting SMBIOS data from sysfs.
</span><span style="color:#323232;">SMBIOS 3.3.0 present.
</span><span style="color:#323232;">Handle 0x0000, DMI type 0, 26 bytes
</span><span style="color:#323232;">BIOS Information
</span><span style="color:#323232;">        Vendor: LENOVO
</span><span style="color:#323232;">        Version: F8CN42WW(V2.05)
</span><span style="color:#323232;">        Release Date: 06/28/2021
</span><span style="color:#323232;">        Address: 0xE0000
</span><span style="color:#323232;">        Runtime Size: 128 kB
</span><span style="color:#323232;">        ROM Size: 16 MB
</span><span style="color:#323232;">        Characteristics:
</span><span style="color:#323232;">                PCI is supported
</span><span style="color:#323232;">                BIOS is upgradeable
</span><span style="color:#323232;">                BIOS shadowing is allowed
</span><span style="color:#323232;">                ACPI is supported
</span><span style="color:#323232;">                USB legacy is supported
</span><span style="color:#323232;">                BIOS boot specification is supported
</span><span style="color:#323232;">                Targeted content distribution is supported
</span><span style="color:#323232;">                UEFI is supported
</span><span style="color:#323232;">        BIOS Revision: 2.42
</span><span style="color:#323232;">        Firmware Revision: 2.42
</span><span style="color:#323232;">
</span><span style="color:#323232;">Handle 0x0001, DMI type 1, 27 bytes
</span><span style="color:#323232;">System Information
</span><span style="color:#323232;">        Manufacturer: LENOVO
</span><span style="color:#323232;">        Product Name: 20VE
</span><span style="color:#323232;">        Version: ThinkBook 15 G2 ITL
</span><span style="color:#323232;">        SKU Number: LENOVO_MT_20VE_BU_idea_FM_ThinkBook 15 G2 ITL
</span><span style="color:#323232;">        Family: ThinkBook 15 G2 ITL
</span><span style="color:#323232;">
</span><span style="color:#323232;">Handle 0x0002, DMI type 2, 15 bytes
</span><span style="color:#323232;">Base Board Information
</span><span style="color:#323232;">        Manufacturer: LENOVO
</span><span style="color:#323232;">        Product Name: LNVNB161216
</span><span style="color:#323232;">        Version: SDK0J40700 WIN
</span>
Jumuta,

so cat /sys/power/mem_sleep or whatever outputs with the brackets on deep?

Tushta,

Yeah, if the bracket is on deep, it crashes and enter the BIOS recovery thingy. If it’s s2idle, it does what it says on the tin.

ikidd, in Is anyone using awk?
@ikidd@lemmy.world avatar

Just had to use it today to turn a key file into a single string with line breaks:

awk ‘NF {sub(/r/, “”); printf “%s\n”,$0;}’ id_rsa

sibloure, in I have started using fedora silverblue

I’ve been using Silverblue as my main computer for a couple years now and love it. It just always works and is super solid. I layered on distrobox for any other software so I can pretty much run any Linux software ever needed and it’s cleanly organized in containers.

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

Your request goes against the unix philosophy. Grep does one thing and does it well. If you desire additional functionality, you should add another utility to accomplish what you want.

rsync -naP --exclude-from=rsync-homedir-local.txt /home/$USER/ $BACKUPDIR/ | grep denied

In your specific task, utilize bashims to do (what I think) you want:

rsync -naP --exclude-from=rsync-homedir-local.txt /home/$USER/ $BACKUPDIR/ || echo “task failed”

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

This is a troll, clearly. Purge this guy.

jackpot,
@jackpot@lemmy.ml avatar

?

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

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

Very well done list … Thx fellow penguin

mvirts, (edited ) in Wifi stopped showing in linux mint

I would check for kernel logs from the iwlwifi driver. If there is nothing in dmesg about it failing, maybe see if newer firmware is available for your device?

neurospice, in Terminal Utility Mega list!

gdu - basically ncdu written in go and much faster

bim - really lightweight text editor inspired by vim

Steamymoomilk,

added and will half to try gdu

kixik, (edited ) in What are your opinions of Guix?

These two posts are really enlightening:

How I Built My New Linux Gaming Desktop In 2021 With Amd Cpugpu And Gnu Guix

I Love Arch But Gnu Guix Is My New Distro

From the last, there is a non guix project including packages for guix, which are not officially supported given hey are not free software. I recommend taking a look at the last post at least, since it comes from someone who used Arch, and made the move to Guix, not just opinions from people like me, who haven’t ever used Guix.

That said, Guix is in my TODO list. The thing is that I want to learn a bit more than minimal Guile, so I can write packages myself (there are always missing packages, even on Arch/Artix + AUR, I always have the need to whether tweak something at some point, or create a package still not in there), and also deal with my own services to run with shepherd. So I don’t want to blindly try things out…

It shares with Nix the reproducible build of everything, but the language it uses is Guile, which has some history. Nix has its own language. To me that’s a plus on Guix. But the most important part, is that the official repos are all for free software, and then on the non guix project one can look for non free software pieces, which to me this is also a plus. I guest most might differ.

But again, if you want to try it, even if it’s just because of curiosity, why not doing it so? I hope those prior posts from someone who migrated there might be helpful.

CanadaPlus,

Yes, that’s a great review! Having one language for everything also sounds pretty great. A hard line on nonfree software is pretty tough, but I’m glad to hear you can “downgrade” back to the Linux kernel if you need to deal with a GPU or something.

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