Less-Common Tools for Linux

Posted by Chief on Apr 19, 2010 in Reference, Scripts, Tricks and Hacks
No Comments

As found here: 10 Tools to Add Some Spice to Your UNIX Shell Scripts. This is no substitute for the great write-up and screenshots that the author put together. It’s a summary for myself.

The highlights (and how I really feel about them):

  • notify-send (I never knew — better than tweat deck)
  • tput (eh, maybe)
  • setleds (i don’t have lock-key LEDs on my keyboard)
  • zenity (has potential)
  • kdialog (better than zenity? looks like VB functionality — good?)
  • dialog (like kdialog, but uses (n)curses, not kde)
  • logger (good to know!)
  • setterm (practical jokes… and maybe useful for modal/portal stuff)
  • smbclient (does that still work? Couldn’t get past authentication prompt)
  • bash sockets (interesting… ICP? wasteful)

Tags: , , , , , , , , , , , ,

Git – Install and Configure

Posted by Chief on Nov 4, 2009 in System Administration
No Comments

Git is a code revision system not much unlike subversion and CVS.  One of the best features of git is that it is a distributed revision system, so you can check-in, check-out, commit, revert, etc without ever needing direct access to the central repository.  You can work with your repository as if it were a centralized system if need be found. Read more …

Tags: , , , , , , , ,

STDERR redirect into STDOUT redirect into file

Posted by Chief on Oct 22, 2009 in Scripts, Tricks and Hacks
No Comments

When you want to redirect stderr to a file, you have choices.  Either redirect only stderr to a file, or redirect both stderr and stdout to the same file.

The right way:

Redirect stderr and stdout to [[file]]:

[[command]] > [[file]] 2>&1

Redirect stderr to [[efile]] and stdout to [[file]]:

[[command]] 2> [[efile]] > [[file]]

The wrong way:

Doesn’t do anything useful:

[[command]] 2>&1 > [[file]]

Tags: , , ,

Summing a list of numbers

Posted by Chief on Oct 15, 2009 in Scripts, Tricks and Hacks
No Comments

awk '{sum += $0} END {print sum}'

Example:
% find . -type f -exec wc {} \; | tr -s " " | cut -f2 -d" " | awk '{sum += $0} END {print sum}'

What’s going on? I want to recursively count the number of lines present in all files contained by the current directory. Why? Sub-directories => namespaces, and I want to know how many lines of code exist in the entire project, namespaces and all.

Tags: , ,

Copyright © 2010 cat brain.log | less All rights reserved.
Shades v1.2 theme from BuyNowShop.com.