Thursday, April 11, 2013

youtube-dl :- A audio/video download tool

youtube-dl seems to be a versatile tool. It can download from

CollegeHumor, Comedy Central,  Dailymotion, Facebook, Metacafe, MyVideo, Photobucket, The Escapist, Vimeo, Yahoo!, YouTube, blip.tv, depositfiles.com, video.google.com,  xvideos, Soundcloud, InfoQ, Mixcloud, OpenClassRoom.

Since it supports soundcloud downloads. You can get mp3 files.

Wednesday, April 10, 2013

Areas of innovation

I feel the following areas has tremendous scope of improving and we can expect break through innovation. Atleast I am really interested :

  • Battery Technology . Esp., for smartphone. Smartphone batteries don't last long. Current technology is insufficient to provide long term battery. We need ways to pack more electric power per unit of space and also less current input to output loss. Hence saving us the time battery takes to charge. 
  • Data Communication networks :  From my experience as sys admin. I strongly believe that network can go miles of improvements. multipath tcp is step in that direction. SDN (Software defined networking) is also being developed. In this age of Cloud services, networking performance becomes very important. Current technology is based on assumption that servers are fixed inside cages of data centre. But virtualisation enables to make and destroy servers at will or need. Also we move servers from one physical server  to another physical server live. And then there is also wireless networks.

run scp in background without using nohup in linux


You can multiple scp in background , running them parallel in background. I assume you are intenting to scp multiple large files . I am going to show how using job control feature of bash. When I initially googled , suggestion where to use screen (terminal multiplexers) but I think bash job control method is better, b'cos it less resource hungry. 

The basic concept is as below, i improved upon it with a simple bash for loop.

scp user@host:/file1 .
ctrl-zscp user@host:/file2 .
ctrl-zscp user@host:/file3 .

ctrl-z
bg 1
bg 2
bg 3
jobs
du -h file1 file2 file3

I will explain what is happening in bit. But first i will show the above process in a bash script.

for i in file1 file2 file3
do
scp user@host:/$i .
done

Basically what is happening is ctrl-z key combination suspends the process and after that bg job-id resumes the process in background. jobs command lists the status of jobs like if they are running or not. Since you are running the scp in background we dont get to see the progress bar but thats not a issue since the du -h command will give that status information. It will say how much of the each of files is downloaded.

Now for the script part. After each scp you have to manually press ctrl-z , bg , jobs and du commands as necessary.

Note that there is a dot at the end of every scp command. As you might be aware i am trying to download to the dir where i am executing it.

One thing i noticed is that job control is pty specific. So if you open a another terminal and type part of it here and part there, it wont work.

Saturday, March 23, 2013

centos frehclam log file error

I was repeated receiving email about logging failed in freshclam. The exact error message in email was:

/etc/cron.daily/freshclam:

ERROR: Problem with internal logger (UpdateLogFile = /var/log/clamav/freshclam.log)ERROR: Can't open /var/log/clamav/freshclam.log in append mode (check permissions!).



The solution to this problem is to edit the /etc/freshclam.conf and fix the user thing. The text you have to edit is:

DatabaseOwner someowner

Search for the above and replace someowner with the owner of the file  /var/log/clamav/freshclam.log . Then run freshclam and it wont throw the error and also run yum update because it showed me that my version of clamav is being phased and out and a newer version is available in repos. After the update everything is smooth and perfect as before.

The way to make sure everything is fine is by running the freshclam yourself and looking if it runs fine.

Wednesday, February 20, 2013

run mplayer in background from command line

Tested and proven way to make mplayer work in background when invoked from command line in Linux.


mplayer filename.ogg < /dev/null > /dev/null 2>&1 &;

When i searched on internet . I saw the following two options.


  1. mplayer file.ogg < /dev/null &;
  2. mplayer -noconsolecontrols file.ogg &;
Both of them fails for me. To my surprise first method is from mplayer official website faq.
The second method is from stackexchange. Though it doesnt work for me, it has comments on the site saying it work for him.

Finally got the above  comment to make it work from linuxquestions.org As stated in the post. mplayer reads from stdin and writes to stdout and stderr. 

Sunday, February 17, 2013

new blog site

