Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
Mr Shiny Pants
Nov 12, 2012

RFC2324 posted:

Yup. Tried fixing perms on the executable :)

Ah, I thought you might, but you never know. :)

Adbot
ADBOT LOVES YOU

RFC2324
Jun 7, 2012

http 418

Mr Shiny Pants posted:

Ah, I thought you might, but you never know. :)

Never not cover the basics. I've been caught with the proverbial power cable unplugged often enough to not mind less obvious basics pointed out, and who checks perms on /usr/bin/su?

Very first thing I did was frantically check perms in .ssh/ even tho they have nothing to do with that part of the script lol

Its obviously an issue with the pseudo user that services run as being able to change security contexts inside an environment variable inside a script running as a service.

I'm just hoping someone has a workaround/fix thats better than my next step of just saving the commands output in a file and having it read that. Kinda feels like its defeating the purpose of keeping my security certifiates in a store

BlankSystemDaemon
Mar 13, 2009



If it's run by a shell script which the use of environment variables suggests, are you using sh -e?

RFC2324
Jun 7, 2012

http 418

BlankSystemDaemon posted:

If it's run by a shell script which the use of environment variables suggests, are you using sh -e?

I am not and will try that shortly.

And while I haven't torn it apart yet, borgmatic is an automation wrapper for borg backup, which lets you have a config file instead of passing a 300+ character command. Pretty sure it just assembles the settings and then issues the complex command, based on watching in ps faux

It bothers me that they use a different name for the variable in the settings than the underlying program for no obvious reason, but I doubt that matters (the two things appear to have identical values)

RFC2324 fucked around with this message at 18:13 on Jun 20, 2021

RFC2324
Jun 7, 2012

http 418

I just rechecked the error, and I don't see how sh -e would help

code:
Jun 20 01:44:11 computerborgmatic[13472]: CRITICAL runuser: cannot set groups: Operation not permitted
                                           passcommand supplied in BORG_PASSCOMMAND failed: Command '['/sbin/runuser', 'rfc', '-c', '/usr/bin/bash', '-c', '/usr/bin/gpg --export --armor rfc']' returned non-zero exit status 1.
we already know its failing.

here is the setting from the config.yaml
code:
    encryption_passcommand: /sbin/runuser rfc -c /usr/bin/bash -c "/usr/bin/gpg --export --armor rfc"
and I can test it as working here:
code:
# export BORG_PASSCOMMAND=$(/sbin/runuser rfc -c /usr/bin/bash -c "/usr/bin/gpg --export --armor rfc")
# echo $BORG_PASSCOMMAND
-----BEGIN PGP PUBLIC KEY BLOCK----- 

RFC2324
Jun 7, 2012

http 418

tested without the borgmatic wrapper, and had to modify the variable to this to make it work
code:
export BORG_PASSCOMMAND="/sbin/runuser rfc -c /usr/bin/bash -c '/usr/bin/gpg --export --armor rfc'"
so borgmatic is obviously wrapping it in quotes when it passes it to the environment.

oh, and borgmatic works when I invoke it from the cli, it just doesn't work from a systemd service.

BlankSystemDaemon
Mar 13, 2009



Is it a problem with nested quoting then? I have no other guess, but I'm not going to go look through systemd to find out.

RFC2324
Jun 7, 2012

http 418

BlankSystemDaemon posted:

Is it a problem with nested quoting then? I have no other guess, but I'm not going to go look through systemd to find out.

finally figured it out. the systemd unit file that came pre-packaged is locked down af and didn't allow for group changes. comment out all of the various restrictions and it started working.

I'm all for locked down stuff, but at least explain what your poo poo does if you release it

waffle iron
Jan 16, 2004
I would recommend using a drop in file instead of directly modifying a unit file installed by a package manager.

RFC2324
Jun 7, 2012

http 418

waffle iron posted:

I would recommend using a drop in file instead of directly modifying a unit file installed by a package manager.

don't worry, it wasn't. if you want to make it a service they have a couple of unit files on their git that you can grab. borgmatic is very much a do it yourself type solution, even if its automating something even more basic

