Slow boot ElementaryOS on MacBook 4,1

# vi /etc/default/grub

Then add the kernel boot parameter: video=SVIDEO-1:d, so it will look like this: GRUB_CMDLINE_LINUX_DEFAULT="quiet splash video=SVIDEO-1:d"

  • update-grub
  • reboot

Also, to get rid of

Failed to Set MokListRT: Invalid Parameter
sudo su -
cd /boot/efi/EFI/ubuntu
cp grubx64.efi shimx64.efi
reboot

To install wifi drivers simply

sudo ubuntu-drivers autoinstall

To silence the fan

 apt-get install macfanctld

edit /etc/macfanctl.conf

and make sure that you replace these lines:

temp_avg_floor: 55 #45
temp_avg_ceiling: 65 #55

temp_TC0P_floor: 55 #50
temp_TC0P_ceiling: 65 #58

temp_TG0P_floor: 55 #50
temp_TG0P_ceiling: 65 #58

Once you have edited you only have to restart macfanctl daemon just like:

service macfanctld restart

Refresh security yum info

First, refresh all security info

subscription-manager refresh
yum clean all
yum repolist
yum updateinfo summary
yum updateinfo list security
yum updateinfo list available
yum updateinfo list bugzillas
yum updateinfo list security all
yum updateinfo list sec

Then you can apply only security updates

yum --security update

If you have the CVEs in a file

yum -y update `cat cves |while read c;do echo " --cve $c ";done|xargs`

reference: https://access.redhat.com/solutions/10021

Nagios Event Handlers

Restarting-Linux-Services-With-NRPE
https://assets.nagios.com/downloads/nagiosxi/docs/Restarting-Linux-Services-With-NRPE.pdf

At each monitored server
————————
Add this line to /usr/local/nagios/etc/nrpe.cfg :
command[service_restart]=sudo service $ARG1$ restart 2>&1

And give nagios permissions to execute service
echo “nagios ALL = NOPASSWD: `which service`” > /etc/sudoers.d/nagios

At the Nagios XI server
———————–
– Test with
/usr/local/nagios/libexec/check_nrpe -H 10.25.13.34 -c service_restart -a apache2
– add these contents to /usr/local/nagios/libexec/service_restart.bash
#!/bin/bash
case “$1” in
OK)
;;
WARNING)
;;
UNKNOWN)
;;
CRITICAL)
/usr/local/nagios/libexec/check_nrpe -H “$2” -c service_restart -a “$3”
;;
esac
exit 0

– set permissions
chown apache:nagios /usr/local/nagios/libexec/service_restart.bash
chmod 775 /usr/local/nagios/libexec/service_restart.bash

-test
/usr/local/nagios/libexec/service_restart.sh CRITICAL 10.25.13.34 apache2

– Create a “command” in the core config mannager with this command line:
$USER1$/service_restart.sh $SERVICESTATE$ $HOSTADDRESS$ $_SERVICESERVICE$
Also select “misc_command” from command type

– Update a service adding the event handler

– in the misc settings add a “free variable”
_SERVICE apache2

Read:
https://assets.nagios.com/downloads/nagioscore/docs/nagioscore/3/en/eventhandlers.html#example
http://www.techadre.com/content/nagios-event-handler-restart-remote-service

Nagios event handlers for NRPE


https://assets.nagios.com/downloads/nagioscore/docs/nagioscore/3/en/objecttricks.html

install nagios xi agent

for ElementaryOS

# apt install xinetd libssl-dev build-essential
# cd /tmp; wget https://assets.nagios.com/downloads/nagiosxi/agents/linux-nrpe-agent.tar.gz
# tar zxvf linux-nrpe-agent.tar.gz
# cd linux-nrpe-agent
# vi fullinstall
(after the 4th line insert a line distro=Ubuntu)
# ./fullinstall

Docker cheat sheet

# docker version
# docker info
# docker run hello-world
# docker ps
# docker ps -a
# docker images
(image=non-running vm)
(container=running image)
# docker pull alpine
# docker pull ubuntu
# docker pull ubuntu:14.04

To remove an image
# docker rmi ubuntu:14.04

To stop a container
# docker stop ubuntu

Start ubuntu container, name it temp, connect to it
# docker run -it –name temp ubuntu:latest /bin/bash
(to exit the console type ctrl-p-q)

Stop all containers
# docker stop $(docker ps -aq)

Remove all containers
# docker rm $(docker ps -aq)

Remove all images
# docker rmi $(docker images -q)