Skip to content

Instantly share code, notes, and snippets.

View cristianmenghi's full-sized avatar
🎯
Focusing

Cristian Menghi cristianmenghi

🎯
Focusing
View GitHub Profile
@cristianmenghi
cristianmenghi / routes_monitor.rsc
Last active October 17, 2023 21:38
route monitoring script, for 2 internet connections, which notifies in case of failure.
# Main interface name
:global MainIf WAN-FTTH
# Reserve interface name
:global RsrvIf WAN-LTE
:local PingCount 5
:local PingTargets1 {"1.1.1.1";"8.8.8.8"};
:local PingTargets2 {"1.0.0.1";"8.8.4.4"};
:local MESSAGE "ROUTE DOWN"
:local DATE [/system clock get date]
@cristianmenghi
cristianmenghi / remove_bg.py
Created October 13, 2023 19:25
Remove background
import argparse
from rembg import remove # pip install rembg
from PIL import Image
def main():
parser = argparse.ArgumentParser(description="Remove background from an image using rembg")
parser.add_argument("input_path", help="Input image file path")
parser.add_argument("output_path", help="Output image file path")
args = parser.parse_args()
#!/bin/sh
print_usage() {
echo "Usage:"
echo " Create a top level structure: 'create_ansible_structure.sh [TOP_DIRECTORY_PATH]'"
echo " Create a role structure: 'create_ansible_structure.sh role [TOP_DIRECTORY_PATH] [ROLE_NAME]'"
}
error() {
echo "Error: ${1}"

Mikrotik>Telegram

Pequeño script para mandar mensajes al bot Telegram, así podemos detectar o monitorear cambios de los cuales queremos enterarnos.

Este ejemplo notifica del cambio de estado de un puerto.

El TELEBOTID es el ID de bot cuando lo crearmos con el @botFather El TELECHATID lo obtenes con el @getmyid_bot

Lo importanet son las 2 primeras lineas y la ultima, en el medio se puede poner cualquier info o el resultado de cualquier operacion de Mikrotik y guardan el mensaje en "enviar"

@cristianmenghi
cristianmenghi / gist:c1a460fa9a91970e8ba9043e555b8686
Created February 13, 2019 21:20 — forked from dexalex84/gist:334bdd189dd923a63e80c45300fb30be
Pentaho BA CE 7.0 Install with PostgreSQL repo DB on CentOS
Pentaho BA 7.0 Install with PostgreSQL repo DB
INSTALL POSTGRES
https://wiki.postgresql.org/wiki/YUM_Installation
1) find
/etc/yum.repos.d/CentOS-Base.repo
vi /etc/yum.repos.d/CentOS-Base.repo
remove
add
100.0.52.248
100.11.82.170
100.15.39.173
100.16.230.154
100.2.3.172
100.36.44.130
100.38.6.182
101.0.93.66
101.100.141.55
101.100.144.174
@cristianmenghi
cristianmenghi / reclaimWindows10.ps1
Last active April 4, 2017 15:37 — forked from alirobe/reclaimWindows10.ps1
"Reclaim Windows 10" turns off a bunch of unnecessary Windows 10 telemetery, removes bloatware, and privacy invasions. Review and tweak before running. Scripts for reversing are included and commented. Fork via https://github.com/Disassembler0 (different defaults)
##########
# Win10 Initial Setup Script
# Author: Disassembler <disassembler@dasm.cz>
# Version: 1.7, 2016-08-15
# dasm's script: https://github.com/Disassembler0/Win10-Initial-Setup-Script/
# THIS IS A PERSONALIZED VERSION
# This script leaves more MS defaults on, including MS security features.
# Tweaked based on personal preferences for @alirobe 2016-11-16 - v1.7.1

Keybase proof

I hereby claim:

  • I am cristianmenghi on github.
  • I am cmenghi (https://keybase.io/cmenghi) on keybase.
  • I have a public key whose fingerprint is 2C28 8D1D 919C 36AA 05F2 8F41 B912 1B1C 5DE6 10E9

To claim this, I am signing this object:

@cristianmenghi
cristianmenghi / parallelize.php
Created September 19, 2016 17:35 — forked from leowebguy/parallelize.php
Parallelize downloads across hostnames for WordPress. Useful to boost static resources load speed on websites. Recommended by GTmetrix, Pingdom, Google Speed Insights, and others.
<?php
/******
Parallelize downloads across hostnames for WordPress.
Useful to boost static resources load speed on websites.
Recommended by GTmetrix, Pingdom, Google Speed Insights, and others.
See full post > https://medium.com/p/32e9dc2fec0c
In order to work properly, all subdomains/hostnames MUST have the same structure/path. Ex:
http://mydomain.com/wp-content/uploads/2015/11/myimage.jpg