also, I like to use systemctl edit --full anyway, its easier than hunting down the unit files. I also learned about systemctl show <foo> in the course of this, which was pretty cool.

Newf
Feb 14, 2006
I appreciate hacky sack on a much deeper level than you.
Are there any current linux distros that are specifically targeting lower spec machines? 3gb ram, "ultrabook" with a small ssd + touch screen?

Lord Stimperor
Jun 13, 2018

I'm a lovable meme.

Newf posted:

Are there any current linux distros that are specifically targeting lower spec machines? 3gb ram, "ultrabook" with a small ssd + touch screen?

Ubuntu Mate, Puppy Linux, Slax? There are roundups for low hardware Linux on the internet where you can compare them a bit like

https://itsfoss.com/lightweight-linux-beginners/


E: wait I'm sorry I didn't see that you were looking for touchscreen support specifically. I can't answer that part of your question sorry

Lord Stimperor fucked around with this message at 07:50 on Jun 22, 2021

VictualSquid
Feb 29, 2012

Gently enveloping the target with indiscriminate love.

Newf posted:

Are there any current linux distros that are specifically targeting lower spec machines? 3gb ram, "ultrabook" with a small ssd + touch screen?

I am running Manjaro with xfce on a similar machine. Originally even from the old windows restore partition which has 16GB size, but that was barely enough.
Running a rolling distro on a rarely used laptop was a mistake, but I am too lazy to switch.
The touch screen did left clicks out of the box, but enabling any right click mode was too complex for me.
Let me rant a bit: The ubuntu docs suggested that there is a graphical menu option in gnome to activate this, which is not exposed in any shell or other window manager. And of course it didn't ever acknowledge that other wms exist or that gnome sometimes reorganize menus. The docs for redhead suggested that you have to hand-patch your kernel to do this.

Zurtilik
Oct 23, 2015

The Biggest Brain in Guardia
Spent like two hours trying to get Ubuntu and Windows to dual boot and then I realized the one dumb thing I was doing and got it sorted out. Also apparently I installed my windows on Legacy instead of UEFI. Oops.


Anyway, with that out of the way I was ready to roll...

Ubuntu doesn't natively support my wifi adapter.

Went to bed.


I know I can wire it up if I need to, but I like my modem where it is and my computer isn't near it. RIP.

Should've just put wireless in my desktop when I built it to begin with but back then I was always wired.

I'm going to tinker around and look about the net with it more later this week. But if any kind soul somehow knows a way to get a Linksys WUSB6100M to work with Ubuntu uhhh, feel free to drop an answer.

Zurtilik fucked around with this message at 18:47 on Jun 23, 2021

Sheep
Jul 24, 2003
Does this not work? https://help.ubuntu.com/community/WifiDocs/Device/LinksysWUSB11

quote:

Prior to plugging it in, do the following:

install the firmware package: sudo apt-get install atmel-firmware

load the kernel module: sudo modprobe at76c50x-usb

Then plug in the WUSB11

To make sure it works, run lsusb. You should now see the device listed, along with its version and hardware chipset

Run iwconfig to see your wireless config; you should see a new wireless device.

Mr Shiny Pants
Nov 12, 2012

Zurtilik posted:

Spent like two hours trying to get Ubuntu and Windows to dual boot and then I realized the one dumb thing I was doing and got it sorted out. Also apparently I installed my windows on Legacy instead of UEFI. Oops.


Anyway, with that out of the way I was ready to roll...

Ubuntu doesn't natively support my wifi adapter.

Went to bed.


I know I can wire it up if I need to, but I like my modem where it is and my computer isn't near it. RIP.

Should've just put wireless in my desktop when I built it to begin with but back then I was always wired.

I'm going to tinker around and look about the net with it more later this week. But if any kind soul somehow knows a way to get a Linksys WUSB6100M to work with Ubuntu uhhh, feel free to drop an answer.

You can use mbr2gpt to convert your Windows installation to UEFI. I've used it in the past and does exactly that. I was quite surprised how easy it went.

Zurtilik
Oct 23, 2015

