Sunday, March 20, 2011

Public provident fund India


Public provident fund India-Know your Status
Public Provident fund or simply PPF is a scheme introduced by the Government of India in 1968 under which any citizen of India can make a contribution to the scheme by which he/she can claim a income tax rebate under appropriate Income tax laws.
Only Individuals are eligible to invest in the public provident fund. If the individual is a minor, an individual corresponding to the minor can make a contribution to the scheme.
The duration of the scheme is of 15 years but can be extended for 1 or more terms of 5 years. The PPF account can be terminated at any time but further contributions to the scheme later can only be made once 15 year term is over.
Investment amounts
A minimum amount of Rs.500 can be made per annum and any further amount can be made in multiples of Rs.5 subject to a maximum of Rs.70000 per annum.
Interest rate calculation
The interest rate for your PPF account is calculated on every 31st of March at 8%. This interest rate is calculated based on the minimum amount that exists in your account between 5th of March and 31st of March.
So one should not withdraw any part of the PPF amount between March 5th and 31st if the Interest rate is to be fully utilized.
Tax benefits
The Interest accrued from PPF is completely exempted from the Income Tax under section 88 of IT Act.
And any amount that is to be credited is also fully exempted from wealth tax.
Loan facility
Loans of up to 25% of the balance at the end of 1st financial year from 3rd to 6th year can be taken. Next loan can be taken once the first loan is completely paid off.
Withdrawal policy
Withdrawal of PPF amount is not possible for the first 5 years. From the 6th year you can withdraw amount from your account but that can be made only once in a financial year.
If the account is extended beyond 15 years, up to 60% of the balance at the start of the extended period can be withdrawn.
You can contact your bank or the Post office branch or anybody in which you opened the account at any time to know the status of your PPF account.
Likewise, if you want to see the status of your PPF account and have your account in SBI or its subsidiaries, contact your branch to add the PPF account to your existing Online banking account and also ask to give you the transacting rights so that you can view, check your account status and pay your PPF online.

Thursday, March 17, 2011

How to resume partially downloaded files in Linux with wget


Introduction

Resuming interrupted downloads is too important in some areas where the internet is not as stable as it could be in U.S. or Europe.
I find myself usually having interrupted downloads in the Hotels, usually wifi hot spots radios in hotels, are not well installed, I have found some of them with the radiation lobe parallel to the walls and not to the floor of the building, go figure!.
Well, so it is really frustrating to be 40% or 70% of a 300 MByte file downloaded, and that suddenly the Internet goes, even for 2 or 3 minutes, and then you have to restart the download of the file.
Well, no more, wget will help you on that.

Resume partial downloaded files with wget

First be sure to always use the -c option in wget, that way you will be accustomed to it, and will not erase your partially downloaded file with a new one.
As an example, let’s download Gentoo Linux
wget -c http://distfiles.gentoo.org/releases/x86/autobuilds/current-iso/install-...
Now, if we interrupt the download of the file, and run the command again.
wget -c http://distfiles.gentoo.org/releases/x86/autobuilds/current-iso/install-...
You will get something like this, where clearly you can se that the download is being resumed from the point it was interrupted.
bash-4.1$ wget -c http://distfiles.gentoo.org/releases/x86/autobuilds/current-iso/install-...
--2011-03-09 10:45:42--  http://distfiles.gentoo.org/releases/x86/autobuilds/current-iso/install-...
Resolving distfiles.gentoo.org (distfiles.gentoo.org)... 216.165.129.135, 64.50.236.52, 137.226.34.42, ...
Connecting to distfiles.gentoo.org (distfiles.gentoo.org)|216.165.129.135|:80... connected.
HTTP request sent, awaiting response... 206 Partial Content
Length: 121139200 (116M), 114139951 (109M) remaining [application/octet-stream]
Saving to: "install-x86-minimal-20110301.iso"

 7% [+++++==>                                                                                              ] 9,630,265   5.69K/s  eta 2h 51m  ^
