Search

colordiff: put some color in your diffs

January 9th, 2008 edited by Patrick Murena

Article submitted by arno. We are running out of articles! Please help DPOTD and submit good articles about software you like!

colordiff is a small tool to colorize diff output which greatly improves readability.

colordiff can be used as a wrapper around diff, a tool used to compare files line by line. Simply run:

$ colordiff file1 file2

That will output differences between file1 and file2 in a colored way. You can also pass diff options to colordiff. So, to output a colored difference between two directories, you can run:

$ colordiff -Nur dir1 dir2

colordiff can also be used through a pipe. Just give it some diff content on its input and it will output the same content with colors.

$ cat some_patch_file | colordiff

Or:

$ cvs diff | colordiff

colordiff even works with wdiff since version 1.0.7 (currently only in Debian unstable, not in Ubuntu).

Default colors are very clean on a dark terminal: blue for new text, red for old text, magenta for other diff stuff. You can also modify them easily if you wish. Because colordiff has no way to determine if it writes on a dark or on a light terminal, default colors may be quite harsh on a white terminal. So, colordiff comes with colordiffrc-lightbg file, a configuration example for light backgrounds.

Related tools

Many text editors can display differences with two or more files. Graphical tool xxdiff can display differences between two or three files (it also has more features).

If you like to colorize everything on the console, you may like ccze to colorize log files, colormake to colorize make output, colorgcc to colorize gcc output, or highlight (with --ansi option) to colorize source code for more than 100 languages.

Tips

diff alias

Colordiff can be used anywhere diff is used. So, you may want to set colordiff as an alias for diff. Put in your shell configuration file:

alias diff=colordiff
svndiff function

If you use version control regularly, it may be useful to define a diff wrapper in your ~/.bashrc, ~/.zshrc, or other shell configuration file. For example, here is my svndiff function:

svndiff () { svn diff "${@}" | colordiff | less -R -E }

So, I can run svndiff in a directory controlled by svn, and get very readable differences information. You can find a cvsdiff function in colordiff manual, or write one for your favorite control version.

Screenshots

You can find some screenshots on colordiff site:
http://colordiff.sourceforge.net/screenshots.html

colordiff is available in Debian from oldstable Sarge to unstable Sid and for Ubuntu from Dapper to Gutsy.

Posted in Debian, Ubuntu | 9 Comments »

pwsafe: A cross-platform tool for password management

January 6th, 2008 edited by Tincho

Entry submitted by Kam Salisbury. DPOTD needs your help, please contribute!

PWSafe is a Command Line Interface (CLI) tool for managing and securely storing passwords. Using the public domain cipher Blowfish, PWSafe maintains an encrypted database of login account details and their associated passwords. The database format PWSafe uses is cross platform compatible with Counterpane PasswordSafe (for Windows), MyPasswordSafe for QT application environments (KDE) and Password Gorilla for the tck/tk application environment (Windows, Mac OS X, Linux, Solaris, *BSD).

Installing PWSafe is accomplished via command line (apt-get) or X Windows (Synaptic) and has been available in both Debian and Ubuntu since a long time ago.

PWSafe is used from the command line prompt but also supports copying the passwords into the X selection buffer and into the clipboard. One main password is used to “unlock” the datafile. Screen shots of PWSafe in operation are available from the author’s (Nicolas Dade) website. Should you need to, PWSafe also supports random password generation.exporting databases to text, and merging separate databases together.

A strength of PWSafe is the cross platform compatibility of the data files. For example, you could store a copy of your PWSafe data files on a USB Flash Drive, along with installers or executables for some platforms and now you have a secure account and password management utility across a wide variety of computing platforms available to you all the time. You could keep that USB Flash Drive in your safe deposit box, should something ever happen to you, your spouse could recover and coordinate turn over of administrative accounts to others. PWSafe, secure password management as simple as it gets.

Posted in Debian, Ubuntu | 7 Comments »

Rhythmbox: An OpenSource iTunes Clone

January 2nd, 2008 edited by Alexey Beshenov

Entry submitted by Kevin Hunter. DPOTD needs your help, please contribute!

The Linux desktop environment has made great strides in terms of usability in the past couple of years. In that light, I present Rhythmbox, an OpenSource music player ala iTunes for the Gnome desktop. Some of its features include an iTunes-style layout, search box, playlist management, podcast handling, and iPod integration. If you learned iTunes, using Rhythmbox will take only a slight adjustment, mostly involving a minimally different look-and-feel.

Installation

Thanks to the power of apt/aptitude/synaptic, installation should be a breeze:

