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
BlankSystemDaemon
Mar 13, 2009




VictualSquid posted:

That reminds me: While cleaning up I found a simple sed script that I used to use to help organize some :files: back then.
I wrote it, but I haven't used it for over 10 years
code:
find -not -type d | sed -n -e 'h;s/^\.\|\.\///;s/\//\-/g;s/ /_/g;s/[^[:alnum:]\._-]//g;s/\.\(.*\.\)/\1/g;s/[_-][_-]\+/-/g;H;g;s/\([^[:alnum:]]\)/\\\1/g;s/\\\n/ /;p' | xargs -l mv --backup=simple -v 
Wouldn't you need to -exec sed … {} + instead?

VostokProgram posted:

Emacs is great, I don't use it as much anymore but it was my main editor for a while
Emacs is a good OS.
It's a shame about the lack of a good editor.

RFC2324 posted:

vi(m) is the default editor that exists on basically every unix-like system in existence. if you are gonna janitor servers, you need to know it.
Not only that, but unless you're an emacs user, you should probably switch your line editing mode to vi with set -v vi.
Unless, of course, you're a (t)csh user, because it uses vi line editing - which isn't really very surprising.

waffle iron posted:

I do all my coding in cat and output redirection.
Real system operators use ed.

Jokes aside, I found it pretty useful to at least know how to use ed enough to rescue a system, which got had its termcap (terminfo-equivalent for Linux users) blown up by someone who probably shouldn't have had superuser access, without bringing the system down for maintainable.

Adbot
ADBOT LOVES YOU

Bob Morales
Aug 18, 2006


Just wear the fucking mask, Bob

I don't care how many people I probably infected with COVID-19 while refusing to wear a mask, my comfort is far more important than the health and safety of everyone around me!

Am I the only dude who still uses Sublime?

VictualSquid
Feb 29, 2012

Gently enveloping the target with indiscriminate love.

BlankSystemDaemon posted:

Real system operators use ed.

Jokes aside, I found it pretty useful to at least know how to use ed enough to rescue a system, which got had its termcap (terminfo-equivalent for Linux users) blown up by someone who probably shouldn't have had superuser access, without bringing the system down for maintainable.
I once learned the basics of ed to win a bet. It is pretty easy if you are already up on vi and regex.

But the one time I almost needed it, ed wasn't actually installed. The gentoo minimal install (of 15 years ago) didn't come with either ed or vi. It had nano instead.

Yaoi Gagarin
Feb 20, 2014

Bob Morales posted:

Am I the only dude who still uses Sublime?

I use it every day for work.

Armauk
Jun 23, 2021


drunken officeparty posted:

Please tell me these are relics of the late 80s and nobody actually uses these anymore.
Not at all. I've been using Emacs for decades, as many other people. It's a text editor for a lifetime.

ExcessBLarg!
Sep 1, 2001
The other nice thing about using the same tools for decades is they never really go obsolete. Are Eclipse, Sublime, whatever obsolete now? I don't know, never used them.

BlankSystemDaemon
Mar 13, 2009




VictualSquid posted:

I once learned the basics of ed to win a bet. It is pretty easy if you are already up on vi and regex.

But the one time I almost needed it, ed wasn't actually installed. The gentoo minimal install (of 15 years ago) didn't come with either ed or vi. It had nano instead.
If you know vi and regex, there's barely anything more to learn.

So the Gentoo minimal installation is not POSIX compatible?

BlankSystemDaemon fucked around with this message at 15:47 on Oct 19, 2021

RFC2324
Jun 7, 2012

http 418

Gentoo minimum installation has always been... Creatively non-standard in some way.

Its part of the challenge. Gentoo is linux hardmode

MustardFacial
Jun 20, 2011
George Russel's
Official Something Awful Account
Lifelong Tory Voter

Mr. Crow posted:

I had to lookup what this means is this still what people do? Whats the use-case that ansible or some other configuration management tool doesn't do better?

Look at this guy using automation like his infrastructure isn't built on decades of tech debt and cruft.

I do what I can with what I have. Automation is coming, but I've got to fix everything else first.


In any case, I think I've settled on MobaXTerm for the time being. It seems to do everything I want and it's not crazy expensive. Thanks for the advice everyone.

BlankSystemDaemon
Mar 13, 2009




Speaking of shells (or not, as the case may be): FreeBSD switched the default shell for root to be /bin/sh.

Sheep
Jul 24, 2003
I was asked in an interview about my preferred editor and I almost reported them to the EEOC for asking about religion.

vim is the correct answer.

RFC2324
Jun 7, 2012

http 418

