Installing iptables-persistent on OVH kimsufi

If you try to sudo apt-get install iptables-persistent on you may get this error:

root@mothership:~# apt-get install netfilter-persistent
Reading package lists... Done
Building dependency tree
Reading state information... Done
netfilter-persistent is already the newest version.
The following package was automatically installed and is no longer required:
  bind9utils
Use 'apt-get autoremove' to remove it.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
2 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y
Setting up netfilter-persistent (1.0.3) ...
update-rc.d: warning: start and stop actions are no longer supported; falling back to defaults
A dependency job for netfilter-persistent.service failed. See 'journalctl -xn' for details.
invoke-rc.d: initscript netfilter-persistent, action "start" failed.
dpkg: error processing package netfilter-persistent (--configure):
 subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of iptables-persistent:
 iptables-persistent depends on netfilter-persistent (= 1.0.3); however:
  Package netfilter-persistent is not configured yet.

dpkg: error processing package iptables-persistent (--configure):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 netfilter-persistent
 iptables-persistent
E: Sub-process /usr/bin/dpkg returned an error code (1)

Sep 02 18:45:31 mothership.installgentoo.com systemd-modules-load[12122]: Failed to lookup alias 'ipmi_poweroff':
Sep 02 18:45:31 mothership.installgentoo.com systemd-modules-load[12122]: could not open moddep file '/lib/module
Sep 02 18:45:31 mothership.installgentoo.com systemd-modules-load[12122]: Failed to lookup alias 'ipmi_si': Funct
Sep 02 18:45:31 mothership.installgentoo.com systemd-modules-load[12122]: could not open moddep file '/lib/module
Sep 02 18:45:31 mothership.installgentoo.com systemd-modules-load[12122]: Failed to lookup alias 'ipmi_watchdog':
Sep 02 18:45:31 mothership.installgentoo.com systemd[1]: systemd-modules-load.service: main process exited, code=
Sep 02 18:45:31 mothership.installgentoo.com systemd[1]: Failed to start Load Kernel Modules.

To resolve you have to edit the file:

/usr/lib/modules-load.d/ipmievd.conf

and comment out like so:

#ipmi_devintf
#ipmi_msghandler
#ipmi_poweroff
#ipmi_si
#ipmi_watchdog

then reboot

nginx fail to install Debian 8 Jessie

After you sudo apt-get install nginx-full and you get this:

nginx: Setting up nginx-full (1.9.2-1) ...
nginx: Starting nginx: nginx failed!
nginx: invoke-rc.d: initscript nginx, action "start" failed.
nginx: dpkg: error processing nginx-full (--configure):
nginx: subprocess installed post-installation script returned error exit status 1
nginx: dpkg: dependency problems prevent configuration of nginx:
nginx: nginx depends on nginx-full (>= 1.9.2-1) | nginx-light (>= 1.9.2-1) | nginx-extras (>=
1.9.2-1); however:
nginx: Package nginx-full is not configured yet.
nginx: Package nginx-light is not installed.
nginx: Package nginx-extras is not installed.
nginx: nginx depends on nginx-full (<< 1.9.2-1.1~) | nginx-light (<< 1.9.2-1.1~) | nginx-extras
(<< 1.9.2-1.1~); however:
nginx: Package nginx-full is not configured yet.
nginx: Package nginx-light is not installed.
nginx: Package nginx-extras is not installed.
nginx:
nginx: dpkg: error processing nginx (--configure):
nginx: dependency problems - leaving unconfigured
nginx: Errors were encountered while processing:
nginx: nginx-full
nginx: nginx
nginx: E: Sub-process /usr/bin/dpkg returned an error code (1)
Failed nginx install.
Skipped nginx config, due to presence in failed steps
1 steps selected, 1 failed.
Failed steps: nginx

All you need to do is remove:

listen [::]:80 default_server;

from /etc/nginx/sites-enabled/default.

This is caused if you server does not support IPv6 but nignx is trying to listen on it.

node.js on Debian

After installing node.js and npm and you go to run a node application you get this error:

sh: 1: node: not found
npm ERR! error installing chokidar@0.4.0
npm WARN This failure might be due to the use of legacy binary "node" 
npm WARN For further explanations, please read
npm WARN /usr/share/doc/nodejs/README.Debian
npm WARN

This is because in debian nodejs installs to /usr/bin/nodejs while the script/program is looking for /usr/bin/node.

To fix just run:

sudo ln -s /usr/bin/nodejs /usr/bin/node