The Biggest Brain in Guardia
I will check that out!

Also, no luck on the adapter. Might just get a wireless card for my computer, less annoying than eating one of my USB ports anyway. IDK.

Uhhhh LINUX is a hassle to use when you're so new, and this is with Ubuntu which people claim to be the noob/normie friendly distro. I don't really have any real goal in mind with it though. I mostly just wanted to play around with it.

Mr. Crow
May 22, 2008

Snap City mayor for life
Is there a way to blacklist specific packages from specific repositories with DNF?

gstreamer is getting half updates from rpm-fusion and it's breaking my ability to use spice with VMs for some reason.

xzzy
Mar 5, 2009

I would disable the repo in question in the repo's config. This does mean when you do want to update it's manual but that's better than breaking your stuff.

You can put excludes= lines in the config for the repo too but I believe that also excludes that package from any other repo that also provides it.

Or you can use the versionlock plugin to pin the system to a specific version of an rpm.

RFC2324
Jun 7, 2012

http 418

Mr. Crow posted:

Is there a way to blacklist specific packages from specific repositories with DNF?

gstreamer is getting half updates from rpm-fusion and it's breaking my ability to use spice with VMs for some reason.

you can just lock the specific package in an uninstalled state using yum, I assume the functionality is in its successor

E: wait, is this packages you want a specific version from a different repo?

xtal
Jan 9, 2011

by Fluffdaddy
Does anyone have any advice for debugging why it would take like 30+ seconds for the kernel to prompt me for my password during bootup? (BTRFS + LUKS, no LVM.) I think it started pretty recently, but it affects all the kernel versions I have installed (5.2+).

systemd-analyze doesn't help since it's all kernel time. I turned up the verbosity parameter but I don't see it logging anything between "Starting systemd 247", waiting a long time and then asking for a password.

I've ran btrfs check and looked at SMART so far, all clean.

VictualSquid
Feb 29, 2012

Gently enveloping the target with indiscriminate love.

xtal posted:

Does anyone have any advice for debugging why it would take like 30+ seconds for the kernel to prompt me for my password during bootup? (BTRFS + LUKS, no LVM.) I think it started pretty recently, but it affects all the kernel versions I have installed (5.2+).

systemd-analyze doesn't help since it's all kernel time. I turned up the verbosity parameter but I don't see it logging anything between "Starting systemd 247", waiting a long time and then asking for a password.

I've ran btrfs check and looked at SMART so far, all clean.

Does it mount btrfs before asking for the password? That can take 30 seconds for some setups.

xtal
Jan 9, 2011

by Fluffdaddy

VictualSquid posted:

Does it mount btrfs before asking for the password? That can take 30 seconds for some setups.

No, that was just me being stupid. The btrfs is inside the LUKS container so the type of the FS must not be what's causing the issue. The bootloader is just on VFAT. Sorry for my confusion there.

xtal fucked around with this message at 19:16 on Jun 27, 2021

NihilCredo
Jun 6, 2011

iram omni possibili modo preme:
plus una illa te diffamabit, quam multæ virtutes commendabunt

Gentoo noob question!

I've got a headless Pi running gentoo, and I needed to extract a .7z archive, so I tried installing app-arch/p7zip. From what the wiki says, the package includes a GUI only if the wxwidgets USE flag is enabled.

Here's the output of emerge --ask --tree --verbose. It looks like it wants to install a bunch of stuff including Wayland:



I tried checking with euse -i wxwdidgets, and sure enough, the local flag is in state 'D', apparently required by some Qt ebook reader I absolutely don't want or need:

code:
# euse -i wxwidgets
global use flags (searching: wxwidgets)
************************************************************
[+  D   ] wxwidgets - Add support for wxWidgets/wxGTK GUI toolkit

local use flags (searching: wxwidgets)
************************************************************
[+  D   ] wxwidgets
    app-text/coolreader: Use x11-libs/wxGTK instead of Qt5
        [+  ] 3.2.2.1-r2 [gentoo]
        [+  ] 3.2.39 [gentoo]
        [+  ] 3.2.45 [gentoo]
        [+  ] 3.2.49 [gentoo]
