Mount ISO Files

Loop De Loop

Someone recently asked me about reading ISO files and how to go about it. In Debian or any flavour of Linux it's easy.

The command is in three parts.

1. The mount command.
2. The location of the ISO file.
3. The location of the mount point.

ISO file is called homevideo.iso. Locate the ISO image in your home directory. Create a directory to mount it.

mkdir isomnt

We mount the ISO in our home directory mount point:

mount -o loop /home/myname/homevideo.iso /home/myname/isomnt

You can cd into /home/myname/isomnt to check the contents.

When your done you need to unmount the ISO file. Do:

umount /home/myname/isomnt

That's about it.

Done!

XFCE4 Xmodmap Problem

Broken

Running X commands in XFCE4 at start up works, in theory. In practice, not. I had this problem for a while and searched for a solution, without success. Today I was reading through documents on XFCE website and found this entry.
Is it possible to use Media keys in the Shortcut Editor?
Use xmodmap to assign keycodes to your Media keys to make them available for the Xfce shortcut editor:
To determine keycodes of the multimedia keys use the program xev. Create a .Xmodmap file in your $HOME directory containing those keycodes and assign keysyms to them. All possible keysyms can be found in /usr/lib/X11/XKeysymDB or /usr/share/X11/XKeysymDB. 
To ensure that the .Xmodmap file is loaded when you start Xfce add /usr/bin/xmodmap $HOME/.Xmodmap to your .xinitrc or .xprofile file. When you start the shortcut editor the assigned keysyms should show up when you press one of your multimedia keys. Now it is possible to assign a command to them. 
Note: Several problems with auto-loading of .Xmodmap files at xfce startup have been reported (also when issued as autostart command). Search the xfce bugzilla sites for current problems. As a workaround, run xmodmap ~/.Xmodmap by hand every time, or try out editing the somewhat less straightforward xkb configuration files.
There you have it.

Done!

Web Cam Setup In Debian

Moving Pictures

I set up a Web cam running Debian Squeeze in around 10 minutes. The Web Cam itself was an 'el cheapo' model made by Microsoft.

Its a LifeCam VX-1000 color Web Cam with 640x480 resolution for video and still images. It has a built-in microphone and a USB type A connector. More importantly, its supported in Debian Linux.

I plugged the camera in and ran 'lsusb'.

lsusb
Bus 003 Device 004: ID 045e:00f7 Microsoft Corp. LifeCam VX-1000

The device was recognized immediately. Great. I'm running Debian 2.6.32 kernal, I guess the device driver is already in the kernel.

I installed an app to see the Web Cam in action. I pulled down Camorama. Its a simple application with limited abilities, but it will do fine for testing.

aptitude install camorama

Two minutes later, it was installed. I fired up the program and had Web Cam images onscreen. Camorama can capture stills or display images as they happen. It has no streaming capabilities.

I installed Cheese from the Debian repository:

aptitude install cheese

On completion, I fired it up and could capture still images or record video. Its slightly more versatile than Camorama.

I also got the Web Cam to display images in mplayer. I did:

mplayer -fps 30 tv://

I googled but results were thin on the ground for what I wanted. I read briefly you can use Mencoder to save the stream to disk or similar. I guess I will have to dive into the MPlayer / Mencoder documents to find what I need.

I will look into that over the next couple of weeks, and post on results.

Anyhow, its a positive start. It works.

Done!

Disable Annoying TouchPad In XFCE4

Veritable Irritant No More

If you have a laptop running Debian Linux or another Linux flavour, touchpad tapping is enabled by default.

This causes the cursor to hop around if your typing or if your hand touches / brushes the touchpad.

Its annoying and time consuming, to go back and correct typing errors caused this way.

If you run GNOME or KDE desktops its easily fixed. If you run XFCE4 the method is not so obvious. There are no settings to disable this activity.

Disable the mouse touchpad on the command line with the following:

syndaemon -d

This causes syndaemon to delay response before activating again after a key press.

Done!

Memory In Linux

Recall

To check memory usage in Linux do:

cat /proc/meminfo

You'll get a long listing of all memory usage.

Use free to show memory usage in megabytes:

free -m

You can use -k for kilobytes or -G for gigabytes.

There is vmstat too:

vmstat 2 5

vmstat displays output every 2 seconds 5 times.

Done!

DVD Backup Revisited

Burn Some More

After digging a little further, I unearthed a couple of other DVD Backup apps, to secure your important data.

K9Copy is a small utility which allows DVD backup on Linux. The DVD video stream is compressed by the program Vamps. Options include:

Copy without menus :
DVDAuthor creates a new structure for the DVD. It is possible to arbitrarily set the order of the videos.

Copy with menus :
As dvdauthor can't copy the original menus, K9Copy recreates the original DVD structure. The menus as well as IFO files are modified to point to the compressed MPEG2 stream.

K9Copy features include:
The video stream is compressed to make the video fiton a 4.7GB recordable DVD
DVD Burning
Creation of ISO images
Choosing which audio and subtitle tracks are copied.
Title preview (video only)
The ability to preserve the original menus.

Prerequisites
DVDAuthor
libdvdread
growisofs
mencoder
mplayer
libhal
libdbus
libdbus-qt


OGMRip a Gnome centric app which looks useful. OGMRip is an application and a set of libraries for ripping and encoding DVD into AVI, OGM, MP4, or Matroska files using a wide variety of codecs. It relies on mplayer, mencoder, ogmtools, mkvtoolnix, mp4box, oggenc, lame, and faac to perform its tasks.

The GUI features a clean GNOME 2 interface and tries to minimize esoteric settings for the end user. A CLI client is also available, it's called shRip.

Done!

F4V Files

What Are They?

