Downloading videos from youtube – Ubuntu

Today I come across a fantastic command in Ubuntu called youtube-dl. This command is used to download videos from youtube. It has some great features like extracting sounds from the video in Ubuntu, set the audio format during extraction, resume partially downloaded files, Set the video timings for downloading etc….

Installation: $sudo apt-get install youtube-dl

Example: – After the installation you need to update the youtube-dl command to the latest version

$ sudo youtube-dl  -U

Then you can download the required video by

$ sudo youtube-dl

For more help do $man youtube-dl

Excel file already used by another user.

There may be a lot excel files stored in network and some users have equal rights to access the excel files. In a scenario when a user opens an excel file, the same file can be opened by another user. He gets a popup message “This file is already used by another user”.  It is difficult for that user to identify who has opened that particular file.


You need to write a VBA code to solve the above issue. This will help to identify the user who is currently working with that file. Please find the procedure below.

My working environment – office 2010.

  1. Open a excel file and press ALT + F11
  2. This will open VB editor
  3. Go to insert menu and select modules
  4. Type the required VBA code in that text area

“Private Sub Workbook_SheetActivate(ByVal Sh As Object)

If ActiveSheet.Name = “Sheet1” Or ActiveSheet.Name = “Sheet2” Then

Cells(1, 1) = Environ(“username”)

End If

End Sub”

5. Save the worksheet.


This solves the problem.

Ref url:

[Errno 14] Could not open/read file:///media/CentOS/repodata/repomd.xml Trying other mirror.

After the configuration of proxy in Centos, the following error message occurs while we do yum update “[Errno 14] Could not open/read file:///media/CentOS/repodata/repomd.xml  Trying other mirror”.


Edit the file mentioned in the below path and make the enabled 0.

#vi /etc/yum.repos.d/CentOS-Media.repo


name=CentOS-$releasever – Media





enabled=0 <—make sure this is 0


This solves the problem and you can run the yum update successfully.

CHAP secret given does not conform to the standard. Please see system eventlog for more information.

Today I tried OpenNAS product for testing ISCSI target. I come across an error “CHAP secret given does not confirm to the standard. Please see system event log for more information” in Windows ISCSI initiator while I try to discover the target.


This error is due to the password strength is very minimum for CHAP authentication.  Please ensure your password character length should be 12 characters minimum in OpenNAS. This solves my problem.

Linux newbies to work with CLI terminal

CLI Companion is an application which helps Linux newbies to work with terminal (CLI) efficiently. Using the built in commands you can explore the potential of the terminal. Experienced users can also add the command in the command dictionary to store and search when you need to explore again.

To install the CLI companion in Ubuntu run the following commands

$sudo add-apt-repository ppa:clicompanion-devs/clicompanion-nightlies
$sudo apt-get update
$sudo apt-get install clicompanion





To increase History size, Timestamp and to eliminate repeated commands in history

Scenario:  To eliminate duplicate / repeated commands in history, Timestamp for the history commands and also to increase the history size. The default histsize will be 1000.


1. To eliminate repeated commands in history please add the following in the environment.

$ export HISTCONTROL=erasedups

This will eliminate the repeated commands used by the user. Also this will save the histsize.


2. To achieve timestamp in history the following statement should be added in the environment.

$ export HISTTIMEFORMAT=”%F %T “. This will list the history like

karthick@karthick:~$ history

1  2012-10-05 14:25:51 cat history

2  2012-10-05 14:29:10 mv .bash_history.bak .bash_history

3  2012-10-05 14:29:27 cat .bash_history

4  2012-10-05 14:29:32 ls

5  2012-10-05 14:29:57 env

6  2012-10-05 14:31:07 test

7  2012-10-05 14:31:18 setup

8  2012-10-05 14:32:14 cat .bashrc

9  2012-10-05 14:41:08 history


3. To increase the history  command length from default size 1000 to our requirement size

$export HISTSIZE=10000