Shuva's blog
Bash Arithmetic : Leading 0 (zero) errors : value too great for base 
Sunday, March 22, 2009, 02:35 PM - Tips and Tricks
It can be quite frustrating at time when you cannot get a simple thing as doing a arithmetic expression where the number has a leading zero. I am talking of Bash arithmetic.

Example:
let x=7*5 is OK.


let x=07*5 is also OK

But
let x=08*5 gives the following error:
bash: let: x=081: value too great for base (error token is "081")

The reason is that numbers with leading 0 is treated as octal in Bash. So 01, 02, 03 ...07 would not have any problem. 08, 09 are not valid octal numbers and hence treated so.

OK, OK. How to get rid of a leading zero. Unfortunately in Bash its not so straight forward. Here are some useful hints:

1. Use a loop like this to get rid of leading zeros from the variable x
while [[ $a = 0* ]]
do
a=${a#0}
done


2. The second solution is to explicity mention that it is a base 10 number, which can be quite cumbersome.

y=081
let x=10#$y*7; #Treat 08 as a base 10 digit.



Happy Bashing.//

add comment ( 424 views )   |  0 trackbacks   |  permalink   |   ( 2.9 / 31 )
Online Grevience forum in India. 
Wednesday, February 11, 2009, 04:49 AM - General
India as a country does not stand very well in the list of corrupt countries in the world. One of the most important things that happened in the last few years is the Right to Information Act.

I received this email from my colleague this morning and its one of the few emails that is actually worth forwarding and spreading the word. So here it is:


Hi all

for your information

Government of India has an on-line Grievance forum at http://pgportal.gov.in/ Can you imagine this is happening in INDIA?

The govt. wants people to use this tool to highlight the problems they faced while dealing with Government officials or departments like Passport Office, Electricity board, BSNL/MTNL, Railways etc.
So use this grievance forum and educate others who don't know about this facility. This way we can at least raise our concerns instead of just talking about the ' System ' in India.

Invite your friends to contribute for many such happenings.

PLEASE SPREAD THIS MESSAGE IF U WANTS OUR INDIA TO HAVE A BETTER TOMORROW & FORWARD THIS MAIL TO AS MANY AS POSSIBLE.

Thanks

Taheer Mohd


Happy Grievancing.//
add comment ( 486 views )   |  0 trackbacks   |  permalink   |   ( 2.7 / 35 )
Free email server setup for your domain or small business through Google Apps 
Tuesday, January 20, 2009, 12:08 PM - Analysis and Reviews
If you have a small business, running a non-profit org, or a school, you probably have a website with your own registered domain name. You might also have the requirement of setting up email accounts for your domain, like owner@your-domain.com, etc. Normally, you would be looking for a service provider which supports email along with hosting your site. I would strongly recommend that you switch over to Google Apps to support your Email requirements. All you need is ability to update DNS settings for your domain which your service provider generally provides. Your existing website and other stuff just remains the way it is.

Last week, I switched over the Email system of a website to Google Apps and it took just 20 minutes to do everything. The migration was a cake-walk. Once you register your domain with Google Apps, you would get detail instructions on how to do that, but in a nut shell, you just have to update your domains DNS settings. Technically you would be updating your DNS's CNAME and MX records. Click here to know more about configuring MX records.

The main reasons why we switched over were:
1. Our main server was handling around 1000 emails per day and the usage was continuously growing. Moving to Google Apps meant less usage of resources on the server.

2. Google was much better in handling spam than we could do with open-source anti spam engines. Anti-spam engines take a lot of server resources too.

3. You could login into either http://mail.mydomain.com to check emails or even pull it into your personal gmail address through POP access.

4. You can create groups and specially a catchall@mydomain.com email address that will catch emails addressed to users that you havent created manually.

5. Sites like hotmail uses SPF technology and tend to flag emails coming from several servers as either SPAM or they just reject it. With Google Apps, you have a better chance that they will reach hotmail users. It can be quite embrassing for your business to send an email to a hotmail user which never reaches them or lands in their SPAM folder. You can read more about Hotmail and SPF nightmare here.

There are basically two packages in Google Apps. A free Standard package which gives you only 7GB storage space and a $50/user Premium package.

Check them out at Google Apps comparison page.

The best thing about Google Apps email is the hassle free migration process and their system simply works. Their self-help documentation is also properly laid out to answer all your questions.

Google Apps is not just about Email, but a complete solution for small office setup. I am writing about Email only because I am a very satisfied user of the email system.

Helpful links:
Google Apps getting started guide.
Google Apps Email FAQ page

Happy Google Appsing.//
add comment ( 91 views )   |  0 trackbacks   |  permalink   |   ( 3 / 50 )
New Book release : CISSP in 21 days 
Monday, January 19, 2009, 09:59 AM - Analysis and Reviews
CISSP in 21 Days by M. L. Srinivasan. Yes, thats the name of the new book recently launched. It is a concise revision guide that is supposed to be read just 1 month before the exam to brush up.

Why am I reading this book? First, I have been thinking of taking the exam, but things got delayed not due to project work and lack of time, but due to my own procrastination. But I am now becoming a bit more serious about this CISSP. When I downloaded the official Guide to CISSP, it was around 1000 pages and I never made it. Secondly, I did not have a full picture of the scope of knowledge or study that might be required to be ready for this exam.

This was until, I was offered to go over this newly launched book and give some feedback. This book is just 300 pages and I think I will read this over this month. I just read through Chapter 15 Telecommunications And Network Security in a couple of hours and it was kind of a concise revision of things I have learned at work over the last few years. I think I am going to read this entire book and get some honest feedback to the publishing house, who have been kind to offer me the e-book and also gave me permission to host Chapter 15 in this blog for my readers.

You can read Chapter 15 by downloading it from here and you can get more details about the book and purchase it from packtpub.

Happy Reading.//
2 comments ( 269 views )   |  0 trackbacks   |  permalink   |   ( 2.9 / 47 )
General diffeence between NAS and SAN 
Sunday, January 18, 2009, 05:28 AM - Technology
We have often heard of people using the words SAN and NAS to indicate a very high storage area in the lab. I have often use these two words too casually without understanding the difference. Thinking about it I got confused and wanted to know the general difference between the two and here are some important points I found.

SAN = Storage Area Network
NAS = Network Address Storage.


(One reason for confusion is that one abbreviated form is reverse of the other). Anyways here are some important points:

1. NAS is a storage-solution where huge RAID disks exists and the data is exposed to the world over NFS or CIFS protocol. It means that you can connect a normal laptop or desktop to a NAS share just like you connect to any of your colleague's shared drive. All you need is a path in UNC format Exmaple: \\nasserver1\fsSongs\ in your Windows explorer. In Unix, you would add another NFS mount point.

SAN on the other hand cannot be accessed by normal desktop or servers. It requires servers with SCSI fiber channel. It means that SAN is only for server class machines.

2. Another notable difference that you might hear from very technical people is: NAS uses file level access and SAN uses block level access. What does this mean? For one, this is the reason why NAS(file level access) can be accessed via normal desktops and SAN only via server class machines. It also means that file management in NAS is handled by itself (actually a component called NAS-head in the NAS hardware itself), and for SAN(block level access) file management must be done by the client (the server which is connected to SAN via fiber).

Happying storaging.//
add comment ( 40 views )   |  0 trackbacks   |  permalink   |   ( 3.2 / 24 )

<<First <Back | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | Next> Last>>