Monthly Archives: September 2010

4 Tips from the Unix Greybeards

So I’ve been using Unix for a number of years, and think of myself as relatively competent in using Posix based operating systems. I’ve recently had the great pleasure of working with a few guys who’ve been using Unix for longer than I’ve been able to read, and I’ve been able to add a couple of more commands that are extremely useful. It’s always great to watch a master using their tools, and to learn while working with them.

The commands below are a mix of ones that I’ve just learnt. I probably should have known these already – but they are lovely, and you need to add them to your arsenal.

  1. !!
  2. locate
  3. look
  4. xargs

    1. !!

    re-execute the last command.

    !! also has friends like !COMM where it will execute the last command in your history that starts with COMM.
    !find will re-execute your last find.

    2. locate

    With a locate database setup, locate is magic. Think spotlight for the commandline.

    3. look

    The man page for look talks about it searching a file, then mentions about the default location being /usr/share/dict/words. The default location is the key for the best usage. It’s a great little dictionary for looking up how to speel words.

    4. xargs

    The most masterful developers that I work with have advanced beyond xargs to the next level, but for people continuing on their pathway to true unix mastery, xargs is a great tool to add in.

    I commonly end up using variations of find and xargs together to search the contents of files, or to find out information about a project. If nothing else, the command:find . -name "*.java" |xargs wc -l | sort is your friend.

    Database Security Product Vapourware

    from the posts that I never got around to posting department (originally dated at 26 July 2005)… posting now because Oracle Open World has a bunch of database security products now – and someone might actually implement this :).

    I have got a product vapourware idea that has been floating around in my head for a little while. A product that will help protect databases.

    The tool will do the following:

    1) record checksum for key objects in the database (by default it shoud do the data dictionary). It will allow users to record checksums for all objects, in particular supporting stored procedures, and views. This will help prevent attackers from hiding there tracks. This type of attack has been setup in a proof of concept shown at Red Database Security Services (edit – sorry – not sure of the deep link or if this is still publicly available).
    2) check the passwords of users in the database, ensuring that the password quality is good.

    I can picture quite easily how to do this in Oracle, can see the feasability of it in SQL Server, and know that every database will provide a data dictionary that will make at least step 1 possible. So – to all you database security vendors out there – please implement.