The F4V file format is an FLV MPEG-4 file Flash video file, that's been renamed to F4V. (Given .F4V extension).

The F4V format and the FLV format, are MPEG-4 video formats defined by Adobe. F4V files are containers for H.264 and MP3.

Before you can open or play an F4V format file, you must have the appropriate codecs installed. The video compression used is H.264. Audio compression is AAC or MP3.

If your media player can't open or play the file, you can download the necessary codecs to enable your media player.

Other choices are to look at VLC, the VideoLan Client, or check out mPlayer for your platform. On the windows platform, media player classic is available.

All have the necessary codecs to play F4V files.

Done!

More DVD Backup In Linux

Burn Some More

DVD backup on Linux using dvd::rip. Its similar in many ways to Thoggen. Using a GUI front end and most actions are accessible via point and click. DVD::Rip is easy to use.

If you run Debian, the install is a breeze. Use aptitude to search for the dvd::rip, to ensure your repositories are set up correctly.

If its there, just do:

aptitude install dvd::rip

After a few minutes, your up and running. Full documentation for dvd:rip, is available at dvd::rip site. I suggest you take a read of the documentation.

dvd::rip supports a whole range of codecs including, Xvid, ffmpeg4, DivX 4/5, mjpeg, and many others.

DVD audio codecs are usually encoded using the AC3 format. dvd::rip also supports MP3 and Vorbis.

The following container formats are supported: AVI, OGG, MPEG-1, MPEG-2.

If you run Debian, pull it down and give it run.

End!

Web Browser No Mouse

No Rodents!

I just discovered, downloaded and installed a browser I have been hunting for ages. I guessed it existed, but did not find it. Today, I got it.

Its a special kinda browser. Different. Very different. This browser uses no mouse controls. Understands no mouse controls. Has no buttons to click. No scroll bars to move. No right-click. No left-click. In fact, it has no click.

The browser is called "Conkeror".

A little history. For a while I used KDE 3.5, and I ran with Konqueror, the KDE Web browser. Konqueror was fast and had one other desirable feature: keyboard navigation. When you pressed he 'Alt' key, Konqueror would hi-light all visible links and assign them a letter. You could then jump to a link by hitting that letter. Unfortunately, Konqueror didn't have 'Adblock', and a few other minor issues.

This new special 'Conkeror' with a 'C', apart from the fact its keyboard controlled, has one other very special feature: 'Emacs'.

Conkeror is a Mozilla-based web browser whose design is inspired by Gnu Emacs. This is totally insane. Totally brilliant.

You cannot imagine what a pain it is to lift your hands from the keyboard and move them 12" to your right to pick up the mouse. It is so disruptive to work flow or leisure flow or any kind of surfing the Net.

If you have read Steve Yegge's post on utilising Emacs and the power of the keyboard. Go read it now. It is a 'Must Read'.

Keeping your hands on the keyboard is THE way. Rodent hunt is not!

The key bindings are based on Emacs. Can you believe? When you get used to using Emacs key bindings, using anything else, is so lame.

Believe. It is the way.

Go download, install and start sweating to learn, Emacs. Once you do, I promise, I swear, you will not regret it. You will not look back.

There is just one last piece missing from the puzzle, and I believe I have found that too. Though I have not installed it yet. I am almost there. The final piece is... the desktop.

Watch this space.

DVD Backup

Linux DVD Backup Made Easy

You built up your collection of shiny DVD movies and music, and a friend asks to borrow one or two so he can enjoy some old films over the weekend. Cos he's a good friend, you lend him that prized rare Criterion Collection Copy of one of your fav's.

He returns the DVD on Monday, as promised, but his dog got to it and the scratches are deeper than an open cast mine. Its probably unplayable. You know in your heart you should have made a back up copy. But how?

Thoggen. That's how.

Thoggen is a DVD backup utility to protect your precious personal DVD collection. Thoggen allows you to make back up copies of all your favourite DVDs. Its designed to be easy to use and mostly hides unnecessary complexity from Joe Public.

Thoggen is available for Debian. Its in the sid/unstable packages, and you will probably need the  libdvdcss2 library package from Christian Marillat's repository.

Thoggen is also available for Fedora / Redhat and Ubuntu.

Ubuntu users should check out the Ubuntu restricted formats wiki page.

Go download Thoggen and backup that precious DVD collection now.

Done!

Linux DV Video Editors

Home Movies

When it comes to DV-Avi, there are only a few apps available on the Linux platform.

Kino DV Video Editor. Kino is a non-linear DV editor for GNU/Linux. It features excellent integration with IEEE-1394 for capture, VTR control, and recording back to the camera. It captures video to disk in Raw DV and AVI format, in both type-1 DV and type-2 DV (separate audio stream) encodings.

You can load multiple video clips, cut and paste portions of video/audio, and save it to an edit decision list (SMIL XML format). Most edit and navigation commands are mapped to equivalent vi key commands. Also, Kino can export the composite movie in a number of formats: DV over IEEE 1394, Raw DV, DV AVI, still frames, WAV, MP3, Ogg Vorbis, MPEG-1, MPEG-2, and MPEG-4. Still frame import and export uses gdk-pixbuf, which has support for BMG, GIF, JPEG, PNG, PPM, SVG, Targa, TIFF, and XPM. MP3 requires lame. Ogg Vorbis requires oggenc. MPEG-1 and MPEG-2 require mjpegtools or ffmpeg. MPEG-4 requires ffmpeg.

Vivia a video editing app for Linux that offers user friendly editing of DV Video material. Vivia offer efficient and editing of clips and transitions, multi-cam edit mode, natural editing of scenes  recorded by multiple cameras simultaneously. Often typical in music videos and interviews. Also supports multiple scenes in a single movie project.

