Thursday, 29 July 2010

Java plugin for Firefox

Instructions to install java plugin in linux at location: http://www.java.com/en/download/help/linux_install.xml#rpm
Its easy to get this link from internet, but, I want to put it here so that I can quickly get this whenever I need it.

Thursday, 24 June 2010

GCC

"/usr/lib/gcc/i586-suse-linux/4.3/collect2 --verbose" gives us good data while using gcc for compilation. gcc tries to find lib*.so but not lib*.so.* during linking. This is same as /usr/bin/ld.

Wednesday, 28 April 2010

editcap

vim, less and any other file manipulation commands take lot of time to load or search in very big files and so we use split such big files into small to analyze them.
Similarly, we used to face problems in analyzing network packets captured files. To cut the files or to filter some packets from the network traces captured files, you can use editcap. Its command line oriented provided along with ethereal/wireshark.
Also, there are few perl scripts available in Internet which are based on libpcap. I yet to install and try that. Looks like that give us more control in filtering the packets.
If some one know or have idea about using libpcap, share it with us.

IndianRail - Frustration

I booked a tatkal rail ticket from the counter thinking that
- there will be more quota at the counter
- if the ticket is in waiting list, this ticket will be given preference compared to eticket.
I'm sure about second point, but not sure about first point.
But, now, I lost the ticket. I have the PNR number, Xerox copy, photo ID card and so approached counter to take the duplicate ticket.
Here, to provide a duplicate ticket, they are charging half the ticket fare. Its too huge penalty just to print a ticket. They are sucking the blood.
This was for my wife - so I just paid the money and took the ticket in order not for any problem for her during travel. If it was for my travel, I should have just took the xerox copy and the photo ID card.
So, if any one face this problem and ready to fight with TC, take these and say you lost the ticket while climbing the train.
Can any one help me in complaining about the huge penalty for duplicate ticket?

Tuesday, 27 April 2010

Issue with union

Recently, found the union in the 'C' code with 33 bits as a structure and an unsigned long as members.
There will be no problem in the memory allocation. But, what might be the problem with this type of data structure?
Issue we had was the union variable initialization. Usually, the unsigned long variable in union will be initialized to intialize the bits in structure. But, being 33 bits, one bit won't be initialized. A learning we had!!

Monday, 26 April 2010

Couple of Blogspot features

- Came across this "Follow" feature combining Google Reader and Blogger. Previously, I used to subscribe to blogs using feeds in Google Reader. Now, this helps better. Also, it helps you to find out who are following you.
- Integration with openId. Blogger provides you an openId url which can be used for authentication against any openId enabled web sites.
Aren't they cool?

RaahuKaalam calculation

Recently found an interesting article how to calculate Raahukaalam. It depends on the Sunrise and sunset in that area on that day. (Sunset-sunrise) is the day and it is divided into 8 parts. Each part is called period and Raahukaalam comes in one of the periods in a day. There is no Rahu Kalam during the first period of any weekday. On Monday it falls on the 2nd period, Saturday 3rd period, Friday 4th period, Wednesday 5th period, Thursday 6th period, Tuesday 7th period & Sunday 8th period.
Courtesy: http://www.astrojyoti.com/rahukalam.htm
But, I don't have idea why they say so.

Scheduling work in multithreaded environment

Its always better to schedule any work at the end of the thread execution as the scheduled work can delete the object all together.
Consider a scenario like
fn Query::readData()
{
getData();
if(m_readDataSize > 0)
...
}
Query object needs some data to evaluate and thus called getData(). But, this getData() can do scheduling to read more data or may place the already read data size in m_readDataSize or it can schedule work to delete the object because of any error case like improper query.
And, if so, there is chance of code getting crashed while accessing m_readDataSize as object might got deleted if the work got scheduled and executed before returning from this function call. So, better is to mark the work to be scheduled and schedule it at the end of the thread execution, say, something like thread->postWork().
With this in view, I always like the OSs which are single threaded like Netware. It gives the better performance, flexibility in using CPU, ease in programming (Ofcourse, it have its own challenges like yielding.)

