Skip to content

Instantly share code, notes, and snippets.

View realtebo's full-sized avatar
💭
I may be slow to respond.

Mirko Tebaldi realtebo

💭
I may be slow to respond.
  • Somewhere over the raimbow
  • Ferrara, Italy
View GitHub Profile
@realtebo
realtebo / Instructions
Last active April 1, 2019 16:25
Backup of mysql on gdrive on a debian
#!/bin/bash
# Installation
su
apt-get install software-properties-common dirmngr
apt-add-repository 'deb http://shaggytwodope.github.io/repo ./'
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 7086E9CC7EC3233B
apt-get update
apt-get install drive
@realtebo
realtebo / init
Created April 2, 2019 10:00
Inizializzare un processore Nativescript vue correttamente
tns create Countdown --vue
cd Countdown
node_modules\.bin\update-ns-webpack --configs
tns doctor
@realtebo
realtebo / configurazione di esempio nginx
Last active May 2, 2019 07:58
Step per avviare un progetto laravel + vue
server {
listen 80;
listen 443 ssl http2;
server_name blablabla.local www.blablabla.local;
root /var/www/html/blablabla.com/public;
add_header X-Frame-Options "SAMEORIGIN";
@realtebo
realtebo / search.sh
Last active June 21, 2019 12:53
Search corrupted php file and fake icons
#!/bin/bash
EXIT_CODE=0
for cartella in $( ls -l /var/www | grep -e "^d" | awk '{ print $9 }'); do
echo "Scansione /var/www/$cartella ...."
for phpfile in $(find /var/www/$cartella -type f -iname '*.php'); do
@realtebo
realtebo / Install NCPA on a Debian 10 [on the remote machine to be controlled by nagios]
Last active November 25, 2020 17:01
Install NCPA on a Debian 10 [on the remote machine to be controlled by nagios]
# All steps on debian require root
# DO NOT TRY THIS ON DEBIAN 8 - It will not works !
# Note the `-`. Is important !
su -
cd /tmp
wget https://assets.nagios.com/downloads/ncpa/ncpa-latest.d9.amd64.deb
# NOTE: if you got this problem or similar :
# dpkg: warning: 'start-stop-daemon' not found in PATH or not executable
# you are not using `su -`.
@realtebo
realtebo / example config for a server without npa
Created August 19, 2019 07:27
example config for a server without npa
# this config file is an example of config file for handle
# remote host with nrpe insted of the new ncpa
# save this file on the controller, NOT on the controlled machine
define host {
host_name Server 212
address 212.271.149.146
check_command check-host-alive
max_check_attempts 5
@realtebo
realtebo / chustom_check_git
Created August 19, 2019 07:31
chustom_check_git
#!/bin/bash
cd /var/www/credit-sales
git status --porcelain | grep php >> /dev/null
if [ $? -gt 0 ]; then
echo "CRITICAL, folder credit-sales modified"
exit 2
fi
@realtebo
realtebo / Install NRPE (to remote host, NOT on the controller)
Last active June 17, 2021 08:59
Install NRPE (to remote host, NOT on the controller)
# Use nrpe on remote host instead of ncpa only if ncpa is not working
# this setup require BOTH nrpe AND plugins
# Use this when on debian 7/8
################
# NRPE #
################
# Execute all as super user !
@realtebo
realtebo / chustom_check_mem script for nrpe
Created August 19, 2019 07:36
chustom_check_mem script for nrpe
#### See https://support.nagios.com/forum/viewtopic.php?f=7&t=53059
# Save the content of the file into /usr/local/nagios/libexec/custom_check_mem
# - ownership root:nagios
# - permissions 755
#!/bin/bash
# Script to check real memory usage
# L.Gill 02/05/06 - V.1.0
# ------------------------------------------
# ######## Script Modifications ##########
@realtebo
realtebo / Example of nginx configuration for nagios - nagios.conf
Last active April 2, 2021 15:41
Example of nginx configuration for nagios - nagios.conf
server {
#### NOTE: UPDATE THE DOMAIN ACCORDING TO YOUR SETUP ####
server_name nagios.test;
#### NOTE: UPDATE THE PATH ACCORDING TO YOUR SETUP ####
#### This is my Debian 10 vps ####
#### Some systems uses /usr/share/nagios/share ####
root /usr/local/nagios/share;