It supports following video and still formats. Video: PAL DV (avi or dv). Still images: bmp, gif, jpg, png, pbm, pgm, ppm, svg, xbm, xpm.

If you have a DV Video Camera, and you run Linux, you'll need one of the above.

Done!

Linux Video Editors

Cut Past Play

Linux has a few apps when it comes to Non-Linear Video Editing. Not as many as Windows, but enough to keep you entertained if your current choice dissatisfies. The first option and probably the easiest, is Avidemux.

Avidemux  easy is designed for simple cutting, filtering and encoding tasks. It supports many different video media:  AVI, DVD, MPEG-2, MP4, ASF, H.264, MPEG-4, QuickTime, 3GP, and more.

Output formats: AVI, H.264, MPEG, MPEG, MP4, etc. Avidemux includes a wide variety of codecs. You can cut, filter, encode movies. Avidemux has scripting capabilities, and supports the following video formats: DVD, VOB, AVI, DivX, XviD, WMV, MPG, MP4, AVI, Mov, Mkv, DV, Flv. Audio codecs: MP2, MP3, Vorbis, AAC, AC-3, WAV PCM, LPCM.

OpenShot a powerful open-sourced video editor for Linux. OpenShot can easily add sub-titles, transitions, and effects, and then export your film to DVD, YouTube, Vimeo, Xbox 360, and many other common formats.

Kdenlive an open-sourced editor for Linux and FreeBSD, which supports DV, AVCHD and HDV editing. Kdenlive uses open source projects, such as FFmpeg, the MLT video framework and Frei0r effects.

Kdenlive was designed for basic video editing to professional class work, and provides unique features that allow you to mix virtually any kind of media, such as  video, audio and still images.

LiVES is simple but powerful video editor that's small in size and has many advanced features.

Mixing realtime video performance and non-linear editing. You can get started editing without worrying about formats, frame sizes, or framerates. A flexible tool for both VJ's and video editors - mixing and switching clips, trimming and editing  using the multitrack timeline.

PiTiVi is a powerful video editor based on GStreamer and GTK+.

PiTiVi allows users to edit audio/video projects based on the GStreamer framework and allows almost any media file supported by GStreamer to be imported, along with projects using any supported container and codec combination.

PiTiVi provides several ways of creating a timeline from simple view full editing view.

Cinelerra is a really powerful video editor, not aimed at the casual or home user, but more at the professional.

Cinelerra includes support for high-fidelity audio and video. It is resolution and frame rate-independent, meaning that it can support video of any speed and size.

Cinefx is a playback, editing, encoding, animation and visual effects tool based on the Jahshaka technology that allows you to create professional digital media on your desktop. Use tools like hollywood uses to create great films and special effects.

VLMC from the people who brought you VLC the VideoLan Client, now comes VLMC the VideoLAN Movie Creator. A non-linear editing software for video creation based on libVLC and running on Linux, Windows and Mac OS X!

Finally, ZS4 Video Editor. ZS4 has many features. Here are a few: Unlimited number of audio, video and picture tracks. Unlimited number of video/audio effects for every track. Produce video with a resolution of 8x8 or 16000x16000 (~200 Megapixels / frame) and many sizes in between (custom). Full automation control for all track and effect variables using keyframes (cropping, zooming, panning, volume, rotation, opacity, key-color etc...). Full cross integration of audio and video. (noise gates triggering video effects. video brightness controlling volume etc.). Manipulate the flow of time, forward, backward, speed up and slow down smoothly. Grouping of video/audio tracks into sub-groups (submixers) which can then be manipulated (faded/rotated/effected etc) as if they were a single track.

Now go choose.

Video Conversion In Linux

Transcoding

If you need to convert those home movies of birthday and xmas parties from years gone by, you need a transcoder of one kind or another. Linux has a few.

Handbrake. Multiplatform video / audio transcoder that handles almost any format you like. Its fast, stable and actively developed.

It supports any DVD-like source: VIDEO_TS folder, DVD image or real DVD, and some .VOB and .TS files, Any multimedia file that libavformat reads and libavcodec decodes.

Handbrake outputs the following formats: MP4, MKV, Video: MPEG-4, H.264, or Theora, Audio: AAC, MP3, Vorbis or AC-3 pass-through.

Transcode. Transcode is a command line utility, for transcoding video, audio, and container formats. It includes a variety of video and audio filters, including video de-interlacing, audio resampling, framerate conversion, different video resizing algorithms, smoothing, sharpening, noise removal, and cutting.

Transcode decodes / encodes audio and video formats: MPEG-1/2, MPEG-4 (-part 3) DivX / XviD, Quicktime, MPEG-PS (decode only), MPEG-1-layer-1/2/3 audio, AC3 audio.

A number  of video and audio processing filters are available for: video de-interlacing, audio resampling, framerate conversion, smoothing, cutting. Transcode can import DVDs on-the-fly, or record from Video4Linux devices.

Transcoder. To really muddy the water and confuse things, we also have Transcoder. It doesn't use Transcode but FFmpeg at the backend and GTK+ for a GUI front end.

FFmpeg
. A fast video / audio converter that can also grab from a live video / audio source. Using a command line interface designed to be intuitive. FFmpeg tries to guess the required  parameters automatically. Usually only specifying the target bitrate.

FFmpeg converts any sample rates to those desired. It can resize video on the fly.

WinFF. A GUI front-end for FFmpeg. Allows conversion of video and audio formats. Once installed its easy to use.

Mencoder. The other half of mPlayer. The awesome all round media player for Linux. Mencoder will convert most formats. Mencoder is one of the big boys of Linux transcoders.

