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 / 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 / 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 / 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 / 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 / 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 / Nagios 4.4.6 + plugins 2.3.3 on Debian 10 and nginx
Last active May 6, 2021 09:59
Nagios Core 4.4.6 + Nagios plugins 2.3.3 on Debian 10 with Nginx
# Source of truth
# https://support.nagios.com/kb/article/nagios-core-installing-nagios-core-from-source-96.html#Debian
# About nginx installation
# https://olivertappin.com/command-line-tools/installing-nagios-nginx-php-fpm-nagiosgraph-ubuntu-16-04/
# All steps on debian require root AND `-` to use full env
su -
# Prerequisites
@realtebo
realtebo / service-worker.js
Created November 16, 2018 20:06
Portion of service-worker.js
server.get("/service-worker.js", (req, res) => {
// Don't cache service worker is a best practice (otherwise clients wont get emergency bug fix)
res.set("Cache-Control", "no-store, no-cache, must-revalidate, proxy-revalidate");
res.set("Content-Type", "application/javascript");
const filePath = join(__dirname, '.next', req.url);
app.serveStatic(req, res, filePath);
});
@realtebo
realtebo / service-worker.js
Created November 15, 2018 08:04 — forked from cristoni/service-worker.js
Esempio di service worker con workbox per workbox-webpack-plugin
if (workbox) {
console.log(`Yay! Workbox is loaded 🎉`);
// workbox.setConfig({ debug: false });
// workbox.precaching.suppressWarnings();
workbox.precaching.precacheAndRoute(self.__precacheManifest, {});
workbox.routing.registerRoute(/^https?.*/, workbox.strategies.networkFirst(), 'GET');
} else {
console.log(`Boo! Workbox didn't load 😬`);
}
@realtebo
realtebo / readme.md
Last active August 11, 2018 20:35
Add a new PiHole
  1. Clone Ubuntu base VM

  2. Assign IP to the new machine (read MAC at assign using DHCP)

  3. Add the ip to ansible [dns] group, in the file /etc/ansible/hosts

  4. Login with default username and password

  5. Enble SSH auth via password to allow first ansible login

       sudo sed -i 's/PasswordAuthentication no/PasswordAuthentication yes' /etc/ssh/sshf_config
    
  6. Restart

  7. From ansible controller, check

@realtebo
realtebo / Dockerfile
Last active August 9, 2018 12:24
Start with docker + laravel
FROM php:7.0.4-fpm
RUN apt-get update && apt-get install -y libmcrypt-dev \
mysql-client libmagickwand-dev --no-install-recommends \
&& pecl install imagick \
&& docker-php-ext-enable imagick \
&& docker-php-ext-install mcrypt pdo_mysql