Wednesday, July 21, 2010

Identify a set of unresponsive servers!!

Crisis! Outage!! My online server repository is also down. Need to figure out quickly which and all server is Alive. Luckily I have a list of servers, and I know the subnet of quite a few of them. This is how would I go about -

for i in `cat wslist.txt`; do nc -v -w 1 -z $i 22 ; done
for i in `cat wslist.txt`; do nmap -sP -n $i ; done | grep down

With the help of Broadcast address,
# ifconfig | grep Bcast
inet addr: Bcast: Mask:
and then,
# ping -b

Note: Please remember, some/most of the routers are configured to filter broadcast and multicast packets to prevent broadcast storm, if so, broadcast is useless.

for ((i=1;i<255;i++)); href="">fping and netdiscover is also used by some gurus.
Do share, your way of quickest discovery of unresponsive hosts.


Saturday, July 17, 2010

Cronjob On System Reboot!!

I know there are definitely some other reliable way that Linux Guru's use to bring services back online, once the server reboots. Most people also use rc.local a great way. One of them can be adding these to your init scripts, but to write to /etc/init.d you do need to be root.

There is this cool facility of crontab which even normal users can use. It was a news for me too sometime back that there is this alternative way of adding entries to your crontab file, using shortcuts. These shortcuts allow you to make entries that will match at particular times.

Out of those available - most popular is @reboot.

You can edit your crontab entry -

#Crontab -e

@reboot 'some-command'

I am not sure how many of your were 'wowed' with this feature of crontab, but today I am here to caution you of a couple of caveats here..

  1. First of all, it is NOT going to work when you have a system back online after crash or shutdown.
  2. secondly - If you are planning to run something basing apache with some script once your system reboots, probably something like - wget -O - http://localhost/notify.php it is not going to be a success. But yeah! if you want to send a notify email with some shell script basing sendmail server it will get through. Thats beacuse - in /etc/init.d/rc3.S "cron " is executed with priority 85, and Apache with priority 90.
So check the dependencies carefully, before you use @reboot.