Its so nice to see that the editor wars are finally over

And emacs so resoundingly lost

Elias_Maluco
Aug 23, 2007
I need to sleep
I use sublime for most text related stuff, nano on the command line, and an IDE (phpstorm) to do actual work

I hate vim and found emacs way over my head when I tried it decades ago

Chilled Milk
Jun 22, 2003

No one here is alone,
satellites in every home

Bob Morales posted:

Am I the only dude who still uses Sublime?

Kinda regret renewing my key for ST4 but yeah I still use it. Day job big project coding I've switched back to Vim for since I'm already in the terminal all day for that. But Sublime's my default GUI text editor, it's still nice for quick edits. May as well make use of the license.

Nitrousoxide
May 30, 2011

do not buy a oneplus phone



Atom is my usual go-to GUI text editor, though I sometimes use Visual Studio Code. Atom's got pretty much all the plugins I need though.

I rarely use the command line editor if I can avoid it, so it's not worth it to install a new one. I usually just stick with whatever the distro ships with, usually Nano.

RFC2324
Jun 7, 2012

http 418

For GUI I use sublime text on my work mac, and on the rare occasion I find myself on a Linux GUI I favor Kate.

drunken officeparty
Aug 23, 2006

Maybe I am misunderstanding what a person who’s job is using linux/vim actually does. Surely you don’t mean that you are actually doing fully fledged programming, creating applications that people will use? Why would you do that to yourself? To look like a CSI hacker mashing away on the keyboard?

Methanar
Sep 26, 2013

by the sex ghost

drunken officeparty posted:

Maybe I am misunderstanding what a person who’s job is using linux/vim actually does. Surely you don’t mean that you are actually doing fully fledged programming, creating applications that people will use? Why would you do that to yourself? To look like a CSI hacker mashing away on the keyboard?

Why not

Methanar posted:

Here's what typical vim use looks like. good luck
https://www.youtube.com/watch?v=bzja9fQWzdA

Bob Morales
Aug 18, 2006


Just wear the fucking mask, Bob

I don't care how many people I probably infected with COVID-19 while refusing to wear a mask, my comfort is far more important than the health and safety of everyone around me!

drunken officeparty posted:

Maybe I am misunderstanding what a person who’s job is using linux/vim actually does. Surely you don’t mean that you are actually doing fully fledged programming, creating applications that people will use? Why would you do that to yourself? To look like a CSI hacker mashing away on the keyboard?

What do you think people use it for

xzzy
Mar 5, 2009

When I need to edit a text file, I use vim. Linux administration involves many text files because the system is configured with text files.

Though these days I edit those config files less, and do more work writing puppet manifests to edit the config files for me. I still do all that in vim.

drunken officeparty
Aug 23, 2006

Bob Morales posted:

What do you think people use it for

I don’t know. That’s what I’m wondering.


Like I don’t have a clue how to program. Can’t write a line of it in any language, don’t particularly want to learn. But compare that video posted to something like this

https://www.youtube.com/watch?v=PGuxfdyaKJU

drunken officeparty fucked around with this message at 19:28 on Oct 20, 2021

BlankSystemDaemon
Mar 13, 2009




drunken officeparty posted:

Maybe I am misunderstanding what a person who’s job is using linux/vim actually does. Surely you don’t mean that you are actually doing fully fledged programming, creating applications that people will use? Why would you do that to yourself? To look like a CSI hacker mashing away on the keyboard?
Just because IDEs exist, doesn't mean that everyone has to or likes to use them.
For example, the vast majority of code for the BSDs, from the late 70s and to now, has been written in vi(m) or emacs.

Part of it is also just that an IDE is the antithesis of the old Unix philosophy of doing one thing and doing it well.
Using vi(m), (BSD)make (and /usr/share/mk), LLVM, kyau/ATF, git, ctags, and cscope gets you basically everything that an IDE can do.

As an example, here's a FreeBSD committer working on some stuff:
https://www.youtube.com/watch?v=5tF8tT0DIi4

BlankSystemDaemon fucked around with this message at 19:09 on Oct 20, 2021

VictualSquid
Feb 29, 2012

Gently enveloping the target with indiscriminate love.

drunken officeparty posted:

Maybe I am misunderstanding what a person who’s job is using linux/vim actually does. Surely you don’t mean that you are actually doing fully fledged programming, creating applications that people will use? Why would you do that to yourself? To look like a CSI hacker mashing away on the keyboard?

Vi is perfect for making small edits to config or script files. You install some new software, have to change a few lines and values, and vi is perfect for that. There are a few enormously effective commands, like ctrl-x crtl-f or cE or especially (embarrassingly):w !sudo tee %, that would need you to hunt supprisingly long to find an alternate editor. Especially because it works through a ssh login.