The “+” signs shows the previously downloaded part, and the “=” signs shows the part being downloaded at this time.

Conclusion

There are other ways to do this, Firefox, Chrome let you pause and resume downloads, but those are not as good as wget at least not to me, as sometimes I’ve seen them fail, where wget later did not.

Monday, March 7, 2011

My top five ssh tips and tricks | small cheatsheet


Today I’ll give you five nice ssh tricks, well actually three ssh, and one scp tricks.
Let’s first define ssh and scp
  • ssh
Secure Shell or SSH is a network protocol that allows data to be exchanged using a secure channel between two networked devices. The two major versions of the protocol are referred to as SSH1 or SSH-1 and SSH2 or SSH-2. Used primarily on Linux and Unix based systems to access shell accounts, SSH was designed as a replacement for Telnet and other insecure remote shells, which send information, notably passwords, in plaintext, rendering them susceptible to packet analysis. The encryption used by SSH is intended to provide confidentiality and integrity of data over an unsecured network, such as the Internet.
  • scp
Secure Copy or SCP is a means of securely transferring computer files between a local and a remote host or between two remote hosts. It is based on the Secure Shell (SSH) protocol.
The term SCP can refer to one of two related things, the SCP protocol or the SCP program.
The SCP protocol is a network protocol that supports file transfers. The SCP protocol, which runs on port 22, is based on the BSD RCP protocol which is tunneled through the Secure Shell (SSH) protocol to provide encryption and authentication. SCP might not even be considered a protocol itself, but merely a combination of RCP and SSH
The SCP program is a software tool implementing the SCP protocol as a service daemon or client. It is a program to perform secure copying. The SCP server program is typically the same program as the SCP client.
Now, let’s see those small and useful tips.

Create a X session over a ssh tunnel

This is the most know ssh tip, these are the assumptions:
  • Server: Slackware / IP: 10.1.1.1
  • Client: Slackware / IP: 10.1.1.2
On the server side you need to do this:
xhost 10.1.1.2
Now as root, edit the /etc/ssh/sshd_config and be sure this line exists and that it is not commented.
X11Forwarding yes
This will reduce your server security, so only enable if you really need to, and you may disable when you are done.
Now also as root, restart your ssh server
/etc/rc.d/rc.sshd restart
If you are on Debian, Ubuntu or Fedora run:
/etc/init.d/sshd restart
On the client side
ssh -X user@10.1.1.1
And you are ready, now you can run for example
kate
And kate will run on the server, the you will see it on the client screen.
To remove permission to the client, on the server run:
xhost -10.1.1.2

Find files on a remote computer, get the results on local screen

This one is useful to find files on a remote server, and get the output on your screen, without the need to actually open a permanent remote ssh session screen, it will be open only temporally.
ssh user@10.1.1.1 "find /home/user/ -name '*.mp3'"
You may have an output like this:
/home/user/Dust In The Wind.mp3
/home/user/Life Is Too Short.mp3

Edit files on a remote computer using vim and scp

I like this one, specially when editing config files, like smb.conf, or cups.conf to be sure a new printer will work on the printer server.
vim scp://root@10.1.1.1//etc/samba/smb.conf
You can use it as a normal user, just be sure the user you are use has read and write permissions on the file you are trying to edit.
vim scp://user@10.1.1.1//tmp/some-file.txt

Play mp3 files over ssh connection

This might not be entirely useful, but I like to do it, I know there are better ways, sharing the mp3 files on the server over ssh, samba, NFS or other way is a better way to do this, but I like this way.
ssh user@10.1.1.1 "cat /home/user/music/artist/*.mp3" | mpg123 -
That will play all mp3 files in the folder /home/user/music/artist on the server, and the sound will be on the client’s speakers.
You can change the path, to match your music folder, and you can also specify just a single file.

Play a movie over a ssh tunnel

ssh user@10.1.1.1 “cat /home/user/movie.mp4” | vlc -
You may not see the password prompt, enter it anyway and hit enter, your movie should start playing in VLC, you can use VLC to play the mp3 files instead of mpg123 if you prefer. For some reason I had no luck with mplayer.

