<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Lindesk &#187; Configuration</title>
	<atom:link href="http://lindesk.com/category/configuration/feed/" rel="self" type="application/rss+xml" />
	<link>http://lindesk.com</link>
	<description>Linux - on the Desktop</description>
	<lastBuildDate>Tue, 23 Jun 2009 14:03:08 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Customizing the Terminal: 6 Command Line Tips and Tricks</title>
		<link>http://lindesk.com/2009/04/customizing-the-terminal-6-command-line-tips-and-tricks/</link>
		<comments>http://lindesk.com/2009/04/customizing-the-terminal-6-command-line-tips-and-tricks/#comments</comments>
		<pubDate>Sun, 26 Apr 2009 15:36:16 +0000</pubDate>
		<dc:creator>BinnyVA</dc:creator>
				<category><![CDATA[Command Line]]></category>
		<category><![CDATA[Configuration]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[command]]></category>
		<category><![CDATA[key]]></category>
		<category><![CDATA[shortcut]]></category>
		<category><![CDATA[tab]]></category>
		<category><![CDATA[terminal]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[tricks]]></category>

		<guid isPermaLink="false">http://lindesk.com/?p=188</guid>
		<description><![CDATA[A few tips and tricks on the terminal to make you more efficient when using it. If you know of any other tips, add it in the comments section.]]></description>
			<content:encoded><![CDATA[<p><img src="http://lindesk.com/wp-content/uploads/2008/02/terminal.png" alt="Terminal" title="Terminal" width="128" height="128" class="alignnone size-full wp-image-96 intro" align="right" /></p>
<p class="intro">A few tips and tricks on the terminal to make you more efficient when using it. If you know of any other tips, add it in the comments section.</p>
<h2>1. ls Without ls</h2>
<p>When you are trying to cd into a deep folder, you might not know the correct folder name some levels deep. You might have to do something like&#8230;</p>
<pre><code class="cli">$ cd ~/Scripts/Perl
$ ls
bin	SedGUI       ToSee	Cronjobs  Maintenance
$ cd Maintenance</code></pre>
<p>There is an easier way &#8211; go to the wanted folder</p>
<pre><code class="cli">$ cd ~/Scripts/Perl</code></pre>
<p>Now, without pressing enter, double tap the TAB key. You will get a list of files. And the command prompt waiting to be filled&#8230;</p>
<pre><code class="cli">$ cd ~/Scripts/Perl/[TAB TAB]
bin	SedGUI       ToSee	Cronjobs  Maintenance
$ cd ~/Scripts/Perl/_</code></pre>
<p>You can also <strong>use double-TAB to auto-complete commands</strong>.</p>
<h2>2. Searching the history with Ctrl+R</h2>
<p>If you have to use a command you have already used before, press CTRL+R and then type a few characters of the command. The latest command with those characters will be shown &#8211; if that is the command you want to execute, press enter and it will be executed. If not, just press CTRL+R again and it will show the next command.</p>
<p>You have no idea how useful this tip is if you haven&#8217;t been using it. I use this all the time.</p>
<p>For more details, read <a href="http://www.lunix.com.au/2008/07/06/searching-bash_history-the-easy-way-with-tagging-and-ctrl-r/">this article</a>.</p>
<h2>3. Open Terminal using a Shortcut</h2>
<p>If you are a GUI user, chances are you prefer using a Terminal emulator(like <code>gnome-terminal</code> or <code>konsole</code>) instead of going into the Terminal mode by pressing CTRL+ALT+F1. If so, assign a shortcut to those emulator apps. I prefer using the shortcut &#8216;Ctrl+Alt+A&#8217; to do this.</p>
<h3>Gnome</h3>
<p>If you are in gnome, there is a very easy way to do this&#8230;</p>
<ul>
<li>Go to System &gt; Preferences &gt; Keyboard Shortcuts</li>
<li>Find &#8216;Run a Terminal&#8217; &#8211; assign the shortcut &#8216;Ctrl+Alt+A&#8217;</li>
</ul>
<h3>KDE</h3>
<ul>
<li>Right Click on the K-Menu &gt; Menu Editor</li>
<li>Find your terminal application in the list(usually System &gt; Terminal Applications &gt; Terminal)</li>
<li>Select the &#8216;Current Shortcut Key&#8217; option and set it to &#8216;Ctrl+Alt+A&#8217;</li>
</ul>
<p>You can also do this by opening the <a href="http://lindesk.com/2007/09/global-hotkeys-for-xmms-using-khotkeys/">KHotKeys</a> application.</p>
<h2>4. Bash Keyboard Shortcuts</h2>
<p>Learn the <a href="http://onlyubuntu.blogspot.com/2007/03/bash-shell-keyboard-shortcuts-for-linux.html">bash keyboard shortcuts</a> &#8211; these are the ones I use the most&#8230;</p>
<dl>
<dt>CTRL+R</dt>
<dd>Search the history. We already talked about this.</dd>
<dt>CTRL+L</dt>
<dd>Clears the screen. Use this instead of the <code>clear</code> command.</dd>
<dt>CTRL+D</dt>
<dd>Use this instead of the <code>exit</code> command.</dd>
<dt>CTRL+C</dt>
<dd>Kill whatever is running</dd>
<dt>CTRL+Z</dt>
<dd>Puts whatever is running into a suspended background process. Use <code>fg</code> to restore it.</dd>
</dl>
<h2>5. Find Command using <code>apropos</code></h2>
<p>Find the command you want using the <code>apropos</code> command. Just type in a description of the command as the first argument. For example, lets say you want to find the command to list the directory contents. Use the command&#8230;</p>
<pre><code class="cli">$ apropos "directory contents"
dir                  (1)  - list directory contents
ls                   (1)  - list directory contents
ls                   (1p)  - list directory contents
ntfsls               (8)  - list directory contents on an NTFS filesystem
vdir                 (1)  - list directory contents</code></pre>
<p>The only problem is that I can never spell &#8216;apropos&#8217; &#8211; so I keep this in my <code>.bashrc</code> file&#8230;</p>
<pre><code class="bash">alias apox='apropos'</code></pre>
<h2>6. Learn New Commands</h2>
<p>There are a few sites that publish cool commands on a daily/semi-daily basics &#8211; subscribe to those and learn new commands&#8230;</p>
<li><a href="http://txt.binnyva.com/">Txt &#8211; Linux Commands and Code Snippets</a> &#8211; My own site &#8211; I <a href="http://lindesk.com/2008/07/introducing-txt/">wrote about this</a> a while ago.</li>
<li><a href="http://www.commandlinefu.com/commands/browse">commandlinefu.com</a></li>
<li><a href="http://www.shell-fu.org/">shell-fu</a></li>
<li><a href="http://snipplr.com/all/language/bash">Bash Snippets</a></li>
<li><a href="http://www.codesnippt.com/search.php?lang=14">Codesnippt.com &#8211; Shell Scripts</a></li>
<li><a href="http://snippets.dzone.com/tag/bash">bash code</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://lindesk.com/2009/04/customizing-the-terminal-6-command-line-tips-and-tricks/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Customizing the Terminal: 5 Configuration Settings in Bash that makes you a CLI Power User</title>
		<link>http://lindesk.com/2009/04/customize-terminal-configuration-setting-bash-cli-power-user/</link>
		<comments>http://lindesk.com/2009/04/customize-terminal-configuration-setting-bash-cli-power-user/#comments</comments>
		<pubDate>Sun, 12 Apr 2009 19:40:09 +0000</pubDate>
		<dc:creator>BinnyVA</dc:creator>
				<category><![CDATA[Command Line]]></category>
		<category><![CDATA[Configuration]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[cli]]></category>
		<category><![CDATA[command]]></category>
		<category><![CDATA[history]]></category>
		<category><![CDATA[power]]></category>
		<category><![CDATA[setting]]></category>
		<category><![CDATA[user]]></category>

		<guid isPermaLink="false">http://lindesk.com/?p=185</guid>
		<description><![CDATA[There are some settings that are very useful if you work on the terminal a lot. Many of the cool ones are not enabled by default - this is a small list of the configuration settings that I use to make my terminal usage more productive.]]></description>
			<content:encoded><![CDATA[<p><img src="http://lindesk.com/wp-content/uploads/2008/02/terminal.png" alt="Terminal" title="Terminal" width="128" height="128" class="alignnone size-full wp-image-96 intro" align="right" /></p>
<p class="intro">There are some settings that are very useful if you work on the terminal a lot. Many of the cool ones are not enabled by default &#8211; this is a small list of the configuration settings that I use to make my terminal usage more productive.</p>
<p>This is part 3 of the Customizing the Terminal series. Already published posts in this series are&#8230;</p>
<ul>
<li><a href="http://lindesk.com/2009/03/customizing-the-terminal-the-prompt/">Customizing the Terminal: The Prompt</a></li>
<li><a href="http://lindesk.com/2009/03/customizing-the-terminal-create-useful-aliases/">Customizing the Terminal: Create Useful Aliases</a></li>
</ul>
<h2>1. Case Correction</h2>
<p>I like to title case my folders and files&#8217; names. The folders in my home are &#8216;Scripts&#8217;, &#8216;Documents&#8217;, &#8216;Temp&#8217; etc. The first character is in upper case. But when I work on the command line, I don&#8217;t always remember to uppercase the first character when trying to cd into a folder. Consequently, the tabbing will not work. Fortunately, there is an option that <strong class="highlight">auto corrects the case</strong> for you. Just open a terminal and type in this command&#8230;</p>
<pre><code class="bash">shopt -s nocaseglob</code></pre>
<p>Other useful shopt option are&#8230;</p>
<dl>
<dt>cdspell</dt>
<dd>Corrects typos in your file/directory name.</dd>
<dt>histappend</dt>
<dd>Makes sure that histories in multiple simultaneous shells don&#8217;t overwrite each other.</dd>
</dl>
<h2>2. Select Which Commands to Store in History</h2>
<p>By default, all commands you type in are stored in the history. You can pick and chose the commands you want to store by putting the option&#8230;</p>
<pre><code class="bash">export HISTCONTROL=ignorespace</code></pre>
<p>in your <code>~/.bash_profile</code> file. This will <strong class="highlight">make sure that bash don&#8217;t store any command beginning with the space character</strong>. So if you want bash to forget that you typed in &#8216;ls&#8217;, just type in &#8216; ls&#8217;(&lt;space&gt;ls).</p>
<h2>3. Don&#8217;t Store Duplicate Commands in your History</h2>
<p>As I said earlier, all commands you type are stored &#8211; even the duplicate ones. You can prevent this by putting this text in your <code>.bash_profile</code> file&#8230;</p>
<pre><code class="bash">export HISTCONTROL=ignoredups</code></pre>
<p>If you want to ignore spaced commands <em>and</em> want to prevent storing of duplicate commands, use the option&#8230;</p>
<pre><code class="bash">export HISTCONTROL=ignoreboth</code></pre>
<h2>4. Auto-complete Command from History</h2>
<p>Picture this &#8211; you type in &#8217;ssh&#8217; and press the &#8216;Page Up&#8217; key &#8211; and <strong class="highlight">bash automatically fetches the last command that starts with ssh</strong> &#8211; and completes the command for you. Well, its possible &#8211; add the following line in your &#8216;.bash_profile&#8217; file&#8230;</p>
<pre><code class="bash">export INPUTRC=$HOME/.inputrc</code></pre>
<p>Now, <strong class="highlight">create a file called <code>.inputrc</code></strong> in your home and enter this into it&#8230;</p>
<pre><code class="bash">#Page up/page down
"\e[5~": history-search-backward
"\e[6~": history-search-forward</code></pre>
<p>Yes, I am aware of the up Ctrl+R trick &#8211; that comes in the next post.</p>
<h2>5. Infinite History</h2>
<p>You can increase or decrease the size of the history by adding this line in the <code>.bash_profile</code> file&#8230;</p>
<pre><code class="bash">export HISTSIZE=500
export HISTFILESIZE=500</code></pre>
<p>This will limit the commands to be stored in the history to 500. If you want to <strong class="highlight">remove the limit use these</strong> lines&#8230;</p>
<pre><code class="bash">unset HISTSIZE
unset HISTFILESIZE</code></pre>
<p>There is a good chance that this will make your history file quite huge &#8211; <strong class="highlight">use with care</strong>.</p>
<p>Please share your configuration settings for bash in the comments.</p>
<h3>Related Links</h3>
<ul>
<li><a href="http://linux.about.com/library/cmd/blcmdl1_shopt.htm">shopt &#8211; Linux Command</a></li>
<li><a href="http://snipplr.com/view/5393/shopt-shell-options/">shopt (shell options) &#8211; Bash</a></li>
<li><a href="http://www.ducea.com/2006/05/15/linux-tips-take-control-of-your-bash_history/">Linux Tips: take control of your bash_history</a></li>
<li><a href="http://www.thegeekstuff.com/2008/08/15-examples-to-master-linux-command-line-history/">15 Examples To Master Linux Command Line History</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://lindesk.com/2009/04/customize-terminal-configuration-setting-bash-cli-power-user/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Customizing the Terminal: Create Useful Aliases</title>
		<link>http://lindesk.com/2009/03/customizing-the-terminal-create-useful-aliases/</link>
		<comments>http://lindesk.com/2009/03/customizing-the-terminal-create-useful-aliases/#comments</comments>
		<pubDate>Fri, 27 Mar 2009 19:05:56 +0000</pubDate>
		<dc:creator>BinnyVA</dc:creator>
				<category><![CDATA[Command Line]]></category>
		<category><![CDATA[Configuration]]></category>
		<category><![CDATA[alias]]></category>
		<category><![CDATA[cli]]></category>
		<category><![CDATA[command]]></category>
		<category><![CDATA[customize]]></category>
		<category><![CDATA[terminal]]></category>

		<guid isPermaLink="false">http://lindesk.com/?p=183</guid>
		<description><![CDATA[This is part two of the 'Customizing the Terminal' series. Part one is '<a href="http://lindesk.com/2009/03/customizing-the-terminal-the-prompt/">Customizing the Terminal: The Prompt</a>'. In this part, we'll see how to create aliases to make working in the console easier.]]></description>
			<content:encoded><![CDATA[<p><img src="http://lindesk.com/wp-content/uploads/2008/02/terminal.png" alt="Terminal" title="Terminal" width="128" height="128" class="alignnone size-full wp-image-96 intro" align="right" /></p>
<p class="intro">This is part two of the &#8216;Customizing the Terminal&#8217; series. Part one is &#8216;<a href="http://lindesk.com/2009/03/customizing-the-terminal-the-prompt/">Customizing the Terminal: The Prompt</a>&#8216;. In this part, we&#8217;ll see how to create aliases to make working in the console easier.</p>
<h2>How To Create an Alias</h2>
<p>You can create a temporary alias using this command&#8230;</p>
<pre><code class="bash">alias new_name='old command'</code></pre>
<p>This will stop working when you exit the terminal. If you want to make the alias permanent, put the same command in your <code>~/.bashrc</code> file.</p>
<p>There is another way to create an alias &#8211; create a executable file and place it in a folder in your path. This is not technically an alias &#8211; but it works the same way. I use this for alias that tend to change often. Its easier to find a file in a folder and edit it. <abbr title="YMMV">YMMV</abbr>.</p>
<h2>My Aliases</h2>
<p>This is a incomplete list of the aliases I use. Feel free to copy them to your .bashrc file.</p>
<h3>Quick Directory Jumps</h3>
<p>Create an alias to jump to folders you have to visit often. This is my list&#8230;</p>
<pre><code class="bash">alias www='cd /var/www/html'
alias e='cd /mnt/x'</code></pre>
<h4>Relative Jumps</h4>
<p>The above jumps are absolute jumps &#8211; relative jumps are possible too&#8230;</p>
<pre><code class="bash">alias ..='cd ..'
alias ...='cd ../..'
alias ....='cd ../../..'
alias .....='cd ../../../..'</code></pre>
<p>Some prefer this syntax&#8230;</p>
<pre><code class="bash">alias ..='cd ..'
alias ..2='cd ../..'
alias ..3='cd ../../..'
alias ..4='cd ../../../..'</code></pre>
<h3>Often Used Commands</h3>
<p>If you use some commands a lot, create smaller alternative for it&#8230;</p>
<pre><code class="bash">alias x='exit'
alias q='exit'
alias rmdir='rm â€“rf'</code></pre>
<p>Many of my own scripts are also alias&#8217;ed this way&#8230;</p>
<pre><code class="bash">alias bk='perl "/home/binnyva/Scripts/Perl/Maintenance/<a href="http://lindesk.com/2008/05/shell-script-to-backup-files-locally-using-rsync/">Rsync Backup/RsyncBackup</a>.pl"'
alias rbk='perl "/home/binnyva/Scripts/Perl/Maintenance/<a href="http://lindesk.com/2008/06/script-to-backup-files-over-a-network-using-rsync/">Rsync Backup/RsyncRemoteBackup</a>.pl"'
alias nbk='perl "/home/binnyva/Scripts/Perl/Maintenance/Rsync Backup/RsyncNetworkBackup.pl"'
alias bdb='perl "/home/binnyva/Scripts/Perl/Maintenance/<a href="http://lindesk.com/2008/06/perl-script-to-backup-mysql-databases/">Database Backup/Dbbackup</a>.pl"'</code></pre>
<h3>Complex Commands</h3>
<p>Create a short version of long and complex command using alias&#8230;</p>
<pre><code class="bash">alias gitstat='git status | perl -pe "exit if(/Untracked files\:/)"'
alias ra='ruby script/server'
alias wikipedia='cd /mnt/x/Data/Wikipedia/mywiki; firefox "http://localhost:8001/"; python manage.py runserver 8001; '
alias sup='svn update'</code></pre>
<p>and more.</p>
<h3>Command Changes</h3>
<p>When I came from Windows to Linux, I was used to the dos commands &#8211; but not to the linux&#8217;s mv,cp commands. So I used to have aliases for those(I don&#8217;t have these now)</p>
<pre><code class="bash">alias move='mv'
alias copy='cp'
alias ren='mv'
alias del='rm'</code></pre>
<p>If you go from Red Hat/Fedora to Debian/Ubuntu(or vise versa), you can set up a few alias to make the change easier&#8230;</p>
<pre><code class="bash">alias yum='apt-get'</code></pre>
<p>You can get a lot of ideas for more aliases by looking at <a href="http://dotfiles.org/.bashrc">others .bashrc files</a>.</p>
<p>Now tell me you aliases&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://lindesk.com/2009/03/customizing-the-terminal-create-useful-aliases/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Customizing the Terminal: The Prompt</title>
		<link>http://lindesk.com/2009/03/customizing-the-terminal-the-prompt/</link>
		<comments>http://lindesk.com/2009/03/customizing-the-terminal-the-prompt/#comments</comments>
		<pubDate>Tue, 10 Mar 2009 18:04:13 +0000</pubDate>
		<dc:creator>BinnyVA</dc:creator>
				<category><![CDATA[Command Line]]></category>
		<category><![CDATA[Configuration]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[command]]></category>
		<category><![CDATA[customize]]></category>
		<category><![CDATA[prompt]]></category>
		<category><![CDATA[shell]]></category>
		<category><![CDATA[terminal]]></category>

		<guid isPermaLink="false">http://lindesk.com/?p=181</guid>
		<description><![CDATA[Most Linux 'gurus' spend a lot of time working in the terminal. If you belong to that group, this post is for you. This is a tutorial to configure the terminal prompt to the best possible value for your use. Note: This tutorial is for bash users - these instructions will not work in other shells.]]></description>
			<content:encoded><![CDATA[<p><img src="http://lindesk.com/wp-content/uploads/2008/02/terminal.png" alt="Terminal" title="Terminal" width="128" height="128" class="alignnone size-full wp-image-96 intro" align="right" /></p>
<p class="intro">Most Linux &#8216;gurus&#8217; spend a lot of time working in the terminal. If you belong to that group, this post is for you. This is a tutorial to configure the terminal prompt to the best possible value for your use. Note: This tutorial is for bash users &#8211; these instructions will not work in other shells.</p>
<h2>The Prompt</h2>
<p>You must have seen the prompt if you have use the terminal &#8211; it is the first few characters in each line. Usually, it will be&#8230;</p>
<pre><code class="bash">[username@localhost] ~ $</code></pre>
<p>In this case, the user is shown three piece of information in the prompt &#8211; </p>
<ul>
<li>Username of the current user</li>
<li>Hostname</li>
<li>Current folder name</li>
</ul>
<p>This post will show you how to customize this prompt to your needs.</p>
<h3>Editing the Prompt</h3>
<p>Editing the prompt is very simple &#8211; you just have to edit a shell variable. To see the current prompt&#8217;s value, open a shell and type the command&#8230;</p>
<pre><code class="bash">echo $PS1</code></pre>
<p>The result will be something like this(in Ubuntu)&#8230;</p>
<pre><code class="bash">binnyva@binlap:~$ echo $PS1
\[\e]0;\u@\h: \w\a\]${debian_chroot:+($debian_chroot)}\u@\h:\w\$</code></pre>
<p>Which is functionally the same as&#8230;</p>
<pre><code class="bash">\u@\h:\W\$ </code></pre>
<p>To edit this variable, run the command&#8230;</p>
<pre><code class="bash">export PS1=&lt;New Prompt Value&gt;</code></pre>
<p>Most desktop systems don&#8217;t need the username and hostname in the prompt &#8211; this is only relevent if your are connected to a remote system. So the first thing to do, if you are on a desktop system, is to remove those two. To do that, run the command&#8230;</p>
<pre><code class="bash">export PS1="[\W]\$ "</code></pre>
<p>This will change the prompt in the current terminal. To make it permanent, edit the ~/.bashrc and set the PS1 variable there. Just add this line at the end of the file&#8230;</p>
<pre><code class="bash">export PS1="[\W]\$ "</code></pre>
<h2>A Better Prompt</h2>
<p>Currently, the prompt has the basename of the current working directory. That is, if we are in &#8216;~/Sites/Lindesk/posts&#8217;, the prompt will be &#8216;[posts]$ &#8216;. This is good enough for most people. But I have a problem with this. If I go to another folder, say, &#8216;~/Sites/<a href="http://www.openjs.com/">OpenJS</a>/posts&#8217;, the prompt is still &#8216;[posts]$ &#8216;. The prompt is a bit ambiguous in this case. This can be done using a different character &#8211; in this case \w(small &#8216;w&#8217; &#8211; the default was capital &#8216;W&#8217;).</p>
<pre><code class="bash">[posts]$ export PS1="[\w]$ "
[~/Sites/OpenJS/posts]$ _</code></pre>
<p>This is nice &#8211; but you will have a problem if the directory you are in is several levels deep. It might be something like this&#8230;</p>
<pre><code class="bash">[/var/www/html/sites/Lindesk/lindesk.com/wp-content/plugins/eventr/langs]$ _</code></pre>
<p>That&#8217;s long &#8211; and inconvenient. There are better ways of doing this.</p>
<h3>Show the Beginning and the End.</h3>
<p>A better way of doing this is to cut of a part of the folder &#8211; so the above path will look something like&#8230;</p>
<pre><code class="bash">[/var/www/html.../eventr/langs] $ _</code></pre>
<p>This option will show the first 15 characters of the path and then the last 15 characters &#8211; if the directory path is bigger than 30 characters. To enable this mode, open up the file <code>~/.bashrc</code> and add this code&#8230;</p>
<pre><code class="bash">PROMPT_COMMAND='DIR=`pwd|sed -e "s!$HOME!~!"`; if [ ${#DIR} -gt 30 ]; then CurDir=${DIR:0:12}...${DIR:${#DIR}-15}; else CurDir=$DIR; fi'
PS1="[\$CurDir] \$ "</code></pre>
<h3>The First Character of Each Directory</h3>
<p>There is yet another method &#8211; I got this idea from the <a href="http://lindesk.com/2007/04/fishfriendly-interactive-shell/">fish shell</a>. In this approach, the big path will appear as&#8230;</p>
<pre><code class="bash">[/v/w/h/s/L/l/w/p/e/langs] $ _</code></pre>
<p>In this option, only the first character of each parent folder will be shown. Only the base folder name will be shown entirely. This is the approach I use. If you want to use this, open the <code>~/.bashrc</code> file and add this&#8230;</p>
<pre><code class="bash">PROMPT_COMMAND='CurDir=`pwd|sed -e "s!$HOME!~!"|sed -re "s!([^/])[^/]+/!\1/!g"`'
PS1="[\$CurDir] \$ "</code></pre>
<h3>Prompt Variables</h3>
<p>The other values you can insert into the prompt are&#8230;</p>
<dl>
<dt>\d</dt>
<dd>the date in &#8220;Weekday Month Date&#8221; format (e.g., &#8220;Tue May 26&#8243;)</dd>
<dt>\D{format}</dt>
<dd>the format is passed to strftime(3) and the result is inserted into the prompt string; an empty format results in a locale-specific time representation. The braces are required</dd>
<dt>\e</dt>
<dd>an ASCII escape character (033)</dd>
<dt>\h</dt>
<dd>the hostname up to the first â€˜.â€™</dd>
<dt>\H</dt>
<dd>the hostname</dd>
<dt>\j</dt>
<dd>the number of jobs currently managed by the shell</dd>
<dt>\l</dt>
<dd>the basename of the shellâ€™s terminal device name</dd>
<dt>\n</dt>
<dd>newline</dd>
<dt>\r</dt>
<dd>carriage return</dd>
<dt>\s</dt>
<dd>the name of the shell, the basename of $0 (the portion following the final slash)</dd>
<dt>\t</dt>
<dd>the current time in 24-hour HH:MM:SS format</dd>
<dt>\T</dt>
<dd>the current time in 12-hour HH:MM:SS format</dd>
<dt>\@</dt>
<dd>the current time in 12-hour am/pm format</dd>
<dt>\A</dt>
<dd>the current time in 24-hour HH:MM format</dd>
<dt>\u</dt>
<dd>the username of the current user</dd>
<dt>\v</dt>
<dd>the version of bash (e.g., 2.00)</dd>
<dt>\V</dt>
<dd>the release of bash, version + patch level (e.g., 2.00.0)</dd>
<dt>\w</dt>
<dd>the current working directory, with $HOME abbreviated with a tilde</dd>
<dt>\W</dt>
<dd>the basename of the current working directory, with $HOME abbreviated with a tilde</dd>
<dt>\!</dt>
<dd>the history number of this command</dd>
<dt>\#</dt>
<dd>the command number of this command</dd>
<dt>\$</dt>
<dd>if the effective UID is 0, a #, otherwise a $</dd>
<dt>\nnn</dt>
<dd>the character corresponding to the octal number nnn</dd>
<dt>\\</dt>
<dd>a backslash</dd>
<dt>\[</dt>
<dd>begin a sequence of non-printing characters, which could be used to embed a terminal control sequence into the prompt</dd>
<dt>\]</dt>
<dd>end a sequence of non-printing characters</dd>
</dl>
]]></content:encoded>
			<wfw:commentRss>http://lindesk.com/2009/03/customizing-the-terminal-the-prompt/feed/</wfw:commentRss>
		<slash:comments>20</slash:comments>
		</item>
		<item>
		<title>Recovering Deleted Data in Linux Ext3 Filesystem: Use Trash Can</title>
		<link>http://lindesk.com/2009/01/recovering-deleted-data-linux-ext3-filesystem-use-trash-can/</link>
		<comments>http://lindesk.com/2009/01/recovering-deleted-data-linux-ext3-filesystem-use-trash-can/#comments</comments>
		<pubDate>Sun, 25 Jan 2009 18:25:09 +0000</pubDate>
		<dc:creator>BinnyVA</dc:creator>
				<category><![CDATA[Configuration]]></category>
		<category><![CDATA[Opinion]]></category>
		<category><![CDATA[Troubleshooting]]></category>
		<category><![CDATA[delete]]></category>
		<category><![CDATA[ext3]]></category>
		<category><![CDATA[fat32]]></category>
		<category><![CDATA[fragmentation]]></category>
		<category><![CDATA[ntfs]]></category>
		<category><![CDATA[recover]]></category>
		<category><![CDATA[recovery]]></category>
		<category><![CDATA[trash]]></category>

		<guid isPermaLink="false">http://lindesk.com/?p=170</guid>
		<description><![CDATA[As most of you know, <strong class="highlight">Ext3 file system don't have to be defragmented</strong> like the FAT32 or NTFS file systems. This is a nice feature - but this has a bad side effect as well. You <strong class="highlight">cannot recover deleted files</strong>. This is a good trade-off in a server environment. Its not practical to run a defragmenter on a live server. It might take hours to complete - and disk access will not be allowed in that time. And most server environment have very strong backup mechanisms - so data recovery is not a big issue. But <strong class="highlight">when it comes to the desktop environment, this is a very Bad Thing</strong>.]]></description>
			<content:encoded><![CDATA[<p><img src="http://lindesk.com/wp-content/uploads/2009/01/trashcan.png" alt="Deleting Files to the Trash" title="Deleting Files to the Trash" width="128" height="128" class="alignnone size-full wp-image-171 intro" align="right" /></p>
<p class="intro">As most of you know, <strong class="highlight">Ext3 file system don&#8217;t have to be defragmented</strong> like the FAT32 or NTFS file systems. This is a nice feature &#8211; but this has a bad side effect as well. You <strong class="highlight">cannot recover deleted files</strong>. This is a good trade-off in a server environment. Its not practical to run a defragmenter on a live server. It might take hours to complete &#8211; and disk access will not be allowed in that time. And most server environment have very strong backup mechanisms &#8211; so data recovery is not a big issue. But <strong class="highlight">when it comes to the desktop environment, this is a very Bad Thing</strong>.</p>
<p>From a desktop user perspective, it is not a huge deal to run a defragmenter once in a while. I used to do it once every month or so when I was on windows. But <strong class="highlight">accidental deletion is a huge problem</strong> as most desktop users don&#8217;t have a very strong backup system in place.</p>
<p>In Windows(FAT32 or NTFS) if you want a deleted file back, there are file recovery software available that might recover the file. There is a good chance of getting back the file in one piece if you try to recover the file soon. But this is not possible in Ext3 &#8211; the way the file system is designed makes it next to impossible. This is because the <strong class="highlight">file system will overwrite the deleted portions &#8211; to prevent fragmentation of files</strong>. The advantage of this method is that fragmentation will be avoided. The disadvantage is, well, you will not be able to recover deleted files.</p>
<h2>Solution: The Trash</h2>
<p>There is a very simple solution to this problem &#8211; but it is something no self respecting geek will use. The Recycle Bin. <strong class="highlight">The Trash Can. Use it</strong>.</p>
<p>The problem is I have not seen anyone other than total newbies delete files into the Trash. Most people I know use the Shift+Delete shortcut to delete. I use a slightly different shortcut &#8211; Shift+Delete, Enter. That means I don&#8217;t even see the deletion confirmation prompt. And <strikethrough>if</strikethrough> when I delete something important, the only thing left to do is cry.</p>
<p>I have <a href="http://lindesk.com/2008/06/perl-script-to-backup-mysql-databases/">several</a> <a href="http://lindesk.com/2008/05/shell-script-to-backup-files-locally-using-rsync/">backup systems</a> <a href="http://lindesk.com/2008/06/script-to-backup-files-over-a-network-using-rsync/">in place</a> &#8211; but you know the Murphy&#8217;s law when in comes to backups&#8230;</p>
<blockquote><p>You have a backup of everything &#8211; except the file that was deleted</p>
</blockquote>
<p>So, <strong class="highlight">start using the Trash &#8211; do a delete instead of a shift+delete</strong>. I would advice removing the confirmation dialog on the delete action to make it go faster. You can do it easily in Konquorer&#8230;</p>
<ul>
<li>Open Konquorer</li>
<li>Setting &gt; Configure Konquorer&#8230;</li>
<li>Behavior &gt; Ask Confirmation For</li>
<li>Make sure the &#8216;Move to trash&#8217; checkbox is turned off.</li>
</ul>
<p>I am sure this is possible in Nautilus as well &#8211; but I am not sure how to do it. If any of my readers is a gnome user, please post a comment on how to do it.</p>
<p>One last thing &#8211; remember to clean the trash once every two days or so.</p>
]]></content:encoded>
			<wfw:commentRss>http://lindesk.com/2009/01/recovering-deleted-data-linux-ext3-filesystem-use-trash-can/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
		<item>
		<title>Creating Custom Service Menus in Konqueror</title>
		<link>http://lindesk.com/2008/10/action-context-custom-service-menus-konqueror/</link>
		<comments>http://lindesk.com/2008/10/action-context-custom-service-menus-konqueror/#comments</comments>
		<pubDate>Mon, 06 Oct 2008 18:53:37 +0000</pubDate>
		<dc:creator>BinnyVA</dc:creator>
				<category><![CDATA[Applications]]></category>
		<category><![CDATA[Configuration]]></category>
		<category><![CDATA[KDE]]></category>
		<category><![CDATA[action]]></category>
		<category><![CDATA[context]]></category>
		<category><![CDATA[desktop]]></category>
		<category><![CDATA[konquoror]]></category>
		<category><![CDATA[menu]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[service]]></category>

		<guid isPermaLink="false">http://lindesk.com/?p=140</guid>
		<description><![CDATA[f you are using <a href="http://lindesk.com/2007/04/konqueror-a-killer-app-for-linux/">Konqueror</a> and have not used custom service menus, you are missing out. Just like the <a href="http://lindesk.com/2007/04/nautilus-scripts-terminal-file-finder/">Nautilus Scripts</a> in Nautilus, <strong>Konqueror also has the ability to customize the context menus</strong>. This post will show you how to do it]]></description>
			<content:encoded><![CDATA[<p><img src="http://lindesk.com/wp-content/uploads/2007/04/konqueror.png" alt="" title="Konqueror Logo" width="170" height="168" class="alignnone size-full wp-image-21 intro" align="right" /></p>
<p class="intro">If you are using <a href="http://lindesk.com/2007/04/konqueror-a-killer-app-for-linux/">Konqueror</a> and have not used custom service menus, you are missing out. Just like the <a href="http://lindesk.com/2007/04/nautilus-scripts-terminal-file-finder/">Nautilus Scripts</a> in Nautilus, <strong class="highlight">Konqueror also has the ability to customize the context menus</strong>. This post will show you how to do it.</p>
<p>We are going to create two different kind of service menus &#8211; one will create an item in the action part of the right click menu. The next type will create a submenu in the &#8216;actions&#8217; menu with multiple menu items. Hopefully, you will get an idea about how to do it by yourself.</p>
<h2>Single Item Service Menu</h2>
<p>This service menu will <strong class="highlight">create a menu item in the Action section of the context menu for all ISO files</strong>. For this to work as intended, the mimetype for ISO file must be application/x-iso .</p>
<ul>
<li><strong class="highlight">Open ~/.kde/share/apps/konqueror/servicemenus folder</strong></li>
<li><strong class="highlight">Create a file with the name &#8216;PlayISO.desktop&#8217;</strong> &#8211; the name can be anything &#8211; but the <strong class="highlight">extension must be &#8216;.desktop&#8217;</strong></li>
<li>Enter the following content&#8230;</li>
</ul>
<pre><code class="desktop">[Desktop Entry]
ServiceTypes=application/x-iso
Actions=PlayISOInXine

[Desktop Action PlayISOInXine]
Name=Play ISO File in Xine
Icon=player_play
Exec=xine -pq --no-splash dvd:/%f
</code></pre>
<p>Now lets see a line by line explanation of the code.</p>
<dl>
<dt>[Desktop Entry]</dt>
<dd>Start the file with this line.</dd>
<dt>ServiceTypes=application/x-iso</dt>
<dd>This <strong class="highlight">decides which all file types must this service menu be shown</strong> to. You can find the mimetype for various files by taking Control Center &gt; KDE Components &gt; File Associations. Then search for the extension in the given text field.</dd>
<dt>Actions=PlayISOInXine</dt>
<dd>Name of the action &#8211; this will be defined in the next line</dd>
<dt>[Desktop Action PlayISOInXine]</dt>
<dd>The definition of the &#8216;PlayISOInXine&#8217; action goes here.</dd>
<dt>Name=Play ISO File in Xine</dt>
<dd>The text to be shown in the menu item.</dd>
<dt>Icon=player_play</dt>
<dd>The icon to be used in the menu. The icon can be an absolute path or the file name of an image in your current theme(for example, if you are using Crystal SVG theme, then the images you can use is in the folder &#8216;/usr/share/icons/crystalsvg/16&#215;16/actions&#8217;).</dd>
<dt>Exec=xine -pq &#8211;no-splash dvd:/%f</dt>
<dd>The <strong class="highlight">command to be executed when the menu item is clicked</strong>. The %f stands for the full name of the file. The other options are listed in the <a href="http://standards.freedesktop.org/desktop-entry-spec/latest/ar01s06.html">documentation</a>.</dd>
</dl>
<p>This is the end result&#8230;</p>
<p><img src="http://lindesk.com/wp-content/uploads/2008/10/iso_menu.png" alt="" title="ISO Action Menu Result" width="456" height="124" class="alignnone size-full wp-image-142" /></p>
<h3>Submenu Service Menu</h3>
<p>This sample will give you the option to <strong class="highlight">convert the selected html file to a plain text file or a compressed archive</strong>. The code looks like this&#8230;</p>
<pre><code class="desktop">[Desktop Entry]
ServiceTypes=text/html
Actions=convertToText;convertToZip
X-KDE-Submenu=Convert

[Desktop Action convertToText]
Name=Convert To Text
Icon=txt
Exec=lynx -dump "%f" > "`dirname "%f"`/`basename "%f" ".html"`.txt"

[Desktop Action convertToZip]
Name=Compress as Zip
Icon=tar
Exec=zip "`dirname "%f"`/`basename "%f" ".html"`.zip" "%f"
</code></pre>
<p>Again, a line by line explanation&#8230;</p>
<dl>
<dt>[Desktop Entry]</dt>
<dd>You know.</dd>
<dt>ServiceTypes=text/html</dt>
<dd>This is only for HTML files &#8211; so we specify the mimetype as text/html</dd>
<dt>Actions=convertToText;convertToZip</dt>
<dd>We have <strong class="highlight">two different actions</strong> instead of just one as in the last case. So we provide the name of both actions separated by a &#8216;;&#8217;.</dd>
<dt>X-KDE-Submenu=Convert</dt>
<dd>This will <strong class="highlight">make sure its shown in a submenu</strong> &#8211; and that the name of the submenu is Convert.</dd>
<dt>[Desktop Action convertToText]</dt>
<dd>Defining the first action &#8211; convertToText</dd>
<dt>Name=Convert To Text</dt>
<dd>The label of the menu item</dd>
<dt>Icon=txt</dt>
<dd>And its icon</dd>
<dt>Exec=lynx -dump &#8220;%f&#8221; &gt; &#8220;`dirname &#8220;%f&#8221;`/`basename &#8220;%f&#8221; &#8220;.html&#8221;`.txt&#8221;</dt>
<dd>This command will convert a html file to a text file and put the resulting file in the same folder as the html file.</dd>
<dt>[Desktop Action convertToZip]</dt>
<dd>Defining the next action &#8211; convertToZip</dd>
<dt>Name=Compress as Zip</dt>
<dd>Label</dd>
<dt>Icon=tar</dt>
<dd>And Icon</dd>
<dt>Exec=zip &#8220;`dirname &#8220;%f&#8221;`/`basename &#8220;%f&#8221; &#8220;.html&#8221;`.zip&#8221; &#8220;%f&#8221;</dt>
<dd>The command to compress the html file as a zip file.</dd>
</dl>
<p>If done correctly, it should look something like this&#8230;</p>
<p><img src="http://lindesk.com/wp-content/uploads/2008/10/html_menu.png" alt="" title="HTML Service Menu Result"  class="alignnone wp-image-141" /></p>
<h2>Related Links</h2>
<ul>
<li><a href="http://standards.freedesktop.org/desktop-entry-spec/latest/index.html">Desktop File Documentation</a></li>
<li><a href="http://www.linux.com/feature/148002">Do-it-yourself Konqueror commands</a></li>
<li><a href="http://www.kde-apps.org/?xcontentmode=287">Collection of Service Menu Scripts</a></li>
<li><a href="http://www.kde-apps.org/content/show.php/Service+Menu+Editor?content=85062">GUI Service Menu Editor</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://lindesk.com/2008/10/action-context-custom-service-menus-konqueror/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Adding Support for almost All Video Formats/Codecs in Linux</title>
		<link>http://lindesk.com/2008/09/adding-support-for-almost-all-video-formatscodecs-in-linux/</link>
		<comments>http://lindesk.com/2008/09/adding-support-for-almost-all-video-formatscodecs-in-linux/#comments</comments>
		<pubDate>Fri, 12 Sep 2008 18:55:15 +0000</pubDate>
		<dc:creator>BinnyVA</dc:creator>
				<category><![CDATA[Configuration]]></category>
		<category><![CDATA[Troubleshooting]]></category>
		<category><![CDATA[Video]]></category>
		<category><![CDATA[codec]]></category>
		<category><![CDATA[format]]></category>
		<category><![CDATA[guide]]></category>
		<category><![CDATA[install]]></category>
		<category><![CDATA[multimedia]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://lindesk.com/?p=126</guid>
		<description><![CDATA[There is an over abundance of video formats right now - fortunately, our favorite OS, Linux, is capable of handling all of them. But some video formats are not supported 'out-of-the-box' - in such cases, we have to install the necessary codecs. This guide will show you how install the codecs for just about every video format under the sun.]]></description>
			<content:encoded><![CDATA[<p><img src="http://lindesk.com/wp-content/uploads/2008/09/videos.png" alt="Multimedia" title="Videos" width="128" height="128" class="size-full wp-image-127 intro" align="right" /></p>
<p class="intro">There is an over abundance of <a href="http://en.wikipedia.org/wiki/List_of_codecs#Video_codecs">video formats</a> right now &#8211; fortunately, our favorite OS, Linux, is capable of handling all of them. But some video formats are not supported &#8216;out-of-the-box&#8217; &#8211; in such cases, we have to install the necessary codecs. This guide will show you how install the codecs for just about every video format under the sun.</p>
<p>Before going into the topic further, let me pacify the flamers in the audience. There are many codecs that include DRM and many are proprietary &#8211; and for this reason, many distros refuse to support them. But these can be supported using external software &#8211; whether or not to do that is a choice I leave to the readers. I am only handling the technical issue of installing the codecs here. The moral and ethical concerns have been handled by others better than me.</p>
<h2>The Players &#8211; Video Trinity</h2>
<p>There is no shortage of <a href="http://lindesk.com/2007/05/top-5-video-players-in-linux/">video players in linux</a>. Among these, three players are more prominent than the others &#8211; these are Mplayer, Xine and VLC. <strong class="highlight">I call them the Video Trinity</strong>. Before doing anything, install all three players. Yes, all of them.</p>
<h3>Mplayer</h3>
<p><img src="http://lindesk.com/wp-content/uploads/2008/09/mplayer_logo.png" alt="" title="Mplayer Logo" width="234" height="193" class="alignnone size-full wp-image-128" /></p>
<p><a href="http://www.mplayerhq.hu/">Mplayer</a> is perharps the most popular among linux video players. You can install it in a Red Hat/Fedora system using this command(the command for debian/ubuntu systems will be similar &#8211; can someone post it in the comments?)&#8230;</p>
<pre><code class="cli">yum install mplayer mplayer-fonts mplayer-gui</code></pre>
<p>If you are on a Debian based system &#8211; like Ubuntu, use this command&#8230;</p>
<pre><code class="cli">apt-get install mplayer mplayer-fonts mplayer-skins</code></pre>
<h3>Xine</h3>
<p><img src="http://lindesk.com/wp-content/uploads/2008/09/xine_logo.png" alt="" title="Xine Logo" width="270" height="140" class="alignnone size-full wp-image-129" /></p>
<p><a href="http://xinehq.de/">xine</a> is a free multimedia player. It plays back CDs, DVDs, and VCDs. It also decodes multimedia files like AVI, MOV, WMV, and MP3 from local disk drives, and displays multimedia streamed over the Internet. It interprets many of the most common multimedia formats available &#8211; and some of the most uncommon formats, too. Installing xine is just as easy&#8230;</p>
<pre><code class="cli">yum install xine xine-lib xine-skins xine-lib-extras-nonfree </code></pre>
<p>Again, on a  Debian/Ubuntu system, use the command&#8230;</p>
<pre><code class="cli">apt-get install xine-ui</code></pre>
<h3>VLC</h3>
<p><img src="http://lindesk.com/wp-content/uploads/2008/09/vlc_icon.png" alt="" title="VLC Icon" width="140" height="154" class="alignnone size-full wp-image-130" /></p>
<p>VLC media player is a highly portable multimedia player for various audio and video formats (MPEG-1, MPEG-2, MPEG-4, DivX, mp3, ogg, &#8230;) as well as DVDs, VCDs, and various streaming protocols. VLC is popular in the windows crowd as well. Here is the command to install it&#8230;</p>
<pre><code class="cli">yum install vlc</code></pre>
<p>Debain/Ubuntu uses should use the command&#8230;</p>
<pre><code class="cli">apt-get install vlc</code></pre>
<p><strong>With these 3 players installed, you must be able to open 90% of the video</strong> files out there. But for the more exotic video formats, <strong>we must install the extra codecs provided by mplayer</strong>. First install the codes available in your distro&#8217;s repository &#8211; in Fedora(with Livna repository) the command I used is&#8230;</p>
<pre><code class="cli">yum install gstreamer libdvdcss gstreamer-plugins-ugly audacious-plugins-nonfree-mp3 kdemultimedia-extras-nonfree ...</code></pre>
<p>Or in Debian/Ubuntu system</p>
<pre><code class="cli">apt-get install gstreamer0.10-plugins-ugly gstreamer0.10-plugins-ugly-multiverse gstreamer0.10-plugins-bad gstreamer0.10-plugins-bad-multiverse gstreamer0.10-ffmpeg</pre>
<p></code></p>
<h2>Essential Video Codecs</h2>
<p>The binary codec packages provided by mplayer <strong>adds support for codecs that are not yet supported natively</strong>, like newer RealVideo variants and a lot of rare formats. Note that they are not necessary to play most common formats like DVDs, MPEG-1/2/4, etc. Take a look at the <a href="http://www.mplayerhq.hu/DOCS/codecs-status.html">codec status table</a> for the list of currently supported codecs in Mplayer. </p>
<p>Instructions for installing binary codecs can be found in the <a href="http://www.mplayerhq.hu/DOCS/README">README</a> or in the README.txt file that accompanies each codec package. Detailed usage instructions are in the <a href="http://www.mplayerhq.hu/DOCS/HTML/en/codecs.html">codecs section</a> of the documentation. A brief overview of the installation procedure is given below...</p>
<h3>Installing the Codecs</h3>
<p>First, <a href="http://www.mplayerhq.hu/MPlayer/releases/codecs/">download the codecs package</a> that matches your system. In most cases, that is <a href="http://www4.mplayerhq.hu/MPlayer/releases/codecs/essential-20071007.tar.bz2">Linux x86</a>.</p>
<p>First, <strong>extract the file</strong> to a local directory. There should be 64 files(currently). Next, we have to <strong>copy this to the system's codecs folder(usually /usr/local/lib/codecs/)</strong>. To do this, you must have root user privileges...</p>
<pre><code class="cli">sudo cp -R essential-20071007/ /usr/local/lib/codecs/</code></pre>
<p>Voila - we have installed the codecs. But we are not done yet. Some players look for the codecs in other folders - to accommodate those players, we have to <strong>link the other folders to the central codecs directory</strong>. To do that, run these commands(as root)...</p>
<pre><code class="cli">ln -s /usr/local/lib/codecs/ /usr/lib/codecs
ln -s /usr/local/lib/codecs/ /usr/lib/win32
ln -s /usr/local/lib/codecs/ /usr/local/lib/win32
</code></pre>
<h2>Playing the Video</h2>
<p>Now <strong>open up the video you are trying to play in any video player(say mplayer)</strong> - in 99% of the cases, it will play without any issues. In the unlikely <strong>event of a problem, open up the same video in xine</strong>. If it still <strong>does not play, go to vlc</strong>. Your video will be working in atleast one of these three players.</p>
<p>Did it work for you - let me know in the comments...</p>
]]></content:encoded>
			<wfw:commentRss>http://lindesk.com/2008/09/adding-support-for-almost-all-video-formatscodecs-in-linux/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<item>
		<title>MPD &#8211; Music Player Daemon</title>
		<link>http://lindesk.com/2008/04/mpd-music-player-daemon/</link>
		<comments>http://lindesk.com/2008/04/mpd-music-player-daemon/#comments</comments>
		<pubDate>Mon, 14 Apr 2008 18:30:58 +0000</pubDate>
		<dc:creator>BinnyVA</dc:creator>
				<category><![CDATA[Audio]]></category>
		<category><![CDATA[Configuration]]></category>
		<category><![CDATA[daemon]]></category>
		<category><![CDATA[mp3]]></category>
		<category><![CDATA[mpd]]></category>
		<category><![CDATA[music]]></category>
		<category><![CDATA[player]]></category>

		<guid isPermaLink="false">http://lindesk.com/?p=105</guid>
		<description><![CDATA[MPD is not for everyone.

Before continuing into the article, a word of warning. MPD is not for everyone. If you are a casual desktop linux user with zero geek genes, stay away from this player. There are many other simpler players for you.

But then again, &#8216;casual desktop linux user&#8217; &#8211; that sounds like a contradiction [...]]]></description>
			<content:encoded><![CDATA[<blockquote class="pullquote"><p>MPD is not for everyone.</p>
</blockquote>
<p class="intro">Before continuing into the article, a word of warning. <strong class="highlight">MPD is not for everyone.</strong> If you are a casual desktop linux user with zero geek genes, stay away from this player. There are <a href="http://lindesk.com/2008/03/top-10-linux-mp3-players/">many other simpler players</a> for you.</p>
<p><a href='http://lindesk.com/wp-content/uploads/2008/04/mpd_logo.png'><img src="http://lindesk.com/wp-content/uploads/2008/04/mpd_logo.png" alt="" title="Mpd Logo" width="359" height="156" class="intro alignright size-full wp-image-106" /></a></p>
<p>But then again, &#8216;casual desktop linux user&#8217; &#8211; that sounds like a contradiction in terms. The very fact that you are reading this means that you are a geek.</p>
<h2>Getting Started with MPD</h2>
<p>Setting up MPD is not as simple as other music players.</p>
<h3>Installation</h3>
<p>To see MPD in action, first we have to install MPD &#8211; and a client. I installed the following&#8230;</p>
<ul>
<li>MPD server</li>
<li>MPC &#8211; A command line MPD client</li>
<li>gmpc &#8211; A GUI client for Gnome</li>
</ul>
<p>In a RedHat based system, you can install these using the command&#8230;</p>
<p><code>yum install mpd mpc gmpc</code></p>
<h3>Configuration</h3>
<p>Here is where it starts to get a bit confusing. MPD don&#8217;t have a pretty GUI to go along with it. It has to be configured using a text file. Create a file &#8216;.mpdconf&#8217; in your home folder and enter the following in it&#8230;</p>
<pre><code class="cli">
port					"6600"
music_directory         "~/Songs"
playlist_directory      "~/.mpd/playlists"
db_file                 "~/.mpd/mpd.db"
log_file                "~/.mpd/mpd.log"
error_file              "~/.mpd/mpd.error"
</code></pre>
<p>The &#8216;music_directory&#8217;(&#8220;~/Songs&#8221; in our example) must point to the folder where you keep your music. If you have your music in multiple folders then I cannot help you. MPD was designed with just one music root directory in mind.</p>
<p>It is a good idea to create the playlist folder now &#8211; it will prevent errors later on. To do that run the command&#8230;</p>
<p><code>mkdir -p ~/.mpd/playlists</code></p>
<p>Next run these commands&#8230;</p>
<pre><code class="cli">mpd --create-db
mpc update
mpc add /
mpc play</code></pre>
<p>If all went well, you must be hearing sweet music now. Here is an explanation of the commands we used and their purpose&#8230;</p>
<dl>
<dt>mpd &#8211;create-db</dt>
<dd>This will start the daemon. The &#8216;&#8211;create-db&#8217; argument will read the contents of the root music directory and add the Music files to a text database. You should see the list of files being added into the DB. This may take some time to complete &#8211; based on size of your music collection.</dd>
<dt>mpc update</dt>
<dd>The command used here is &#8216;mpc&#8217; &#8211; not &#8216;mpd&#8217;. We are using a command line client now. This command scans the root music directory for updates.</dd>
<dt>mpc add /</dt>
<dd>This command will add all the files in the music directory to the current playlist. Please note that the &#8216;/&#8217; here means root music directory &#8211; and not the global linux root.</dd>
<dt>mpc play</dt>
<dd>This will start playing the files in the current playlist.</dd>
</dl>
<h2>GUI Clients</h2>
<p>There are many GUI clients for MPD &#8211; the ones I would recommend are&#8230;</p>
<ul>
<li>Gnome Music Player Client(gmpc)</li>
<li>Sonata</li>
</ul>
<p>Once the mpd daemon is up and running, just open these clients and click on the connect button to control the daemon using these clients.</p>
]]></content:encoded>
			<wfw:commentRss>http://lindesk.com/2008/04/mpd-music-player-daemon/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Sound Issue in Fedora 8</title>
		<link>http://lindesk.com/2007/11/sound-issue-in-fedora-8/</link>
		<comments>http://lindesk.com/2007/11/sound-issue-in-fedora-8/#comments</comments>
		<pubDate>Wed, 14 Nov 2007 12:30:24 +0000</pubDate>
		<dc:creator>BinnyVA</dc:creator>
				<category><![CDATA[Audio]]></category>
		<category><![CDATA[Configuration]]></category>
		<category><![CDATA[Fedora]]></category>
		<category><![CDATA[Troubleshooting]]></category>

		<guid isPermaLink="false">http://lindesk.com/2007/11/sound-issue-in-fedora-8/</guid>
		<description><![CDATA[Solution for the sound issue in Fedora 8.]]></description>
			<content:encoded><![CDATA[<p><img src='http://lindesk.com/wp-content/uploads/2007/07/kaboodle.png' class="intro" align="right" alt='Music' /></p>
<p class="intro">Today I upgraded my system from Fedora 7 to Fedora 8. The installation process went very smoothly. But once the installation was done, I started the long process of configuring it. That&#8217;s when I ran into the sound issue in Fedora 8 &#8211; and based on the forum posts, so did many others.</p>
<p>Basically, you get this error at KDE startup&#8230;</p>
<pre>Sound Error Informational Message:
Error while initializing the sound driver:
device: default can't be opened for playback (Permission denied)
The sound server will continue, using the null output device
</pre>
<p>You will not be able to play any sound &#8211; amarok will crash if you try to play anything. But if you run system-config-soundcard(or System -&gt; Administration -&gt; Soundcard Detection), you will be able to hear the test sound. That is because you are running it as root.</p>
<h2>Solution 1 &#8211; Console-Kit Service</h2>
<p>Did you turn of Console-Kit and avahi-daemon startup services using system-config-services? If so, go back and re-enable them.</p>
<ul>
<li>Run system-config-services(or System -&gt; Administration -&gt; Services)</li>
<li>Find Console-Kit and enable it</li>
<li>Find avahi-daemon, enable it</li>
<li>Restart the system and see if that fixed the problem.</li>
</ul>
<p>This worked for me &#8211; so I did not try any of the following solutions.</p>
<h2>Solution 2 &#8211; alsa-plugin</h2>
<p>If the first solution did not solve the problem, try removing the pulseaudio plugin for alsa by running this command.</p>
<p><code>yum remove alsa-plugins-pulseaudio</code></p>
<h2>Solution 3 &#8211; Permissions</h2>
<p>If neither of the above work, open <code>/etc/security/console.perms.d/50-default-perms</code> and add this line to the top&#8230;</p>
<p><code>&lt;sound&gt;=/dev/dsp* /dev/snd/*</code></p>
<p>And at the end, add this line&#8230;</p>
<p><code>&lt;console&gt; 0666 &lt;sound&gt; 0600 root</code></p>
<h2>Related Links</h2>
<p>Hopefully, your problems are solved by now. If not, here are some links to help you further&#8230;</p>
<ul>
<li><a href="https://bugzilla.redhat.com/show_bug.cgi?id=292201">Bugzilla Bug 292201: ALSA mixer only usable as root</a></li>
<li><a href="http://home.nyc.rr.com/computertaijutsu/rhsound.html">Fixing Broken Sound in Fedora</a></li>
<li><a href="http://fedoraforum.org/forum/showthread.php?t=171083">Fedora 8 &amp; pulse audio &#8211; nonroot users have no sound Thread</a></li>
<li><a href="http://fedoraguide.info/index.php/Main_Page#Pulse_Audio_Potential_Issues">Pulse Audio Potential Issues</a></li>
</ul>
<p>More about Fedora 8 in the next post.</p>
]]></content:encoded>
			<wfw:commentRss>http://lindesk.com/2007/11/sound-issue-in-fedora-8/feed/</wfw:commentRss>
		<slash:comments>26</slash:comments>
		</item>
		<item>
		<title>Five Amarok Tips and Tricks</title>
		<link>http://lindesk.com/2007/10/five-amarok-tips-and-tricks/</link>
		<comments>http://lindesk.com/2007/10/five-amarok-tips-and-tricks/#comments</comments>
		<pubDate>Wed, 10 Oct 2007 18:25:40 +0000</pubDate>
		<dc:creator>BinnyVA</dc:creator>
				<category><![CDATA[Applications]]></category>
		<category><![CDATA[Audio]]></category>
		<category><![CDATA[Configuration]]></category>

		<guid isPermaLink="false">http://lindesk.com/2007/10/five-amarok-tips-and-tricks/</guid>
		<description><![CDATA[
Rating
If the rating feature is turned on you can rate the songs from the player&#8230;
Settings -&#62; Configure Amarok -&#62; General -&#62; Use Rating = On

Song Information Fetching
Amarok can automatically fetch information about the current song from the internet&#8230;
Lyrics
Context -&#62; Lyrics
This will fetch the lyrics of the current song from http://lyrc.com.ar and display it within amarok.

Singer [...]]]></description>
			<content:encoded><![CDATA[<p><a href='http://lindesk.com/2007/08/mp3-audio-players-in-linux/amarok/' rel='attachment wp-att-54' title='Amarok'><img class="intro" align="right" src='http://lindesk.com/wp-content/uploads/2007/08/amarok_logo.png' alt='Amarok' /></a></p>
<h2>Rating</h2>
<p>If the rating feature is turned on you can <strong class="highlight">rate the songs</strong> from the player&#8230;</p>
<p>Settings -&gt; Configure Amarok -&gt; General -&gt; Use Rating = On</p>
<p><img src='http://lindesk.com/wp-content/uploads/2007/10/amarok_ratings.png' alt='Ratings in Amarok' /></p>
<h2>Song Information Fetching</h2>
<p>Amarok can automatically fetch information about the current song <strong class="highlight">from the internet</strong>&#8230;</p>
<h3>Lyrics</h3>
<p>Context -&gt; Lyrics</p>
<p>This will fetch the lyrics of the current song from <a href="http://lyrc.com.ar">http://lyrc.com.ar</a> and display it within amarok.</p>
<p><img src='http://lindesk.com/wp-content/uploads/2007/10/amarok_lyrics.png' alt='Lyrics in Amarok' /></p>
<h3>Singer Details</h3>
<p>Context -&gt; Artist</p>
<p>Fetches the Wikipedia page for the singer of the current song.</p>
<h3>Album Cover</h3>
<p>Right Click Song -&gt; Edit Track Information -&gt; Summary<br />
Right Click on the CD Cover Image -&gt; Fetch from Amazon.com<br />
Click on the &#8216;Next&#8217; button until you find an Image you like and then click &#8216;Save&#8217;.</p>
<h2>Plugins/Extensions/Scripts</h2>
<p>If you want more from amarok, you can install some <a href="http://amarok.kde.org/wiki/Scripts">Amarok plugins</a>(they are called &#8216;Scripts&#8217; in amarok)</p>
<p>If you did not find the plugin you need, you can <a href="http://amarok.kde.org/wiki/Script-Writing_HowTo">write your own plugin</a>.</p>
<h2><abbr title="On Screen Display">OSD</abbr> for Current Song</h2>
<p>It is possible <strong class="highlight">see the title of the current song</strong> without opening amarok.</p>
<p>Settings -&gt; Configure Global Shortcuts -&gt; Show OSD = Ctrl+Shift+Q(for example)</p>
<p>Now whenever you press that shortcut, a small OSD will popup showing the name of the current song and the artist.</p>
<h2>Browse the Amarok DB</h2>
<p>Amarok stores all the information in a SQLite database(by default). This can be found at &#8216;~/.kde/share/apps/amarok/collection.db&#8217;. You can browse through it with a software capable of opening SQLite. You will find playlists, albums, fetched lyrics etc.</p>
<p>I have not found a practical use for this &#8211; yet. If you find any, let me know.</p>
<h2>More Tips&#8230;</h2>
<ul>
<li><a href="http://amarok.kde.org/wiki/Tips_and_Tricks">Amarok Tips and Tricks</a></li>
<li><a href="http://techgage.com/article/top_five_amarok_tips/">Top Five Amarok Tips</a></li>
<li><a href="http://www.linux.com/articles/59396">Get your groove on with Amarok</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://lindesk.com/2007/10/five-amarok-tips-and-tricks/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>
