Friday, December 9, 2016

ssh error - Agent admitted failure to sign using the key


Solution : 1

ssh login using command

SSH_AUTH_SOCK=0 ssh server-ip

Example : SSH_AUTH_SOCK=0 ssh username@192.168.0.xx


Solution : 2

Run Command
ssh-add

Ubuntu Boot Error - Fixing Recursive Fault Issue


Solution :

sudo nano /etc/default/grub
Change the line
GRUB_CMDLINE_LINUX_DEFAULT=”quiet splash” 
to
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash acpi=off"
And then update grub
sudo update-grub

Monday, November 14, 2016

PHP Parse error: syntax error, unexpected '$value' (T_VARIABLE)

PHP Parse error:  syntax error, unexpected '$value' (T_VARIABLE)

If you are getting this error for specific php keywords used in code like yield, you need to upgrade your php version. May be you have php 5.4 or lower version, upgrade it to php 5.5 or php 5.6 or higher.

PHP Fatal error: Call to undefined function mb_strpos()


Solution :

php-mbstring package is not installed on your Linux distribution.

Install it.

If you are using Debian or Ubuntu
sudo apt-get install libapache2-mod-php5
If you are using Fedora or CentOS
yum install php-mbstring

Restart apache and try again.

date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone.

Set following value in php.ini file


date.timezone = 'Asia/Kolkata'

It depends on your timezone. Set your timezone in php.ini
You may face this error if this line is commented.

Restart Apache and try again.

SQLSTATE[HY000]: General error: 1364 Field doesn't have a default value

Solution :

Go on mysql prompt and run following command.


mysql> SET GLOBAL sql_mode=''

Make sure no value has been set for attribute sql_mode in the file my.cnf.

Monday, October 10, 2016

mysql default current_timestamp error

The DEFAULT CURRENT_TIMESTAMP support for a DATETIME (datatype) was added in MySQL 5.6.

It is now possible to achieve this with DATETIME fields since MySQL 5.6.5

Previous versions can't do that with DATETIME.But you can do it with TIMESTAMP.


Upgrade your mysql with this version and you will not get this error again.

Ubuntu : apt-get upgrade : ubuntu The following packages have been kept back

Solution :

To solve this issue, Run command :

sudo apt-get dist-upgrade

Ubuntu 16.04 - Enable ssh root login

Steps :

a) Edit file /etc/ssh/sshd_config
sudo nano /etc/ssh/sshd_config

b) Change following attribute.
FROM:
PermitRootLogin prohibit-password
TO:
PermitRootLogin yes


c) sudo service ssh restart

gitlab large size files push issue

error: RPC failed; result=22, HTTP code = 413
fatal: The remote end hung up unexpectedly, gitlab large file size push issue

Steps :

1) Upgrade gitlab with latest version. Right now current version is 8.12.4

2) Increase file size in /etc/gitlab/gitlab.rb under nginx section.
  nginx['enable'] = true
  nginx['client_max_body_size'] = '250m'


3) Increase max attachment size in http://gitlab.domain/admin/application_settings


4) Reconfigure gitlab and restart system.

Tuesday, September 6, 2016

Netbeans : Next button of installer is not working

If you are trying to install Netbeans on Ubuntu 15.10 and Next button of the installation wizard is disabled so you are not able to install Netbeans. Here is the solution for you.

Install : oracle-java8-installer to solve above issue

sudo apt-add-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java8-installer

Now try to install Netbeans again. Next button of the wizard should be enabled now.

Friday, August 5, 2016

windows 7 and ubuntu dual boot : windows 7 boots in background but showing distorted screen of ubuntu

If you have installed Windows 7 and Ubuntu as a dual boot and when you boot windows 7, it loads a distorted screen of Ubuntu although you can hear the windows 7 start up sound but you are not able to do anything because nothing is displayed.

Here is the solution.
sudo nano /etc/default/grub
Now Uncomment following line.
GRUB_TERMINAL="console"

Update the grub.
sudo update-grub

Restart your system.
sudo reboot

Thursday, August 4, 2016

ejabberd Error : large number of users are crashing ejabberd

CRASH REPORT Process  with 0 neighbours exited with reason: {process_limit,{max_queue,}} in p1_fsm:terminate/8 line

