tag:blogger.com,1999:blog-25661417055957541132024-02-21T08:04:29.412-08:00My Linux BlogBy Sanket PadaweSANKET PADAWEhttp://www.blogger.com/profile/13068805206666421402noreply@blogger.comBlogger76125tag:blogger.com,1999:blog-2566141705595754113.post-50192710085338269972021-10-03T23:01:00.004-07:002021-10-03T23:05:58.154-07:00Upstox new user referral code: Earn Rs 1000 as credit using https://bv7np.app.goo.gl/D3D6B<p> </p><div class="aju" style="align-items: center; background-color: white; color: #222222; cursor: default; display: flex; float: none; font-family: Roboto, RobotoDraft, Helvetica, Arial, sans-serif; height: 80px; min-width: 40px; padding: 0px 16px;"><div class="aCi" style="position: relative;"><img aria-hidden="true" class="ajn" data-hovercard-id="grespot@gmail.com" data-name="Sanket P" id=":pp_1-e" jid="grespot@gmail.com" name=":pp" src="https://ssl.gstatic.com/ui/v1/icons/mail/profile_mask_2x.png" style="background-color: #cccccc; border-radius: 50%; display: block; height: 40px; width: 40px;" /></div></div><div>Hey, have you tried Upstox? Upstox is one of India's largest and fastest-growing investment platforms with over 50 lakh users. Recently they’ve introduced a new app, which is swifter, smarter, smoother and easy-to-use, for both pro traders and beginners. It allows you to invest in Stocks, Futures, Options, Mutual Funds, IPOs and more and offers Rs. 1000 brokerage credit valid for the first 30 days. Opening an account is fast and paperless! Sign up now with my link to open your account: <a href="https://bv7np.app.goo.gl/D3D6B">https://bv7np.app.goo.gl/D3D6B</a></div>SANKET PADAWEhttp://www.blogger.com/profile/13068805206666421402noreply@blogger.com0tag:blogger.com,1999:blog-2566141705595754113.post-63250292648343962112012-07-31T10:38:00.000-07:002012-07-31T10:38:24.526-07:00Synchronize time of two or more PCs with NTP<div dir="ltr" style="text-align: left;" trbidi="on">
1) At first check whether NTP is installed or not. Install if its not installed.<br />
<br />
#apt-get install ntp<br />
<br />
2) Start or restart ntp using<br />
<br />
#/etc/init.d/ntp restart/start<br />
<br />
3) On server machine do following things.<br />
Open /etc/ntp.conf and add following things<br />
<br />
<br />
server ntp.ubuntu.com iburst<br />
server pool.ntp.org<br />
server 127.127.1.0<br />
fudge 127.127.1.0 stratum 10<br />
<br />
<br />
restrict 192.168.10.0 mask 255.255.255.0 nomodify notrap<br />
<br />
Here first two lines are external ntp servers which will be used to synchronize to time. 3rd and 4th line is used if machine has infrequent internet connection. Last line is used so that any machine from network 192.168.10.0 can use this machine as a server to synchronize time. So result would be that you would see same time on all machines in that network 192.168.10.0 and current machine(server).<br />
<br />
Restart ntp using<br />
<br />
#/etc/init.d/ntp restart<br />
<br />
4) On client machine<br />
Open /etc/ntp.conf and add ip address of the server machine. We assume that ip address of server machine was 192.168.10.12.<br />
<br />
so in ntp.conf enter<br />
<br />
server 192.168.10.12 iburst<br />
<br />
Restart ntp<br />
# /etc/init.d/ntp restart<br />
<br />
Check using following command<br />
<br />
#ntpq -c lpeer<br />
And you should see ip address or hostname of server machine.<br />
<br />
Thats it. Now onwards all the client machines in the network 192.168.10.0 and server machine(192.168.10.12) will always show same time and will remain synchronized.<br />
<br /></div>SANKET PADAWEhttp://www.blogger.com/profile/13068805206666421402noreply@blogger.com0tag:blogger.com,1999:blog-2566141705595754113.post-52928811190428990272012-07-31T10:24:00.000-07:002012-07-31T10:25:55.740-07:00Clear cache memory used by linux kernel and processor cache<div dir="ltr" style="text-align: left;" trbidi="on">
You just give one command to do this:<br />
# free && sync && echo 3 > /proc/sys/vm/drop_caches && free<br />
This would clear only disk cache.<br />
<br />
In order to clear processor cache memory, there is no perfect method. I can only suggest one method.<br />
At first write a c program to allocate large amount of memory using malloc. That memory should be almost equal to the amount free memory available which you can see using top command. Now fill that allocated memory by writing it with random data or may be even 0. That would clear your processor cached.</div>SANKET PADAWEhttp://www.blogger.com/profile/13068805206666421402noreply@blogger.com0tag:blogger.com,1999:blog-2566141705595754113.post-33887134580583602962012-07-31T10:16:00.002-07:002012-07-31T10:17:35.480-07:00Login without password using ssh<div dir="ltr" style="text-align: left;" trbidi="on">
At first install openssh client and server using following commands.<br />
#sudo apt-get install openssh-client</strong><br />
#sudo apt-get install openssh-server</strong><br />
<br />
Lets assume that there are two machines A and B. You want to login from B to A without using password..<br />
<br />
1) So from machine B give following commands.<br />
# ssh-keygen<br />
<br />
After that press enter for the file (i.e. let it use default file), then press enter when asked for entering password.<br />
<br />
Example from my machine:<br />
<br />
<br />
root@hpc-13:~/.ssh# ssh-keygen<br />
Generating public/private rsa key pair.<br />
Enter file in which to save the key (/root/.ssh/id_rsa):<br />
Enter passphrase (empty for no passphrase): (PRESS ENTER)<br />
Enter same passphrase again: (PRESS ENTER)<br />
Your identification has been saved in /root/.ssh/id_rsa.<br />
Your public key has been saved in /root/.ssh/id_rsa.pub.<br />
The key fingerprint is:<br />
ac:d6:6a:b2:98:f6:8a:0f:df:76:af:a6:82:7c:4f:c1 root@hpc-13<br />
The key's randomart image is:<br />
+--[ RSA 2048]----+<br />
| |<br />
| |<br />
| |<br />
| . . |<br />
| E S |<br />
| .o |<br />
|o. .o . |<br />
|.=o=+.+. |<br />
|.oB=*Ooo. |<br />
+-----------------+<br />
<br />
2) Now use ssh-copy-id command to do rest of the things.<br />
<div>
<br /></div>
<div>
# ssh-copy-id -i ~/.ssh/id_rsa.pub username@hostname_of_remote_machine(machine A in our case)</div>
<div>
<br /></div>
<div>
Example from my machine:</div>
<div>
<br /></div>
<div>
<div>
root@hpc-13:~/.ssh# ssh-copy-id -i ~/.ssh/id_rsa.pub user@hpc-12</div>
<div>
The authenticity of host 'hpc-12 (10.192.19.158)' can't be established.</div>
<div>
RSA key fingerprint is 3f:9b:b2:b2:8e:36:09:4b:92:4c:df:bd:d6:14:b7:9f.</div>
<div>
Are you sure you want to continue connecting (yes/no)? yes</div>
<div>
Warning: Permanently added 'hpc-12,10.192.19.158' (RSA) to the list of known hosts.</div>
</div>
<div>
<div>
user@hpc-12's password:</div>
<div>
Now try logging into the machine, with "ssh 'user@hpc-12'", and check in:</div>
<div>
<br /></div>
<div>
.ssh/authorized_keys</div>
<div>
<br /></div>
<div>
to make sure we haven't added extra keys that you weren't expecting.</div>
</div>
<div>
<br /></div>
<div>
3) Now try ssh to machine A</div>
<div>
<br /></div>
<div>
#ssh user@hostname_of_remote_machine(machine A in our case)</div>
<div>
<br /></div>
<div>
And you should be able to login without password.</div>
<div>
<br /></div>
<div>
<br /></div>
</div>
SANKET PADAWEhttp://www.blogger.com/profile/13068805206666421402noreply@blogger.com0tag:blogger.com,1999:blog-2566141705595754113.post-77991959839435881532012-07-10T10:05:00.002-07:002012-07-10T10:05:41.678-07:00How to find cached copy of any webpage url<div dir="ltr" style="text-align: left;" trbidi="on">
Google stores all the pages in cache for few days and they can be found out by using this url<br />
<br />
<a href="http://webcache.googleusercontent.com/search?q=cache:http://example.com/">http://webcache.googleusercontent.com/search?q=cache:</a><br />
<br />
Now just append the url who's cache copy you want to see. For example if you want to see cache copy of www.google.com then your url will be<br />
<br />
<a href="http://webcache.googleusercontent.com/search?q=cache:http://www.google.com">http://webcache.googleusercontent.com/search?q=cache:http://www.google.com</a><br />
<br />
You can offcourse try with those url which are not active currently for example facebook photos which are deleted later on.</div>SANKET PADAWEhttp://www.blogger.com/profile/13068805206666421402noreply@blogger.com1tag:blogger.com,1999:blog-2566141705595754113.post-3047391613243515462012-06-26T12:37:00.001-07:002012-06-26T13:47:08.464-07:00error: Failed dependencies: libc.so.6 is needed<div dir="ltr" style="text-align: left;" trbidi="on">
I actually got this error while trying to install rpm of driver of a network card on RHEL 6.2 64 bit. That error looked something like this:<br />
<br />
# rpm -i myri_dbl-2. 1.0.51076-3636.x86_64.rpm<o:p></o:p><br />
<div class="MsoNormal">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;">error: Failed dependencies:<o:p></o:p></span></div>
<div class="MsoNormal">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;"> libc.so.6 is needed
by myri_dbl-2.1.0.51076-3636.x86_64<o:p></o:p></span></div>
<div class="MsoNormal">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;"> libc.so.6(GLIBC_2.0)
is needed by myri_dbl-2.1.0.51076-3636.x86_64<o:p></o:p></span></div>
<div class="MsoNormal">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;"> libc.so.6(GLIBC_2.1)
is needed by myri_dbl-2.1.0.51076-3636.x86_64<o:p></o:p></span></div>
<div class="MsoNormal">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;">
libc.so.6(GLIBC_2.1.3) is needed by myri_dbl-2.1.0.51076-3636.x86_64<o:p></o:p></span></div>
<div class="MsoNormal">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;"> libc.so.6(GLIBC_2.3)
is needed by myri_dbl-2.1.0.51076-3636.x86_64<o:p></o:p></span></div>
<div class="MsoNormal">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;"> libdl.so.2 is needed
by myri_dbl-2.1.0.51076-3636.x86_64<o:p></o:p></span></div>
<div class="MsoNormal">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;"> libdl.so.2(GLIBC_2.0)
is needed by myri_dbl-2.1.0.51076-3636.x86_64<o:p></o:p></span></div>
<div class="MsoNormal">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;"> libpthread.so.0 is
needed by myri_dbl-2.1.0.51076-3636.x86_64<o:p></o:p></span></div>
<div class="MsoNormal">
<span style="font-family: Calibri, sans-serif; font-size: 11pt;">
libpthread.so.0(GLIBC_2.0) is needed by myri_dbl-2.1.0.51076-3636.x86_64<span style="color: #1f497d;"><o:p></o:p></span></span><br />
<span style="color: #1f497d; font-family: Calibri, sans-serif;"><span style="font-size: 15px;"><br /></span></span><br />
This error occurs because of some 32 dependencies which are required. The solution is to install 32 version of glibc.<br />
<span style="color: #1f497d; font-family: Calibri, sans-serif;"><span style="font-size: 15px;"><br /></span></span><br />
<span style="font-family: Arial, Tahoma, sans-serif; font-size: 15px;"># yum install libstdc++-4.4.6-4.el6.i686</span>
<br />
<span style="font-family: Arial, Tahoma, sans-serif;"><span style="font-size: 15px;"><br /></span></span><br />
<span style="font-family: Arial, Tahoma, sans-serif;"><span style="font-size: 15px;">This will mostly solve your problem.</span></span></div>
</div>SANKET PADAWEhttp://www.blogger.com/profile/13068805206666421402noreply@blogger.com5tag:blogger.com,1999:blog-2566141705595754113.post-47181019675995661552012-06-22T17:24:00.000-07:002012-06-25T13:13:14.536-07:00To check which application is using a particular port<div dir="ltr" style="text-align: left;" trbidi="on">
You give following command to check which application is using a particular port.<br />
<br />
# netstat -ltnp | grep portno<br />
<br />
or<br />
<br />
# lsof -i :portno</div>SANKET PADAWEhttp://www.blogger.com/profile/13068805206666421402noreply@blogger.com0tag:blogger.com,1999:blog-2566141705595754113.post-17676622210502479122012-06-22T17:18:00.000-07:002012-06-25T16:17:09.677-07:00Check whether hyperthreading is enabled or not ?<div dir="ltr" style="text-align: left;" trbidi="on">
We can check whether hyper threading is enabled or not without checking in bios by giving following command<br />
# cat /proc/cpuinfo<br />
If the number of siblings and number of cores you see is same then hyper threading is not enabled. If they are not same then its enabled.<br />
If its enabled, then "siblings" give logical cores present and "cpu core" gives actual physical cores.<br />
<br />
Total number of cpu's is equal to maximum number of cpu id available in the result + 1.<br />
<br />
If you want to find out how many cores are present in a particular cpu and what there numbers are then you can give following command.<br />
<br />
#<span > cat /sys/devices/system/cpu/cpu2/topology/core_siblings_list</span><br />
<div>
<span style="background-color: white;"><br /></span></div>
</div>SANKET PADAWEhttp://www.blogger.com/profile/13068805206666421402noreply@blogger.com1tag:blogger.com,1999:blog-2566141705595754113.post-1899460889135912402012-06-22T17:10:00.003-07:002012-06-22T17:10:41.281-07:00CPU affinity using taskset command in linux<div dir="ltr" style="text-align: left;" trbidi="on">
In case of a machine having mulitple processor like NUMA processes generally perform better on one processor when compared to other processors. So its necessary to attach process to that particular processor so as to maximize performance. For such reasons, a tool named taskset can be used. The linux scheduler then acts according to processor affinity set by taskset command. But generally scheduler tries to keep process on same CPU as long as it supports natural affinity. So this taskset command may not work in all cases.<br />
<br />
Command to check affinity of process with pid<br />
# taskset -p pid<br />
This command tells which cores have been assigned to the process with taht pid.<br />
<br />
Command to set affinity of process<br />
# taskset -p mask pid<br />
This command is used to assign process with pid to cores given by that mask.<br />
<br />
Mask is defined as follows:<br />
It is a bitmap of processors present in the system. For example if there are 4 cores then 4 bits will be used in bitmap and if there are 8 cores then 8 bits will be used in bitmap.LSB indicates first core and MSB indicates last core. So to assign process with pid 1111 to cores 0,2,4,6 we will give following command<br />
# taskset -p 0X55 1111<br />
To assign it to cores 1,3,5,7 we will give following command<br />
# taskset -p 0Xaa 1111<br />
<br /></div>SANKET PADAWEhttp://www.blogger.com/profile/13068805206666421402noreply@blogger.com0tag:blogger.com,1999:blog-2566141705595754113.post-42575486246253653472012-06-20T17:11:00.000-07:002012-07-23T12:24:04.352-07:00Lock paged memory when using memcached by using memcached -k option<div dir="ltr" style="text-align: left;" trbidi="on">
In case of memcached, paged memory should be locked for following reasons<br />
<br />
1) If we reserve some paged memory for memcached then time would be saved in allocating memory for key/value pairs dynamically.<br />
So memcached has memcached -k option to lock paged memory. But generally when you use this option you tend to get following error.<br />
<br />
#memcached -u user -k &<br />
warning: -k invalid, mlockall() failed: Cannot allocate memory<br />
<br />
This occurs because by default llocked memory is only 64K. You can check this using<br />
# ulimit -l<br />
<br />
To change this, open /etc/security/limits.conf and then enter following lines at the end of file.<br />
<br />
root - memlock 1048576<br />
<br />
where root is the user who is going to run the memcached command from command line.<br />
<br />
After that logout and login again and then check by using<br />
#ulimit -l</div>SANKET PADAWEhttp://www.blogger.com/profile/13068805206666421402noreply@blogger.com0tag:blogger.com,1999:blog-2566141705595754113.post-46883054010806244542012-06-20T14:58:00.000-07:002012-06-25T13:11:53.560-07:00vmap allocation for size=<> failed errror and adding kernel parameter while booting<div dir="ltr" style="text-align: left;" trbidi="on">
This error arrises because the virtual memory allocated when operating system boots is limited. In order to solve this problem we have to increase virtual memory by giving external parameter to kernel when its booting.<br />
<br />
This can be done in following way.<br />
<br />
1)On the splash screen showing grub i.e.where operating system to be booted is shown, press e.<br />
<br />
2)Then on the page which appears select that line which starts with the work "kernel". Again press e and go to the end of the line and write vmalloc=<size><size></size></size><br />
<br />
3)After that press enter and boot that operating system. That would remove that error.</div>SANKET PADAWEhttp://www.blogger.com/profile/13068805206666421402noreply@blogger.com0tag:blogger.com,1999:blog-2566141705595754113.post-6723062527360330862012-06-20T14:47:00.001-07:002012-06-25T13:11:34.687-07:00Error inserting module : unknown symbol _udivdi3 undefined<div dir="ltr" style="text-align: left;" trbidi="on">
This error occurs on 32 bit operating system. This won't come if you are using 64 bit operating system. If you wan't to avoid this error in 32 bit operating system then you will have to do following thing.<br />
<br />
In your code wherever you are doing division by using "/" operator replace it by following<br />
<span style="font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, serif; font-size: 14px; line-height: 18px;">uint32_t do_div(uint64_t dividend, uint32_t divisor)</span>
<br />
<span style="font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, serif; font-size: 14px; line-height: 18px;"><br /></span><br />
<span style="font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, serif; font-size: 14px; line-height: 18px;">So a/b would be do_div(a/b).</span><br />
<span style="font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, serif;"><span style="font-size: 14px; line-height: 18px;"><br /></span></span></div>SANKET PADAWEhttp://www.blogger.com/profile/13068805206666421402noreply@blogger.com0tag:blogger.com,1999:blog-2566141705595754113.post-65242880884406996312012-06-20T14:15:00.000-07:002012-06-25T13:10:27.193-07:00RHEL Network card not detecting ( Troubleshooting network )<div dir="ltr" style="text-align: left;" trbidi="on">
There might be many reasons for network not working as per our requirement. I am going to point out few things which I always do when there is some problem with network. And after working over all theses things for long time, I guess I will be covering most of the reasons for network not working as per our requirement.<br />
<div>
<br /></div>
<div>
Before you start, you can disable firewall using</div>
<div>
#service iptables stop</div>
<div>
<br /></div>
<div>
1)You can use following command to configure your network adaptor</div>
<div>
#system-config-network</div>
<div>
After that you can give it IP address, netmask, broadcast address or allow it to take ip from dhcp server. Then you can save and quit and give following command.</div>
<div>
#service network restart
</div>
<div>
<br /></div>
<div>
2) #ifconfig</div>
<div>
This is the command which you should use first to check if the network interfaces are as per your requirement. So this will confirm that network adaptor is enabled.</div>
<div>
<br /></div>
<div>
3)After this you can try connecting i.e. pinging some ip address in your network which is active. If ping does not work then mostly cable is not properly attached. You can use ethtool to figure that out.</div>
<div>
<br /></div>
<div>
#ethtool ethX</div>
<div>
If cable is fine then it will show at the bottom "Link detected : yes"</div>
<div>
Otherwise it will show "no" instead of "yes". In that case you can try fixing the cable properly.</div>
<div>
<br /></div>
<div>
4) If there is still problem you can check further information about network card and just cross check it with following command.</div>
<div>
#ethtool -i ethX</div>
<div>
This will show information about network card</div>
<div>
<br /></div>
<div>
5)You can also check whether network card driver has loaded properly by using following command.</div>
<div>
#lsmod | grep <nameofdriver></nameofdriver></div>
<div>
<br /></div>
<div>
<br /></div>
</div>SANKET PADAWEhttp://www.blogger.com/profile/13068805206666421402noreply@blogger.com0tag:blogger.com,1999:blog-2566141705595754113.post-41338832988469576412012-06-15T16:28:00.001-07:002012-06-27T13:41:46.124-07:00Installing Memcached with libevent and benchmarking it with memslap<div dir="ltr" style="text-align: left;" trbidi="on">
<div dir="ltr" style="text-align: left;" trbidi="on">
<div style="text-align: left;">
<span style="font-family: Times, 'Times New Roman', serif;">Memcached is "<span style="line-height: 18px; text-align: -webkit-auto;">Free & open source, high-performance, distributed memory object caching system</span><span style="line-height: 18px; text-align: -webkit-auto;">, generic in nature, but intended for use in speeding up dynamic web applications by alleviating database load</span><span style="color: #333333; line-height: 18px; text-align: -webkit-auto;">.</span>" Memcached is used by most of the companies today including Facebook, Craiglist, Flickr and Twitter. This is one of the thing which I worked on during my summer intern. I am just going to mention the steps for installing memcached and the problems which I faced doing it.</span></div>
<div style="text-align: left;">
<span style="font-family: Times, 'Times New Roman', serif;"><br /></span></div>
<div style="text-align: left;">
<span style="font-family: Times, 'Times New Roman', serif;">Installation:</span></div>
<div style="text-align: left;">
<span style="font-family: Times, 'Times New Roman', serif;">1) </span>Download libevent from <a href="http://libevent.org/">http://libevent.org/</a> . This is one of the dependency for installing memcached.</div>
<div style="text-align: left;">
<br /></div>
<div style="text-align: left;">
<span style="font-family: Times, 'Times New Roman', serif;">2) Extract it</span></div>
<div style="text-align: left;">
<span style="font-family: Times, 'Times New Roman', serif;"><br /></span></div>
<div style="text-align: left;">
<span style="font-family: Times, 'Times New Roman', serif;">3) Go inside extracted directory and type following things</span></div>
<div style="text-align: left;">
<span style="font-family: Times, 'Times New Roman', serif;">#./configure --prefix=/usr/local</span></div>
<div style="text-align: left;">
</div>
(If you don't put --prefix then chances are that later on while installing memcached it might give problems.)<br />
<br />
<br />
<div style="text-align: left;">
<span style="font-family: Times, 'Times New Roman', serif;"># make && make install</span></div>
<div style="text-align: left;">
<span style="font-family: Times, 'Times New Roman', serif;"><br /></span></div>
<div style="text-align: left;">
<span style="font-family: Times, 'Times New Roman', serif;">4) Download source code of memcached from </span><a href="http://www.memcached.org/">http://www.memcached.org/</a></div>
<div style="text-align: left;">
<br /></div>
<div style="text-align: left;">
5) Extract it</div>
<div style="text-align: left;">
<br /></div>
<div style="text-align: left;">
6) Go inside the extracted directory.</div>
<div style="text-align: left;">
#./configure --libevent-with=/usr/local</div>
<div style="text-align: left;">
# make && make install</div>
<div style="text-align: left;">
<br /></div>
<div style="text-align: left;">
7) You can check whether memcached is working by giving following command</div>
<div style="text-align: left;">
# memcached -u nobody &</div>
<div style="text-align: left;">
After that you can do </div>
<div style="text-align: left;">
# ps -el | grep memcached</div>
<div style="text-align: left;">
to see if memcached is started.</div>
<div style="text-align: left;">
<br /></div>
<div style="text-align: left;">
8)Now its time to install memslap which is client for memcached. Its used for benchmarking purpose.</div>
<div style="text-align: left;">
<br /></div>
<div style="text-align: left;">
9) Download couchbase from <a href="http://www.couchbase.com/">http://www.couchbase.com/</a><br />
<br />
10) Extract it and go inside libmemcached directory present in it.<br />
<br />
11) Then build libmemcached.<br />
<br />
# ./configure<br />
# make<br />
<br />
12) Now go inside clients directory present inside libmemcached and give following command<br />
# ./memslap -s server_ip<br />
to start benchmarking process. After some time (600s) you will get some output. You can vary parameters as per documentation of memslap.</div>
</div>
<br /></div>SANKET PADAWEhttp://www.blogger.com/profile/13068805206666421402noreply@blogger.com1tag:blogger.com,1999:blog-2566141705595754113.post-52266429472625660972012-06-14T20:34:00.002-07:002012-06-25T13:09:18.425-07:00Installing g++ on rhel and the error " libtool: link: unsupported hardcode properties"<div dir="ltr" style="text-align: left;" trbidi="on">
First let me just tell you how generally g++ is installed on RHEL and then the problem which I faced after installing that.<br />
<br />
For RHEL,<br />
# yum install gcc-c++<br />
<br />
After I installed g++ on RHEL , then when I tried installing some tool/utility from its source code, I got following error "libtool: link: unsupported hardcode properties" while building the source code. This is what I did to solve this problem.<br />
<br />
#make distclean<br />
# ./configure<br />
# make<br />
# make install<br />
<br />
And this solved my problem</div>SANKET PADAWEhttp://www.blogger.com/profile/13068805206666421402noreply@blogger.com3tag:blogger.com,1999:blog-2566141705595754113.post-67276731766231489322012-06-14T20:30:00.003-07:002012-06-14T20:30:48.116-07:00No route to host error<div dir="ltr" style="text-align: left;" trbidi="on">
This is one of the very common problem and at times it can be really irritating since it can be difficult to figure out the problem if you are not experienced user of linux and especially RHEL. Even after using RHEL for more than 2 years I got stuck over this problem for 4-5 hours trying to do everything possible and later realizing that problem was with firewall. Here are few steps which you can do.<br />
<br />
1) First of all give ifconfig and check all interfaces and whether they are according to your requirement.<br />
2) Give command #system-config-network and check network configuration<br />
3) Check firewall rules. Disable it using<br />
# service iptables stop<br />
<br />
I guess in most of the cases problem must be with firewall. Remember newly installed RHEL does have firewall enabled by default. So that can cause problem if you are not experienced RHEL user.</div>SANKET PADAWEhttp://www.blogger.com/profile/13068805206666421402noreply@blogger.com0tag:blogger.com,1999:blog-2566141705595754113.post-6791884860401796102012-06-14T10:40:00.003-07:002012-06-14T10:40:32.000-07:00Force user to logoff from remote or any terminal<div dir="ltr" style="text-align: left;" trbidi="on">
So at times it may happen the a user logs in from remote terminal and forgets to log off. So in order to kill such a session of a remote user, following things can be done.<br />
# who -u<br />
This will give you the pid of the process user is using to log in.<br />
Then you can kill that process using<br />
#kill -9 pid</div>SANKET PADAWEhttp://www.blogger.com/profile/13068805206666421402noreply@blogger.com1tag:blogger.com,1999:blog-2566141705595754113.post-52155181698146589212012-06-12T19:36:00.003-07:002012-06-12T19:51:02.207-07:00Registering RHEL 6<div dir="ltr" style="text-align: left;" trbidi="on">
Initially when you install a new RHEL 6 on your pc and try using even basic utilities like gcc, it will show errors like no package named gcc installed. Even when you do yum install gcc it won't work and will throw errors like:<br />
<br />
<div style="text-align: justify;">
# sudo yum install gcc
<br />
Updating Red Hat repositories.
<br />
Setting up Install Process
<br />
Error: Nothing to do</div>
No package gcc available.
<br />
<div style="text-align: left;">
<br />
If you try</div>
<div style="text-align: justify;">
#sudo yum grouplist</div>
Loaded plugins: product-id, subscription-manager
Updating Red Hat repositories.
No group data available
Error: for configured repositories
<br />
If you try<br />
#sudo yum repolist<br />
Loaded plugins: product-id, subscription-manager<br />
Updating Red Hat repositories.
<br />
repolist: 0<br />
<br />
All these problems are mostly because your newly installed RHEL is not registered. You can confirm this by giving following command.<br />
# yum repolist all<br />
<br />
If the system is not registered it will give ouptut status as disabled. Now you can register your system with following command and then enter the required details.<br />
# sudo rhn_register<br />
<br />
After it has successfully registered, give following command.<br />
#yum update
</div>
SANKET PADAWEhttp://www.blogger.com/profile/13068805206666421402noreply@blogger.com0tag:blogger.com,1999:blog-2566141705595754113.post-55088156885597544602012-05-28T13:08:00.003-07:002012-06-27T13:42:07.744-07:00Laser chess source code (c++ and cilk++)<div dir="ltr" style="text-align: left;" trbidi="on">
<div dir="ltr" style="text-align: left;" trbidi="on">
Here is the source code of game named laser chess (computer vs human) written in c++ and cilk++ so as to run it on super computer. In order to run this code you should install cilk++. This program can also be run on normal pc where the code will be same as running it on single core of a computer. For running it on super computer you can refer to intel's cilk++ guide. To run it on normal pc, just install cilk++ on your machine and run it. More details can be found inside manual provided along with the source code.<br />
<br />
<a href="http://sharecash.org/download.php?file=2869133">Manual: Laser chess</a><br />
<a href="http://sharecash.org/download.php?file=2869133">Laser chess source code (parallel version)</a><br />
<br />
Serial version of this game can also be found on <a href="https://github.com/sanketp123/Laser-chess">git@github.com:sanketp123/Laser-chess.git</a> . <br />
<br /></div>
<br /></div>SANKET PADAWEhttp://www.blogger.com/profile/13068805206666421402noreply@blogger.com0tag:blogger.com,1999:blog-2566141705595754113.post-16825561214403438702012-05-28T11:56:00.000-07:002012-05-28T11:57:38.813-07:00Installing and Uninstalling ubuntu kernel<div dir="ltr" style="text-align: left;" trbidi="on">
<div style="text-align: left;" trbidi="on">
<br /></div>
<div style="font-family: Arial,Helvetica,sans-serif; text-align: left;">
<h3 style="text-align: left;">
Steps for installing ubuntu kernel </h3>
</div>
<ul style="font-family: Arial,Helvetica,sans-serif; text-align: left;">
<li>Get the source code </li>
</ul>
<div style="font-family: Arial,Helvetica,sans-serif; text-align: left;">
apt-get source linux-image-$(uname -r)</div>
<ul style="font-family: Arial,Helvetica,sans-serif; text-align: left;">
<li>Perform this step only for the first time you build kernel.</li>
</ul>
<div style="font-family: Arial,Helvetica,sans-serif; text-align: left;">
Downloading dependencies</div>
<div style="font-family: Arial,Helvetica,sans-serif; text-align: left;">
sudo apt-get build-dep linux-image-$(uname -r)</div>
<ul style="font-family: Arial,Helvetica,sans-serif; text-align: left;">
<li>Building kernel </li>
Now move inside the downloaded kernel directory and type following commands. </ul>
<ul style="font-family: Arial,Helvetica,sans-serif; text-align: left;">fakeroot debian/rules clean
<br />
fakeroot debian/rules binary-headers binary-generic
</ul>
After this step, 3 files with .deb extension would be generated in the parent directory of your current folder. Install them using this command<br />
<ul style="text-align: left;">
<li> sudo dpkg -i linux*2.6.38-7.37*.deb</li>
</ul>
<ul style="font-family: Arial,Helvetica,sans-serif; text-align: left;">
</ul>
<ul style="text-align: left;">
<li> Now reboot. After rebooting you can do uname -r to check whether you have booted into new kernel. </li>
</ul>
<br />
<br />
<h3 style="text-align: left;">
Steps for uninstalling ubuntu kernel
</h3>
<ul style="text-align: left;">
<li>Open the Synaptic package manager. If its not present you can at first install it.</li>
<li>Now check your current kernel version using uname -r . Or just make a note of the kernel version which you want to remove.</li>
<li>Now inside Synaptic package manager you will find "search". Inside that type 'linux-image'. </li>
<li>After that you will see different kernel images which are installed in your pc.</li>
<li>Now select the one which you want to remove and mark it for removal.</li>
<li>After that apply the changes to remove that kernel version. </li>
</ul>
<div style="text-align: left;">
</div>
</div>SANKET PADAWEhttp://www.blogger.com/profile/13068805206666421402noreply@blogger.com0tag:blogger.com,1999:blog-2566141705595754113.post-39397128876029414392011-07-31T08:17:00.000-07:002011-07-31T08:24:18.141-07:00Configure a system to use an existing LDAP directory service for user and group information#system-config-authentication<br />
Then select "ldap"<br />
Enter base dn and ldap server name<br />
Download certificate by entering given url.<br />
select authentication methodSANKET PADAWEhttp://www.blogger.com/profile/13068805206666421402noreply@blogger.com0tag:blogger.com,1999:blog-2566141705595754113.post-87885784653277166702011-07-31T07:21:00.000-07:002011-07-31T07:21:03.904-07:00Diagnose and address routine SELinux policy violationsUse either of the given below files to check logs <br />
/var/log/audit/audit.log<br />
/var/log/messages<br />
#sealertSANKET PADAWEhttp://www.blogger.com/profile/13068805206666421402noreply@blogger.com0tag:blogger.com,1999:blog-2566141705595754113.post-22798118659399726052011-07-31T07:19:00.001-07:002012-01-15T08:36:19.640-08:00Use boolean settings to modify system SELinux settingsTo find boolean selinux of a service<br />
# getsebool -a | grep servicename<br />
eg:<br />
# getsebool -a | grep http<br />
<br />
Change boolean<br />
#setsebool -P [boolean = <on (1) | off (0)>]<br />
eg:<br />
# setsebool -P httpd_enable_homedirs=1SANKET PADAWEhttp://www.blogger.com/profile/13068805206666421402noreply@blogger.com1tag:blogger.com,1999:blog-2566141705595754113.post-31407470984676339212011-07-31T07:15:00.001-07:002012-01-15T08:39:35.746-08:00Restore default file contexts#restorecon -R filenameSANKET PADAWEhttp://www.blogger.com/profile/13068805206666421402noreply@blogger.com0tag:blogger.com,1999:blog-2566141705595754113.post-39555836582603757802011-07-31T07:14:00.001-07:002012-01-15T08:39:25.543-08:00List and identify SELinux file and process contextList file context<br />
#ll -Z filename<br />
<br />
SELinux uses three different contexts to enforce security: user, role, and domain<br />
<br />
User context:<br />
unconfined_u Unprotected user<br />
system_u System user<br />
user_u Normal user<br />
<br />
Role context:<br />
object_r File<br />
system_r Users and processes<br />
<br />
Domain context:<br />
unconfined_r Unprotected file or process<br />
<br />
To see Process context<br />
#ps -ZlSANKET PADAWEhttp://www.blogger.com/profile/13068805206666421402noreply@blogger.com0