I would warn anyone that read this to understand what each command does before actually running anything on a machine. Things like "sudo !!" are INCREDIBLY dangerous, and I would never put that on a cheat sheet.
I use this one like a dozen times a day. user@host$ less /var/log/syslog Permission Denied crap... $ sudo !! sudo less /var/log/syslog Woo!
Devops/Sysadmin Cheatsheet
91–100 of 110 posts
Re: Devops/Sysadmin Cheatsheet
#92Earlier quoted context omitted.
Thanks! You are completely right. Just basic sysadmin stuff. It's titled that way simply a) I thought I'd see if I could hang with the term and b) the "source" of these commands (including myself) are from developers who specialize in rails ops work (so we do write app code, but specialize on the server side)
Christ, just admit you did it so you could be associated with the term when someone Googles your name.
Re: Devops/Sysadmin Cheatsheet
#93Great list. A few more (related or building on those there) Quick mysql "why is my database under so much load suddenly" that doesn't rely on the slow query log: pt-query-digest --processlist h= --interval=0.01 --print > /tmp/queries.out pt-query-digest /tmp/queries.out Tracking down what files exactly are filling up the disk. Go to /, and follow the big numbers: du -smc * Combine strace (for the file handle no), lso…
Host
HostName
ProxyCommand ssh -W %h:%p
Which doesn't require nc (or anything else) installed on the bastion host.Re: Devops/Sysadmin Cheatsheet
#94Earlier quoted context omitted.
Correct with one important caveat: because * is a shell expansion, it will not process any directories starting with a ".". e.g., imap maildir directories.
du -sh .* * Problem solved.
Re: Devops/Sysadmin Cheatsheet
#95Re: Devops/Sysadmin Cheatsheet
#96Re: Devops/Sysadmin Cheatsheet
#97Some random thoughts: - Instead of 'while true;' you can use the shorter 'while :;'. ':' is a null command. - On OS X, dtruss is kinda, sorta like strace (it's a wrapper around dtrace, and the dtruss name comes from Solaris). - For basic host to IP resolution, I prefer ping as it calls gethostbyname(), like most other programs will do. host/dig are suitable for querying/testing DNS independent of how the local box is…
Re: Devops/Sysadmin Cheatsheet
#98For getting around linux I've found no better helpers than manpages and the cheatsheets by Peteris Krumins[1]. I notice this isn't offered as a pdf or image, is the idea that someone will come and visit the site when their server is in trouble? That said, I didn't know about some stuff here like scriptreplay -- thanks! [1]: http://www.catonmat.net/projects/cheat-sheets/
I'd second a quick pdf version of it as well, I'm sure more than a few of us have a directory with cheatsheets in somewhere on their drive as a 'just in case'.
Re: Devops/Sysadmin Cheatsheet
#99For getting around linux I've found no better helpers than manpages and the cheatsheets by Peteris Krumins[1]. I notice this isn't offered as a pdf or image, is the idea that someone will come and visit the site when their server is in trouble? That said, I didn't know about some stuff here like scriptreplay -- thanks! [1]: http://www.catonmat.net/projects/cheat-sheets/
Re: Devops/Sysadmin Cheatsheet
#100Thanks for this nice list. Small nitpick/question: why put the commands in inputs? Do you edit them on that page? Or is it just to format them? I tried to do a copy/paste on the page contents to my personal offline notebook but the most important bits, the commands, didn't paste.