How to send html-formatted email

Short answer: sending .html-formatted email is rather easy, even from a local laptop. But there can be difficulties, which are not avoided easily. To begin with, the short and (hopefully) working answer:

Mac OS | CentOS | Debian

cat letter.html | mail -s "$(echo -e "Testing email\nContent-Type: text/html")" login@example.com

Make sure you check the SPAM folder, as it has nearly 0 chance of getting through to your mailbox from scratch. If it doesn’t work out, you’ll have to go deeper.

… 

 

Nagios doesn’t start / internal service error / PID unfound

Nagios web-interface can fail to connect to process or to display any content at all. There can be different source of the problem, but the key to solving it:

  1. Checking permissions on the cgi-bin, fcgi-bin folders and scripts inside /nagios path.
  2. Checking Suexec log if you use it (`/var/log/apache2/suexec.log` for example).
  3. Checking access mode on statusjson.cgi and status.cgi

In case it doesn’t help, and nagios simply refuses to start, showing only:

Running configuration check...
or
Starting nagios:.

You have to manually run configuration check with the -v flag:

/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg

If the check is correct, but nags refuses to run, providing no info in {path}/var/nagios.log and not creating {path}/var/nagios.lock, then the problem might be in the device space.

 

How to set up a ssh connection from Host to Guest VirtualBox

  1. VM’s Settings -> System -> check “Enable I/O APIC.”
  2. Shut the guest down, and use VirtualBox Settings to enable a second virtual network adapter, named (by default) vboxnet0.
  3. Inside Guest edit /etc/network/interfaces file or analogue and append the following lines:
    auto eth1
    iface eth1 inet dhcp
    
    

    or

    allow-hotplug eth1
    iface eth1 inet dhcp
  4. In Guest start the interface: ifup eth1
  5. Test ssh root@[ip address from ifconfig in Guest] from Host system.
  6. Make sure you have root login enabled in Guest /etc/sshd_config settings.

	    		
 

Connecting to kernel jupyter/ipython error

There is a possibility, that you get

404 GET /nbextensions/widgets/notebook/js/extension.js

error in console and «Сonnecting to kernel»  or «No kernel» message in the web interface, this might be because of your browser bug. Try disabling adblock or using another browser.