Skip to content

Instantly share code, notes, and snippets.

View zoilomora's full-sized avatar
🏠
Working from home

Zoilo Mora zoilomora

🏠
Working from home
View GitHub Profile
@zoilomora
zoilomora / failover.rst
Last active February 5, 2021 08:32
Failover with MikroTik

# ------------------- header ------------------- # Base script created by # Script by Tomas Kirnak, version 1.0.7 # If you use this script, or edit and # re-use it, please keep the header intact. # # For more information and details about # this script please visit the wiki page at # http://wiki.mikrotik.com/wiki/Failover_Scripting

@zoilomora
zoilomora / loop.sh
Created March 30, 2020 08:52
Script to execution loop with output if it fails
#!/bin/sh
set -e
while true
do
eval "$@"
done
@zoilomora
zoilomora / README.md
Last active May 28, 2023 17:22
Configure Forwarded DNS in MikroTik

Configure Forwarded DNS in MikroTik

Stages

My house MikroTik runs a permanent tunnel to the offices of my job. DHCP configures the devices to send DNS requests to MikroTik, which then sends the requests to Google or forwards them to the DNS server of my job.

Job intranet = intranet.job.local
Job DNS Server = 192.168.90.1
@zoilomora
zoilomora / README.md
Last active May 31, 2024 22:47
How to disable cloud-init in Ubuntu

How to disable cloud-init in Ubuntu

Prevent start

  • Create an empty file to prevent the service from starting

      sudo touch /etc/cloud/cloud-init.disabled
    

Uninstall

@zoilomora
zoilomora / README.md
Last active May 13, 2024 16:49
How to disable systemd-resolved in Ubuntu

How to disable systemd-resolved in Ubuntu

Stages

  • Disable and stop the systemd-resolved service:

      sudo systemctl disable systemd-resolved.service
      sudo systemctl stop systemd-resolved
    
  • Then put the following line in the [main] section of your /etc/NetworkManager/NetworkManager.conf:

mdadm

Glossary:

  • md: multiple devices
command description
cat /proc/mdstat show status of all raids
mdadm --detail /dev/md0 detailed status of raid md0
@zoilomora
zoilomora / command_generator.php
Created October 14, 2018 19:13
Descargar canciones de la "Lista LOS40" - Los 40 Principales
<?php
$data = json_decode(file_get_contents('./data.json'));
$result = '';
foreach ($data->songs as $song) {
$ffmpegCommand = sprintf(
'ffmpeg -ss %s -t %s -i {} \"%s.mp3\" && rm {}',
$song->start,
$song->duration,