LXDE Desktop

Manage It

I installed LXDE, the lightweight desktop environment. I like it. Its light, fast, and has a most things to make it usable. I say most, not all.

It doesn't have a sound volume control on the panel by default. To add it, do:

Right click panel > Add remove panel items > Panel Applets > Add > Volume Control

After Gnome, which is a fat elephant wandering the plains, this thing is a cheetah sprinting in full stride.

Done!

XTerm & Fonts

Good Size

I tried various fonts and font sizes with XTerm and recently I settled on Lucidatypewriter 12 with a window geometry of 90 x 24.

Here's how the line looks:

/usr/bin/xterm -font -b&h-lucidatypewriter-medium-r-*-*-12-*-*-*-*-*-iso8859-* -geometry 90x24

Here's a quick run down.

/usr/bin/xterm

Launches the xterm application and gives the path.

-font 

Tells XTerm watch out, here comes the font I want.

-b&h-lucidatypewriter-medium-r-*-*-12-*-*-*-*-*-iso8859-*

Gives XTerm the font details.

-geometry 90x24

Tells XTerm to use an initial size of 90 wide by 24 chars high.

You can try other sizes if ya like such as 100x20 or so. But 90x24 works well for me.

Thats it!

MPlayer Language & Subtitles

Decirlo En Ingles

The more you use mplayer the greater your appreciation of its power, simplicity, its raw beauty. Its such a fine piece, crafted with a clear philosophy to make it work and make it simple.

Occasionally I use totem, the default movie player with Gnome. Totem trips splutters and falls with some films. MPlayer merely inhales and breezes through them. Its such a great Movie Player.

If you want to watch a movie in a different language using mplayer, do:

mplayer -alang eng movie.avi

Will play movie.avi with eng language

If you want subtitles in spanish, do:

mplayer -slang spa movie.avi

Try it. You'll like it.

Linux And Par Files

Parity Is Equality

You ever download something from the Net and found a parity file? Wonder what that file is and what it does?

Parity file is a means ensuring the integrity of a file. A par file is a way of checking the file is not broken and if it is, you can fix it. The par file contains enough info to fix your broken download.

How good is that?

The rest of the good news is Linux has a full blown parity checker, usually in-built into most distros. Check to see if you got it:

which par2

Something like 

/usr/bin/par2

You got it. Its on your system and your good to go. If not you can install it easily using one of Debian's excellent installers apt-get or aptitude:

aptitude install par2

Check the integrity of your file?

par2 verify filename.par2

Want to fix a broken file?

par2 repair filename.par2

Want to create a new parity file

par2 create filename

There's loads more, if your interested. 

Check out the man page.

man par2

Linux And RAR Files

Wrap It Up

There is no denying the Windows world exists along with many of its proprietary utilities such as RAR files. These populate the Net in one form or another. If you're not running on the windows platform how do ya deal with these? The answer is ... easy. Linux has developed many tools to interact with all forms of data no matter how its packaged.

To open/unwrap/unpackaged RAR files linux has developed unrar. Its probably already installed on your system. Check it out by typing

which unrar

If you get a response such as

/usr/bin/unrar

Its already on your system. If its not on your system you can download and install it using apt-get or aptitude:

aptitude install unrar

Dealing with WinRAR/RAR files is not a big issue.

To extract RAR files, do:

unrar e filename.rar

To list file contents:

unrar l filename.rar

To test file archive:

unrar t filename.rar

To print file to stdout

unrar p filename.rar

There are many switches to change unrar output.

Check out the man page

man unrar

Debian Boot In One Second

Must Be A Record

Continuing with the theme of Debian booting, I came across an old post at Engadget about a Debian boot in less than 1 second. Yes. Believe. The OS is embedded in the motherboard NAND flash chips.

I haven't rebooted Debian since I installed it a few weeks back. As Debian and Linux in general is so stable, the occasional boot is okay, even if it takes a few minutes. Its not like you have to do it every day or every other day.

I reckon it would be better suited to the Windows OS, which gets flaky if its been running for more than a couple of days. When I was running Windows 7, the slow down in performance and poor response would force me to reboot after a few days. Windows was getting as fast as a zimmer frame racer.

The constant reboots that Windows demands would be well suited to this motherboard.

Debian fsck & Reboot

Up 'n' Down

