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 / Ban|Hammer.md
Last active July 2, 2021 16:00
Bots de Telegram

AntiSpam

El AntiSpam consiste en el bloqueo de los mensajes que contengan el link de otro grupo o canal de Telegram. Puedes activar y configurar diversos parámetros enviando el comando /antispam en el grupo.

  • /lb add <canales o tglink>: Añade canales o tglinks a la lista blanca.
  • /lb del <canales o tglink>: Elimina canales o tglinks de la lista blanca.
  • /lb allow X: Respondiendo a un usuario y siendo la X un numero, le da a ese user la opcion de mandar X mensajes con spam sin que sea expulsado durante 10 minutos por defecto.
  • /lb allow X X: Respondiendo a un usuario y siendo la primera X el numero de mensajes a permitir y la segunda X el tiempo en minutos que dura el permiso, le da a ese user la opcion de mandar X mensajes con spam en el X tiempo especificado sin que sea expulsado.
@zoilomora
zoilomora / Run commands in Windows 10 from Linux.md
Created March 30, 2021 20:31
Run commands in Windows 10 from Linux

Run commands in Windows 10 from Linux

In many cases, it can be very useful to send a command to a Windows from Linux. In my case, I was given this need when trying to shutdown a computer remotely via command line and then integrate said command into Node-RED.

Take these simple steps and you can get them done quickly.

Install OpenSSH natively on Windows 10 with PowerShell

Follow the instructions given by Microsoft for the installation and configuration of the service: OpenSSH Install FirstUse.

@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

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 / 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 / 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,