Dissatisfied with the blogspot , i started another blog with the url annanstylepandi.wordpress.com . I wanted to make a blog private. As a journal entry only for my reference and not be available to world. Blogspot says it wont support and instead asked me to start another blog to do that, in which i shall post all private entries. That sounds stupid to me. I researched on popular blog sites and feature list. I found that wordpress is quite popular and also has the feature i was looking for. So i will post in both the places for some time, after which based on my experiences i will choose to close this or that.  

Wednesday, January 30, 2013

How to activate BSNL Mobile missed call alert free service in android gingerbread

BSNL provides free missed call alerting service. I just now configured and tested this service in my mobile. My mobile is dell xcd35. I am sure it is the same or similar procedure in other mobile phones also. Very similar if it is android gingerbread phone. In the mobile goto
 
         Settings -> call settings -> GSM/WCDMA call settings -> Call forwarding -> forward when unreachable and enter the number 17010 and click enable.

Call forwarding is also called call diverting in other terminology.

I tested it by switching off the mobile and calling it. When i turned it on back, i got a sms saying there is call from number at time. Good to see that bsnl is providing such valuable service at free of cost, while other service provider charge it. I have seen a similar service (though not same) from tata docomo charges 15 Rs per month for missed call alerting service. Hail BSNL mobile.

Tuesday, January 29, 2013

Change windows 7 user account password from linux

The below post describes the method i used to change the windows 7 administrative account password for the username ashwin.

First i tried to view the password , so that i dont have to change the password. So i downloaded the ophcrack and burned it into disk. Then upon booting from disk i found that it was smart to show the user account that exists and it correctly shows the accounts with blank password. But it failed to show the password for ashwin account. This happened even after loading of all tables and it took 10 mins to load the tables. So ophcrack failed for me.

The next step i tried was to nuke the password. For which my linux partition helped me. I had the laptop dual boot with linux. I booted into the linux partition and mounted the windows c drive. I used the package management software ( pacman in my case ,  other popular package management tools commonly found are yum and apt-get) to install chntpw. Then i did the below:


             #mount -t ntfs /dev/sda2 /windows/c/
             #cd /windows/c/Windows/System32/config/
             #chntpw -u ashwin SAM
             i choose 1 and then write to sam and then reboot into windows.

Now i am able to login to windows ashwin account and change the password as desired. 

Make sure you use the right device number in the above mount command. Mine was /dev/sda2 , yours could be different (most likely it will be different).

Saturday, January 12, 2013

cli ways to prevent certain package upgrade and get repository package version



i stumbled upon 2 things which i am going to share with you. These i got from google search.

1st) I was looking for ways to make the ubuntu not to upgrade the thunderbird package. In previous post we saw how to achive this in GUI mode. The problem with GUI mode is that it works only in GUI , if you use command line tools then GUI rules wont apply. So i tried

# apt-get upgrade

and it lists thunderbird in it and i looked for option to disable thunderbird even through cli tools. So below describes that procedure.

# echo hold | sudo dpkg --set-selections

The above line does the job. So i did my thunderbird stop upgrade as follows:

#dpkg-query -W \*thunderbird\* | cut -f1 > 1.lst
# for i in $(cat 1.lst)
do
echo $i hold | dpkg --set-selections
done

#apt-get update

Now thunderbird package does not appear even in cli (apt-get) upgrade list.


2nd) The other thing i wanted to see was a way to get the package version in

apt-get upgrade

When you issue the above command then it only list the packages that are going to be upgraded and not the version number it is upgrading to, that way yum does the job. But there is a way to see the package version in repos and package version currently. The good part is that it need not be a package in upgrade list . It can used to compare the latest version in each branch in repository and your PC.

To see package version in your PC:

dpkg-query -W package

To see package version in the repository:

apt-cache madison package

This madison option is awesome.



Thursday, January 10, 2013

How to make ubuntu ignore updates for certain packages

If you want , you can ask ubuntu not to keep bugging you for updates to certain packages. For example I dont want ubuntu to keep prompting me for updates to thunderbird, since i dont use thunderbird. So here is how i achieve that:
Goto the ubuntu dash home and goto synaptic package manager and in the search bar in synaptic type your package name (thunderbird here) and select the package and click Package (from the menu bar) and click lock version. Repeat the same for every package you dont want ubuntu to prompt.

If you want ubuntu to never check for updates:

ubuntu dash home -> update manager -> settings (lower left corner) and enter password -> Updates -> in the section Automatically check for updates select never.

This is for ubuntu 12.04 LTS.

But i certainly warn you that swtiching off updates is not a good idea. If possible you should keep atleast security updates.