Live data from Hacker News

Devops/Sysadmin Cheatsheet

rubytune.com

91–100 of 110 posts

Re: Devops/Sysadmin Cheatsheet

#91
post #9

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!

This is exactly how I use it. A time saver for mundane "whups" moments.

Re: Devops/Sysadmin Cheatsheet

#92
post #55
post #53

Earlier 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.

YES, this is all part of my master plan to be THE KING OF DEVOPS!!11one.

Re: Devops/Sysadmin Cheatsheet

#93

Great 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…

With recent enough SSH (> 5.4), SSH tunnels can be achieved with

  Host 
    HostName 
    ProxyCommand ssh -W %h:%p 
Which doesn't require nc (or anything else) installed on the bastion host.

Re: Devops/Sysadmin Cheatsheet

#94

Earlier 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.

The trouble with that is that it matches '.' and '..', which you probably don't want. I don't tend to have a single character after the dot in a name, so I usually use '.??*'.

Re: Devops/Sysadmin Cheatsheet

#96

Here's one I like for testing bandwidth between two machines: host1$ while : ; do nc -l 6666 > /dev/null; done host2$ pv /dev/zero | nc host1 6666 156MiB 0:00:17 [9.46MiB/s] [ ]

You should check out iperf as well.

Looks like a useful tool. Thanks!

Re: Devops/Sysadmin Cheatsheet

#97
post #16

Some 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…

Regarding ctime, some Unix versions(or I should say filesystems) really store the creation time(birthtime) of the inode. FreeBSD's find has the -Bmin switch for searching for true creation time.

Re: Devops/Sysadmin Cheatsheet

#98
post #5

For 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'.

Here's a work in progress, still needs some loooovvvee: https://www.dropbox.com/s/a0rx9c28euwokaz/cheatsheet-pdf-ver...

Re: Devops/Sysadmin Cheatsheet

#99
post #5

For 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/

Here's a first version, still working on it though: https://www.dropbox.com/s/a0rx9c28euwokaz/cheatsheet-pdf-ver...

Re: Devops/Sysadmin Cheatsheet

#100
post #24

Thanks 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.

Still working on it, but: https://www.dropbox.com/s/a0rx9c28euwokaz/cheatsheet-pdf-ver...
Post reply on HN