Linux Video Converter Rudd-O. Linux Video Converter. The simple video transcoder for Linux. Choose your video, select the new format, hit OK and presto, it's done. Linux video converter makes it easy to convert your videos to several popular formats to archive or upload into video sharing sites, such as YouTube or Vimeo.

It uses the powerful Mencoder transcoding suite.

VLC. VideoLanClient is a media player and a video network server. VideoLan was originally developed to stream media over a LAN (local area network), hence the name VideoLan. The VideoLan Client can also convert media to another encoding. VLC has many codecs inbuilt by default.

You have a few to choose from. Go have a look!

Done!

Create DVDs In Linux

Digital Versatile Disc

In the Windows world you are spoilt for choice if you want to author (burn) a dvd, so it can be played in a standalone dvd player (set-top box). In Linux, your options are limited, but they do exist.

One package I used recently is Bombono. A GUI front-end to DVDAuthor. Its an easy to use product for burning DVDs, and its available on Gnome, KDE, and most other Linux desktops.

I run a spartan install of Debian with XFCE4 desktop. Bombono, downloaded, installed and worked without a hitch. To get Bombono onto your system, do:

aptitude search bombono
bombono-dvd

aptitude install bombono-dvd

A few minutes later, I had it running.

If Bombono does not show up on your search, check your /etc/apt/sources.list. You may need to add Christian Merillat's Debian-Multimedia repository to your list.

If you don't like the look or feel of Bombono, you can use Q-DVD-Author. As with Bombono, its a front-end for DVDAuthor. I haven't used QDVDAuthor, so can't comment. But it looks a useful tool. There's a HowTo over at this website.

Another option is DVDStyler, a cross-platform application available on Linux, Mac and Windows. I haven't used it, so don't know how good it is.

Then there's DVD::Rip. A DVD copy program written in Perl, that provides an easy to use  GUI to control most aspects of ripping and transcoding. Utilising the widely used video  processing engine transcode and other Open Source tools.

Try it yourself, and let me know.

Done!

Emacs Commands

Control Meta Alt Esc

Basics
C-x C-f "find" file i.e. open/create a file in buffer
C-x C-s save the file
C-x C-w write the text to an alternate name
C-x C-v find alternate file
C-x i   insert file at cursor position
C-x b   create/switch buffers
C-x C-b show buffer list
C-x k   kill buffer
C-z     suspend emacs
C-x C-c close down emacs


Moving
C-f    forward char
C-b    backward char
C-p    previous line
C-n    next line
M-f    forward one word
M-b    backward one word
C-a    beginning of line
C-e    end of line
C-v    one page up
M-v    scroll down one page
M-<    beginning of text
M->    end of text


Editing
M-n    repeat command n times
C-u    repeat command 4 times
C-u n  repeat n times
C-d    delete a char
M-d    delete word
M-Del  delete word backwards
C-k    kill line

C-spc  Set mark for region
C-w    kill marked region
M-w    copy marked region
C-y    paste copied/killed text
M-y    yank earlier text (cycle the kill buffer)
C-x C-x exchange cursor and mark
C-x h  select all (the whole buffer)
M-h    make region current paragraph

C-t    transpose two chars
M-t    transpose two words
C-x C-t transpose lines
M-u    uppercase letters from point to end
M-c    first letter uppercase
M-l    opposite to M-u


Various
C-g    quit current action
C-x u  undo previous action

C-x /  undo previous action
M-x revert-buffer undo changes since last save
M-x recover-file recover text from autosaved file
M-x recover-session if editing several files


Help
C-h c  describe command
C-h k  describe command action
C-h l  show last 100 keys pressed
C-h w  describe key-combo
C-h f  describe function
C-h v  describe variable
C-h b  desplay key commands buffer
C-h t  emacs tutorial
C-h i  info reader
C-h C-k info reader and search key-combo
C-h F  show emacs FAQ
C-h p  show Elisp info 


Search/Replace
C-s    search forward
C-r    search backward
C-g    return to start point
M-%    query replace


Space or y replace this occurence
Del or n don't replace
.      only replace this and exit (replace)
,      replace and pause (resume with Space or y)
!      replace all following occurences
^      back to previous match
RETURN or q quit replace


Search/Replace RegEx
Characters to use in regular expressions:
^      beginning of line
$      end of line
.      single char
.*     group or null of chars
\<  beginning of a word
\>  end of a word
[]     every char inside the backets (for example [a-z] means every small letter)

M C-s RETURN search for regular expression forward
M C-r RETURN search for regular expression backward
M C-s  incremental search
C-s    repeat incremental search
M C-r  incremental search backwards
C-r    repeat backwards
M-x query-replace-regexp search and replace


Window
C-x 2  split window vertically
C-x o  change to other window
C-x 0  delete window
C-x 1  close all windows except the one the cursors in
C-x ^  enlarge window
M-x shrink-window command says it ;-)
M C-v  scroll other window
C-x 4 f find file in other window
C-x 4 o change to other window
C-x 4 0 kill buffer and window
C-x 5 2 make new frame
C-x 5 f find file in other frame
C-x 5 o change to other frame
C-x 5 0 close this frame


Bookmarks
C-x r m set a bookmark at current cursor pos
C-x r b jump to bookmark
M-x bookmark-rename says it
M-x bookmark-delete "
M-x bookmark-save "
C-x r l list bookmarks


d      mark bookmark for deletion
r      rename bookmark
s      save all listed bookmarks
f      show bookmark the cursor is over
m      mark bookmarks to be shown in multiple window
v      show marked bookmarks (or the one the cursor is over)
t      toggle listing of the corresponding paths
"        path to this file
x      delete marked bookmarks
Del ?
q      quit bookmark list

