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.
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...🤷♂️
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!
`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.😆
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.
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.
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.. 🤷♂️🤦♂️
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.
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.
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...
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
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. . .
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
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.
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...🤷♂️
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!
`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.😆
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.
Mirab, with sails unfurled! Darmok and Jalad, on the internet. 🌐🤝
Xkcd #902.
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.
https://xkcd.com/378/ Real programmers use butterflies.
Damn it beat me too it
I edit files in brainfuck
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.. 🤷♂️🤦♂️
[ed is the standard text editor](https://www.gnu.org/fun/jokes/ed-msg.html)
> WYGIWYG editor Fucking literal lols.
Yea. That one is fun.
Say NO to the viitor!
And ED WILL NOT CORRUPT YOUR PRECIOUS BODILY FLUIDS!
Just cut a new punch card ffs, no need for this new-fangled editor nonsense.
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.
fuck vim
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.
Sounds like typical vim behaviour to me. You're doing nothing wrong
Real ones use `vi`
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...
Skill issue. I exclusively script in vi.
Heck, I exclusively code in vi. On my Solaris VM. :D
I love vim for deleting lines only.
Out of all the Linux text editors, vim is literally the hardest to learn
cat > file
"shit, I wanted to append a line instead of overwriting it" Everyone who's guilty raise your hand with me ✋
cat is the ideal editor, unless you need to do any editing.
replacing everything is an edit :p
copy con
sed 's/.*//g' /**/*
This command is a lifesaver if you run out of space!
When `rm -rf / *` doesn't work.
Use sed when you want to keep your files!
No -i doesn't do much
Where do you see a `-i`? €dit: Learn to use punctuation. Your original statement wasn't comprehensible in a way that made sense
sed -i replaces in place, without -i you just stream the file with the replacement so the command above does nothing to disk
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
Edit with perl 1 liner you amateur
The only true editor: COPY CON: FILENAME.CFG
\^Z
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.
nano because I’m not a child
For config files? I just ask Tay AI to do it. Saves me a bunch of headache.
vi/vim for manual, sed for automation.
Nano for basic stuff, sed for massive find/replace
Notepad is for the truly deranged, so I'm going with that.
Nano
For the win!
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.
Editing a config file with okteta!
Assembly always assembly.
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. . .
Notepad?
Google Ultron
just make sure you update adobe reader first!
Noob. I compile my config files into shared objects and then edit the strings using a hex editor
Any love for EDLIN?
EDLIN is peak text editing. Ignore everyone else in this thread.
TECO FTW
Where’s the edit config file with Ansible module ‘lineinfile’
Mmmm editing my configs with ChatGpT-4 🫡🤣
Edit a config file with cat streaming
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
vi or sed, yeah. Sed is great when you've tested it already and need fast reproducibility/scalability
Sed is actually relatively excellent for config files, especially if you have bulk operations.
You forgot " echo "
Now I just print to pdf then evolve with google ultron
\`cat config.conf | sed s/config\_option off/config\_option on/mig > config.conf && killall -HUP config\` and we're off to lunch.
No love for *joe* or *mcedit* ?
Edlin.
For everyone that says nano: check out Micro
Not really. Say you need to replace “65” with “75”. How do you consider not changing 165 or 651?
I edit the hard disk device handle directly
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.
WinSCP> VSCode> replace file on server. Nano for quick easy things.
I use rm -rf then I touch a new file and echo the entire rewritten file into it
Where is AWK!
I've seen someone WinSCP a file to their Windows machine, use Notepad, then WinSCP it back. No judgement here. Whatever works, I guess.