indiWiz.com

Subhash's Tech Log

Archive for the ‘Linux’ tag

Configuring service startup in Ubuntu

without comments

If you are one of the old-timers who has migrated to Ubuntu from RedHat/Fedora distribution in the past, you might be familiar with the ntsysv tool in those Linux versions. I used to use that oddly-named tool to switch-on/off services in my Linux box. I was searching for a similar tool for Ubuntu, and found rcconf:

$ sudo apt-get install rcconf
$ rcconf

Written by Subhash Chandran

December 18th, 2009 at 4:35 pm

Posted in Linux

Tagged with , ,

Linux: Diff between two folders

without comments

To find the files which are in one and not in the other:

$ diff -r folder1/ folder2/

To find the file content differences:

$ diff -r -N folder1/ folder2/

Written by Subhash Chandran

November 15th, 2009 at 10:40 am

Posted in Linux

Tagged with ,

OpenSource Font Manager

without comments

Fontmatrix is an excellent Font organizing Software available for Linux, Windows and MacOS.

To install it in all Debian based systems (including Ubuntu):

$ sudo apt-get install fontmatrix

Screenshot of Fontmatrix running in my system:

Fontmatrix

Written by Subhash Chandran

September 23rd, 2009 at 2:40 pm

Posted in Linux,OpenSource

Tagged with , , , ,

Mounting WebDav in Ubuntu

without comments

$ sudo apt-get install davfs2
$ sudo mount -t davfs http://localhost:8080/alfresco/webdav <filesystem_folder>

Written by Subhash Chandran

September 14th, 2009 at 7:33 pm

Posted in Linux

Tagged with , ,

Finding the width and height of Ogg Theora videos

without comments

When placing Ogg Theora video files in your site using HTML5 <video> tags, you can optionally specify the width and height of the videos. But how do you find the width and height? Use the tool ogginfo:

$ ogginfo video.ogg

Written by Subhash Chandran

July 31st, 2009 at 9:43 am

Posted in Linux

Tagged with ,

Text-to-speech in Linux

without comments

Festival is an interesting OpenSource project for converting text-to-speech in Linux environment. It has a commandline tool text2wave which converts, guess what, text to voice in wave format. Simple usage:

$ echo "Hello World" | text2wave > a.wav

Wave files are uncompressed, and occupy lot of space. To encode to Ogg Vorbis format:

$ oggenc a.wav

This will create a.ogg in the current directory.

Written by Subhash Chandran

July 31st, 2009 at 8:55 am

Posted in Linux

Tagged with ,

Desktop Video Capture in Linux

without comments

recordmydesktop is a powerful screencasting commandline tool for Linux. To capture the screen:

$ recordmydesktop


Press Ctrl+C to quit capturing. The captured video will be encoded in Ogg Theora format and saved as out.ogv (if out.ogv exists, as out-1.ogv and so on). To save the file in another name, say myout.ogv:

$ recordmydesktop myout.ogv


There is also a GTK frontend for recordmydesktop. To launch it:

$ gtk-recordMyDesktop

Written by Subhash Chandran

July 15th, 2009 at 4:00 am

Posted in Linux

Tagged with , ,

Encoding to Ogg Theora Format: For use in HTML5

without comments

To encode a video file for use in HTML5 video compatible browser (firefox 3.5 and above supports HTML5 video), use the command:

$ ffmpeg -i in.flv -vcodec libtheora -sameq \
   -acodec libvorbis -ac 2 -sameq out.ogg


Finally use it in your page:

<video src="out.ogg">
Your browser does not support HTML5 video.
</video>


Reference: HTML 5 <video> Tag.

Written by Subhash Chandran

July 14th, 2009 at 9:08 am

Posted in Software Dev

Tagged with , , , , ,

Video format conversion in Linux

without comments

To stream video content using Video View Portlet, I had to re-encode some videos to flv format. This is pretty simple in Linux:

$ mencoder -oac copy -ovc lavc -o out.flv in.avi


-oac means Output Audio Codec and -ovc means Output Video Codec. The various options for -oac:

copy no encoding, just streamcopy.
pcm Encode to uncompressed PCM.
mp3lame Encode to MP3 (using LAME).
lavc Encode with a libavcodec codec.

The options for -ovc:

copy no encoding, just streamcopy.
raw Encode to an arbitrary uncompressed format (use ’-vf format’ to select).
lavc Encode with a libavcodec codec.

Written by Subhash Chandran

June 24th, 2009 at 11:13 am

Posted in Linux

Tagged with , ,

Crontab quickies

without comments

When searching the Web for setting hourly cron job, I was pleasantly introduced to a simplified syntax:

@hourly <application>

For understanding the shortcut commands, go through the complete documentation of the crontab syntax by typing man 5 crontab in your command-prompt.

Written by Subhash Chandran

June 16th, 2009 at 9:24 am

Posted in Linux

Tagged with ,

Color Picking in Linux

without comments

Which color-picking software do I use? I found out two options (both are GTK based):

  • gpick: The project also has binaries for popular Linux distros available.
  • gcolor2: This is part of the Debian repository.

Written by Subhash Chandran

April 22nd, 2009 at 5:47 pm

Posted in Linux

Tagged with ,

Linux Screen Rulers

with 3 comments

Recently I have been working with a demanding Web Designer based client. She was insisting on pixel-level spacing and detail. Thus I wanted to have a Screen Ruler for measuring her template. I use Ubuntu-based Linux, and found the following tools in its repository:

For KDE users:


$ sudo apt-get install kruler

For GNOME users:


$ sudo apt-get install screenruler

Written by Subhash Chandran

April 21st, 2009 at 3:13 pm

Posted in Uncategorized

Tagged with , ,

Linux command-line XSLT

without comments

To convert an XML based on a XSL, use this command:

$ xsltproc /path/to/xsl.xsl /path/to/xml.xml

The converted document will be written to STDOUT. To write to a particular file, you may use the -o parameter:

$ xsltproc /path/to/xsl.xsl /path/to/xml.xml -o out.html

Check the info/man pages for additional information.

Written by Subhash Chandran

February 2nd, 2009 at 5:28 pm

Posted in Linux

Tagged with , ,

Haskell: The first step (Installing Haskell Compiler in Linux)

without comments

Today visited the Chennai Book Fair. And in pursuit of my New Year Resolution, I bought Real World Haskell book. I am running Mint Linux, and installed the GHC compiler thus:

$ sudo apt-get install ghc6
$ sudo apt-get install libghc6-mtl-dev

Written by Subhash Chandran

January 17th, 2009 at 9:54 pm

Posted in Uncategorized

Tagged with ,

Accessing WebDAV From Commandline

with one comment

Linux has a wonderful commandline tool for accessing WebDAV resources. It is cadaver. To access any resource:

$ cadaver http://portale:8080/alfresco/webdav/Web%20Projects

If the resource requires authentication, cadaver will prompt for it. Then you may use the standard UNIX and FTP commands for navigating and manipulating content. Some of the common commands are: cd, pwd, ls, put, get, mput, mget, less, cat and delete. Similar to FTP commands, it has corresponding local commands too: lcd, lpwd and lls.

Edit In-line

To edit a file in-line in cadaver, just issue the edit <file-name> command. The default editor will open the file. To change the editor (to, say, emacs), issue the command: set editor emacs from cadaver prompt.

Written by Subhash Chandran

November 21st, 2008 at 7:37 am

Posted in Linux

Tagged with ,