Debian Linux rarely needs rebooting. Its rock solid and runs for weeks, months, err you know the score. Debian in its current iteration runs ext3 file system. Ext3 is a Journal File system meaning data loss is minimized and fsck's are redundant, almost.

Debian by default runs file system check after a few months. Any how in the rare event you need to force an fsck, there are a couple of ways to do it.

Create forcefsck file in the root filesystem. You must be root user for this.

# touch /forcefsck

Force a shutdown, fsck and reboot.

# shutdown -Fr now

-F forces fsck on reboot
-r forces a reboot

Done!

Mount ISO & IMG Files In Linux

Mount 'em Up

ISO and IMG files content can be accessed quite easily in Linux. First you need to connect the iso / img files to your files system. Just as USB pen drives / memory sticks need to be connected before you can use them. For USB storage, this is normally done automatically by the operating system.

Connecting iso / img files is called mounting. The term comes from the early days of computing as a method for old mainframe computers to connect storage media. In order to attach the data storage, they were first mounted on the mainframe.

To mount iso or img files create a mount point in /mnt, then mount it:

mkdir /mnt/newiso
mount -o loop ./various.iso /mnt/newiso

Now cd into the newly mounted iso:

cd /mnt/newiso/

Done!

MPlayer On Debian

Media Player Par Excellence

If you've used MPlayer you'll know it needs to be configured before using. If you haven't used it, you're missing out on the best media player for Linux/Unix.

Config takes a few tweaks to get it going, but its worth the effort. Other movie players don't come close to mplayer. Its image rendering and stability are amazing. Mplayer can play almost every media file available. It tolerates broken mp4, wmv, avi, flv, and most others you throw at it, where most other media players choke.

First, if you're using the command line version, you need to pass mplayer the video output to use, if its not setup by default. You can do this by passing an argument:

mplayer -vo xv anyfilm.avi

or try:

mplayer -vo x11 anyfilm.avi

You can add the following to mplayer's config file:

vo=xv



or

vo=x11

The config file is located at $Home/.mplayer/config

Its dependent on the graphics card and driver installed on your system.

If you want to enable zoom, add:

zoom=yes

Start mplayer fullscreen:

mplayer -fs -vo x11 anyfilm.avi

One error message I got when I installed and first used it, mplayer complained about not finding subfont.ttf. MPlayer is looking for a subtitle font and for its on screen display. It prefers a sans serif something like Arial font. To fix this you need to create a symbolic link in your .mplayer directory.

Locate your MS TrueType font ttf folder, its probably somewhere round /usr/share/fonts/truetype/mscorefonts/. In an XTerm do:

ls /usr/share/fonts/truetype/mscorefonts/arial.ttf

This should display arial.ttf Once you have the path, create the following symlink.

ln -s /usr/share/fonts/truetype/mscorefonts/arial.ttf ~/.mplayer/subfont.ttf

One time this did not work for me. I copied arial.ttf to ~/.mplayer/ and renamed it subfont.ttf. That fixed the problem.

To toggle full screen and regular, press 'f'.

To pause, press 'p'. Press any key to restart.

You can control mplayer's size/resolution onscreen:

mplayer -geometry 600x480

Or add it to your config file.

You can set resolution using -x and -y for display on the command line:

mplayer -vo x11 -fs -zoom -x1600 -y1200 somefile.avi

Dependent on your screen size and resolution.

Want mplayer to loop media file 4 times, do:

mplayer -loop 4

Want mplayer to loop media file infinitely, do:

mplayer -loop 0 (zero not O)

Want subtitles with that movie? Not a problem. Make sure the subtitle.srt file is in the same directory as the media file and has exactly same name as the movie file (apart from the .avi /.srt) or mplayer will not recognise it as belonging to the movie. Having the same name, will prompt mplayer to automatically load the subtitle file for use.

Press 'v' to show/hide subtitles

Press x / z adjust delay +/- 0.1 seconds

Press b / j to cycle through available subtitles

Press y /g to step forward/back in the subtitle list

Press 'F' to toggle displaying "forced subtitles".

Press 'a' toggle subtitle alignment: top / middle / bottom.

Press r /t to move subtitles up/down.

List of help commands:

mplayer -vo help

Play a media file on DVD, try:

mplayer dvd://

Or

mplayer dvd://1

Seek forward / back 10 seconds <- / ->

Seek forward / back 1 minute up / dn arrow

Seek forward / back 10 minutes PgUp / PgDn

Increase / decrease playback speed 10% [ / ]