But the unique qaulity of @reboot is that - while each of the other shortcuts, like (@yearly, @annually, @monthly, @weekly, @daily, @midnight, @hourly) has an equivalent mapping to the "normal" crontab format. (e.g. @daily is identical to (0 0 * * *"), @reboot is an exception and definitely helpful some time when you have a scheduled reboot of the server.

Now to skipfast or adopt, this has to be decided by our creative minds - and nothing there, that I can enforce ;-)


Wednesday, July 7, 2010

RHEL 6 all set to bid bub-Bye To XEN and eye-TAY-nee-əm!!

This April we saw one more (.dot)5 release on RHEL5. Post which CentOS 5.5 also got release which I could download and install. With the recent Beta2 release from RedHat probably by end of this year, RHEL 6 should be able to hit the market. But with release notes from both this Beta - it does not seem like, we should expect any killer new feature or application.

RHEL 6 includes the ext4 file system as its default - where along with bigger file-system capability, ext4's multiblock allocation, and faster fsck/defragmentation would be something really worthy to experience and I too personally is very much excited. Red Hat is also making the XFS file system part of the RHEL 6 for the sake of customers who need to support very large files and directory sizes.

Not only this, this time there is also a considerable improvement on Windows management tools and a new graphical user interface for joining Windows Domains though.

Also, RHEL 6 is much talked about on it's scalability front, theoretically up to 64,000 cores and 256TB of main memory, 128TB for the kernel and 128TB for the user-space for physical memory addressing. I am not sure, if someone would be really able to test this up - and that's why probably I said 'Theoretically" :-)

Anyway coming back to the subject line - this giant who is also a major contributor of enterprise Linux has actually dropped two overload with this release -

First of all , as expected XEN will NOT be shipped any more with RHEL starting with 6, which was almost known to everyone after Citrix Systems acquired XenSource, Inc in October 2007. Dropping Xen will free Red Hat from the substantial work involved in maintaining two hypervisor code bases . But how much pain will it incur to upgrade /adopt KVM is still too early to speculate.

Secondly, there will be no more support for Itanium-based servers(Itanium's biggest cheerleader being Hewlett-Packard!!), much the same way as Window's had planned with it 's new upcoming public releases on server side. This is something to be worry about if you have quite good amount of servers in your DataCenter. But NOT really if your are satisfied with current RHEL5 which is a perfectly fine operating system.

So lets stay tuned !! - May be it is coming with some real good surprise which we don't know yet :-)


Sunday, July 4, 2010

Let's Test the Tester!!

We all like owning a dog(watchdog) at our house. We enjoy it more when he sits/jumps on our command. Sometimes he becomes a bad boy when poops on the floor, destroys your yard, chewing your new shoes. It is so embarrassing, when you call your colleagues for dinner and the dog runs off with the roast -is not it? Dogs need training, and the very basic thing to remember while training a dog is that - we must praise and have small treats to reward him on a regular basis. Also while training, the feedback should be instantaneous. That's how it anticipates things with proper signal, right on the spot. There might be superior brain breed, but in general they have less brain than us and they are beast! Never expect a dog to learn "NOT To DO" stuff after quite ample amount of time gap, after committing a mistake. You might see your kitchen tans , cupboard being open - returning home after a very tiring day - as if the house was haunted by some crazy benevolent spirits , but no, you are wrong! it was your favorite dog who just got real! Dogs are good at Counter Surfing in absence of his Boss! Now after 5-6 hrs, if you try to yell at him, its actually of no use. Probably he might already have performed some other stupid(for us!) adventures.(his kinda!) , which you have yet to discover. Hence he doesn't know for which crime his boss is shouting at him. Anticipating right signal is so important!

Software testing is an integral part of a software environment. Software testing contributes to improving the quality of the product. Testing verifies that the system meets the different requirements including, functional, performance, reliability, security, usability and so on. The developer can himself do the testing, but you know what - he will never find a bug, because he will carry the same mindset to do the testing , which he had, while developing. I like keyboard shortcuts and 'Peter' always does it with the mouse. And its me who found how things hanged while hitting multiple 'tab' keys on his newly designed software. Its a different story, when 'Perter' says - close all the windows and restart it, it will all over work. I know he is a windows(Microsoft) guy. But I know I just saw a bug.

Very less as a professional but quite a few while as a student, I too wrote some code. Later I realized that - getting better at what you do requires quick feedback, whether it is positive or negative. The faster you get the feedback, the faster you learn. Same thing applies in case of a programmer. QA person or a Tester also should be fast enough to provide feedback on what crap he found on the code. It actually helps the programmer, else later bad habit gets permanent on his skills.

Have you ever seen, programmers launching a fight with QA team? I know it's sad. I also know that its for no personal grudge, as I see them sipping coffee together just the very next day. Had those visual not come forth, I would have definitely thought, we never need a QA team. As I am a peace loving person. In that case, the GoLive! plan would have been "launch it live without being QA'ed and get those bugs get caught Live! :-) ". I actually suggested this to one of my QA friend and saw him laughing his heart out. There is no better way to improve a programmer’s morale or his happiness. No QA is paid to do so in the workplace. I myself don't like - when people says - "Dude! Your blog has no unique write up's for a quite long time. You should also try to write on this X Y Z etc. etc. crap". But yeah I have to maintain my cool for that minute or so. I know how difficult it is to hear those sentences. I guess, this pain is more for programmers. They do coding day and night, gathering all their creative juices - typing away, writing all this awesome code, and nobody cares.

We definitely need a tester. They do such a superb job by contributing to improving the quality of the product and help maintaining the well-earned reputation of the organization by making it bug free with their valued quality testing. But my strong feeling is that - if the Tester emphasis more on (only)what he needs to test, he might have a peaceful life; might he even miss the misaligned text, hostile user interface, bad color choices etc. etc. It's really not something he was told to test. Programmer's also will probably like that - but what he missed here is a general intelligence which can't be taught. I have seen some good testers in my career; some of them even did not know how he became such a good tester. Probably, in the start of their career, they never tested software's (only)on the stated requirements, and rather might had just tried their hands on certain other bugs(feature) out of just mere curiosity, and was always constructive and positive on what he/she conveyed back to the developer. Developers later started to come to 'him and only him' after any new feature he developed. Saying so what I mean here is that- Tester must have love and curiosity on the products in and around the house. Should be methodical and must know how things should be communicated back whether it is a positive feedback or negative. As said earlier, being quick is such essential, as otherwise by the time you take your own sweet time to report back, some other real feature might have already being worked on those buggy foundation and later it is so difficult and annoying to trace down. Also, I have not seen much of the QA team people often appreciating or discussing on good feature that he liked on the product while testing. It can be very instrumental sometimes. I guess no company sets this eligibility point of "being pessimist" as one of the criteria while looking for candidate in this field.

I felt if QA team is humble and genuine when dealing with developers regarding defects.,the environment gets a friendly one, and this kind of collaborative effort really rocks! . Also, being a good listener is the key here. We often have this habit of trying to get rid of the person in front of us - when we think we have just heard all the information I needed from him. I know its very difficult to be a good listener sometimes! But it is really essential , as developers like to brief on features(no idea if it is excitement fever OR publicity stunt!! ) that's coming up with this release - and it is so helpful from the point of view of a QA, to get a casual brief on the new feature list on the cards which makes you feel already actively engaged with the project. They must also know what is the importance of what is now being all set to pass from their desk's which is going to hit the market and will soon face the hands of zero tolerance 'n' timeless user.

Its not always broad knowledge of testing methodologies- that helps to be a great tester I would say, but I think there are surely some such unique qualities which can help him make his engagement really beautiful & meaningful, on being such a crucial and important role with us.


Friday, July 2, 2010

Transferring PuTTY settings

On my last post you might have come to know that almost after quite a long time I have upgraded my desktop to a Windows 7, and since most of the time I work with UNIX/LINUX/Solaris boxes, a huge list of server's had actually piled up in my PuTTy. So eventually I had to figure out a way to export this list to the new windows environment. I was able to do it without much hassle and here is how I exported my saved sessions.

Run -> Regedit -> HKEY_CURRENT_USER -> Software -> SimonTatham

BTW, what is this Simon Tatham :-)


Click File->Export. Give your file an appropriate name like, "putty.reg" and click "Save". Save the putty.reg file somewhere safe. The file doesn't contain any passwords or actual SSH key values, hence it is relatively safe from prying eyes. But, still, it contains your configuration and could be a good idea to be a bit cautious.

Importing Your PuTTy Configuration:

To import your saved PuTTy configuration on any other Windows computer, like what I had to do for my said XP to Windows 7 upgrade activity; simply copy your exported registry key, right click on the file and click "Merge". Windows will ask you for confirmation that you want to import this set of registry values. We know this file is safe, because we created it but, you should never import registry information from an unknown source.


Why Database CI/CD?

Making the Database Part of Your Continuous Delivery Pipeline The database, unlike other software components and code or compiled co...