Archive: ‘Applications’

Favorite CLI Linux Apps: Lynx

02.19.10

Posted by adamlinuxhelp  |  1 Comment »

Lynx is a text-only web browser that runs in the shell.

Lynx is useful tool for those times when you want to extract only the web links from a web page.  Install lynx using the Synaptic (or other) package manager.

To view the hyperlinks of a given web page (google.com in this example), issue the command

lynx -dump http://www.google.com

It can also behave in a similar way to wget when you want to view the HTML source code of a web page.  The command to view the HTML source code is

lynx -source http://www.example.com

Click the following link to view a post where we collected links to mp3 files to build an unattended download list for the wget command.  Another feature of Lynx is that it allows you to view your pages as a web crawler/robot such as googlebot might see them.

Favorite Linux Apps: Intro

02.12.10

Posted by adamlinuxhelp  |  No Comments »

So far, we’ve been talking about using the command line to download files or make some repetitive work simpler.  We’ve also seen how to upgrade a Firefox Web browser in Ubuntu.

Today we’ll discuss general “tools” that a Linux user might need on a daily basis.  Most of these tools are (believe it/not) GUI applications.  You can lose time by slogging through a CLI solution only to learn you could have gotten the job done quicker with a GUI app.  But when the GUI app is clumsy or lacks a reliable batch process—I consider command line solutions.

So, with that, here are some tools/apps that I install to my Linux desktops.  Since I prefer Debian-based package management, GUI installs will reference “Synaptic” while command line install instructions will be “aptitude”.

Favorite Linux Apps: Audio & Video

02.12.10

Posted by adamlinuxhelp  |  1 Comment »

This one’s up to you.  There are so many to pick from, just check Synaptic.

Digital Audio Playback

For an iTunes-style program, try AMAROK, and for simple playback of audio files without hearing the audible “gap” between song cuts, try Aqualung.

Audio Editing

I have used Audacity for simple stereo-file (non-multitrack) audio editing.  It got the job done, but arguably, there are better tools available for semi-pro recording on a Linux system.

Digital Video/Media Playback

VLC is a reliable application that can play many multimedia formats.  VLC sometimes comes standard with a distro.

Video Editing

I haven’t done much video editing, but so far I’ve tried Kino and I found it really easy to use.

Favorite Linux Apps: Web Coding

02.12.10

Posted by adamlinuxhelp  |  No Comments »

Linux Gui Applications for Website Design/Development

If you’ve got a site to develop or design, it’s easy to set up a working web server based environment in Linux. As stated in another post, you will need an IDE-style text editor (or at the very least you’ll need an editor that lets you keep several files open at the same time).

Run your pages using a web server such as Apache

While there are a few ways to do this, installing XAMPP for Linux by Apache Friends is simple.  It is free, well-documented, and you can set up a website very quickly.  By default, the web server is not started at boot time, (which to me is a plus) and starting/restarting can be controlled by issuing a command at the terminal.  XAMPP comes with MySQL and PHP 5, so it gives you just about everything you need to develop/create dynamic, database-driven web pages with the ability to reuse code (via PHP “include” directives).

Check your work in a few browsers to ensure consistency

If you’re running Linux it may seem a daunting task to evaluate your site’s appearance in Mac OS-X or Microsoft Windows.  Daunting yes, but you can come close.  Safari in Mac OS-X uses the “webkit” layout engine and you can view your pages in the konqueror web browser as a poor-man’s substitute.  It’s not perfect, but it’s close.  Mozilla firefox uses the Gecko layout engine so it won’t show you know how a site looks in Internet Explorer for Windows.  Firefox has a browser plugin called “IE Tabs” but I’m not sure if this reasonably captures the look and behaviour of the native IE.  Be sure to browse the Firefox Web Development add-ons page.

Favorite Linux Apps: Photo & Image

02.12.10

Posted by adamlinuxhelp  |  No Comments »

Linux Gui Applications for Photos and Image-based tasks

If you like to store your digital photos in “album-style” format, then I recommend Digikam.  It’s a KDE-based app so I suggest installing it using Synaptic on Debian-based systems.  Let Synaptic fetch other files as needed.  This saves you the headaches of “dependency hell”, which happens when an app you wish to install needs additional files and you have no idea which ones, where to find them, or how to properly install them.

To manipulate photos and images (such as cropping, or layering text captions onto them) I suggest you install the GIMP if it’s not there by default.  To find out if you have it, you can check your Applications menu or issue the following command in a terminal

which gimp

If the shell returns something like “/usr/bin/gimp“, then its installed.  If it returns nothing, you’ll need to install it.  The GIMP also does scaling (resizing images while keeping the aspect ratio) and is the closest freeware knockoff of Adobe Photoshop to my knowledge.

When I say “closest” I implore you to decide for yourself if your tasks can be done with free software.  The GIMP has a lot of great features such as transparency, layers, gradients, and more; but IT IS NOT CAPABLE of replacing Photoshop if that’s what your work requires.