I checked that nothing depends on this coolreader package with equery depends, and indeed nothing did. So I ran
code:
emerge --deselect app-text/coolreader
follow by
code:
 emerge -a --depclean[/url] to uninstall it. However, the latter command did absolutely nothing.

The output mentioned I should run an [code]emerge --update --newuse --deep @world
before the depclean, but that seems a little overkill (on a Pi it would take a night or so) and I didn't see such suggestions online, it seems deselect -> depclean is pretty standard. Am I missing something?

Cyber Punk 90210
Jan 7, 2004

The War Has Changed
I've been fiddling around with the Zorin OS 16 beta on my spare laptop and it's real pretty, It'll probably be my daily driver after release.

RFC2324
Jun 7, 2012

http 418

I tried to put opensuse tumbleweed on a rpi3b+ over the weekend and let me tell you.

It doesn't boot off sd if you have drives plugged into the usb slots, which makes it a terrible nas.

Also, either its terminally slow even with their cli only JeOS or I put it on a bad SD card. I'm thinking both based on the performance of the new Raspbian install vs the old one prior to this test. Gonna try wiping the old SD(which I kept for rollback) and copying the system I just put together over to it to see if that speeds it up

Paul MaudDib
May 3, 2006

TEAM NVIDIA:
FORUM POLICE
yo I loving suck at shell scripts and this is probably a thirty-second question if you know what you're doing, but it's stalling me out. The specific bit I'm stuck on is that it needs to take the output from git rev-list and parse it into three variables: commithash, filehash, and filename.

The command is:
code:
git rev-list --objects ${oldref}..${newref} --filter=object:type=blob
and you can replicate this by picking any two commit refs in any of your repos and using them as oldref and newref.

the output is:
code:
commithash
filehash1 path/to/file.ext
filehash2 path/to-file2.ext
So you get commithash on the first line and then a repeating sequence of filehash and filename. What's the easiest way to run the 'git rev-list' then assign commithash, filehash, and filename as shell variables as you loop across the file rows?

I've tried various permutations of the "read" multiline syntax but I haven't quite managed to get it yet.

Bonus points if there's a way to filter this using either the 'git rev-list' by file extension (is there a trivial way in shell script to get the file extension if it has one, and null if it doesn't? obviously if you do that it's just a "continue" statement if it doesn't match.)

(bash shell)

Paul MaudDib fucked around with this message at 06:34 on Jun 30, 2021

Methanar
Sep 26, 2013

by the sex ghost

Paul MaudDib posted:

yo I loving suck at shell scripts

code:
#!/bin/bash

i=1
while IFS="\n" read line; do
        if [ "$i" == "1" ]; then
                commithash=$line
                (( i++ ))
                continue
        fi

        filehash=$(echo $line | awk '{print $1}')
        filepath=$(echo $line | awk '{print $2}')

        if [[ $filepath =~ ^.*\.py$ ]]; then
                echo "py file"
	else
		echo "not a py file"
        fi

done < <(git rev-list --objects 9625be2ec2abde58375cad5a512a4bf66da93311..9a313569ae1ab8f6456b48f83f178ba1fd487449 --filter=object:type=blob)
If the repeating pattern eventually resets back to having just a commithash line. you'll want nested loops. One watching for each commithash subsection of files and then one to iterate over every file in the subsection.

Every line check if your line actually has two fields with awk or something, if not: break, because you've completed a subsection and need to re-parse the new commithash of the next section.

It's a gross solution to a gross text parsing problem.

Methanar fucked around with this message at 07:28 on Jun 30, 2021

Antigravitas
Dec 8, 2019

Die Rettung fuer die Landwirte:

NihilCredo posted:

Gentoo noob question!

I've got a headless Pi running gentoo, and I needed to extract a .7z archive, so I tried installing app-arch/p7zip. From what the wiki says, the package includes a GUI only if the wxwidgets USE flag is enabled.

Here's the output of emerge --ask --tree --verbose. It looks like it wants to install a bunch of stuff including Wayland:



