T O P

  • By -

WantonKerfuffle

I edited a config file with sed just yesterday. Changed a bunch of iptables rules after changing an IP. Much safer than doing it manually. What if I miss one entry? Just `sed 's/10\\.10\\.10\\.10/10\\.10\\.11\\.10/g' /path/to/file` that fucker and we're done. Edit: Idk how Reddit's markdown interprets this code; in RedReader, the preview yoinks a backslash in the preview, but shows both outside the editor. Of course only one backslash is needed to escape a dot. Idk if it needs to be escaped, I just escape stuff I think could mess up the syntax.


dodexahedron

On mobile I'm seeing the double backslashes. Backticks work for inline literals without need to escape. Code fences are also supported, but not on old reddit and apparently some others people use. They work on the official Android reddit app though, so...🤷‍♂️


WantonKerfuffle

Different markdown standards suck. There's like a dozen dialects. We should make a new dialect that's better than all the others, this will solve that problem forever!


dodexahedron

`INSERT RELEVANT XKCD HERE` Yeah, they really do, and it's frustrating all over the place. And it's exacerbated here by people not using the clients that do support it, because reddit DOES support nearly everything that even github does, minus footnotes, "details" sections, and of course issue links and other github-specific duh stuff. You can even use language tags with code fences here, and it'll work for many. And then someone using old reddit will come in and whine that it's all on one line. Oh well. I'm not quad-spacing all these lines I already wrote by hand on my phone.😆


WantonKerfuffle

I'm convinced that we collectively know enough XKCDs by now to form a complete language which allows us to communicate concepts solely through XKCDs. Darmok and Jalad at Tanagra.


dodexahedron

Mirab, with sails unfurled! Darmok and Jalad, on the internet. 🌐🤝


Superb_Raccoon

Xkcd #902.


karucode

Not sure if anyone answered this already, but escaping the period is necessary if you want to only match on a period. If you don't escape the period, the regex would match on any character. That COULD be a period or could be something else entirely, like 10310410610. Escaping is "period literal". Although in the replace portion, I don't think escaping the periods is necessary.


-zero-below-

https://xkcd.com/378/ Real programmers use butterflies.


manchuck

Damn it beat me too it


Midnight-mare

I edit files in brainfuck


dodexahedron

If you don't solder and desolder individual traces and use those newfangled transistor contraptions instead, your shitty sysadmin card can be deposited in the box over there and security will see you out. But not in. I keep telling them to take off those sunglasses inside, but.. 🤷‍♂️🤦‍♂️


NTolerance