If you’re doing commercial graphical work, your software choice (and budget) should be “an investment” and not “an expense”.  For many personal uses, the GIMP may be able to give you professional-looking results.

Favorite Linux Apps: Text Editors

02.12.10

Posted by adamlinuxhelp  |  No Comments »

Linux Gui Applications to write and edit text

For simple stuff I recommend Gedit that comes with GNOME-based Linux distros.  If you’re running a K-Desktop Environment (KDE) then Kate is really good.   Gedit works well for writing quick text snippets or copying text from websites to use later on.

For text writing in general, I like Pyroom which came pre-installed with Crunchbang Linux 9.04 and I happen to be writing this very blog post using Pyroom.  Pyroom reminds me of a typewriter interface—everything else on the screen (except for your text and a light border) is invisible.  Nothing to distract your eyes.  You only see the words that you type (non-formatted) on your (virtual) page.  Each time you hit “return”, your work just scrolls upward.  And it can “auto-save” your work at intervals that you set in preferences.

If you’re going to write scripts in various programming languages, then you’ll need a decent IDE-style code editor.  This comes in handy if you’re building a website, because you can create a “project” file that will group together the text-based files related to your website.

For this type of work, I use Geany, but have recently installed Aptana Studio to try it out.

The benefit of an IDE-style editor is that it can color the syntax so your commands don’t look like a big vat of text.  This makes reading, writing, documenting (or “in-code comments”) and troubleshooting your work much much easier.

Favorite Linux Apps: Burning disks

02.12.10

Posted by adamlinuxhelp  |  No Comments »

Linux Gui Application to Burn CDs/DVDs

Depending on your Linux distribution, you already have an application capable of burning Data CDs for file/folder backups and Music CDs.  Most of them offer the ability to burn an .iso file.

I usually install K3B (KDE-based) for disk burning.  Install k3b with Synaptic package manager:  type “k3b” [no quotes] after clicking the “Search” button.  If you’re using a non-KDE System, let Synaptic install any extra items.

I prefer k3b because I find it more reliable than other burning software that may come bundled with a distro.  I won’t name applications, but for one reason or another they disappointed me, even though community opinion of them is high.

There are times when you just have to trust your instincts and experiences.

When something works for you, use it.  If it gives you headaches, then seek alternatives.

That’s the benefit of choice.

Upgrade Firefox: Ubuntu-style Linux

02.02.10

Posted by adamlinuxhelp  |  No Comments »

Upgrade your Firefox web browser.

Found this great tutorial site for upgrading Firefox web browser in Ubuntu (and Ubuntu-style) Linux distributions.  I’ve linked to the category page, because (to date) the latest version mentioned is Firefox 3.5.5 and currently (as of 2nd February 2010) Mozilla has released version 3.6 for download.  Click the following link to Mozilla Firefox downloads page.

Why is “Ubuntu and Ubuntu-style” relevant here?  Because the tutorial that I found applies to the Linux distro that I’ve been using for a while.  It’s called “Crunchbang Linux” and it’s also known by it’s symbolic alias of #!more info on Crunchbang Linux at this link.  The tutorial was written with Ubuntu in mind but will also work on Ubuntu derivatives such as Linux Mint and others.

The tutorial has 3 easy steps—possibly even 2 steps—depending on whether or not you’ve already upgraded Firefox or not.  If you have upgraded, you’ll need to follow all 3 steps.  If not, then you’ll only need 2 steps.  Note, I do not count the step of moving the downloaded Firefox *.tar.bz2 file to your /home/userName directory as a step because it’s something you will have to do (or not do) depending on your Firefox download folder preferences.  Early versions of Firefox have a default setting of downloading all files to the /home/userName/Desktop folder, however, depending on the flavor of Linux you are running, it may choose the /home/userName/downloads folder.

Thanks again to Jaxov for the awesome tutorial.  Just follow this link (or the link at the top of this post) and then look for the highest Firefox version available.  You should also visit the Mozilla download link above to see if a later version is available.  The steps in the tutorial are similar (if not identical) for recent versions of Firefox, so even if you are downloading version 3.6 you can still follow the directions in the tutorial for 3.5.5 and it will work.

Download several files: part 2

01.14.10

Posted by adamlinuxhelp  |  2 Comments »

In an earlier post we used wget to download a single image file, and then used it to get all of the ‘gif’ and ‘jpg’ files from a single command.  Multi-download commands of this type are helpful when you know the URL and exact directory where the image files exist.  Let’s now take it a step further, and get lazy too.  Lazy?? Yes, lazy.  Since we’re looking to use Linux for time-saving shortcuts, the less work we have to do to get to accomplish our task, the better.

As previously mentioned, I like podcasts.   Podcasts are (usually) available in an RSS feed in the form of a web URL.  Programs such as ITunes, Amarok, Rhythmbox (or other) use feed URLs to get info about the available audio files and you can manually download them or set up preferences that do this for you.