I tried checking with euse -i wxwdidgets, and sure enough, the local flag is in state 'D', apparently required by some Qt ebook reader I absolutely don't want or need:

code:
# euse -i wxwidgets
global use flags (searching: wxwidgets)
************************************************************
[+  D   ] wxwidgets - Add support for wxWidgets/wxGTK GUI toolkit

local use flags (searching: wxwidgets)
************************************************************
[+  D   ] wxwidgets
    app-text/coolreader: Use x11-libs/wxGTK instead of Qt5
        [+  ] 3.2.2.1-r2 [gentoo]
        [+  ] 3.2.39 [gentoo]
        [+  ] 3.2.45 [gentoo]
        [+  ] 3.2.49 [gentoo]
I checked that nothing depends on this coolreader package with equery depends, and indeed nothing did. So I ran
code:
emerge --deselect app-text/coolreader
follow by
code:
 emerge -a --depclean[/url] to uninstall it. However, the latter command did absolutely nothing.

The output mentioned I should run an [code]emerge --update --newuse --deep @world
before the depclean, but that seems a little overkill (on a Pi it would take a night or so) and I didn't see such suggestions online, it seems deselect -> depclean is pretty standard. Am I missing something?

I don't quite understand you.

In your first screenshot you show that p7zip is being emerged with wxwidgets enabled. You state you don't need wxwidgets. I guess it's part of the profile you use (desktop profile perhaps)?

So, echo "app-arch/p7zip -wxwidgets" >> /etc/portage/package.use/p7zip should tell portage to not pull in wxwidgets for that package. If /etc/portage/package.use doesn't exist, create it.

For the second part: deselect and depclean are for removing packages from your list of desired packages and cleaning anything that isn't part of the dependency tree (and isn't on the list of desired packages) respectively. It won't do anything if the package in question isn't installed.

NihilCredo
Jun 6, 2011

iram omni possibili modo preme:
plus una illa te diffamabit, quam multæ virtutes commendabunt

Antigravitas posted:

So, echo "app-arch/p7zip -wxwidgets" >> /etc/portage/package.use/p7zip should tell portage to not pull in wxwidgets for that package. If /etc/portage/package.use doesn't exist, create it.

Oh, I didn't know that was an option! I thought that I had to get rid of the USE flags, and since I had that coolreader package installed, I needed to first uninstall it before I could remove the flag.

Thanks, it worked perfectly. Also the euse output I quoted didn't mean that coolreader was installed?

Antigravitas
Dec 8, 2019

Die Rettung fuer die Landwirte:
I'm not familiar with euse, so I don't know quite what the output is supposed to mean. But generally speaking, if coolreader isn't listed in your world file (/var/lib/portage/world) (or any other sets but that probably doesn't apply to you), and isn't required as a dependency, it'll be removed by emerge --depclean if it were installed.

Your world file lists anything you want to have installed on your system, and portage will try to pull in every package explicitly listed there and all of their dependencies.

I'd recommend using equery (part of gentoolkit) for interrogating packages and their dependencies, and eix (part of eix) for looking up packages, btw.

Amethyst
Mar 28, 2004

I CANNOT HELP BUT MAKE THE DCSS THREAD A FETID SWAMP OF UNFUN POSTING
plz notice me trunk-senpai
I'm writing a little thing that manipulates the color palette in the terminal emulator with ansi escape codes. I'm having a lot of trouble understanding the available documentation.

The wikipedia article on ansi escape codes is very useful and is actually the best, most comprehensive source i've found so far.

I've figured out that I can get terminal capability definitions from the terminfo database which is fine but don't really understand the format at all.

The "initialize color" function is described pretty well in the terminfo man page, but when I run the infocmp I get this:
code:
initc=\E]4;%p1%d;rgb\:%p2%{255}%*%{1000}%/%2.2X/%p3%{255}%*%{1000}%/%2.2X/%p4%{255}%*%{1000}%
I understand that this means the initc sequences begins with the escape character, then 4, then there is a decimal paramter (%p1%d). What I don't understand is what is going on with the other parameters.