$ sudo aptitude install rhythmbox

When complete, take a gander at your Applications → Sound and Video menu. Select Rhythmbox Music Player and you should be in business.

How to Use It

first run

The main Rhythmbox window has four frames. The first, partially obscured in the picture to the left, displays different sources of audio media. Think Library, Playlists, or Podcasts. The two medium frames, titled Artist and Album, list all the artists and albums in your collection. Clicking on one of the entries filters the main list below … At least that will be the case soon: since this is the first time running Rhythmbox, it won’t know about any of your music files. Note the main list (large white square) is empty. To remedy this, tell Rhythmbox to import your music folders via the file menu item Music → Import Folder.

I have chosen to place my music in my home folder under Media/, so I would navigate the dialog box to ~/Media/Music/. Once you click Open, give Rhythmbox some time to index your library.

importing a folder

When it completes, you are ready to rock. Double click a song in the main song list and start listening. Alternatively, you can enter a couple of terms in the search box above, or select a specific artist or album to filter the main list, then make your selection.

Rhythmbox has the other half covered as well: For those just starting or augmenting their digital music collection, Rhythmbox has integrated ripping: pop a music CD into your computer, right-click on the new icon and select Copy to Library. (Fiddlers: relax! There are always choices. If you don’t want to rip to the ogg file format, or want to adjust where your freshly ripped files go, have a look through Edit → Preferences.)

importing a cd

The Good Stuff

But ho hum. At this point, I’ve told you about all the ways that Rhythmbox is like iTunes. Are you trying to convince your boss that she should run Linux because there’s an iTunes clone? Get a clue! you say. You’re right. That’s the blasé —but important— stuff. The fun begins when you take note of the plugins. Plugins are what make Rhythmbox cool and give it any worthwhile functionality. I’ll explain about my two favorite plugins, Jamendo and Magnatune, and leave the others to your capable exploration (Edit → Plugins).

While I focus on the technology here, I’ll first briefly describe Jamendo and Magnatune. They are companies that embrace the world of digital media. Functionally, their added-value is trust of customers and respect for artists: you can listen to their libraries for free, on demand, and choose the price, if any, you want to pay. Philosophically, however, they are much more that. I highly encourage you to check them out: Jamendo, Magnatune.

The Jamendo and Magnatune plugins combine the media-browsing power and usability of Rhythmbox with the richness of their respective content. The beauty is in the seamless integration so that you (almost) forget that you haven’t (yet) bought the music —and lest you think I’m suggesting you mooch, I’m not. (Do check out both companies.)

To show off the power of these plugins, click on one of their icons under Stores in the sources list. (If an entry isn’t there, make sure its plugin is enabled. Edit → Plugins) Rhythmbox will take a minute to download an index of available music and then display the list in the main frame. Now you can peruse and listen to their library as if it were your own. No 30-second teasers. Way cool.

Playing music from Magnatune.com

Rhythmbox has other plugins, not limited to DAAP streaming (share your music, even with iTunes), lyrics look-up (still has a few kinks, but cool nonetheless), and visualizations. Again, fiddlers and tinkerers alike, don’t worry. Be happy: there is well-written documentation detailing how to write a Rhythmbox plugin.

The Bad Stuff

I have only encountered a couple of sticking points with this otherwise great piece of software. At the time of this writing, Rhythmbox is at v0.11.3, meaning that it has a couple of rough spots. The ones that I have encountered were random crashes and were spaced far enough apart that I have not taken the time to track them down.

Another issue is one of memory. I unfortunately don’t know how it compares to its OpenSource competitor, Amarok, but I do notice the age of my box when running Rhythmbox with any other memory-hogging applications. My favorite plugins also use a lot of memory (presumably to hold the company music index). Rhythmbox is not alone in this area though, so it’s not a huge shock. Just annoying.

The last issue I’ll bring up is one of integration with the industry standard mp3 format. While I use the Ogg Vorbis codec for any new songs I rip, I still have a large personal library of mp3s I ripped during my Microsoft days. (Not to mention that most portable players, iPod included, don’t support ogg.) It’s the same problem that every other *nix media player has with licensing. The necessary codecs are fairly easy to acquire, but it is still a (major) problem.

Conclusion

To one whose main issue with Linux six years ago was the power, quality, and ease of media handling, Rhythmbox was a welcome find. I hope you enjoy it as much as I do.

Rhythmbox has been a member of the Debian archives since at least Sarge, and Ubuntu since Dapper.

Posted in Debian, Ubuntu | 13 Comments »

Next Entries »