M-x bookmark-write write all bookmarks in given file
M-x bookmark-load load bookmark from given file


Shell
M-x shell starts shell modus
C-c C-c same as C-c under unix (stop running job)
C-d delete char forward
C-c C-d Send EOF
C-c C-z suspend job (C-z under unix)
M-p    show previous commands


Dired
C-x d  start up dired
(large C) copy
d      mark for erase
D      delete right away
e or f open file or directory
g      reread directory structure from file
G      change group permissions (chgrp)
k      delete line from listing on screen (don't actually delete)
m      mark with *
n      move to next line
o      open file in other window and go there
C-o    open file in other window but don't change there
P      print file
q      quit dired
Q      do query-replace in marked files
R      rename file
u      remove mark
v      view file content
x      delete files marked with D
z      compress file
M-Del  remove all marks (whatever kind)
~      mark backup files (name~ files) for deletion
#      mark auto-save files (#name#) for deletion
*/     mark directory with * (C-u * removes that mark again)
=      compare this file with marked file
M-=    compare this file with it's backup file
!      apply shell command to this file
M-}    change to the next file marked with * od D
M-{ "    previous "
% d    mark files described through regular expression for deletion
% m "   (with *)
+      create directory
>   changed to next dir
<   change to previous dir
s      toggle between sorting by name or date
M-x speedbar starts up a separate window with a directory view


Telnet
M-x telnet starts up telnet-modus
C-d    either delete char or send EOF
C-c C-c stop running job (similar to C-c under unix)
C-c C-d send EOF
C-c C-o clear output of last command
C-c C-z suspend execution of command
C-c C-u kill line backwards
M-p    recall previous command


Text
M-s    center line
M-S    center paragraph
M-x    center-region name says


Macros
C-x (  start macro definition
C-x )  end of macro definition
C-x e  execute last definied macro
M-n C-x e execute last defined macro n times
M-x name-last-kbd-macro give name to macro (for saving)
M-x insert-keyboard-macro save named macro into file
M-x load-file load macro
M-x macroname execute macroname


Coding
M C-\  indent region between cursor and mark
M-m    move to first (non-space) char in this line
M-^    attach this line to previous
M-;    format and indent comment


C, C++ and Java Modes
M-a    beginning of statement
M-e    end of statement
M C-a  beginning of function
M C-e  end of function
C-c RETURN Set cursor to beginning of function and mark at the end
C-c C-q indent the whole function according to indention style
C-c C-a toggle modus in which after electric signs (like {}:';./*) emacs does the indention
C-c C-d toggle auto hungry mode in which emacs deletes groups of spaces with one del-press
C-c C-u go to beginning of this preprocessor statement
C-c C-c comment out marked area


General
M-x outline-minor-mode collapses function definitions in a file to a mere {...}
M-x show-subtree If you are in one of the collapsed functions, this un-collapses it
In order to achive some of the feats coming up now you have to run etags *.c *.h *.cpp (or what ever ending you source files have) in the source directory
M-. (Thats Meta dot) If you are in a function call, this will take you to it's definition
M-x tags-search ENTER Searches through all you etaged
M-, (Meta comma) jumps to the next occurence for tags-search
M-x tags-query-replace yum. This lets you replace some text in all the tagged files

Gnu Debugger
M-x gdb starts gdm in an extra window

Version Control
C-x v d show all registered files in this dir
C-x v = show diff between versions
C-x v u remove all changes since last checkin
C-x v ~ show certain version in different window
C-x v l print log
C-x v i mark file for version control add
C-x v h insert version control header into file
C-x v r check out named snapshot
C-x v s create named snapshot
C-x v a create changelog file in gnu-style


Billy The Billboard

Do What?

use Host Gator for hosting a few websites. I posted earlier about a guy who had a Host Gator logo tattoo. I felt I the need to expand a little on this one. This young guy has several company logos tattoo'd across his body. He is actively seeking sponsors for the other parts which are presently blank.

Check out this page on the Host Gator blog.

Billy has offered his forehead for anyone interested. Bids in the region of $8,000 considered.

I found it real strange that anyone would want to deface their body in that way.

I understand that at the present time its vogue to 'ink the skin yer in'. But as with all fashions and trends, they pass.  Today's fashion is tomorrow's passe. The bigger problem with tattoo's being all the rage right now, is what will they look in 5 or 10 years time? Will they still be fashionable? Will tattoo's look like a throw back to abhorrent age?

Remember the fashion of the 80's? Would anyone dress that way now? Big hair and bad make up? I don't think so!

Yet the problem of ink permanency remains. The tattoo may fad a little, but its not about to go away. This strikes me as a bad idea.

Everyone to their own.

Google Fonts

Striking

In case you did not hear, Google has released a number of new fonts to help beautify the Web. The fonts are not so much downloaded, as linked-to on Google hosted font servers. You don't need to install the fonts. The user doesn't need to install the fonts.

Code your pages or web site and embed the Google code and URL for your chosen font. When the page is requested, voila. A request is sent and Google provides the fonts-on-demand.

Brilliantly simple. It takes the guess work out of design, with font substitution and all that. There's some nice glyphs too.

Here's the Google Web Fonts Home page

Here's a starter page for the fonts

Have a look at the font directory

Take the fonts for a test drive

Don't say Google gives you nothing.

Done!

Gmail Video Chat - Debian Linux

See You

Setting up Gmail Video Chat in Debian Linux is pretty simple. First you need a Gmail account. You also need a Webcam, or you need some to chat with who has a Webcam. Next you need the Gmail Video Chat plug-in. Finally you need to install the plug-in and restart your browser.

Go to the Gmail Video Chat plug-in download page and pull down the version for your distro and chip. I went with Debian 64-bit.

After the download completes, fire up an Xterm and become root.

#su
password

Change to downloads directory

cd ~/downloads

If you try to install the .deb package, it may complain:

Package libglew1.5 is not installed

Install that first:

# aptitude install libglew1.5

Next install google-video-plug-in:

#dpkg -i google-talkplugin_current_amd64.deb

It should run to completion without a hitch (hopefully).

Kill and restart your browser.

Log in to Gmail. On the left menu under 'Chat', click on one of your contact's name, then select Video and More. You should see an option to link by video. There's a small green camera icon. Click it to fire up the Web Cam connection. A video image will appear.

Now your on camera.

Enjoy.

Emacs Fonts

Smooth Lines

Changing fonts in Emacs can be challenging at times. Even if you use the menu options, its tedious and  difficult to find and change to the desired font.

You can set Emacs fonts in .Xresources, .Xdefaults or in the dot .emacs config file.

I use the following entry in .emacs to set selected fonts:

(set-default-font "-b&h-lucidatypewriter-medium-r-normal-sans-12-120-75-75-m-70-iso8859-1")

Another way to set fonts is to run the function, customize-face:

M-x cusomize-face
Default
Lucidatypewriter
Save

Now enjoy shiny new fonts.

Done!

Emacs Delete Double Blank Lines

Gone

Working through documents prepared by others, you frequently find the text littered with multiple blank lines.

An easy way to eliminate these blanks while working through the text is to use delete-blank-lines function in Emacs. This useful tool removes all superfluous blanks around the point (cursor), leaving a single blank in place. Its a great to use though it does require you to navigate to the blanks before running the function.

Its so simple. To see it in action, move to a place with several blanks and hit the key combo:

C-x C-o

Here's how it works:

On blank line, delete all surrounding blank lines, leaving just one
On isolated blank line, delete that one
On nonblank line, delete any immediately following blank lines

Done!

Host Gator Mail

Where's My Mail?

To access mail on your Host Gator account, type your web URL in the address bar and add /Mail at the end. For example, if my domain address is: www.mydomain.com, I would enter www.mydomain.com/Mail. This opens a login page for all mail accounts on that domain. Enter the full email address and the password for the mail account. If you forgot the password, you can reset it in cPanel.

You can also access all mail accounts as admin. Open your cPanel. Click on the Mail bar to open up the box. Click on the Email Accounts icon (not Webmail icon). At the bottom, you see the email accounts listed. Click the drop down arrow marked 'More' Select Access Webmail,

Select web mail client to use, RoundCube, SquirrelMail, Horde. Now you can enjoy all your wonderful mail. Did someone say Spam?

The second option on the drop down arrow marked More 'Configure Email Client', provides details to set up your desktop email client, should you so desire.

If you forgot your password, reset it in cPanel after you click on the Webmail button.

Some people love Host Gator so much, they want the world to know about it...











That is a 'real' tattoo, not make up.

Astounding!!!

I cannot believe what some people do.

Media ID Code

Hidden

When you buy blank DVDs CDs or BluRay discs, you have no idea who makes the disc. With a few exceptions, most name brand media blanks are not made by the company itself. The manufacture is outsourced.

Sony discs are made by Ricoh, Mitsubishi, Taiyo Yuden. Philips discs are made by CMC and Ritek, Mitsubishi. TDK are made by CMC, Ritek, Ricoh, Maxell. Memorex are made by CMC, Ritek, Prodisc, Infodisc, Moser Baer. The list goes on.

If you can't tell what make of disc you're buying, how can you assess the quality? The blanks don't have a manufacturers ID printed on them. But they do have a Media ID Code embedded in the disc, if you have the software to read it.

On Debian or other Linux distros, you should have dvd+rw-tools installed. If you haven't, its easy to pull down.

apt-get install dvd+rw-tools

Once installed, place a disc in your burner and run the following:

dvd+rw-mediainfo /dev/cdrom

I tested a Verbatim DVD. This is what I got:

$ dvd+rw-mediainfo /dev/cdrom
INQUIRY:                [PIONEER ][DVD-RW  DVR-216D][1.06]
GET [CURRENT] CONFIGURATION:
 Mounted Media:         1Bh, DVD+R
 Media ID:              MCC/004
 Speed Descriptor#0:    00/2295103 R@20.0x1385=27700KB/s W@20.0x1385=27700KB/s
 Speed Descriptor#1:    00/2295103 R@16.0x1385=22160KB/s W@16.0x1385=22160KB/s
 Speed Descriptor#2:    00/2295103 R@12.0x1385=16620KB/s W@12.0x1385=16620KB/s
 Speed Descriptor#3:    00/2295103 R@8.0x1385=11080KB/s W@8.0x1385=11080KB/s
 Speed Descriptor#4:    00/2295103 R@6.0x1385=8310KB/s W@6.0x1385=8310KB/s
 Speed Descriptor#5:    00/2295103 R@4.0x1385=5540KB/s W@4.0x1385=5540KB/s
READ DVD STRUCTURE[#0h]:
 Media Book Type:       00h, DVD-ROM book [revision 0]
 Legacy lead-out at:    2295104*2KB=4700372992
READ DISC INFORMATION:
 Disc status:           blank
 Number of Sessions:    1
 State of Last Session: empty
 "Next" Track:          1
 Number of Tracks:      1
READ TRACK INFORMATION[#1]:
 Track State:           blank
 Track Start Address:   0*2KB
 Next Writable Address: 0*2KB
 Free Blocks:           2295104*2KB
 Track Size:            2295104*2KB
READ CAPACITY:          0*2048=0

You can see the Media ID Code:

Media ID:              MCC/004

Check the code online and you can confirm its made by Mitsubishi Chemical Corp. A premium quality manufacturer.

If you run Windows, you can get a free util DVD Identifier. I haven't used it. It is free. Its DonateWare.

Done!

GPG No Pub Key

Lock Out

I ran aptitude update and received the following error message.

W: GPG error: http://ftp.xxxxx.xxx testing Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 07DC563D1F41B907

Can't get in the pub? No. Not that. apt-get is telling me they have no public key to certify the download source is secure. The error message relates to Christian Merrilat's Debian Multimedia repository.

If you don't have it already, install the debian-archive-keyring package.

apt-get install debian-archive-keyring

But it doesn't fix the current problem. We need to update the key for Debian Multimedia.

Add their gpg key to the keyring. Copy the PUBKEY ID. In my case it was 07DC563D1F41B907. Request the key from the keyserver.

gpg --keyserver hkp://wwwkeys.eu.pgp.net --recv-keys 07DC563D1F41B907

gpg: requesting key 1F41B907 from hkp server wwwkeys.eu.pgp.net
gpg: key 1F41B907: "Christian Marillat " not changed
gpg: Total number processed: 1
gpg:              unchanged: 1

Export the key from gpg and add it to your list of trusted keys, using apt-key

gpg --armor --export 07DC563D1F41B907 | apt-key add -
OK

Thats about it. You should be good to go.

Blank DVDs & CDs

Coasters No More

We've seen the coasters laying on the floor or thrown to the waste bin. Tossed aside in frustration at another failed burn.

Burning data to a blank CD or DVD is a painless process on most current OS. Whether you run Linux, Mac or Windows there are apps available that make CD or DVD burning painless. The problems come later when you need to pull the data back off the media and you find it was somehow corrupted.

Generally, the corruption has little to do with you or the OS you used to burn your data. Most failed CDs / DVDs are a result of poor quality blank discs. Even if you buy name brands such as Sony, Maxell, Imation, Philips, etc, you will still get coasters. Why?

Poor Media.

Most blank media is made by a handful of companies and then re-branded before shipping. A Sony blank DVD could be made in the same factory as the unknown brand sitting next to it on the shelf selling for half the price.

To make matters worse, there are no external markings to indicate where or who pressed the blanks you buy. You can test your CD/DVD blanks by putting one in your DVD burner and firing up your burning app. In Windows you should give Imgburn a shot. Its free, easy to use and displays data about the coasters your about to create.

The only quality media to buy are JVC, Taiyu Yuden or Verbatim (Mitsubishi). These will burn safely and stay readable at some future date.

The problem with other inferior media is a combination of:
  • The dye layer
  • The burner
  • The burn speed
Many blanks cannot take a high-speed burn. The dye layer is not good enough to take the rapid burn. A slower burn would reduce the risk of burn errors.

I've had blank media fail on me several times in the recent past. Cheap CDs/DVDs are a waste of money.

If you value your CD/DVD data. Avoid cheap media. Ensure you burn at the recommended speed for the blanks. Ensure you have a good quality burner installed.

Done!

Emacs & Bash

Terminal

Running Emacs you frequently need to execute commands or run command line process that would be more suited to an XTerm or similar terminal emulator.

Its a pain to move hands off keyboard and fumble with the mouse when all you need is a quick, 'grep', 'find', 'rename', or 'mv'. Its way simpler to stay in Emacs and hit the command line.

Inside Emacs, you have a few options. You can run the 'shell', 'eshell', or if your used to the XTerm and want full Bash functionality, you can use the 'term'.

Running a terminal in Emacs buffer has many benefits. You can switch between buffers/term as you normally would. You get all the functionality of an XTerm, prompt, color highlight, and so on.

To launch a 'shell' inside an Emacs buffer:

M-x shell

To launch 'eshell' in an Emacs buffer:

M-x eshell

To launch an 'XTerm in an Emacs buffer:

M-x term

Emacs will quiz you if you want '/bin/bash/'. Hit [return] for yes.

One point to note. Normally you hit C-x or M-x to run commands in Emacs. When you run an XTerm session C-x does not work. You need to hit C-c first before executing your command.

For example, to visit a file or open a new file, you hit C-x C-f. In an XTerm buffer, C-x C-f does not open a file. You hit C-c C-f.

Effectively C-c replaces C-x. Mess around, you'll get the hang of it.

Done!

Zero Disk Erase

From Hero To Zero

You can download or buy utilities to wipe old disks clean and ensure any personal data is permanently erased. DBAN is one such utility, but there are ways, if you run Linux.

You can Zero disk contents using 'dd' command. Try this:

dd if=/dev/zero of=/dev/sda

The command will overwrite the first scsi or sata disk. For the second sata disk, it would be:

dd if=/dev/zero of=/dev/sdb

If you have ide disks, it will probably show up as /dev/hda or /dev/hdb. Use the mount command to check.

If you have an old disk laying around you want wiped clean, give it a try.

What have you got to lose apart from your data?

Done!

CSS Overflow

Too Narrow

Sometimes the content you have is too wide for the box or page you're display it on. This is particularly true if its code examples using <pre>.

To handle the problem CSS provides 'Overflow' property. It works really simply. Place the wide text in a <div>, set a width for the div then add 'overflow:auto' property.

As you probably guessed, its in two parts, CSS and HTML. First the CSS:

.scroll {
    width:200px;
    overflow:auto;
}

The HTML:

<div class="scroll">Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</div>

Here's the result:

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua

Debian XFCE4 Minimal Install

Keep It Small

The objective is to complete a minimal Debian install with XFCE4 Desktop Environment. Its essential to keep the installation small light fast clean with no clutter.

Some Linux installations include a lot of deadwood with a bunch of non-essentials. Stuff added that you will probably never use.

This time its lean 'n' lite. Nothing included that'is not used or needed.

This Debian install will include the following:
  • Debian Base System
  • Xorg
  • XFCE4
  • XTerm
  • Emacs23
  • Galculator
  • Mousepad
  • MS TrueType Core Fonts
  • Ristretto Image Viewer
  • Epdfview PDF View
  • Gcolor2 Color Selector
  • Irssi Chat Client
  • Mplayer Movie Media Player
  • Audicious Sound Media Player
  • Screenruler
  • NTFS Access
  • Iceweasel/Firefox Browser
  • Google Chrome Browser
  • XFCE4 Task Manager
  • XFCE4 Screenshooter
  • Fortune Humour
The above will give a basic working system using The X-Windows System, XFCE4 desktop, along with the above list of applications.

Here's how to do it - a blow-by-blow account:

1. Install Base Debian System

Place Debian Net Install CD in CDROM drive and reboot box. Ensure your BIOS is set to check CDROM first device for bootable OS

2 . Hit Install

3. Select Language

4. Select Country

5. Select ???

6. Select Disk to install

7. Select Standard System


2. Add Debian repositories

vi /etc/apt/sources.list

Add '#' to start of cdrom lines. Don't check cdrom for updates
Add contrib non-free to the end of the debian repositories
I run Squeeze. You may run Lenny. Leave a space between entries


3. Update package list

aptitude update

Updates aptitude database of packages, installed or available


4. Add Xorg X Windows System

aptitude install xorg

X Windows System


5. Add XFCE4 Desktop Environment

aptitude install XFCE4

Lightweight Desktop 



6. Add Emacs

aptitude install emacs

Life without Emacs? No Way!



7. Add Calculator

aptitude install galculator

Lightweight calculator for XFCE4

8. Add Graphical Text Editor

aptitude install mousepad

Lightweight text editor for XFCE4

9. Add MS True Type Fonts

aptitude install msttcorefonts

Ubiquitous Web fonts

10. Add Image Viewer

aptitude install ristretto

A lightweight Image Viewer

11. Add PDF Viewer

aptitude install epdfview

Lightweight PDF Viewer

12. Add Color Selector

aptitude install gcolor2

Useful for sampling and messing with colors

13. Add Chat Client

aptitude install irssi

Text based chat client

14. Add Movie Media Player

aptitude install mplayer

The 'Best' media/movie player for Linux. Period.

15. Add Music Media Player

aptitude install audicious

Useful for tunes. Similar in looks to XMMS, with plenty of skins.

16. Add Screen Ruler

aptitude install screenruler

Useful for messing with images and websites

17. Add NTFS Access

aptitude install ntfs-g3

Essential for accessing your old stuff from pre-linux days

18. Add Google Chrome Browser

aptitude install google-chrome

Google's fast modern browser Or you can install Firefox/Iceweasel.

Firefox. The standard by which other browsers are measured

20. Add XFCE4 Screen Shots

aptitude install xfce4-screenshooter

Useful for screenshots, blackmail, etc, etc, etc.

21. Add Fortune Cookie

aptitude install fortune

Fun laughter games. What more can I say.

This install is fast, snappy, responsive. Apps startup immediately. Menus leap instantly. Windows launch into life. Everything is so responsive. Its great!

Now the system is pretty much well packed out goodies. Enough at least to get going. And its still fast and responsive, which was one of the prime objectives. I didn't install a Word Processor (AbiWord, OpenOffice) or Spreadsheet, as I don't use them. I do most of my work in Emacs or Chrome/Firefox. Of course you can add more as you need. And its easy as 1 2 3.

1. Open XTerm as root
2. Search package (aptitude search pkg-name)
3. Install package (aptitude install pkg-name)

Done!

Debian Add Sata Disk

More Space

Add the new disk drive to your machine, connect power and data cables, then reboot your machine.

If you had a different disk installed, on reboot, Linux may complain and attempt to drop you to a console. Ignore, hit Ctrl-d and continue with the reboot. Once Linux is running, open a terminal or XTerm. 

As root run fdisk command to get installed disk details.

# fdisk -l

Disk /dev/sda: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot Start    End      Blocks   Id  System
/dev/sda1   *      1    852     6835200   83  Linux
/dev/sda2        852  60802   481549312+   5  Extend
/dev/sda5        852   3293    19606528   82  Swap
/dev/sda6       3293  60802   461941760   83  Linux

Disk /dev/sdc: 2000.4 GB, 2000398934016 bytes
255 heads, 63 sectors/track, 243201 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot Start    End      Blocks   Id  System
/dev/sdc1          1 243201  1953512001   83  Linux


Disk Partition

fdisk /dev/sdc

<< ------------ fdisk commands go here --------- >>


Format Disk

mkfs.ext3 /dev/sdc1


Mount Disk

mkdir /NewDisk

mount -t ext3 /dev/sdc1 /NewDisk

Check with mount command:

# mount
/dev/sda1 on / type ext3 (rw,errors=remount-ro)
/dev/sda6 on /home type ext3 (rw)
/dev/sdc1 on /newdisk type ext3 (rw)


# ls -l /NewDisk/
total 24
drwxr-xr-x 3 root root  4096 Sep 18 00:26 .
drwxr-xr-x 22 root root  4096 Sep 17 14:27 ..
drwx------ 2 root root 16384 Sep 17 14:09 lost+found


Auto Mount New Disk

To auto mount new disk, we add an entry in /etc/fstab

vi /etc/fstab

/dev/sdc1        /NewDisk        ext3        defaults,errors=remount-ro 0

If you had other disks connected, delete the entry, or add a comment at start of line.

Save the file and reboot.

Done!