For actual coding of large projects I use an ide.
Now you can turn vi into an ide using plug-ins and settings, but it is surprisingly system dependent in my experience and not really worth the trouble. I did write my master's thesis in vi and loved things like the fold system, which is somehow superior to what more modern ides offer for some reason. But that was mostly because I wanted to use the same editor in linux at home and in solaris at uni. And I actually did most of the actual coding in matlab's official ide.

And then there is vimdiff, which many people use despite not using vi otherwise.

The question is more, what do you want to use instead?

VictualSquid fucked around with this message at 19:16 on Oct 20, 2021

minato
Jun 7, 2004

cutty cain't hang, say 7-up.
Taco Defender

drunken officeparty posted:

Maybe I am misunderstanding what a person who’s job is using linux/vim actually does. Surely you don’t mean that you are actually doing fully fledged programming, creating applications that people will use?

vim reduces the friction between intention and action, so I can work faster. If I want to move a line of code up 2 lines then I move the cursor there, hit dd to delete the line and copy it to the buffer, kk to move up 2 lines, and p to paste. Done in less than a second (and without moving my hands off the keyboard) and then I'm onto the next thing.

Compare with a mouse-based IDE, where I'd (presumably) move my hand to the keyboard to the mouse, select the whole line, Ctrl-X, reposition the mouse at the start of the target, Ctrl-V, and then twiddle with any messed up newlines that were added/removed by mistake. Maybe 5 seconds if I'm fast.

All this extra time not only adds up, it just feels worse; I'm spending time aiming a cursor, not thinking about what I want to do next.

Yaoi Gagarin
Feb 20, 2014

I never code fast enough for vim to be an improvement over normal keyboard shortcuts like pgup/pgdown, home/end, etc

Kevin Bacon
Sep 22, 2010


i do all my coding in notepad.exe running on wine

Mr. Crow
May 22, 2008

Snap City mayor for life

MustardFacial posted:

Look at this guy using automation like his infrastructure isn't built on decades of tech debt and cruft.

I do what I can with what I have. Automation is coming, but I've got to fix everything else first.


In any case, I think I've settled on MobaXTerm for the time being. It seems to do everything I want and it's not crazy expensive. Thanks for the advice everyone.

Wasn't trying to be a dick.

Ansible supports ad-hoc commands if you're not aware which might help you migrate towards a more modern architecture and avoid spending the money.

NihilCredo
Jun 6, 2011

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

minato posted:

vim reduces the friction between intention and action, so I can work faster. If I want to move a line of code up 2 lines then I move the cursor there, hit dd to delete the line and copy it to the buffer, kk to move up 2 lines, and p to paste. Done in less than a second (and without moving my hands off the keyboard) and then I'm onto the next thing.

Compare with a mouse-based IDE, where I'd (presumably) move my hand to the keyboard to the mouse, select the whole line, Ctrl-X, reposition the mouse at the start of the target, Ctrl-V, and then twiddle with any messed up newlines that were added/removed by mistake. Maybe 5 seconds if I'm fast.

All this extra time not only adds up, it just feels worse; I'm spending time aiming a cursor, not thinking about what I want to do next.

I think every code editor made since like 2010 has had Alt+up/down arrow to move line(s) of text up and down :ssh:

ExcessBLarg!
Sep 1, 2001

drunken officeparty posted:

urely you don’t mean that you are actually doing fully fledged programming, creating applications that people will use?
I do systems engineering so it's not so much user-facing applications, but yes I do all my professional work in VIM, supplemented with shell, GDB, etc.

drunken officeparty posted:

Why would you do that to yourself?
Because I'm really good with it. The occasion I have to compile something in some old version of Visual Studio on an RDP session is a nightmare for me.

Realistically most large software projects involve as much debugging/editing of existing code as much as writing new code and VIM's modal interface is especially good at the former.

Also, my primary desktops since 2014 have been Chromeboxes/Chromebooks and I do (and have always done) all programming over a terminal. This works well because my daily hardware is cheap, disposable, and easily replaceable. Also I can push fixes in a pinch over my phone.

ExcessBLarg! fucked around with this message at 22:06 on Oct 20, 2021

xzzy
Mar 5, 2009

I would love to do fixes on my phone, if only someone would come out with an iOS client with kerberized ssh. :argh:

I should probably set up an ssh gateway on my home lan where I can kinit to get access to work but that kind of irritates me. Am also pretty nervous about having ingress to my home network.

Chilled Milk
Jun 22, 2003