%ps%{255}%*%{1000}. According to the terminfo man page the {255} and {1000} are just numeric constantcs, which means the second paramter is multiplied by 255000? why? and the %2 isn't documented anywhere I can find.

I've found usages in other peoples scripts, where thse parameters are just simple hex encoded strings, like so: "\0334;4;rgb;FF/7A/00\033\\" but I don't see how that conforms to the given format.

What I'm really confused abou tis there is another parameter sequence floating around in random scripts where the first paramter is a '?' and the others are omitted completely to query to color value. This does not appear anywhere in terminfo unless it's hidden in that format string somehow. I can't find ANY documentation on this at all, anywhere, besides a few random scripts on github! where is this info?

Somehow it's even more annoying that it actually works when I try it in a terminal emulator.

VictualSquid
Feb 29, 2012

Gently enveloping the target with indiscriminate love.

NihilCredo posted:

Oh, I didn't know that was an option! I thought that I had to get rid of the USE flags, and since I had that coolreader package installed, I needed to first uninstall it before I could remove the flag.

Thanks, it worked perfectly. Also the euse output I quoted didn't mean that coolreader was installed?

It means that the flag does something unusual for the coolreader package.

Paul MaudDib
May 3, 2006

TEAM NVIDIA:
FORUM POLICE
are there any gotchas or weird edge cases with sharing a hosts file between windows and linux?

linux should probably automatically understand loopback addresses (like, but not limited to, 127.0.0.1) without an explicit hosts file definition right? that's the one I can think of, and obviously I could define 127.0.0.1 for windows too.

I guess the other one is the default windows hosts file doesn't specify whether it supports multiple hostnames on a single line, like "10.0.0.50 myserver myserver.fqdn.com" but that's not really an issue in my home network obviously.

BlankSystemDaemon
Mar 13, 2009



The gotcha would be Unix-style vs Windows-style linebreaks.

EDIT: Also, make sure to check nsswitch.conf - and/or whatever nonsense systemd probably does to mess with that.

BlankSystemDaemon fucked around with this message at 21:03 on Jul 3, 2021

RFC2324
Jun 7, 2012

http 418

windows seems to support nfs well enough that I couldn't get it to stop connecting to my nfs/samba file server to test smb, so you could always do that

oh, this is true across platforms, some apps will handle network shares and some won't

BlankSystemDaemon
Mar 13, 2009



Windows doesn't support NFSv4, which is a shame because NFSv4 is a fundemental redesign, which integrates the mounting protocol, as well as rpc used for locking and statistics, plus it moves all traffic to just one TCP or UDP port (or SCTP port, on FreeBSD), making it much easier to have traverse gateways and firewalls/NAT.

Antigravitas
Dec 8, 2019

Die Rettung fuer die Landwirte:
NFSv4 also lets you use Kerberos principals instead of transmitting uid/gid over the wire, which is a massive improvement. Not only do client and server not have to agree on using the same uid/gid mappings, a compromised client can't impersonate other users anymore, you can have signed and encrypted NFS traffic, you can export to whole subnets and only allow clients from a trusted realm to connect, and so on.

It really is massively improved in all areas.

BlankSystemDaemon
Mar 13, 2009



NFSv4(.3, probably) will also let you do NFS over TLS, which FreeBSD is the first to implement - meaning you can do NFS over WAN.

Adbot
ADBOT LOVES YOU

Begall
Jul 28, 2008
I have a 10 year old HTPC/Home Server (currently on Ubuntu 18.04) that I’m going to be replacing (aside from storage) with all new hardware. 10 years ago for media purposes it ran Kodi and was directly connected to a display, but now it runs PMS and may as well be headless.

My plan for the new setup is to run everything inside either docker or VMs and avoid the absolute nightmarish mash up of random software that I’ve forgotten about, or forgotten how to configure, that I’ve accumulated over the last decade.

With that in mind, are there much better options for this purpose other than a minimal install of Ubuntu Server 20.04? That’s what I’m planning on currently but i don’t know if I’m missing a trick.

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply