Posts

Showing posts with the label ---Avi

Packet loss or dropping Internet connection

The  Maximum Transmission Unit   (MTU)  feature is an advanced configuration that allows you to determine the largest data size permitted on your connection.  Generally, if your MTU is too large for the connection, your computer will experience packet loss, RDP issue or dropping Internet connection. To determine the correct MTU size for your network, you’ll have to do a specific ping test on the destination you’re trying to go to like using another computer or a web address. Once you get the correct MTU value, you can change it on your server using the below steps: On Windows: C:\Windows\system32> netsh netsh> interface ipv4 netsh interface ipv4> show subinterface    MTU  MediaSenseState   Bytes In  Bytes Out  Interface ------  ---------------  ---------  ---------  ------------- 4123495            1          0   ...

Errors with Shinken application

Error:   Poller is dead but pid file exist Reason 1: Poller is not able to write in log file /var/log/shinken/pollerd.log Solution:    - Remove /var/run/shinken/pollerd.pid                     - Change permission for /var/log/shinken/pollerd.log                       i.e. chmod 775 /var/log/shinken/pollerd.log                     - Restart shinken shinken ,celery and uwsgi. Reason 2: Sometime poller is not able to access localhost:port Solution:    - Replace local with 127.0.0.1 in poller-master.cfg                     - Restart shinken shinken ,celery and uwsgi. Error:  Broker is dead but pid file exist Reason:  Broker is dead but still port is used by broker in somewhere in background Solution:     - Search process w...

SVN: File remains in conflict

This error occurs when you didn't update the SVN and try to commit changes or, someone has made changes to this file that are conflicting with your changes. There are two ways to handle this situation. Either, you can revert back the changes you want to commit and then, update the SVN and after that make the changes again and commit. The other way is, you need to resolve the conflicted files one by one. You can keep all the conflicted files in a folder and resolved it at once. >> Revert the changes steps: svn revert . -R svn up >> Resolve the conflicted files: svn resolved <file_name>

Unable to Connect to SSL Services due to PKIX Path Building Failed

