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
ziasquinn
Jan 1, 2006

Fallen Rib

cruft posted:

I should be able to pass -D to nut-scanner

Pass -Deez nuts to the canner?

Adbot
ADBOT LOVES YOU

AlexDeGruven
Jun 29, 2007

Watch me pull my dongle out of this tiny box


jaegerx posted:

I broke 3 people because I use vi mode in zsh not emacs.

Yes kids, we still use vim.

I use vi mode in ksh on my AIX boxes.

But emacs? lol

We have a few devs that still use it because it has a couple of useful functions for the 4GL code they maintain, but otherwise, it's a ghost town.

xzzy
Mar 5, 2009

Mr. Crow posted:

I think you're confused, who the hell uses emacs
Just about everyone? :v:

emacs mode is the default state of most shells, it's the method that lets you use arrow keys or control commands to edit the command line or navigate the history.

vi mode gives you the insert mode to type stuff in and you tap escape to enter the command mode of vi to edit the command. It's cool but is the weird deviant way to shell.

AlexDeGruven
Jun 29, 2007

Watch me pull my dongle out of this tiny box


I guess I never thought about it (or forgot about it) as emacs mode. It's the default for bash, which is everywhere, and that's how I've thought about it since the beginning.

BlankSystemDaemon
Mar 13, 2009



I can't imagine using tcsh in emacs mode.

cruft
Oct 25, 2007

I use emacs.

AlexDeGruven
Jun 29, 2007

Watch me pull my dongle out of this tiny box


cruft posted:

I use emacs.

Found the beard grayer than mine.

Edit: or RMS has entered the chat 😂

cruft
Oct 25, 2007

I have a bunch of employees who use vi, which is fine, too.

Actually they swear up and down they only know vim, and then I find out they don't even know what "dd" does. Their "vim" usage technique is to press "i" and use the cursor keys and backspace A TON.

I don't understand how kids today reconcile themselves with such an incredibly painful and laborious method of editing text files.

So this leaves me, an emacs user, explaining to people how to do super basic vi stuff. I guess that makes me a vi expert by today's standards.

AlexDeGruven
Jun 29, 2007

Watch me pull my dongle out of this tiny box


Inertia is a helluva drug. I started out in vi, and I'll probably continue to use it until I'm done typing for my life. It's my default workflow and muscle memory, which I'm sure is true for most others with the shell/editor they cut their teeth on.

Pablo Bluth
Sep 7, 2007

I've made a huge mistake.
I use nano...

AlexDeGruven
Jun 29, 2007

Watch me pull my dongle out of this tiny box


Pablo Bluth posted:

I use nano...

Heretic!

cruft
Oct 25, 2007

Pablo Bluth posted:

I use nano...

Honestly, so do my aforementioned employees who claim to use vi.

Now that it lets you turn off word wrapping, nano is the right editor to teach new users.

AlexDeGruven
Jun 29, 2007

Watch me pull my dongle out of this tiny box


One thing that does piss me off is that nano is the default editor in Ubuntu and it's really difficult to change. The cognitive dissonance created when I type visudo and get dumped into nano...

spiritual bypass
Feb 19, 2008

Grimey Drawer
Is that controlled by $VISUAL or $EDITOR?

cruft
Oct 25, 2007

AlexDeGruven posted:

One thing that does piss me off is that nano is the default editor in Ubuntu and it's really difficult to change. The cognitive dissonance created when I type visudo and get dumped into nano...

It's not that difficult to change:

code:
export VISUAL=vi
Think of it as visudo, not visudo.

e: f,b

AlexDeGruven
Jun 29, 2007

Watch me pull my dongle out of this tiny box


cum jabbar posted:

Is that controlled by $VISUAL or $EDITOR?

That's the problem I ran into. I don't use Ubuntu much anyway, so the fact that it's now $VISUAL and not $EDITOR threw me.

See my previous statements about inertia, heh.

spiritual bypass
Feb 19, 2008

Grimey Drawer
iirc "visual" is an archaic distinction meaning "not a line editor"

cruft
Oct 25, 2007

AlexDeGruven posted:

That's the problem I ran into. I don't use Ubuntu much anyway, so the fact that it's now $VISUAL and not $EDITOR threw me.

See my previous statements about inertia, heh.

It's been $VISUAL since at least SunOS 4.2 (1982)...

If $VISUAL isn't set, it falls back to $EDITOR.

Why are there two? Well, in 1982, sometimes you logged in using one of these:



e: f, b AGAIN