Streaming music with gnump3p and Linux - mp3, ogg, movies


If you have a big collection of music, you can’t have in all your computers, so you’d better have it only in one of them and share it with the others.
There are a lot of ways to do that, you can use Samba, NFS, or other means to share you drive with others, and thus your music collection, but a better way IMHO, is to share it using a streaming server.
Streaming media
According to Wikipedia:
Streaming media is multimedia that is constantly received by and presented to an end-user while being delivered by a streaming provider. The name refers to the delivery method of the medium rather than to the medium itself. The distinction is usually applied to media that are distributed over telecommunications networks, as most other delivery systems are either inherently streaming (e.g., radio, television) or inherently non-streaming (e.g., books, video cassettes, audio CDs). The verb ‘to stream’ is also derived from this term, meaning to deliver media in this manner. Internet television is a commonly streamed medium.
Live streaming, more specifically, means taking the media and broadcasting it live over the Internet. The process involves a camera for the media, an encoder to digitize the content, a media publisher where the streams are made available to potential end-users and a content delivery network to distribute and deliver the content. The media can then be viewed by end-users live.
In our case, this basically means, that the files does not need to be downloaded in order to play them, and they will flow over the network connection from the server to the computer with the mp3 player software. This “flow” will occur while the music is playing on the other side of the server.
The software we will use to stream the music is gnump3d
From its homepage
GNUMP3d is a streaming server for MP3s, OGG vorbis files, movies and other media formats.
And they also assure the server is highly secure, with these three aspects in mind:
  • Nobody should be able to browse your filesystem, except that specific part which you make your server root
  • Nobody should be able to crash the server, so that you can’t use it. (A denial of service attack).
  • Nobody should be able to trick the server into running code of their choosing
This being said, let’s go directly to the installation and configuration of gnump3d

Streaming music with gnump3d

Installation
Arch Linux
pacman -Sy gnump3d
Slackware
Install if from slackbuilds
I’ve not tested in other distributions but chances are that your package tool, can install if for you, if not you can download the last version from here, and install it like its homepage recommends.

PREREQUISITES
GNUMP3d has only one requirement - a working Perl installation with the fork() function implemented.
In practice this means some for of Unix system, or a Microsoft Windows system with a very recent version of ActiveState’s Perl port.
INSTALLATION
GNUMP3d installation should require no more than the following:-
make install
This will install the software in /usr/bin, with the configuration files in /etc/gnump3d/

