NFS : see what’s exported from an NFS server

To know what directories are exported by a NFS server, you can use the showmount -e nfs_server from a NFS client.

[root@client:~]# showmount -e server
Export list for server:
/data/dir1 (everyone)
/data/dir2 client1 client2 client3

(The /data/dir2 is exported only to specified clients)

Securing automated rsync over SSH

Quoting the RSYNC homepage : “rsync is an open source utility that provides fast incremental file transfer.”

To make rsync both secure and automated (i.e : non-interactive), you can use SSH as the transport and set up a key pair. This is what will be discussed in this post, along with a few improvements.

Continue reading Securing automated rsync over SSH

OpenSolaris 2008.05 released today

OpenSolaris 2008.05 is released today, you can grab it from the OpenSolaris website.

The distribution is a bootable CD which will let you try it before installing. It includes most of the big hits of Solaris 10 (zfs, dtrace, containers and so on).

If you never tried Solaris or OpenSolaris, this might be a good kick start !

Unix : shell tips

I ran into this into the following article, “Learn 10 good UNIX usage habits“. This article is mainly common sense, but there are interesting points, such as :

  • avoid piping when you can, in order to save performance (the classical construct grep | wc to count the lines is useless as most versions of grep can count with grep -c)
  • use awk to “grep” on a specific field of a line with “… | awk ‘$1 == “XXX”‘ which is cool and I never use
  • the find | xargs construct (I’d add “find -print0 | xargs -0″, useful if your find brings back filenames with a space inside …)

All in all it is worth a reading, if only to refresh your memory.

dsh : a distributed shell

clusterA common problem when you deal with a pool of servers (clusters or server farms, you name it) is to execute the same command line on each server. It is usual to solve this with a “for” construct such as :

for i in server1 server2 ; do ssh $i "uname -a"; done

But this is basically re-inventing the wheel everytime. Here comes Distributed Shell (DSH).
Continue reading dsh : a distributed shell