Half / double current playback speed { / }

Reset normal playback speed <- Backspace


Pause playback p / spacebar

Quit / Stop q / esc

Adjust audio delay + / - 0.1 seconds

Increase / decrease volume / or *

Increase / decrease volume 9 / 0

Mute sound 'm'

Toggle On Screen Display 'o'

That should do it.

TrueType Fonts In Debian

Subtle Glyphs

When you install True Type fonts in Debian, in fact any font, they are dumped into a shared directory in the /usr directory.

You can access them at:

/usr/share/fonts/truetype/msttcorefonts

Other truetype fonts are stored here too.

Fonts for X11 window system are located at:

/usr/share/fonts/X11/

If you need them at any time.

Debian Aptitude

Pack It Up

If you run Debian and need to download, install, update, upgrade, remove, or search for software there's a good chance you use apt-get or aptitude. If you're an apt-get user give aptitude a try. Its as easy as apt-get and has additional benefits.

Before we go any further, its important you have the correct source files listed, added or appended in your /etc/apt/ directory. These must include your current Debian version and any contrib / non-free repositories you need.

Change directory to /etc/apt/ and edit sources.list. Add "contrib" and "non-free" to the end of your sources list so it looks something like this:

deb http://ftp.uk.debian.org/debian/ squeeze main contrib non-free
deb-src http://ftp.uk.debian.org/debian/ squeeze main contrib non-free

deb http://security.debian.org/ squeeze/updates main contrib non-free
deb-src http://security.debian.org/ squeeze/updates main contrib non-free

Aptitude is dead easy to use once you master a few simple commands in an XTerm or Gnome-Terminal.

To search for stuff:

aptitude search stuff-your-looking-for

Aptitude will return results and if it does not get what you want, you'll get suggestions. That is great. If your not sure what the package is called and search on "update" you get:

root@apache:/home/patrick/Downloads# aptitude search update
p copyright-update - update copyright information in files
p ez-ipupdate - client for most dynamic DNS services
p freepops-updater-fltk - Graphical interface for the freepops updater en
p freepops-updater-gnome - GNOME interface for the freepops updater engine
p hildon-update-category-database - Hildon desktop MIME type hander - mapping tool
p langupdate - locate updated language files in Emdebian
p libqrupdate-dev - Fast updates of QR and Cholesky decompositions
p libqrupdate1 - Fast updates of QR and Cholesky decompositions
p nss-updatedb - Cache name service directories in DB format
i A update-inetd - inetd configuration file updater
i A update-manager-core - APT update manager core functionality
p update-manager-doc - Update Manager API documentation
i A update-manager-gnome - GNOME application that manages software updates
i A update-notifier - Daemon which notifies about package updates
i A update-notifier-common - Files shared between update-notifier and adept
p xmms2-client-medialib-updater - XMMS2 - medialib-updater client

You get all packages with "update" in the name.

To install stuff:

aptitude install stuff-your-looking-for

To remove stuff:

aptitude install stuff-your-looking-for

To update aptitude database file to match current repositories:

aptitude update

To upgrade your installed packages:

aptitude safe-upgrade

These commands will get you started on using Debian's aptitude.

Want to know more? Read the online aptitude manual.

Done!

Emacs Minibuffer

Navigate

Emacs is a great tool, and if you have a mind to endure a chastening experience then I can recommend nothing better than learning to use Emacs. Apart from the hours of frustration you will endure, you will have much fun along the way. Anyhow, what's life without a little frustration? It would not be the same.

When using Emacs occasionally you find yourself dumped in the minibuffer. While there you can access previous minibuffer entries by using the up/down arrows on the keyboard. But as we all know that means taking your hands off the home row which is verboten. A faster more accomplished and wholly satisfying method is to use M-p / M-n.

M-p displays previous entry

M-n displays next entry

Just you navigate up and down a document using C-p / C-n.

You can also use C-a / C-e to jump to start-of-line / end-of-line in the minibuffer.

What fun!

Remove Gnome Desktop Icons

Disappear


Gnome is quite a nice desktop environment and as with all desktops they tend to put on weight and gain bloat.

From time to time you need to get rid of excess and unused items. Desktop icons for example. I rarely use them, and mostly they are buried beneath an open application. So, its time for them to go.

To remove desktop icons in Gnome, do:

Applications > System Tools > Configuration Editor

apps > nautilis > desktop

Uncheck the icons you want gone and voila.

Done!