Configuration
The configuration is /etc/gnump3d/gnump3d.conf and it is the only file you need to edit, the simpliest one could be:
port = 80
#Default: port =  8888
root = /home/user/mp3collection
#Defaul: root = /home/mp3
#
logfile = /var/log/gnump3d/access.log
#
log_format = $connected_address - $user [$date] "GET $REQUEST" $HTTP_CODE $SERVED_SIZE "-" "$USER_AGENT"
#
errorlog = /var/log/gnump3d/error.log
#
user = nobody
#
allowed_clients = 10.1.1.0/24
# Default: allowed_clients = all
#
always_stream = 1
#
advanced_playlists = 1
#
theme = Tabular
##
theme_directory = /usr/share/gnump3d/
##
#
directory_format =  $DIR_NAME $NEW$SONG_COUNT$DIR_COUNT[$RECURSE]
##
new_format = New
##
new_days   = 7
#
#Default: file_format =  $SONG_FORMAT[Info] [Download]
#
#As I do not want to offer the option do download the song, but only to hear it, I modify the above line, and take the Download link out. I understand that this is not really secure, but for the standard user it will work.
#
file_format =  $SONG_FORMAT[Info]
#
song_format = $TRACK - $ARTIST - $ALBUM - $SONGNAME [ $GENRE - $LENGTH / $SIZE ] $NEW
# Default to sorting by the track number, due to popular.
sort_order = $TRACK
#
plugin_directory = /usr/lib/perl5/5.10.1/gnump3d/plugins
#
mime_file = /etc/gnump3d/mime.types
#
file_types = /etc/gnump3d/file.types
#
now_playing_path = /var/cache/gnump3d/serving
#
tag_cache = /var/cache/gnump3d/song.tags
#
shoutcast_streaming = 1
#
use_client_host = 1
##
#  End of gnump3d.conf
####
Few more tweaks
If you want to tweak it a little bit more, you can implement the downsampling, this is useful if you plan to stream over the internet, because if have your music from iTunes like me, you have notices that the files are really big at 256 Kbps, and that may not work very well over the Internet, but it is great for the Local Network.
First install a software capable to down sample the files, such as lame.
Arch Linux
pacman -Sy lame
Debian
apt-get install lame
Note: You need multimedia repository, enabled in you /etc/apt/sources.list file.
Slackware
Use slackbuilds once again, here is the link
OK, now that lame is installed, you need to enable the feature in the server.
downsample_enabled = 1
Add that line to the /etc/gnump3d/gnump3d.conf file.
Then, add these lines, to decide which clients will have its songs downsampled
downsample_clients = ALL
no_downsample_clients = 10.1.1.0/24
That will downsample for all expect the local network users.
You can also downsample to all users
downsample_clients = ALL
no_downsample_clients = NONE
Finally, add these other lines to define the lever of downsampling
downsample_high_mp3   = /usr/bin/lame  --mp3input -b 56 $FILENAME -
downsample_medium_mp3 = /usr/bin/lame  --mp3input -b 32 $FILENAME -
downsample_low_mp3    = /usr/bin/lame  --mp3input -b 16 $FILENAME -
And the default quality:
default_quality       = medium
When the clients access the server using their browser, 

Sunday, March 6, 2011

Benefits and Advantages of Linux over Windows


Linux has been on the OS scene for a very long time now. Even then it does not enjoy the same amount of popularity with users as Windows or Mac OS X . The greatest difficulty it faces is its image as an operating system for geeks.
What the common user does not understand, is that Linux has come a very long way from those days in which it was completely reliant on the dreaded command prompt. These days some distros of Linux exist, which are simpler than Windows.
We have actually compiled a list why you should try out linux.
  • It is absolutely free : The greatest advantage is that its free. Linux is open source i.e. it is developed, maintained and upgraded by the community. Compare it with the price of Windows 7 Ultimate ($320) and Mac OS X Snow Leopard ($29).
  • Software is also free (most of them) : What would the most commonly used software on a computer be? An office application (Microsoft Office Professional $500), photo editing (Adobe Photoshop CS5 690$) and so on and so forth. So, basically you get the idea. Linux has free and highly capable alternatives for each of them – Open Office and Gimp are nearly as good as their paid counterparts any day.
  • Linux rarely (if ever) crashes : If you have been using Windows all these years, then you will be very familiar with the BSOD (Blue Screen of Death) and hanging. Earlier Windows versions 98 upto XP had the unfortunate problem of crashing when least expected, thereby leading to loss of data. This problem has been minimized in Windows 7 but it still does crash sometimes. Linux on the other hand, if you have not been tampering with the core kernel files will not crash period.
  • Anti virus software not necessary : Linux viruses are extremely rare and an anti virus can be done away with, while a Windows system connected to the internet without an antivirus gets infected within half an hour.
  • Varieties to choose from : Linux comes in various flavours or distributions (distros in short), each appealing to a different user group. Windows also has various flavours – home, professional, ultimate etc. but these are the same with each being a subset of another in terms of features included. Linux distros on the other hand are completely different from one another.
  • Open source customization : Linux is open source i.e. its code is freely available. Thus, if you know some coding, you can modify the operating system to your exact requirements. You can even build and distribute your own Linux distro. Take that Windows ! Check out Linux Wallpaper Mega Pack.
Truthfully, this list is endless. I cannot even begin to enumerate all the reasons why you should give linux a try. Though I hope I have been successful in convincing some of you.