SYSTEMD – controls

Starting with Ubuntu 15.04, Upstart will be deprecated in favor of Systemd. With Systemd to manage the services we can do the following:

systemctl start SERVICE – Use it to start a service. Does not persist after reboot

systemctl stop SERVICE – Use it to stop a service. Does not persist after reboot

systemctl restart SERVICE – Use it to restart a service

systemctl reload SERVICE – If the service supports it, it will reload the config files related to it without interrupting any process that is using the service.

systemctl status SERVICE – Shows the status of a service. Tells whether a service is currently running.

systemctl enable SERVICE – Turns the service on, on the next reboot or on the next start event. It persists after reboot.

systemctl disable SERVICE – Turns the service off on the next reboot or on the next stop event. It persists after reboot.

systemctl is-enabled SERVICE – Check if a service is currently configured to start or not on the next reboot.

systemctl is-active SERVICE – Check if a service is currently active.

systemctl show SERVICE – Show all the information about the service.

sudo systemctl mask SERVICE – Completely disable a service by linking it to /dev/null; you cannot start the service manually or enable the service.

sudo systemctl unmask SERVICE – Removes the link to /dev/null and restores the ability to enable and or manually start the service.

Just copied notes. 😉 nJoy

Resizing a disk once the volume has grown on host in a VM (Ubuntu)

The disk will not automatically resize on many platforms once more disk space was made available.

Particularly in Ubuntu 16.04

Rescanning the device for size maps :

echo 1 > /sys/class/scsi_device/2\:0\:0\:0/device/rescan

Then standard procedures to grow the fs apply.

nJoy 😉

 

 

Cool chkconfig replacement for Ubuntu

Hi,

 

Ubuntu does not carry chkconfig any more ..

besides the standard

update-rc.d apache2 defaults

or

update-rc.d apache2 remove

There is a cool tool called : sysv-rc-conf.

This tool can be installed using :

sudo apt-get install sysv-rc-conf

On its own the command opens a cool ncurses interface like this :

 

 

 

 

 

 

 

 

 

It can Also be used in scripts as :

sysv-rc-conf atd <on or off> and --levels;

man sysv-rc-conf

Will give you some love..

nJoy 😉

 

 

Reboot required Ubuntu

To find out what triggered this use :

more /var/run/reboot-required.pkgs

nJoy 😉

Disabling IPv6, breaks SSH X11 Forwarding in Linux CENTOS and UBUNTU all versions

This was a weird one. It took me ages to discover why SSH X11 died at some point after tuning a box.

It so happens that disabling IPv6 ( not used on my networks) is assumed in SSH at some point and if you disable it (which many people say is a way to avoid systems using IPv6 to other boxes and ignore IPv4 provisions like firewall settings, routes etc..)

So re-enable the IPv6 in /etc/sysctl.conf or /etc/sysconfig/network or other networking script locations, if you need this functionality.

If i find any other counter indication I’ll drop a note and link.

nJoy 😉

How to allow includes, Basic Auth from outside .htaccess

This .htaccess file does the following:

Allow SSI lines 1/2/3

Reauire Authenitcation for all outside except those from a particular IP the rest ..

Options +Includes      
AddType text/html .shtml .html
AddOutputFilter INCLUDES .shtml .html
AuthType Basic
AuthName “Password Required For INGG Monitor”
AuthUserFile /var/www/passwords/password.file
Require valid-user
Order deny,allow
Deny from all
Allow from 323.365.376.398
Satisfy any
Header set Access-Control-Allow-Origin “*”
~

 

you need to enable the headers module (mod_Headers)

In Ubuntu :

cd /etc/apache2/mods-enabled/

ln -s ../mods-available/headers.load headers.load 

nJoy 😉

 

Installing and configuring Postfix Ubuntu 10.04

Introduction

Postfix is the default Mail Transfer Agent (MTA) for Ubuntu. It is in Ubuntu’s main repository, which means that it receives security updates. This guide explains how to install and configure postfix and set it up as an SMTP server using a secure connection.

 

What is a Mail Transfer Agent

In other words, it’s a mail server not a mail client like Thunderbird, Evolution, Outlook, Eudora, or a web-based email service like Yahoo, GMail, Hotmail, Earthlink, Comcast, SBCGlobal.net, ATT.net etc…. If you worked for a company named Acme and owned acme.com, you could provide your employees with email addresses @acme.com. Employees could send and receive email through your computer, but not without your computer running all the time. If all your email addresses are at a domain (@gmail.com, @yahoo.com) you do not own (you don’t own Google) or do not host (acme.com) then you do not need this at all.

(more…)