How to get ip address of a server on Centos 7 in bash

You can use hostname command : ipaddr=$(hostname -I) -i, –ip-address: Display the IP address(es) of the host. Note that this works only if the host name can be resolved. -I, –all-ip-addresses: Display all network addresses of the host. This option enumerates all configured addresses on all network interfaces. The loopback interface and IPv6 link-local addresses … Read more

PHP Warning: Module already loaded in Unknown on line 0

I think you have loaded Xdebug probably twice in php.ini. check the php.ini, that not have set xdebug.so for the values extension= and zend_extension=. Check also /etc/php5/apache2 and /etc/php5/cli/. You should not load in each php.ini in these directories the extension xdebug.so. Only one file, php.ini should load it. Note: Inside the path is the … Read more

“psql: could not connect to server: Connection refused” Error when connecting to remote database

cd /etc/postgresql/9.x/main/ open file named postgresql.conf sudo vi postgresql.conf add this line to that file listen_addresses=”*” then open file named pg_hba.conf sudo vi pg_hba.conf and add this line to that file host all all 0.0.0.0/0 md5 It allows access to all databases for all users with an encrypted password restart your server sudo /etc/init.d/postgresql restart

How to install pip in CentOS 7?

The easiest way I’ve found to install pip3 (for python3.x packages) on CentOS 7 is: $ sudo yum install python34-setuptools $ sudo easy_install-3.4 pip You’ll need to have the EPEL repository enabled before hand, of course. You should now be able to run commands like the following to install packages for python3.x: $ pip3 install … Read more

How to redirect output of systemd service to a file

I think there’s a more elegant way to solve the problem: send the stdout/stderr to syslog with an identifier and instruct your syslog manager to split its output by program name. Use the following properties in your systemd service unit file: StandardOutput=syslog StandardError=syslog SyslogIdentifier=<your program identifier> # without any quote Then, assuming your distribution is … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)