No one here is alone,
satellites in every home
It also depends on what kind of work you're doing. For moderately sized fullstacky web apps I've never found any IDE like Jetbrains particuarly better (in fact kind of worse) than just an editor + standard CLI tools. If I worked on some enterprise java.net monstrosity yeah okay.

I don't even use that many plugins, LSP, fzf, and a few miscellaneous things.


VostokProgram posted:

I never code fast enough for vim to be an improvement over normal keyboard shortcuts like pgup/pgdown, home/end, etc

New code? Maybe not. But I can refactor so much faster with just the basic vim-isms.

RFC2324
Jun 7, 2012

http 418

whats the best tool for reading logs?

I've been kinda digging the new journalctl stuff. the -u switch is pretty loving useful

xzzy
Mar 5, 2009

journalctl is fine, but it's slower than traditional /var/log/messages if the log is large and you want to jump to the newest entries. The -r option works around it, but it's kinda annoying the issue exists at all.

Being able to filter with -u is pretty great, yes.

Kevin Bacon
Sep 22, 2010


decided to start messing around with linux again. last time i tried out antergos, kinda liked it but not enough to keep it going when it broke on me (so that didnt last long).

i initially installed garuda (which is like a hyped up kinda bloated arch "for gaming" distro i guess?) on my laptop, but wasnt impressed. then i got the idea (from reading this thread a fair few pages back i think?) to try openSUSE tumbleweed. ive been an on-and-off linux user for many years, but only ever with debian. and more recently: arch based distros.

i really like it. it might be the case that its the norm for stuff these days to be this stable and well functioning but i have yet to encounter an issue at all pretty much (non self-imposed issues). running kde wayland, spent a ton of time trying get a tiling wm kinda thing going (managed to do it with a kwin extension called bismuth), spent a lot of time getting up to date on how nvidia drivers for laptops work these days (it was very easy and pain-free, but it took me a coupe of hours to learn that it was), now im deep down a rabbit hole of getting proper fan control to work (which i now realize i want to try to automate in some way), all in service of the ultimate goal of running a game for like 10 minutes without overheating/throttling, just to see that it works, and then probably never touch a game ever again



also, is it possible to use a bash script to control system functions like turning on/off a network adapter or disonnect/connect to a wifi network

BlankSystemDaemon
Mar 13, 2009




RFC2324 posted:

whats the best tool for reading logs?
it's less, op

being able to &pattern is such an eye-opener to anyone i've ever showed it to
and -g is pretty helpful too

waffle iron
Jan 16, 2004
I use most

Methanar
Sep 26, 2013

by the sex ghost

RFC2324 posted:

whats the best tool for reading logs?

I've been kinda digging the new journalctl stuff. the -u switch is pretty loving useful

git diff --no-index <(cat /var/log/kern.log) /dev/null

Mega Comrade
Apr 22, 2004

Listen buddy, we all got problems!

minato posted:

vim reduces the friction between intention and action, so I can work faster. If I want to move a line of code up 2 lines then I move the cursor there, hit dd to delete the line and copy it to the buffer, kk to move up 2 lines, and p to paste. Done in less than a second (and without moving my hands off the keyboard) and then I'm onto the next thing.

Compare with a mouse-based IDE, where I'd (presumably) move my hand to the keyboard to the mouse, select the whole line, Ctrl-X, reposition the mouse at the start of the target, Ctrl-V, and then twiddle with any messed up newlines that were added/removed by mistake. Maybe 5 seconds if I'm fast.

All this extra time not only adds up, it just feels worse; I'm spending time aiming a cursor, not thinking about what I want to do next.

Install vsvim (or whatever your IDE of choice vim extention is called). Best of both worlds.

qsvui
Aug 23, 2003
some crazy thing
I've found vim emulation plugins are never good enough. They always seem to be missing something that make me go "eh gently caress it, back to vim". I suppose I could make PRs to add the functionality but to me, one of the main appeals of using a Not Vim is not having to janitor plugins.

Adbot
ADBOT LOVES YOU

Sri.Theo
Apr 16, 2008
So this is on MacOS, but I was hoping someone here could help me. I'm trying to run two apps installed through the command line, SUDO GUI and Netedit, but keep getting errors. Some Linux related forums have suggested it's because the programme gets cranky with 'localhost' in the display variable, but I don't know how to change that? Especially, as this is just running on my laptop.

I get the below errors when using Terminal.

~ % sumo-gui
FXApp::openDisplay: unable to open display :0.0
~ % netedit
FXApp::openDisplay: unable to open display :0.0
~ %

Suggestions welcome.

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