We’re going to look at this from a “get me all the files—now” approach using the Linux command line.

To perform a multi-file “unattended” download…

  1. Make sure that “lynx” (a terminal-based web browser) is installed.  To check if lynx is installed, type which lynx at the prompt.  If the shell responds with nothing but the next prompt, then it’s not installed.  To install lynx and you’re on a debian-based OS such as Ubuntu (or similar) type “sudo aptitude install lynx” at the prompt.  If you’re using a redhat-based system type “yum install lynx” to accomplish the same.   When lynx is installed, the shell will return the executable path of lynx (it might appear as /usr/local/bin/lynx) when you type “which lynx” at your prompt.
  2. Make sure you have wget installed.  In the terminal, type “which wget” and see what the shell returns.  If it’s not on your system then install it.  Items one and two only have to be done once, if at all.  I think wget will be there, but  lynx is probably not included out of the box at install time.
  3. A URL (or RSS feed URL) where the desired files exist.

Here’s our practical example.  Let’s download all the mp3 files at Steven J. Cohen’s “Doctor Who” RSS Feed. You should view this link in a web browser to make sure that the page/feed is still there.

Time for a “trial-run” (this next command will not download, just list the mp3 files at the Feed URL).

lynx -dump http://www.stevenjaycohen.com/audio/drwho/feed | egrep -o "http:.*mp3"

lynx -dump [URL] returns a numbered list of web links from a given web page (for the complete HTML source, use lynx -source [URL]). Since we only want the links, (and not the numbering) we need to filter this list using the UNIX pipe character “|” and the search tool egrep -o [pattern].  We put in “http:.*mp3” as our pattern which will capture any link that starts with http and ends with mp3 (note the .* is a wildcard meaning `any character`). A word of caution. It’s ALWAYS a good idea to do a trial run so that you have an idea of what you will request for download and if your command will succeed in building the list properly.  This is a very important preliminary step.

Now, let’s do this for real.  The following command downloads files into the current directory of the shell.  So if you execute the command from “/home/myUserName/music” then the files get saved into “music”.

lynx -dump http://www.stevenjaycohen.com/audio/drwho/feed | egrep -o "http:.*mp3" | xargs -n1 wget

And that’s it.  The shell shows progress of each file as it downloads.  When it’s done with the first file, it downloads the next one, and so on.  It runs unattended, allowing you to do other things with your time.

To perform the “unattended” download of all the files specified in the list, we needed another pipe, and another command structure known as “xargs”.  Why xargs?  Sometimes the shell runs into a problem of having “too many arguments” in its list to act on.  xargs is your friend should this happen.

xargs [options] [command].  The option and the command work together as follows.  Option “-n1” directs the command “wget” to work one time per each url from the list resulting from the “lynx -dump” part of the command.  Like many shell commands, there’s usually more than one way to do it.

Download several files: part 1

01.14.10

Posted by adamlinuxhelp  |  No Comments »

How to use wget; download many files with one command.

A typical way to download a file is to “right-click” on it and “save as” to a folder on your computer.  Downloading a few files this way is not tedious.  But if an audio book has 25 to 30 files you can bet I don’t want to do those manual moves over and over again.

Using a terminal, there’s a faster way to download files.  I’ll introduce now one of my often-used commands: wget.  This command has many useful options.  For example, you can download files, set up custom directory structures for your download(s), or see if a file exists without actually downloading it.

Using the command (in simple terms): Open a terminal and type wget [options] [urls] at the prompt (usually a dollar sign).  You can use one or several URLs.  Options are (well…) optional.

Here’s a practical example where you can download a gif image from the O’Reilly site linked below.  When you open a Linux terminal, you are usually in your user’s “home” directory.  This is fine for the purpose of this example.  Issue the command

wget http://oreilly.com/catalog/covers/0596009305_bkt.gif

Here’s what will happen: the file 0596009305_bkt.gif gets downloaded and saved to your home folder.  Cool right? But it was a bit of work (typing) just to download one file.  How does this save me time?

Yes, the above example is overly-simplified.  You can, if you wish, download any “.gif” or “.jpg” files from a given web address in the example below.  It’s a time-saving single command, borrowed from the commandlinefu website mentioned in the “cool and advanced uses of wget” link below.

wget -r -l1 --no-parent -nH -nd -A".gif,.jpg" http://example.com/images

*Change the “example.com/images” to a valid web address.  The options above (explained) are:

  • -r for “recursive”
  • -l1 only get files in the “images” directory (don’t dive into subdirectories)
  • –no-parent and -nH and -nd : ignore directory structure (no directories—just get the files)
  • “-A” is the “accept list” for files of type [.gif and .jpg].  It’s case-sensitive, so it would not download files ending in “.JPG”, so if you needed those too, specify with -A”.gif,.jpg,.JPG”

You can find more wget info and options here.  For really cool and advanced uses of wget, see this page.

I’ll post another awesome usage of wget in another post.  Thanks for reading.