i didnt care about how i wrote my bash scripts, coz i know theyd ultimately be used just by myself. but for the past few day, i’ve been working on this project, mk-blog which uses some bash scripts, there are chances that others might look at them. besides in work they’re asking me maintain a server. so why not learn the...
utilize awk if you need to process (=more complex than just grepping) large amounts of text.
make your awk code conform to at least busybox awk for compability
I once did a sh script that needed (because I wanted a challenge?) to be compatible with vanilla Android shell too. So I needed to test it with regular bash, busybox and mksh+toybox. That was ‘fun’.
I’ve had some initial plans to spllit the code out from that project and develop a “shell” library that would ease building shell scripts that are compatible with different systems… But I bet someone else has already done that.
I would then assume those scripts weren’t written properly to begin with.
But yes, shell scripts should be used (normally) to automate some simple tasks (file copying, backups…) or as an wrapper to exec some other program. I’ve written several shell scripts to automate things on my personal machines.
However shell script can be complex program while at the same time being (somewhat) easy to maintain:
functions, use functions, alot
comment every function and describe what it expects in stdin or as an arguments
also comment what it outputs or sets
This way at least I don’t break my scripts, when I need to modify a function or some way extend my scripts. Keeping the UNIX philosophy inside shell scripts: let one function do one thing well.
And of course: YMMV. People have wastly different coding standards when it comes to personal little(?) projects.
Really the hardest part of desktop linux for a regular, so called “internet user”, in the installation.
They don’t have no clue how to install an operating system, even windows.
I once installed CentOS workstation for my father on his ThinkPad. Firefox and Libreoffice is all he needs. Automatic updates in the background make sure all the latest security patches are applied. There have been few time when, after the update, the laptop hangs at boot. I’ve since told him to choose the second-to-last boot option from the “start-up menu” until the fix for the bug has been deployed (usually in within a 24h).
So really using Linux isn’t the hard part. Back in 2004 (ish) I went the painful route of installing my first Linux - Gentoo. But boy I learned a lot from it. Yes, I had a helping friend to get me over the hardest parts.
clean install: you make a backup, nuke the computer, install a fresh upgraded copy of the distro you want from a live usb, copy your data again to the computer....
Well, yeah. Hard drive failure can force a reinstall. And with laptops there isn’t usually another place for a hard drive, from where to restore the system.
sudo is a setuid binary, but it’s a fairly simple program
Some people would disagree to this.
The brief description of run0 already has too many potential points of failure.
If the “listener” is PID1, which will run the privileged command, in theory, it would be quite bullet proof (in a working system PID1 is always there). But since this is systemd, PID1 is much more than that and much more complex. On the other hand spawning another daemon from PID1 to be the “listener” makes it, perhaps, even more complicated. You’d have to make sure the listener is always running and have some process supervisor there to watch if it exits… and maybe even a watchdog polling it to make sure it isn’t frozen.
So my conclusion is the same as yours:
a solution in search of a problem
We already have a working solution. Have a well written SUID program. I’ve been using doas for some years now. It’s simple enough that I trust it.
Yes. I agreed with you. But I made it sound like something else. Bad wording on my side.
As I’m too Gentoo openrc user. I also use seatd+greetd instead of (e)logind and replacing sysvinit with openrc-init. The availability of choices made me do it!
Void offers musl too. Unless they’ve discontinued it.
But
compile everything yourself?
I do (almost) exactly that. I run Gentoo almost everywhere. The ‘almost’ is because Gentoo now offers an official bin repository too, so I can mix compiled and pre-compiled software. (Although you’ve always had the option to set up your own binary host).
Luis Chamberlain sent out the modules changes today for the Linux 6.6 merge window. Most notable with the modules update is a change that better builds up the defenses against NVIDIA’s proprietary kernel driver from using GPL-only symbols. Or in other words, bits that only true open-source drivers should be utilizing and not...
My first Gentoo install took like a week to get X running. It was my first foray into Linux (Ok, I briefly tried mkLinux).
I learnt the hard way, but I learnt. And I’m still on that same path: Gentoo. Why I don’t bother switching? Because I can customize Gentoo to whatever I like, so instead of doing distro hop I just reconfigure things.
bash coding standards?
i didnt care about how i wrote my bash scripts, coz i know theyd ultimately be used just by myself. but for the past few day, i’ve been working on this project, mk-blog which uses some bash scripts, there are chances that others might look at them. besides in work they’re asking me maintain a server. so why not learn the...
SSH as a sudo replacement (whynothugo.nl)
“Systemd is the future” (www.phoronix.com)
Initially the bug report was shot down by systemd developer Luca Boccassi of Microsoft with:...
What is/was your distrohopping journey?
For me it was:...
Federal agency warns critical Linux vulnerability being actively exploited (arstechnica.com)
AsahiLina: ✨ We got a bunch of Steam games to run on Asahi Linux!!! ✨ (vt.social)
Update : more games!
It's time to move to Linux - YouTube (youtube.com)
when you upgrade an OS, do you clean install or upgrade?
clean install: you make a backup, nuke the computer, install a fresh upgraded copy of the distro you want from a live usb, copy your data again to the computer....
Systemd Looks to Replace sudo with run0 (news.itsfoss.com)
HDMI Forum Rejects Open-Source HDMI 2.1 Driver Support Sought By AMD - Phoronix (www.phoronix.com)
For three years there has been a bug report around 4K@120Hz being unavailable via HDMI 2.1 on the AMD Linux driver....
Root access vulnerability in glibc library impacts many Linux distros (securityaffairs.com)
Should I switch to Wayland?
Hey Community,...
Linux 6.6 To Better Protect Against The Illicit Behavior Of NVIDIA's Proprietary Driver (www.phoronix.com)
Luis Chamberlain sent out the modules changes today for the Linux 6.6 merge window. Most notable with the modules update is a change that better builds up the defenses against NVIDIA’s proprietary kernel driver from using GPL-only symbols. Or in other words, bits that only true open-source drivers should be utilizing and not...
I successfully installed Gentoo for the first time today! (lemmy.world)
Screenshot of QEMU VM showing an ASCII Gentoo Logo + system info...