Using PhpMyAdmin to administer a remote server

Imagine the following set-up:

Local machine with Debian 9/10, or Ubuntu, or Linux Mint.

Local machine with MySQL server (which would be MariaDB in this case) and with PhpMyAdmin. One can access http://localhost/phpmyadmin.

In order to access a remote server, we need to do the following:

sudo vi /etc/phpmyadmin/config.inc.php

Add following lines at the end:

$i++;
$cfg['Servers'][$i]['host'] = '10.10.10.11';
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = 'rootpassword';
$cfg['Servers'][$i]['auth_type'] = 'config';

In case you want to provide a default language, add following after the blowfish section:

$cfg['Lang'] = 'en';

(I didn’t see any useful improvement in putting this, just mention it for those that want their server to behave independently of their locale setting.)

On the remote server, you will need to allow the root user to connect and to open the firewall port on 3306. Please modify the network segment from which remote access is allowed and the rootpassword in below script to suit your configuration.

Script for CentOS 6.x

iptables -A INPUT -i eth0 -p tcp -s 192.168.0.0/24 --dport 3306 -m state --state NEW,ESTABLISHED -j ACCEPT
iptables -A OUTPUT -o eth0 -p tcp --sport 3306 -m state --state ESTABLISHED -j ACCEPT

mysql -u root -p
mysql> GRANT ALL PRIVILEGES ON . TO 'root'@'%' IDENTIFIED BY 'rootpassword';

In case you want to connect to a remote server with MySQL< 5.5, you will have to do an upgrade to version 5.5. Otherwise, the latest phpMyAdmin won’t connect. See separate post.

C++ rant

Please consider the following standard C++ program.

#include <iostream>
using namespace std;
main(){
  cout << "Hello, World!";
  return 0;
}

What is wrong with this?

  1.  include statement: we are including a header or a piece of source code, why isn’t it called iostream.h?
  2. using namespace std: if standard, it could be omitted and considered standard because it has not been mentioned.
  3. main function: why there are no parameters in it
  4. return statement: do we assume the function has been defined as int….

Ideal version, in my opinion…. but opinions are subjective

#include <iostream.h>

int main(int argc, char *argv[], char *env[]){
  cout << "Hello, World!";
  return 0;
}

 

Hotspot detection

How to set-up hotspot.

Firefox URL: http://detectportal.firefox.com/success.txt

Google Chrome URL: connectivitycheck.gstatic.com/generate_204

Edge URL:

Internet Explorer URL:

Opera URL:

Chomium URL: chrome.google.com

Dolphin URL:

Observium disk full

If your graphs are showing with ‘graph error’ and your disk is almost full, please follow the instructions below.

Add extra disk to your VM or to your machine and type following commands with root privileges.

# display disk name
fdisk -l

# create partition
fdisk /dev/sdb

# type n enter enter enter enter w enter
# means new partition, default values accept, and write out changes

# extend physical volume group
vgs
vgextend observium-vg /dev/sdb1

# extend size in volume group and resize file system
lvextend -L +19G /dev/mapper/observium--vg-root
resize2fs /dev/mapper/observium--vg-root

# check everything is ok
df -k

# now regenerate graphs that were missing
cd /opt/observium
php discovery.php -h all
php poller.php -h all

Above assumes you are adding a second disk of 20 GB. sdb and +19G might need to change if your configuration is different.

Site moved

This site has moved, please update all your links from http://www.internetcontact.be/scm to http://scm.internetcontact.be.