Live data from Hacker News

Unix tricks

mmb.pcb.ub.es

11–20 of 232 posts

Re: Unix tricks

#12
post #7
post #3

> SMB is better than NFS. More details would be nice.

NFS basically breaks the client computer until the host responds, while SMB detects the I/O error earlier and, at least, doesn't hang the terminal. Other than that, SMB allows for permissions and a bunch of other features. It is, basically, a more modern and robust protocol. Does NFS shine for some use cases? Indeed. Would it be the first choice for most ones? Nope. Disclaimer: my sysadmin skills are not so great, I'…

NFS has 2 mount types, soft and hard.

http://tldp.org/HOWTO/NFS-HOWTO/client.html

Soft mounts report errors immediately, hard mounts hang.

And for permissions, NFS provides everything under the sun that you could possibly need via ACLs. NFSv4 is a very modern protocol, much as SMBv2 is (not SMB though, it's awful).

Linux has had NFSv4 for what, 6 years now, at least, and even v2 and v3 had some limited ACL support?

http://wiki.linux-nfs.org/wiki/index.php/ACLs

Re: Unix tricks

#13
tar czf - . | ssh destination "tar xz"

To pipe all the contents of your current directory (including dotfiles) to the destination machine.

Greetings from LSI-UPC!

Re: Unix tricks

#14
post #5

1) `pgrep` is a standard utility that does what his `psgrep` does and much much more. 2) htop is a cpu and memory hog -- every time I've used it I noticed it takes 6+% CPU time 3) there's an awk trick to do the `sort | uniq` recommendation that works on 10+GB files (single pass): awk '!x[$0]++' 4) Passwordless keys are dangerous -- use ssh-agent to save the password of the keys

Not trying to contradict you, just some explanations 1. I prefer 'psgrep' because it covers 99% of my use cases for pgrep (ps axuf | grep $NAME) 2. htop is very nice, come on! Would not let it running on the background for hours, but it's nicer than top 3. Note taken, thanks! 4. Is ssh-agent really safer than using passwordless keys? Just asking, I'm curious

1. `man pgrep` is your friend (you save two greps, and TBH the `grep -v grep` should be a hint that there's a better way)

2. In my experience on Debian (granted this was in 2010), there is a noticeable performance difference between `htop` and `top`.

4. ssh-agent stores the password in memory and is erased on reboot. OTOH If you use a passwordless key file, anyone can use it if they have the key.

Re: Unix tricks

#16
post #12
post #7

Earlier quoted context omitted.

NFS basically breaks the client computer until the host responds, while SMB detects the I/O error earlier and, at least, doesn't hang the terminal. Other than that, SMB allows for permissions and a bunch of other features. It is, basically, a more modern and robust protocol. Does NFS shine for some use cases? Indeed. Would it be the first choice for most ones? Nope. Disclaimer: my sysadmin skills are not so great, I'…

NFS has 2 mount types, soft and hard. http://tldp.org/HOWTO/NFS-HOWTO/client.html Soft mounts report errors immediately, hard mounts hang. And for permissions, NFS provides everything under the sun that you could possibly need via ACLs. NFSv4 is a very modern protocol, much as SMBv2 is (not SMB though, it's awful). Linux has had NFSv4 for what, 6 years now, at least, and even v2 and v3 had some limited ACL support? h…

That's nice to know, it seems that we have the "hard" configuration at the lab and it's a real pain. Backwards compatibility, you know. For my mini-cluster we use SMB and couldn't be happier.

Re: Unix tricks

#17
> Compile your own version of 'screen' from the git sources. Most versions have a slow scrolling on a vertical split or even no vertical split at all

or just use tmux

Re: Unix tricks

#18
post #7
post #3

> SMB is better than NFS. More details would be nice.

NFS basically breaks the client computer until the host responds, while SMB detects the I/O error earlier and, at least, doesn't hang the terminal. Other than that, SMB allows for permissions and a bunch of other features. It is, basically, a more modern and robust protocol. Does NFS shine for some use cases? Indeed. Would it be the first choice for most ones? Nope. Disclaimer: my sysadmin skills are not so great, I'…

[deleted]

Re: Unix tricks

#19

tar czf - . | ssh destination "tar xz" To pipe all the contents of your current directory (including dotfiles) to the destination machine. Greetings from LSI-UPC!

I use that everyday, but didn't think about adding it to the list. It's on now, thanks!

PS: hey, we're neighbors! :)

Re: Unix tricks

#20
The special bash command I'm most often asked about by shoulder surfers is !$.

It substitutes the last argument in the previous command into the current one.

For example:

  $ ls /some/long/path/somewhere/looking/around/
  
  $ cd !$
  cd /some/long/path/somewhere/looking/around/
Post reply on HN