Tech Tips

October 1st, 2007 by Staff in

Spice up man pages, perform keyword searches, and create a logo or mix audio at the command line.
Your rating: None Average: 4 (1 vote)
Colorize man Pages

Linux man pages are an integral part of Linux folklore. Even seasoned users have to refer to man pages every once in a while. Wouldn't it be much more fun if man pages were a little colorful? If you run a graphical X desktop, it isn't much trouble to add some color to the otherwise very technical and curt manuals. Simply copy the contents of the file called XTerm in the app-defaults directory to your .Xdefaults file. The following replaces the .Xdefaults file entirely:

$ cp /usr/share/X11/app-defaults/XTerm ~/.Xdefaults

Edit the file and uncomment these lines (or create them if they aren't in your particular file). Change the colors from yellow and red to your favorite colors if yellow and red do not suit you:

*VT100*colorULMode: on
*VT100*colorUL: yellow
!*VT100*italicULMode: on
*VT100*underLine: off
! Uncomment this to use color for the bold attribute
*VT100*colorBDMode: on
*VT100*colorBD: red

Enjoy the colorful man pages!

—Girish Venkatachalam

Keyword Search in Firefox

Firefox is a great browser, but you already knew that, right? Firefox's keywords facility can be used for a neat search trick. It is best used for a directed search engine that digs specific data—for example, a Bugzilla search, IMDb search, LXR search or Marcel/wine search (www.wine-searcher.com), and so on. Here are the steps:

  1. Go to a site that offers a simple search facility (for example, IMDb, LXR or your local Bugzilla).

  2. Place the cursor within the search box.

  3. Right-click, and select Add a Keyword for this Search.

  4. Give your new search shortcut a name.

  5. Give your new search shortcut a short keyword (for example, I use bz for my Bugzilla search and lxr for LXR).

That's it.

To try out your new keyword search shortcut, open a new tab (Ctrl-T), place the cursor at the location bar (Ctrl-L), type your keyword followed by the search term(s)—for example, assuming you added keyword bz for the search at bugzilla.mozilla.org, then typing bz 95849 in the location bar will show you this: https://bugzilla.mozilla.org/show_bug.cgi?id=95849.

This is an ideal way to use a search engine that digs through some specific data.

—Steve Fernandez

Command-Line Logo

You can create a neat logo from the Linux command line:

$ convert -size 800x120 xc:white -font Times-Roman 
-pointsize 100 -fill gray -annotate +20+80 'Linux is cool!' 
-fill black -annotate +23+83 'Linux is cool!' -trim 
+repage logo.png

And, the following command should display the result:

$ qiv logo.png

If you want to play with multiple colors and fonts, the following will help:

$ convert -list type
$ convert -list color

—Girish Venkatachalam

Combine Audio Files at the Command Line

Say you have two PCM audio files in WAV format. You can concatenate them with the following command (they must both have the same sample rates, encoding, endianness and so on):

$ sox file1.wav file2.wav combined.wav

If you want to mix two audio tracks, try this:

$ soxmix file1.wav file2.wav mix.wav

—Girish Venkatachalam

__________________________


Special Magazine Offer -- Free Gift with Subscription
Receive a free digital copy of Linux Journal's System Administration Special Edition as well as instant online access to current and past issues. CLICK HERE for offer

Linux Journal: delivering readers the advice and inspiration they need to get the most out of their Linux systems since 1994.

Post new comment

Please note that comments may not appear immediately, so there is no need to repost your comment.
The content of this field is kept private and will not be shown publicly.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <pre> <ul> <ol> <li> <dl> <dt> <dd> <i> <b>
  • Lines and paragraphs break automatically.

More information about formatting options

Newsletter

Each week Linux Journal editors will tell you what's hot in the world of Linux. You will receive late breaking news, technical tips and tricks, and links to in-depth stories featured on www.linuxjournal.com.
Sign up for our Email Newsletter

Tech Tip Videos

From the Magazine

December 2009, #188

If last month's Infrastrucuture issue was too "big" for you then try on this month's Embedded issue. Find out how to use Player for programming mobile robots, build a humidity controller for your root cellar, find out how to reduce the boot time of your embedded system, and if you're new to embedded systems find out the basics that go into one. You can also read about the Beagle Board, the Mesh Potato and a spate of other interestingly named items. And along with our regular columns don't miss our new monthly column: Economy Size Geek.







Read this issue