CRASH REPORT Process <0.645.0> with 0 neighbours exited with reason: {process_limit,{max_queue,2706}} in p1_fsm:terminate/8 line 755

Solution : 1
May be, you have added all your users under one shared roster group. If you remove the group, you will not get the error again.

But if you remove the shared roster group, your users will not be able to see the other users in client like pidgin.
 
If you create multiple shared roster groups, Users of one group will not be able to see users of other group so they can not chat with each other. Bad Idea.

Solution : 2
In your shared roster group, you might have used @all@ parameter to add all users in one group. ejabberd is trying to list all users at once and it is crashing in this process.

You can change @all@ to @online@. Now ejabberd lists all online users only and this is definitely less than total number of users. In this condition ejabberd has less load and chances of crashing is less too.

But you have really a big database and you have 2000-3000 users are online simultaneously, then you should try solution 3.


Solution : 3
Add attribute
max_fsm_queue: 10000
under section port 5222: in the ejabberd.yml config file in following way
listen:
-
    port: 5222
    module: ejabberd_c2s4
    certfile: "/home/ubuntu/ejabberd-16.06/conf/server.pem"
    starttls: true
    resume_timeout: 0
    protocol_options:
      - "no_sslv3"
    max_stanza_size: 65536
    shaper: c2s_shaper
    access: c2s
    max_fsm_queue: 10000
  Restart ejabberd.

You should not get this error again.

Ubuntu boot error : fixing recursive fault but reboot is needed


While booting ubuntu, you are not able to reach upto Login screen. It appears with long list of errors and finally you get "fixing recursive fault but reboot is needed"

Solution :
Boot ubuntu in recovery mode and open command prompt
Now edit following grub file.


sudo nano /etc/default/grub
Change the line

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash" 
to
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash acpi=off"
sudo update-grub
sudo reboot

You should not get the error again and Login screen should be opened successfully.

Friday, July 8, 2016

ejabberd : Other users are not visible after login


Uncomment line

{mod_shared_roster,[]},

in config file of ejabberd and restart ejabberd.

config file - /etc/ejabberd/ejabberd.cfg 

Now you can see option "shared roster group".

Create a group and add users in the group. You can see all users of same group after login.

Thursday, June 9, 2016

ejabberd : No other options except virtualhosts in admin

ejabberd : All links missing, partial admin appears

sudo nano /etc/ejabberd/ejabberd.cfg


Find lines
{acl, admin, {user, "", "localhost"}}.
%% Hostname
{hosts, ["localhost"]}.


and replace it with


{acl, admin, {user, "admin", "localhost"}}.
%% Hostname
{hosts, ["localhost"]}.




Restart ejabberd

Friday, May 6, 2016

ERROR: S3 error: 400 (InvalidRequest): The authorization mechanism you have provided is not supported. Please use AWS4-HMAC-SHA256.

Solution :
Your s3cmd has older version, you need to upgrade it. Download latest one and use the file everywhere.
https://sourceforge.net/projects/s3tools/files/s3cmd/1.6.1/
I faced this problem on 1.1 version of s3cmd, I downloaded latest and got 1.6. After that I did not get the error.


How to use the downloaded folder.
1) Extract the folder and open it.
2) Now run your s3cmd command using this downloaded folder.
 /home/ubuntu/s3cmd-1.6.1/s3cmd ls s3://

/home/ubuntu/s3cmd-1.6.1/s3cmd -c /home/ubuntu/.s3cfg put /tmp/file.sql s3://bucketname


Server reached MaxRequestWorkers setting, consider raising the MaxRequestWorkers setting

There are three modules related to this settings. 
prefork, worker and event

First find which module is activated using

a2query -M

Now change its conf file in mods-available. 

In following case, prefork is enabled, so make changes in mpm_prefork.conf

Open file mpm_prefork.conf and increase the MaxRequestWorkers settings according to your RAM.

MaxRequestWorkers
A simple calculation for MaxRequestWorkers would be: 

(Total Memory – Critical Services Memory) / Size Per Apache process

In this case the server has 3400Mb of memory allocated, 

250Mb used by mySQL and each Apache thread averages about 30Mb. 
MaxRequestWorkers = (3400– 250) / 30
therefore MaxRequestWorkers = 105

Restart Apache. Check here too.