`vi` started out as an extension to `ed` (or maybe `ex`, I don't recall). You'd pop into "visual mode" after starting, by typing `vi` at the `:` prompt.

cruft fucked around with this message at 15:51 on Mar 9, 2023

xzzy
Mar 5, 2009

The real travesty is hjkl navigation. I know arrow keys didn't exist at that point but I still despise the layout. At least make it ijkl so up/down makes sense.

cruft
Oct 25, 2007

xzzy posted:

The real travesty is hjkl navigation. I know arrow keys didn't exist at that point but I still despise the layout. At least make it ijkl so up/down makes sense.

But that positions your hand so that going northwest or southwest is a big long stretch.

cruft fucked around with this message at 15:55 on Mar 9, 2023

Pablo Bluth
Sep 7, 2007

I've made a huge mistake.

cruft posted:

Honestly, so do my aforementioned employees who claim to use vi.

Now that it lets you turn off word wrapping, nano is the right editor to teach new users.
My default is softwrap with line numbers shown in blue or red (depending on the terminal colors)

But the linux text editor closest to my heart will always be nedit.

Kibner
Oct 21, 2008

Acguy Supremacy

cruft posted:

But that positions your hand so that going northwest or southwest is a big long stretch.

In what way? It's just like WASD, but located on a different part of the board.

e: maybe this is just sarcasm that went over my head...

spiritual bypass
Feb 19, 2008

Grimey Drawer

cruft posted:

e: f, b AGAIN

That's what you get for making a higher quality post!!

F_Shit_Fitzgerald
Feb 2, 2017



cruft posted:

Actually they swear up and down they only know vim, and then I find out they don't even know what "dd" does. Their "vim" usage technique is to press "i" and use the cursor keys and backspace A TON.

I don't understand how kids today reconcile themselves with such an incredibly painful and laborious method of editing text files.

It's what they're used to. I can relate because I've had to train myself to think more in a "Linux" way when using vim rather than the Windows way of cursor keys and backspaces. It's an adjustment.

cruft
Oct 25, 2007

Kibner posted:

In what way? It's just like WASD, but located on a different part of the board.

e: maybe this is just sarcasm that went over my head...

In Nethack, T and Y are NW and NE; B and N are SW and SE.

But the real reason it's hjkl is that ^H is left, ^J is down, ^K is "vertical tab", and ^L is "line feed". ^I is tab, and it would have been weird to make the "go right to the next tab stop" key mean "go up".

AlexDeGruven
Jun 29, 2007

Watch me pull my dongle out of this tiny box


cruft posted:

It's been $VISUAL since at least SunOS 4.2 (1982)...

If $VISUAL isn't set, it falls back to $EDITOR.

Why are there two? Well, in 1982, sometimes you logged in using one of these:



e: f, b AGAIN

`vi` started out as an extension to `ed` (or maybe `ex`, I don't recall). You'd pop into "visual mode" after starting, by typing `vi` at the `:` prompt.

Ha, so I'm not as old as I feel sometimes.

BlankSystemDaemon
Mar 13, 2009



cum jabbar posted:

iirc "visual" is an archaic distinction meaning "not a line editor"
It's only archaic once ed(1) goes away - and if you've ever had to fix terminfo(5), you know how useful it can be.

cruft posted:

It's been $VISUAL since at least SunOS 4.2 (1982)...

If $VISUAL isn't set, it falls back to $EDITOR.

Why are there two? Well, in 1982, sometimes you logged in using one of these:



e: f, b AGAIN

`vi` started out as an extension to `ed` (or maybe `ex`, I don't recall). You'd pop into "visual mode" after starting, by typing `vi` at the `:` prompt.
Everything SunOS up to 4.x was based on BSD, and got its ex(1) from what was in 1BSD in 1976 that in 1979 evolved the visual mode that we know today.

The modern vi in the BSDs is a complete re-implementation known as "new vi" by Keith Bostic in 1980, and is still maintained to this day - though what with it being a mature piece of software, there's not exactly much churn in the tree.
It's worth noting that there's a split between nvi 1.x and 2.x, with NetBSD and OpenBSD favouring the former while FreeBSD and DragonFlyBSD favours latter - with the main difference between being support for BSD iconv (meaning proper Unicode support), Berkeley DB v3 locking, and file encoding detection.

ExcessBLarg!
Sep 1, 2001

jaegerx posted:

I broke 3 people because I use vi mode in zsh not emacs.
I've been using vi mode in bash forever. It's also quite helpful when doing poo poo from a phone.

cruft posted:

I don't understand how kids today reconcile themselves with such an incredibly painful and laborious method of editing text files.
Kids these days do all their "text" editing in Adobe Premiere.

AlexDeGruven posted:

That's the problem I ran into. I don't use Ubuntu much anyway, so the fact that it's now $VISUAL and not $EDITOR threw me.
"sudo update-alternatives --config editor" and don't look back.

jaegerx
Sep 10, 2012

Maybe this post will get me on your ignore list!


xzzy posted:

Just about everyone? :v:

emacs mode is the default state of most shells, it's the method that lets you use arrow keys or control commands to edit the command line or navigate the history.

vi mode gives you the insert mode to type stuff in and you tap escape to enter the command mode of vi to edit the command. It's cool but is the weird deviant way to shell.

I knew I liked you.

Yaoi Gagarin
Feb 20, 2014

its me, im the one person under 30 who ever used emacs as my primary editor. but nowadays i use sublime or vs code or actual fatass visual studio

jaegerx
Sep 10, 2012

Maybe this post will get me on your ignore list!


VostokProgram posted:

its me, im the one person under 30 who ever used emacs as my primary editor. but nowadays i use sublime or vs code or actual fatass visual studio

vim is my default, well nvim to be precise, but I will jump into vscode for some longer/bigger projects. It's just so loving easy to use when you're on a Mac or Linux desktop.

fletcher
Jun 27, 2003

ken park is my favorite movie

Cybernetic Crumb
Got a little further on my nut adventure....

nut-scanner found my device:
code:
root@02d9683e2ed8:~# nut-scanner -S --start_ip=192.168.1.83 --end_ip=192.168.1.83
Scanning SNMP bus.
[nutdev1]
        driver = "snmp-ups"
        port = "192.168.1.83"
        desc = "Eaton 5PX 1500 RT2U Netpack G2"
        mibs = "pw"
        community = "public"
I stuck that in my /etc/nut/ups.conf and then ran:
code:
upsdrvctl start
service nut-server start
Then I tried some of the commands from this page to no avail:
code:
root@02d9683e2ed8:~# upscmd -l nutdev1
Error: Connection failure: Cannot assign requested address
root@02d9683e2ed8:~# upsc nutdev1
Error: Connection failure: Cannot assign requested address
I thought this might have something to do with the fact that I'm trying all this in a docker container and maybe something about the way networking is handled was screwing it up, so I tried adding network_mode: "host" to my docker compose. Now it works!
code:
root@dev-vm:~# upsc nutdev1
Init SSL without certificate database
ambient.count: 0
battery.charge: 100
battery.charger.status: floating
...
I don't understand why I needed to do that though?

cruft
Oct 25, 2007

fletcher posted:

Got a little further on my nut adventure....

nut-scanner found my device:
code:
root@02d9683e2ed8:~# nut-scanner -S --start_ip=192.168.1.83 --end_ip=192.168.1.83
Scanning SNMP bus.
[nutdev1]
        driver = "snmp-ups"
        port = "192.168.1.83"
        desc = "Eaton 5PX 1500 RT2U Netpack G2"
        mibs = "pw"
        community = "public"
I stuck that in my /etc/nut/ups.conf and then ran:
code:
upsdrvctl start
service nut-server start
Then I tried some of the commands from this page to no avail:
code:
root@02d9683e2ed8:~# upscmd -l nutdev1
Error: Connection failure: Cannot assign requested address
root@02d9683e2ed8:~# upsc nutdev1
Error: Connection failure: Cannot assign requested address
I thought this might have something to do with the fact that I'm trying all this in a docker container and maybe something about the way networking is handled was screwing it up, so I tried adding network_mode: "host" to my docker compose. Now it works!
code:
root@dev-vm:~# upsc nutdev1
Init SSL without certificate database
ambient.count: 0
battery.charge: 100
battery.charger.status: floating
...
I don't understand why I needed to do that though?

So I was actually sort of impressed with the general quality and organization of the nut codebase. But the code running on your UPS? LOL.

SNMP runs over UDP, and maybe it's doing broadcasts? If so, the Linux kernel may not be able to associate the outgoing packet with inbound replies.

I mean, who knows *. If the only thing you're doing in this container is running this client periodically, there's no additional exposure by giving it the host network.

(* I could help you figure this out if you're just dying to know, but it's going to be a long and winding road)

fletcher
Jun 27, 2003

ken park is my favorite movie

Cybernetic Crumb

cruft posted:

So I was actually sort of impressed with the general quality and organization of the nut codebase. But the code running on your UPS? LOL.

SNMP runs over UDP, and maybe it's doing broadcasts? If so, the Linux kernel may not be able to associate the outgoing packet with inbound replies.

I mean, who knows *. If the only thing you're doing in this container is running this client periodically, there's no additional exposure by giving it the host network.

(* I could help you figure this out if you're just dying to know, but it's going to be a long and winding road)

Interesting! That's good enough for me :)

Thank you for the insight!! I appreciate it

JLaw
Feb 10, 2008

- harmless -
Got a display settings question, figured I'd run it by y'all first before diving into reddit etc.

This is in Pop!_OS 22.04 w/ NVidia card/drivers.

For various reasons I want to be able to programmatically switch between a couple of display-settings arrangements, let's call them "profiles". I have a collection of xrandr commands to do that.

In one case I am setting a monitor to 144 Hz. When I do that, the visible scaling goes to 200%. I can open the settings GUI and set "Scale" back to 100%, and all is well, but obviously I want to avoid the GUI.

I don't know what is causing the "Scale" change, and I don't know how to change it back. The output of "xrandr -q --verbose" shows no difference before and after correcting the scaling through the GUI. Same for the output of "dconf dump /".

Anyone know what the "Scale" widget in the display settings GUI is affecting, in Pop!_OS or more generally Gnome?


Hm one other thing actually, "xrdb -query | grep Xft.dpi" shows 192 instead of 96 in the 200% scale case. But I don't know much about what's going on in X resource stuff. It looks like I could force it back to 96 with "xrdb -merge" but that doesn't seem to affect the current active state of things.

cruft
Oct 25, 2007

JLaw posted:

Got a display settings question, figured I'd run it by y'all first before diving into reddit etc.

This is in Pop!_OS 22.04 w/ NVidia card/drivers.

For various reasons I want to be able to programmatically switch between a couple of display-settings arrangements, let's call them "profiles". I have a collection of xrandr commands to do that.

In one case I am setting a monitor to 144 Hz. When I do that, the visible scaling goes to 200%. I can open the settings GUI and set "Scale" back to 100%, and all is well, but obviously I want to avoid the GUI.

I don't know what is causing the "Scale" change, and I don't know how to change it back. The output of "xrandr -q --verbose" shows no difference before and after correcting the scaling through the GUI. Same for the output of "dconf dump /".

Anyone know what the "Scale" widget in the display settings GUI is affecting, in Pop!_OS or more generally Gnome?


Hm one other thing actually, "xrdb -query | grep Xft.dpi" shows 192 instead of 96 in the 200% scale case. But I don't know much about what's going on in X resource stuff. It looks like I could force it back to 96 with "xrdb -merge" but that doesn't seem to affect the current active state of things.

Hi, maintainer of 9wm here. Before I dive into trying to answer this, can you tell me what you get as output when you run:

code:
echo $WAYLAND_DISPLAY

JLaw
Feb 10, 2008

- harmless -
Yeah, not Wayland-ing here (yet... may try switching to that). That var is empty.

cruft
Oct 25, 2007

JLaw posted:

Yeah, not Wayland-ing here (yet... may try switching to that). That var is empty.

Okay, interesting. All the distros I use, Gnome = Wayland.

I was sort of hoping it was Wayland so there would be an avenue you hadn't checked yet. The fact that the DPI is halving is encouraging: it means X understands everything's gotten blown up.

I reckon the answer is "yes" but have you played with xrandr --scale?

Also, when you use the GUI control to scale back down to 100%, did you make sure you're still using the same frequency? Like, maybe for some weird reason this monitor halves the resolution at 144Hz?

Shooting in the dark here. I was really hoping it was a Weston thing.

JLaw
Feb 10, 2008

- harmless -

cruft posted:

I reckon the answer is "yes" but have you played with xrandr --scale?

Yah, it doesn't fix whatever is going on. "--scale 1" leaves it doubled. I remember trying other scale values to see if I could "cancel out" whatever is going on, and it gets the overall icon and window sizes etc back down to the right dimensions but some things are weird like the rightclick menu popup being truncated.

cruft posted:

Also, when you use the GUI control to scale back down to 100%, did you make sure you're still using the same frequency? Like, maybe for some weird reason this monitor halves the resolution at 144Hz?

Yeah using the GUI I can for sure get it to normal resolution/scaling at 144 Hz. Running some games in vsync verifies that they hit 144 FPS.

It's tantalizing to know that it's possible to get the correct state using the settings GUI... seems like there would have to be some way to do it with the CLI.

Adbot
ADBOT LOVES YOU

cruft
Oct 25, 2007

JLaw posted:

Yah, it doesn't fix whatever is going on. "--scale 1" leaves it doubled. I remember trying other scale values to see if I could "cancel out" whatever is going on, and it gets the overall icon and window sizes etc back down to the right dimensions but some things are weird like the rightclick menu popup being truncated.

Yeah using the GUI I can for sure get it to normal resolution/scaling at 144 Hz. Running some games in vsync verifies that they hit 144 FPS.

It's tantalizing to know that it's possible to get the correct state using the settings GUI... seems like there would have to be some way to do it with the CLI.

Well, if it wasn't quitting time on a Friday, I would dive into the code for the settings to see what's going on. But it is that.

Maybe I'll get a chance to grub around this weekend. Probably there's some weird quirk they found and coded up and (hopefully) left a comment about, that will hint you about what you need to do in this case. The DPI thing, yeah. That's making it seem within grasp.

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