Wednesday, July 30, 2014

Squid Stop Responding/Slow after some time - "WARNING! Your cache is running out of file descriptors"


Squid working fine for some time after restarting & then suddenly goes very slow. Even taking too much time to open google.co.in

Here are the steps need to check

[root@bhagwat ~]# tail -f /var/log/squid/cache.log

WARNING! Your cache is running out of filedescriptors
WARNING! Your cache is running out of filedescriptors
WARNING! Your cache is running out of filedescriptors
WARNING! Your cache is running out of filedescriptors
WARNING! Your cache is running out of filedescriptors


Please follow the below steps to fix the issue & improve the performance of squid

[root@bhagwat ~]# /etc/init.d/squid stop

##Open below file
v
i /etc/security/limits.conf

##Append following line to increase current limit from 1024 to 4096:

* - nofile 4096

[root@bhagwat ~]# vim /etc/squid/squid.conf

##Add the below line at last of squid.conf file

max_filedesc 8096

Save & quit squid.conf

Now open below file

[root@bhagwat ~]# vim /etc/init.d/squid

##Add this line before any code

ulimit -HSn 4096

save & quit the file

Start squid with below command

[root@bhagwat ~]# /etc/init.d/squid start

Enjoy..... Your issue is resolved.

Saturday, June 28, 2014

Install VNC Server in Centos

Installing TightVNC Server

[root@bhagwat ~]# yum install tigervnc-server

Create 1 User for VNC

[root@bhagwat ~]# useradd bhagwat
[root@bhagwat ~]# passwd bhagwat
Changing password for user bhagwat.
New password:
Retype new password:
passwd: all authentication tokens updated successfully.

Set VNC Password for User

[root@bhagwat ~]# su - bhagwat

[bhagwat@bhagwat ~]$ vncpasswd
Password:
Verify:

[bhagwat@bhagwat ~]$ exit


Now set the Xstarup Resolution

Go to
[root@bhagwat ~]# vi /etc/sysconfig/vncservers

Add the following lines at the bottom of file

## Single User ##
VNCSERVERS="1:bhagwat"
VNCSERVERARGS[1]="-geometry 1024x768"

Save & quit the file

Now start the VNC Server with below command

[root@bhagwat ~]# /etc/init.d/vncserver start
Starting VNC server: 1:bhagwat
New 'bhagwat.imcl:1 (bhagwat)' desktop is bhagwat.imcl:1

Starting applications specified in /home/bhawgat/.vnc/xstartup
Log file is /home/bhagwat/.vnc/bhagwat.imcl:1.log
                                                                                     [  OK  ]


Now Download VNC Viewer from Client machine & enter the VNC Server IP along with VNC ID(1 in our case)
Ex. if VNC server IP is 192.168.4.200 & your VNC ID is 1 then it should be
192.168.4.200:1

Enter password that we created with “vncpasswd” command.

##########
Disable SELinux & iptables if you are not able to access the shared directory

Tuesday, June 17, 2014

Samba Server Configuration in Centos 6 with Full Access


Install Samba with yum
[root@bhagwat ~]# yum install samba

Create a directory with full access
[root@bhagwat ~]# mkdir -p /home/software 
[root@bhagwat ~]# chmod -R 0777 /home/software

Edit smb.conf file (change the following line)
[root@bhagwat ~]# vi /etc/samba/smb.conf 
## Line no 75 - Change the to windows default workgroup 
      workgroup = WORKGROUP 

## Line no 81 - Uncomment and set the IP Range 
      hosts allow = 127. 192.168.4. 

## Line 102 - set no authentication 
      security = share 

## Add the following lines at the bottom 
   [Softwares] 
path = /home/software 
writable = yes 
browseable = yes 
guest ok = yes 
create mode = 0777 
directory mode = 0777

Save & exit the samba file & Start the samba service with below command
[root@bhagwat ~]# /etc/init.d/smb start


##########
Disable SELinux & iptables if you are not able to access the shared directory


