3 ms·
When I told my thesis advisor (in about 2001) that I was looking into backend web development as a career, he gave me a post-it note with the following content:
by ksenzee 9y ago
When I told my thesis advisor (in about 2001) that I was looking into backend web development as a career, he gave me a post-it note with the following content:
chmod 0644
[Esc] :wq
Best advice I've ever gotten.
- falcolas 9y agoYes, please do chmod your SSH key, netrc, and other sensitive files as world readable! Sincerely, that other guy on your multi-user OS.
- ksenzee 9y agochmod 0644 is indeed bad advice in ~/.netrc. Similarly, [Esc] :wq is not too helpful at a bash prompt. If you don't know the difference you're not yet ready for the magic post-it note.
- falcolas 9y agoMy point is that if you don't understand what chmod 0644 does, you probably shouldn't use it as general advice. chmod 0640 would be better general advice, but it's not a fix-all. Ditto `:wq`. If you're in vim, and you don't know how to exit, you probably don't want the random keypresses you made while trying to figure out how to exit to be written to the file. Another case where an alternate version might be better: [ESC]:q! nano <file>
- ksenzee 9y agoOf course it's not good general advice. It wasn't given as general advice. It was given as a tongue-in-cheek *nix cheat sheet.
- keithpeter 9y agoAnd as such would make a funny t-shirt. I remember seeing # apt-get a_life somewhere.
- nisa 9y agoNot sure if is there is something more subtle in the note but around 2001 (or even later until today) chmod -R 777 was pretty popular advice to solve all kinds of 'problems'. Usally 0644 is a sane default for web stuff.
- ksenzee 9y agoYep, that's exactly what he meant: Here's how to get out of vi when you get stuck there, and here's how to undo the stupid thing you just did to try make your website work. For web stuff you usually do want 0644, or 0664 if the files are owned by your user account and not apache.