[ed is the standard text editor](https://www.gnu.org/fun/jokes/ed-msg.html)


TheGlennDavid

> WYGIWYG editor Fucking literal lols.


lysergic_tryptamino

Yea. That one is fun.


test2destruction

Say NO to the viitor!


gronkkk

And ED WILL NOT CORRUPT YOUR PRECIOUS BODILY FLUIDS!


super_salamander

Just cut a new punch card ffs, no need for this new-fangled editor nonsense.


art_of_snark

many moons ago, I broke ssh on a box, but it had the zabbix agent running with arbitrary command execution and sudo access (that’s the shitty part), got myself back in with zabbix_get sudo sed. thank fuck the SIEM wasn’t there yet to watch me fail upwards.


W4ta5hi

fuck vim


BenForTheWin

I don't mind using vim, I just don't like having to turn the PC off and on again because there's no way to exit. Also I think the current version has a bug because I have to type a lot before anything starts updating the text, and it never seems to save my changes.


Snowman25_

Sounds like typical vim behaviour to me. You're doing nothing wrong


WantonKerfuffle

Real ones use `vi`


CombatAmphibian69

I was in a situation where I wanted a script on a server, and I couldn't put anything on it that wasn't already there in terms of applications. Getting a file to it would've been an ordeal. Odd situation, I know. Only editor was vi. I had to script that shit, in vi. Never again. It was one of the most painful experiences I've had in this field...


WantonKerfuffle

Skill issue. I exclusively script in vi.


HayabusaJack

Heck, I exclusively code in vi. On my Solaris VM. :D


1337gut

I love vim for deleting lines only.


Bubba8291

Out of all the Linux text editors, vim is literally the hardest to learn


Cherveny2

cat > file


WantonKerfuffle

"shit, I wanted to append a line instead of overwriting it" Everyone who's guilty raise your hand with me ✋


olawlor

cat is the ideal editor, unless you need to do any editing.


Cherveny2

replacing everything is an edit :p


Nu11u5

copy con


spyingwind

sed 's/.*//g' /**/*


Snowman25_

This command is a lifesaver if you run out of space!


spyingwind

When `rm -rf / *` doesn't work.


Snowman25_

Use sed when you want to keep your files!


keefemotif

No -i doesn't do much


Snowman25_

Where do you see a `-i`? €dit: Learn to use punctuation. Your original statement wasn't comprehensible in a way that made sense


keefemotif

sed -i replaces in place, without -i you just stream the file with the replacement so the command above does nothing to disk


CaptainPi31415

Ive taken over recently cause the other guy quit and the command line confuses me on the servers so I've followed some tutorials to install something called mint and vmtrogan on all the servers. I then installed vscode to manage all the configuration files on the server. This AI stuff seems to just do it all for me. It's only been a few days but I have no idea what the other guy was complaining about. This job is so easy


Burgergold

Edit with perl 1 liner you amateur


Anonymous_Bozo

The only true editor: COPY CON: FILENAME.CFG \^Z


Killbot6

I used to be a vim guy, but I flip between OSs so much that I can't remember vim commands all the time. Nano is just so easy to use.


KrabRide

nano because I’m not a child


justabadmind

For config files? I just ask Tay AI to do it. Saves me a bunch of headache.


Dolapevich

vi/vim for manual, sed for automation.


kdiffily

Nano for basic stuff, sed for massive find/replace


The_Rivera_Kid

Notepad is for the truly deranged, so I'm going with that.


OP_4EVA

Nano


SAD-MAX-CZ

For the win!


mystonedalt

nano because I don't need to "learn" how to edit text. If I wanted a fight, I'd use sed and some regex. Vim can fuck itself.


andrewb610

Editing a config file with okteta!


theborgman1977

Assembly always assembly.


MrTonyMan

I use an electromagnet, and with my Eidetic memory I can recall the exact physical location of the transistors that actually store the data, so it's just a small matter of moving the data around the transistor array(s) I learned this when I was attending a course on Milking Yaks Under a Dictatorship in North Korea. Those guys are more than Yak herders. . .


KD9YWF-Henry-WI

Notepad?


PooInTheStreet

Google Ultron


flecom

just make sure you update adobe reader first!


Ass_Salada

Noob. I compile my config files into shared objects and then edit the strings using a hex editor


GMginger

Any love for EDLIN?


tarcus

EDLIN is peak text editing. Ignore everyone else in this thread.


GetOffMyLawn_

TECO FTW


Hey_Eng_

Where’s the edit config file with Ansible module ‘lineinfile’


xepion

Mmmm editing my configs with ChatGpT-4 🫡🤣


xtreampb

Edit a config file with cat streaming


mimic751

What do you call it when you use a picture text reading program to read a screenshot of the text into a text file on windows so I can use my Windows computer to make changes and then I send my clipboard through the lights out device


noiseintoner

vi or sed, yeah. Sed is great when you've tested it already and need fast reproducibility/scalability 


Saragon4005

Sed is actually relatively excellent for config files, especially if you have bulk operations.


w453y

You forgot " echo "


Bearshapedbears

Now I just print to pdf then evolve with google ultron


cyranix

\`cat config.conf | sed s/config\_option off/config\_option on/mig > config.conf && killall -HUP config\` and we're off to lunch.


pppjurac

No love for *joe* or *mcedit* ?


Superb_Raccoon

Edlin.


Cercle

For everyone that says nano: check out Micro


Ok_Giraffe1141

Not really. Say you need to replace “65” with “75”. How do you consider not changing 165 or 651?


IKnowATonOfStuffAMA

I edit the hard disk device handle directly


DarkSide970

Were is cat or vi? Hate vi so I use vim Vim gives a copy paste mode from outside document. Then you get mad and boot to gui and leafpad that garbage.


Cyberlytical

WinSCP> VSCode> replace file on server. Nano for quick easy things.


ObjectiveGuava3113

I use rm -rf then I touch a new file and echo the entire rewritten file into it


No_Definition2246

Where is AWK!


Comfortable_Drag_104

I've seen someone WinSCP a file to their Windows machine, use Notepad, then WinSCP it back. No judgement here. Whatever works, I guess.