Wednesday, 21 April 2010

ssh auto login script

Finding the script for ssh auto login is not at all difficult. Thinking that, I hadn't stored the link that I found as useful. Later when I tried to get that link, it took me some 10 mins to get the same link, and so, thought of blogging it.
Copied the below script from http://programminglinuxblog.blogspot.com/2008/02/automatic-ssh-login-script-all.html

Below script takes care of copying your certificate content into the remote box, which is not the case with other scripts found at different locations. Also, you can learn shell script with this script.

#!/bin/bash

if [ ! $1 ]; then
echo "usage: pushssh.sh user@remoteserver "
exit
fi

PORT=22

if [ $2 ]; then
PORT=$2
fi

# Uploads your id_rsa.pub to the specified host, wrapped for readability

if [ ! -r ${HOME}/.ssh/id_rsa.pub ]; then
ssh-keygen -b 2048 -t rsa
fi

# Make sure auth file exists and chmod to 600

ssh $1 -p $PORT 0> echo "mkdir ~/.ssh; touch ~/.ssh/authorized_keys;
chmod u+rw .ssh/authorized_keys"

# Append to the copy on the remote server

cat ~/.ssh/id_rsa.pub | ssh $1 -p $PORT "cat - >> .ssh/authorized_keys"

if [ $? -eq 0 ]; then
echo "Success"
fi

Once you are done, you just need to create another script say "execRemoteCmd" to execute the command you want as follows:
ssh root@164.99.184.111 $@
ssh root@164.99.184.111 $@
and use it as execRemoteCmd ls -ltr /chroot/lag/core.*

Monday, 19 April 2010

How to reach google.com?

Whenever I type google.com, it always used to make me land in google.co.in. How to reach google.com then?
Reach www.google.com/ncr. It won't redirect you to google.co.in.

Monday, 5 April 2010

FYI regarding platelets

Drinking juice made of papaya tree leaves makes blood platelets count shootup much much faster. My friend was suffering from dengue fever and his blood platelets count had dropped close to critical. He was administered platelets(which is an expensive process too) but it was not working much. His family members searched on internet and found that papaya leaves juice will help a lotttttt. He was given that and even doctors in Apollo were surprised to see the result. The taste of the juice will be highly bitter so just mix lemon juice with it to have a better taste. Doctors were taking his blood samples every 4hrs to see the effect and after taking 5teaspoon full of the juice, it was doing wonders.
Information source: My friend Krishna Mohan

Tuesday, 16 March 2010

ESX and VMWare Workstation

We can load the vmx files in both of the above softwares.

VMWare Workstation

After installing VMWare workstation 7 on SLES, we can create or open existing virtual machines. But, once you reboot the SLES and try to load existing virtual machines (which previously loaded), it throws error saying "Unable to find /dev/vmmon" module.
Do the following steps:
mv /usr/lib/vmware/modules/binary /usr/lib/vmware/modules/binary.old
vmware-modconfig --console --install-all

The reason is:
VMware comes with some pre-built binaries which somehow don't work on SLES. So we are deleting them, and by running that tool they are built again, this time for this OS.

Courtesy:
http://communities.vmware.com/message/1436964
http://forums.fedoraforum.org/showthread.php?t=206983

Wireless issue

You are in Windows and using your wireless connection. If you hibernate / suspend and switch it on again, wireless won't work. When you try to "View Available Connections", it says "Some other application is controlling and so, cannot be displayed" type of message.

Friday, 15 January 2010

Google Moving out of China

China government performing cyber attacks to access few Human Right group's gmail accounts. So, Google decided to come out of China. Many other companies are also targeted in China.
Attacks are done against group of people who have access to core Intellectual Propery. They exploited the vulnerability in Microsoft's Internet Explorer 6. McAffe's CTO's blog gives more information on this attack which they call as "Operation Aurora" to solve this.