Symptom: Connection is refused when attempted to access applications that are encrypted with SSL. Error: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target Diagnosis: Use SSLPoke to verify the connectivity (you will have to download SSLPoke.class using the following link: https://confluence.atlassian.com/kb/files/779355358/779355357/1/1441897666313/SSLPoke.class) # /apps/java/latest/bin/java -classpath /apps/java/latest SSLPoke <hostname> <Port> # /apps/java/latest/bin/java -classpath /apps/java/latest -Djavax.net.ssl.trustStore=/apps/java/latest/lib/security/cacerts SSLPoke <hostname> <Port> # curl -X POST -d @Test.xml https://<endpoint url> -H "Content-Type:application/xml" **add some xml code in Test.xml If the above command is showing "Successfully...

Hung Puppet process on Linux

Kill Hung Puppet process . kill -9 `ps -ef |grep "puppet agent: applying configurat" |grep -ve grep |awk '{print $2}'` /etc/init.d/puppet restart ps -ef |grep -i puppet | grep -v grep

What is IP: 0.0.0.0

In the context of a route entry, it usually means the default route. In the context of servers, 0.0.0.0 means all IPv4 addresses on the local machine. If a host has two IP addresses, 192.168.1.1 and 10.1.2.1, and a server running on the host listens on 0.0.0.0, it will be reachable at both of those IPs.

Linux based file systems become read-only

On a Linux server, when it loses connectivity to underlying storage (even briefly), the server doesn’t typically crash. It keeps running, but switches all the storage to read-only. Most of the OS and applications are running in RAM, so you don’t necessarily see any issues right away. The main issue we see is the OS and applications hold things in the disk-write queues. When you force the reboot after the storage outage, the kernel gets out-of-whack because that disk queue couldn’t clear properly and now doesn’t match the disks. So, we have to reboot and log in with root password under maintenance mode and force a disk check on the root and app file-systems. Once that is done, the host comes back online without issue.

Kernel Panic Error

Recently, I came across the situation where my CentOS server was not booting and displaying Kernel panic error. I have followed the steps mentioned below to make the server online: I spawned the init as bash. This can be done by giving the following boot parameter.   Init=/bin/bash   Once we have the bash prompt we can remount the root partition in read write mode.   Mount –o remount,rw /   Then change the password:   Password root   Once the password is changed reboot the system. It will ask for the fsck and maintenance password. Enter newly changed maintenance password.

Common ports used in Linux

20 FTP data (File Transfer Protocol)  21 FTP (File Transfer Protocol)  22 SSH (Secure Shell)  23 Telnet  25 SMTP (Send Mail Transfer Protocol)  43 whois  53 DNS (Domain Name Service)  68 DHCP (Dynamic Host Control Protocol)  79 Finger  80 HTTP (HyperText Transfer Protocol)  110 POP3 (Post Office Protocol, version 3)  115 SFTP (Secure File Transfer Protocol)  119 NNTP (Network New Transfer Protocol)  123 NTP (Network Time Protocol)  137 NetBIOS-ns  138 NetBIOS-dgm  139 NetBIOS  143 IMAP (Internet Message Access Protocol)  161 SNMP (Simple Network Management Protocol)  194 IRC (Internet Relay Chat)  220 IMAP3 (Internet Message Access Protocol 3)  389 LDAP (Lightweight Directory Access Protocol)  443 SSL (Secure Socket Layer)  445 SMB (NetBIOS over TCP)  666 Doom  993 SIMAP (Secure Internet Message Access Protocol)  995 SPOP (Secure Po...

Find command usage in *nix

• Find all files of a given type from current directory on down: find ./ -name "*.conf" -print • Find all user files larger than 5Mb: find /home -size +5000000c -print • Find all files owned by a user (defined by user id number. see /etc/passwd) on the system: (could take a very long time) find / -user 501 -print • Find all files created or updated in the last five minutes: (Great for finding effects of make install) find / -cmin -5 • Find all users in group 20 and change them to group 102: (execute as root) find / -group 20 -exec chown :102 {} \; • Find all suid and setgid executables: find / \( -perm -4000 -o -perm -2000 \) -type f -exec ls -ldb {} \; find / -type f -perm +6000 -ls Note: suid executable binaries are programs which switch to root privileges to perform their tasks. These are created by applying a "sticky" bit: chmod +s. These programs should be watched as they are often the first point of entry for hackers. Thus it is prud...

Add Swap Memory

You can add Swap memory in the server through creating a swap file. Determine the size of the new swap file in megabytes and multiply by 1024 to determine the number of blocks (here adding 2 GB to Swap): When you add a swap file, you leave existing alone, just swapon a new one. # dd if=/dev/zero of=/swapfile1 bs=1024 count=2097152   [bs=block size, count= 1024*2048(2gb)=2097152] # mkswap /swapfile1 # chown root:root /swapfile1 # chmod 0600 /swapfile1 # swapon /swapfile1 Now verify the added Swap memory : # free -m  # cat /proc/swaps  Notes:  1. No need of swapoff, if you swapoff the existing swap you can crash the host, because may be the system have not enough memory to take over the current swap in use. (always make sure RAM is free before going to do swapoff -a). 2. Making swap space changes persistent As with filesystems, changes made by swapon are not persistent; to have swap added at boot time, create a line in /etc/fstab like this: ...

High Load on *nix servers

To check and reduce the load, I am pasting the commands which will provide you the outputs concerned with high load. Accordingly, you can troubleshoot the issue to reduce the load. 1.Get server uptime with uptime command: $ uptime 2. Gather information like tasks, memory, cpu and swap through Top command: $ top -cd3 Use "Shift +m" to order the memory usage from maximum to minimum. You can use "Shift +o" to choose different options also. 3. See the Load average, memory usage and CPU usage with Sar command: $ sar $ sar -q $ sar -r 4. Check top 10 memory hungry processes using following command: $ ps auxxx --sort=-rss | head -11 5. Check top 10 cpu hungry processes using following command: $ ps auxxx --sort=-%cpu | head -11 6. Check mpstat result with following: $ /usr/bin/mpstat -P ALL 7. Check iostat with iostat command. $ iostat 8. Check free RAM on the server: $ free -m 9. Use pstree to look for any suspicious processes or u...

It's about Bangalore !!!

Hi Folks, This Blog is not technical, but about my new destination, Bangalore. Earlier I have worked in three different cities Jabalpur, Kochi and Mangalore but Bangalore seem different. The first thing you will notice about this city is It's awesome weather. If you have been in Bangalore, no need to explain it to you. When I reached Bangalore in the morning and put my first step on the Road, a cold breeze of Air has welcomed me with all its warm affection towards the newcomer. I must say, It was a pleasant morning, even after a tiresome journey from Mangalore to Bangalore. I found this city as Blend of different cultures and everything is going in Harmony. There are people from every corner of India. They celebrate every festival with the same Joy and Happiness what you find in your place. Currently, the Ganesha Chaturthi festival is in celebration here and its surprise to see the same ebullience and exhilaration as in Maharastra towards Bappa(Lord Ganesha). Further, I wa...

PHP functions checker code

<?php if (function_exists('imap_open')) {     echo "IMAP functions are available.<br />\n"; } else {     echo "IMAP functions are not available.<br />\n"; } if (function_exists('dir')){     echo "dir functions are available.<br />\n"; } else {     echo "dir functions are not available.<br />\n"; } if (function_exists('readdir')) {         echo "readdir functions are available.<br />\n"; } else {     echo "readdr functions are not available.<br />\n"; } if (function_exists('opendir')) {         echo "opendir functions are available.<br />\n"; } else {     echo "opendir functions are not available.<br />\n"; } if (function_exists('eval')) {         echo "eval functions are available.<br />\n"; } else {     echo "eval functions are not available.<br />\n"; } if ...

Steps to install Perl module in cPanel

Step 1. First export the following (replace username with the actual user): export PERL_MB_OPT='--install_base /home/username/perl5' export PERL_MM_OPT='INSTALL_BASE=/home/username/perl5' export PERL5LIB='/home/username/perl5/lib/perl5/i386-linux:/home/username/perl5/lib/perl5' export PATH="/home/username/perl5/bin:$PATH" Step 2. Then add those to the /home/username/.bashrc Step 3. Download the Module's file from the cpan website. Step 4. Untar it Step 5. Run: perl Makefile.pl && make && make install Step 6. chown installed files as necessary.

Speedup your website with Gzip on cPanel

Verify whether mod_deflate in installed or not on the server. It should be installed. $ httpd -l | grep mod_deflate If not, install it through easyapache. $ /scripts/easyapache Then add the following codes in .htaccess:  <IfModule mod_deflate.c>      <IfModule mod_setenvif.c>         BrowserMatch ^Mozilla/4 gzip-only-text/html         BrowserMatch ^Mozilla/4\.0[678] no-gzip         BrowserMatch \bMSIE !no-gzip !gzip-only-text/html        BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html     </IfModule>    <IfModule mod_headers.c>        Header append Vary User-Agent env=!dont-vary    </IfModule>   <IfModule mod_filter.c>      AddOutputFilterByType DEFLATE text/css application/x-javascript text/x-component text/html text/richtext image/svg+xml text/plain text/xs...

Login failed error in Webmail when access from cPanel

Issue: When you access your Webmail account from cPanel, its showing Login failed error Whilst, Webmail is accessible directly through Webmail URL or with Webmail port number. Fix: The issue may occurs due to the missing directory where session files are saved. You need to create the directory "/var/cpanel/cpses/keys" on the server in order to fix the issue.

cPanel AutoFix Scripts

cPanel comes with a number of hidden autofix commands that allow for administrators to fix common problems simply by logging into WHM and going to a special URL. Two of the most useful ones I’ve seen are flushing iptables and restarting SSH in safe mode. You will not find the ‘scripts2’ directory in your server. To run your hidden cpanel commands you will have to login to the WHM. Then you may go to the URL http://serverIP:2086/scripts2/autofixer From there you can type the autofixer scripts name. You will get the autofix commands from the link: http://httpupdate.cpanel.net/autofixer/ Here are some examples: Reset the Firewall Settings   https://serverIP:2087/scripts2/doautofixer?autofix=iptablesflush Reset the SSH Settings        http://serverIP:2086/scripts2/doautofixer?autofix=safesshrestart bsdbindfix                    http://serverIP:2086/scripts2/doautofixer?autofix=bsdbindfix Autorepair...

Bug in Mailman

Error:  We're sorry, we hit a bug! Please inform the webmaster for this site of this problem. Printing of traceback and other system information has been explicitly inhibited, but the webmaster can find this information in the Mailman error logs. Reason:   One of the reason for the issue is that the folders in /usr/local/cpanel/3rdparty/mailman is not having sufficient permission. Fix: You can perform the following steps to fix the issue: Go to /usr/local/cpanel/3rdparty/mailman and check the permission of all the folders. $ ls -al /usr/local/cpanel/3rdparty/mailman Try $ chmod -R 2775 ./*  Now the permission of folders must have changed. Check if this has fixed the issue.  If not, you can try running the fixmailman script in the server at /scripts.

Incorrect disk quota on WHM/cPanel

Issue:   Disk usage zero for all the domains in 'list accounts'  Reason: Mismatch between the disk usage in backend and Cpanel Fix: Check whether /home partition has been mounted with 'usrquota' option (defaults,usrquota in /etc/fstab) # cat /etc/fstab| grep home LABEL=/home  /home    ext3    defaults,usrquota  1 2 # quotacheck -c /home # quotaon /home Also Check the option WHM >> Server Configuration >> Tweak Settings >> System --- Disable Disk Quota display caching