Friday, August 9, 2013

Windows could not start because the following file is missing or corrupt : SOLVED

Many time we start Windows XP & got a black screen with some error like 

Windows could not start because the following file is missing or corrupt
\WINDOWS\SYSTEM32\CONFIG\SYSTEM
\WINDOWS\SYSTEM32\CONFIG\SOFTWARE
\WINDOWS\System32\HAL.dll
\WINDOWS\System32\Ntoskrnl.exe
NTLDR IS MISSING
INVALID BOOT.INI
OR may be any other file is missing

SOLUTION
Solution is very simple
Just insert the Windows XP CD & boot the computer with it
On "Welcome to Setup" just press the R button to start Recovery Console
Select your OS (Generaly 1 if you don't have dual boot OS)
When prompted for password type Administrator password (Press enter if you didn't set any password)
At the Recovery console type these commands
C: CD ..
C: ATTRIB –H C:boot.ini
C: ATTRIB –S C:boot.ini
C: ATTRIB –R C:boot.ini
C: del boot.ini
C: BOOTCFG /Rebuild

After Rebuild type below command to fix any error with HDD
C: CHKDSK /R /F 
C: FIXBOOT
“Sure you want to write a new boot sector to the partition C: ?” press “Y”
C: EXIT
Enter

& It's Done.. Your Windows is now started

Enable Restrictions on iPhone/iPad/iPod to stop App-Purchases

You got a SMS that this amount has credited from your credit card no. in App purchase & later known that your brother/cousin or any other family member had spend money from your credit card on Apple App-store.

Solution

You need to enable Restrictions also known as Parental Controls, to stop this

Tap on Setting App
Go to General & tap on Restrictions
Enable & it will ask you to set a passcode
Just enter any passcode twice to set it (Don't share this passcode with people you don't want making in-app puchase)
Once the passcode is set, Slide the In-App Purchase slider to off

Now don't worry about misuse of your credit card. Let your cousins play games or watch movies on your IOS device

But remember don't share the restrictions password with anyone.

Thursday, August 8, 2013

How to Solve “The program can’t start because MSVCR71.dll is missing” Error in SQL Developer




Oracle SQLDeveloper on Windows 7 is not working after upgrading it to 3.2. 
When I am trying to run, it shows "This application failed to start because MSVCR71.dll was not found. Re-Installing the application may fix this problem."


SOLUTION
Fixing this problem is very simple, just copy the file “sqldeveloper\jdk\jre\bin\msvcr71.dll” to folder “%WinDir%\System32\″

 Suppose the windows installed at C drive then copy the MSVCR71.dll file to "C:\Windows\System32" folder

& It start working again...:)

Friday, April 19, 2013

SSH Login without Password

You can login to a remote Linux server without entering password.

Run ssh-keygen commands to creates the public and private keys on the client machine

[bhagwat@it .ssh]$ ssh-keygen
Generating public/private rsa key pair.
Enter file in which to save the key (/home/bhagwat/.ssh/id_rsa): PRESS ENTER
Enter passphrase (empty for no passphrase): PRESS ENTER
Enter same passphrase again: PRESS ENTER
Your identification has been saved in /home/bhagwat/.ssh/id_rsa.
Your public key has been saved in /home/bhagwat/.ssh/id_rsa.pub.
The key fingerprint is:
5a:ac:52:83:fc:03:d9:d9:d3:cb:d7:41:66:c5:1c:d8 bhagwat@it
The key's randomart image is:


[bhagwat@it .ssh]$ 




Now you have ssh keys stored at .ssh folder of user
Just copy the key inside the id_rsa.pub file 

Go to Server & open ~/.ssh/authorized_keys file
Paste the copied key from client & It's done 

If you are still trouble in login Just change the permission on authorized_keys file of server to below :
chmod 640 authorized_keys


* To allow root access with SSH Keys only please change the below setting  in/etc/ssh/sshd_config
PermitRootLogin without-password


* To Disable root access for all users 

PermitRootLogin no