6 ms·
I had no idea people used nano as their main code editor. I use it on any nix server I'm working on and have probably used it tens of thousands of times. I'd b
by swozey 3y ago
I had no idea people used nano as their main code editor. I use it on any nix server I'm working on and have probably used it tens of thousands of times.
I'd been a linux/bsd engineer forever and I worked at some places where they refused to install nano on servers. There are some greybeard linux admins who absolutely refuse to let someone use anything other than vi. I never got that. It's a 20MB package and not exactly much of an attack vector.
- dormento 3y ago20MB is bigger than some whole GNU/Linux systems I installed in the past. Might explain why the greybeard council disapproves of it.
- swozey 3y agoYou made me curious. I started w/ openBSD 1.2 in '95. I can't find it anywhere though to see what size it was.
- rascul 3y agoThere were some Linux distros in decades past designed to run off of a couple floppies. I struggle to recall any names at the moment.
- cesarb 3y agoThe classic one was "tomsrtbt" (http://www.toms.net/rb/ http://www.toms.net/rb/).
- swozey 3y agoHis homepage just brought me SO much nostalgia. Just needs spinning skulls and construction gifs. http://www.toms.net/ http://www.toms.net/ And dang he owns toms.net, nice. His resume on here hasn't been updated since 2002. Looks like he started his career in 1987. This is an interesting looking resume. Tons of skills at the top, goals, Other. I suppose it's cover-lettery. edit: Oh, nevermind, he has a career page updated in 2019 - http://www.toms.net/career/ http://www.toms.net/career/ - so I guess he's been with Fannie Mae from 2002 - now. Good, I was a bit worried he'd left us.
- kunwon1 3y agoIn 2005 I worked for a small radio shop. Firewall was running Coyote Linux, which booted off a single 3.5" floppy with write protect switched on.
- vdfs 3y ago20MB? just check nano executable and it's 277KB, the whole .deb packages is 860 kB https://packages.ubuntu.com/jammy/nano https://packages.ubuntu.com/jammy/nano
- xyproto 3y agogccgo + upx can reduce the size of Go executables considerably, usually below 1M.
- makapuf 3y agonote that it does not reduce the memory size once loaded (and even prevents sharing pages when several instances are run since memory is written when decompressed, not read as a program binary is)
- londons_explore 3y ago> even prevents sharing pages when several instances are run since memory is written when decompressed, not read as a program binary A shame the linux kernel doesn't have some way for packers to say "I am a packer, I run with access to nothing except the binary, therefore run me with no permissions and then share the pages I make with any user that executes me. If you like, you can even delete my output and reunpack me on-demand"
- xyproto 3y agoThat would be something!
- deleted 3y ago[deleted]
- swozey 3y agoI thought 20MB was a lot. I did "nano debian size" on google and one of them mentions - The Nano package contains a small, simple text editor which aims to replace Pico, ... Download size: 1.5 MB. Estimated disk space required: 20 MB. https://www.linuxfromscratch.org/blfs/view/svn/postlfs/nano.html https://www.linuxfromscratch.org/blfs/view/svn/postlfs/nano....
- kunwon1 3y agoI was a nano user, and this happened to me. I got greybearded into vim, and now I only touch nano when I need to de-crappify a vimrc file I was mad about it at the time, but now I'm happy I made the change. Vim or vi is everywhere, including on the switches and routers I work on. Nano is not everywhere, nor can it easily be put everywhere. If I weren't regularly SSHing into decrepit or resource-constrained hardware, I would likely see less of a benefit
- swozey 3y agoI don't know why, probably terrible memory, but I have practically a mental block when it comes to keyboard shortcuts. I've tried spacevim and a few other bundled vims before but I have such a hard time doing anything other than moving the cursor and :wq! type of stuff. Like.. this is wild https://vim.rtorr.com/ https://vim.rtorr.com/ And now I'm hooked on a horrible amount of vscode plugins.
- linuxdude314 3y agoYou might like x!
- naikrovek 3y agoyou can do it. you have to want to, first, though. then you sit down for an hour and you create and edit a file, and you do not allow yourself to hold any key down to move the cursor around. you have the link you posted printed out, and you use only what is on the sheet to edit. when you want to add something to the end of the line, you do NOT push the END key then enter edit mode, you look at the sheet and you find what you want and you push SHIFT+A to enter edit mode and go to the end of the line at the same time. you keep track of which mode you're in and what mode you need to do something, and you force yourself through the keystrokes needed to operate completely and efficiently using only the keyboard. in an hour, if you force yourself to use only the shortcuts on the cheat sheet, you will be more fluent in vi/vim than ~90% of the people who use it, myself included, and I've been using vi/vim for 25 years.
- LinXitoW 3y agoYou can still use VSCode and just use the Vim plugin. Vim is not an editor, it's a language you speak with your editor. Like with real language learning, some of it is just rote memorization. There are, however, some tricks that I find really help. The first is to find mnemonics for the different actions. Some are obvious, for example (d)elete or (c)hange. Some require a little imagination, like un(t)il (like in 'til). Finally, there's some level of logic to many related things. For example, the CAPITAL version of an action is generally a "louder" more aggressive/stronger version. So (a)ppend is just "insert after current cursor position", whereas (A)PPEND! means "insert at the very end of this line". Just like with languages, if you use them long enough, they start to "make sense", and "feel right". I don't have to translate "I want to append at the end of the line" to the correct keybinding, I simply "speak" to the editor in a way that "feels" right.
- junaru 3y agoHaven't tried removing nano ever but hate it with a passion for one simple reason. If none of the EDITOR/VISUAL/etc. variables are set when you invoke 'visudo' a f*king nano appears. Like god dammit it i assume vi in that name comes from vi as even the manpage has 'vi' among 'see also'. This is akin to launching firefox and some random application popping up - its the ultimate troll and i salute your graybeards for solving the problem at the core!
- zwog 3y agoThat is OS dependent, though. On Arch Linux with EDITOR empty `visudo` opens vi.
- poutinepapi 3y agoGreybeards are going to greybeard mate. Plus, it's always funny to me because a lot of the old crowd you ask them what kind of system they ran and they(with swagger) admit that they were in charge of the WHOOOOLE IT department for their local government, and it was a big town too, so at least 500 users. And I 105% assure that that system was the most secure in the entire county... And also unusable. And when that lad retires or someone in their office kills them out of sheer desperation, hopefully they'll be replaced by one of these new fangled engineers who might not know about vi, but they at least care a little bit about their users(Not a lot though, we're still engineers)
- catiopatio 3y agoYou could have learned enough vim to be usable in the time it took to write that comment.
- codedokode 3y agoHow to quit Vim and install Sublime Text?
- rascul 3y ago> How to quit Vim Restart the computer
- cristifalcas 3y agoSilly you... It's Ctrl+Z
- speedgoose 3y agoYou can try Ctrl+C. Vim will of course not exit but display instructions about how to exit.
- linuxdude314 3y agoAgreed. Nano use is somewhat of a red flag to me. It’s SO inefficient in comparison to Vim, VSCode, or tons of other alternatives. If it’s the only thing on the box, fine, but in reality usually Vim is the only editor installed.
- deleted 3y ago[deleted]
- un1xl0ser 3y agoThe main reason to know vi inside and out as a Unix administrator has to do with it being the lowest common denominator on Unix and Linux systems. As a *nix tech I could get a call to work on a QNX system, HP-UX system, SGI Altix supercomputer or a Sun Ultra 2. Linux systems were easy, as they had the package management support for FL/OSS, and would commonly come with Emacs in the base-pack (before nano was mainstream). Sometimes you would have a terminal issue and have a single line to work with, in which case you would need to operate vi without seeing what you are doing (or use sed/awk). So maybe it is those instincts to KISS and force everyone to learn vi, like they had to (I had to). Certainly it provides no significant surface area of attack to have an editor, but I wouldn't put it past a threat actor to leverage plugin functionality as a persistence mechanism. I presume that these applications operate differently as root, but maybe not as service (daemon) accounts. It's not very well hidden, but there are all grades of threat actors.
- JohnFen 3y agoPersonally, I strongly dislike nano and will take vi any day of the week over it. However, the choice of text editor is a very personal one. It makes no sense at all for anyone to insist that anyone else should or shouldn't use any particular text editor. Just let people use what they like.
- cesarb 3y ago> There are some greybeard linux admins who absolutely refuse to let someone use anything other than vi. I never got that. When I first encountered nano, I found out that it could silently corrupt configuration files (by word wrapping long lines) unless you were very careful to always start it as "nano -w". Since then, I've always removed nano (or at least set something else as the default editor) on every Unix system I administer.
- rascul 3y agoIf I recall correctly that default changed awhile back. One could also set it how they want in nanorc. However, I do understand the criticism, and how that could leave a bad first impression.
- zamadatix 3y ago"-w" changes visual wrapping, it doesn't save that way. No different than the behavior of "cat" in an interactive terminal really, beyond the temptation for editor religion. There is the .nanorc option to do e.g. "setfill 80" and "set breaklines" but that's no different than setting a "tw=80" type config in your vimrc and saying vim breaks config files.
- deleted 3y ago[deleted]
- cesarb 3y ago> "-w" changes visual wrapping, it doesn't save that way. No different than the behavior of "cat" in an interactive terminal really, beyond the temptation for editor religion. What you mentioned is "soft wrapping", which is visual only but doesn't affect the saved file. But the default for nano when I first encountered it was "hard wrapping", which does affect the saved file. Some distributions later changed the default in the nano configuration file, but depending on the configuration file instead of a built-in default is risky. See https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=135978 https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=135978 (and the five other bug reports merged into it) for an example of the problems caused by running nano in the default configuration without disabling its line wrapping.
- notnmeyer 3y agopretty much madness. it’s almost like a badge of honor for some folks.
- stjohnswarts 3y agothere are vi minimalist versions that are much much small than 20MB