Skip to content

Instantly share code, notes, and snippets.

View maitret's full-sized avatar
🤓
Programando ando...

Luis S. Lopez Maitret maitret

🤓
Programando ando...
View GitHub Profile
@maitret
maitret / .htaccess para public
Created October 13, 2024 07:27 — forked from JCervantesB/.htaccess para public
htaccess para proyectos MVC CodigoConJuan
<IfModule mod_negotiation.c>
Options -MultiViews
</IfModule>
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L]
</IfModule>
@maitret
maitret / backup_mysql_db.sh
Created September 28, 2024 00:10 — forked from ph33nx/backup_mysql_db.sh
This bash script automates the process of daily backups for all MySQL/MariaDB databases on a Linux server. It stores each database backup in a dedicated directory under /var/backups/mysql/ and names the backup files using the format <database_name>_<date_time>.sql. Additionally, the script includes a cleanup function that deletes backups older t…
#!/bin/bash
# backup_mysql_db.sh
# This script backs up each MySQL/MariaDB database into its own file daily.
# The backups are stored in /var/backups/mysql/<database_name>/<database_name>_<date_time>.sql
# Backups older than 30 days are automatically deleted.
#
# Author: Ph33nx
# GitHub: https://github.com/ph33nx
#
@maitret
maitret / adobe_exe_firewall_block_windows.bat
Created September 28, 2024 00:09 — forked from ph33nx/WinMasterBlocker.bat
Block All Adobe .exe files via Firewall on Windows Using Batch Script | Stop adobe apps to access internet
@REM Author: https://github.com/ph33nx
@REM Description: This script blocks or unblocks Adobe-related executables in Windows Firewall.
@REM Usage:
@REM - To block executables: adobe_block.bat
@REM - To unblock (delete) existing rules: adobe_block.bat -delete
@echo off
setlocal enabledelayedexpansion
REM Check if the script should delete existing rules
@maitret
maitret / 05-domains.sh
Last active January 9, 2024 04:16
Poste.io Fixes
#!/usr/bin/env bash
# /etc/cont-init.d/05-domains.sh
if [ ! -d /data/domains ]; then
echo -e "\t\t\033[1;33m* creating /data/domains directory\033[0m"
mkdir -p /data/domains
fi
# removed stat --format '%U' ... and stat --format '%G' ... to get rid of statx bug
user="$(/bin/core-username "/data/domains")"

Keybase proof

I hereby claim:

  • I am maitret on github.
  • I am maitret (https://keybase.io/maitret) on keybase.
  • I have a public key whose fingerprint is 3298 C748 4711 3667 6744 3D4F 1C7B F0E7 0FD0 4991

To claim this, I am signing this object:

@maitret
maitret / php-curl-request-multipart.md
Created September 15, 2021 17:01 — forked from ramingar/php-curl-request-multipart.md
PHP cURL request multipart/form-data #php #curl #request #multipart #formdata #file #upload
$ch = curl_init();

$headers   = array();
$headers[] = "Authorization: Bearer " . $apiToken;
//$headers[] = "Content-Type: multipart/form-data";     // ERROR: no uses esta cabecera. Si $post es un array, la cabecera se añade automáticamente. Si se añade manualmente, me ha pasado que el boundary o el base64 se genera mal.

$cfile = new \CURLFile($fileNameWithFullPath);

//$post = array($fieldName => '@/tmp/phpDT8j');         // ERROR: no uses '@'. Genera errores en el base64. Desde PHP 5.5 está obsoleto. En su lugar usar CURLFile.
@maitret
maitret / Activate Office 2019 for macOS VoL.md
Created March 14, 2020 19:53 — forked from zthxxx/Activate Office 2019 for macOS VoL.md
crack activate office on mac with license file

Activate MS Office 2019/2016 for macOS - Microsoft_Office_2019_VL_Serializer

Office 2019 above

2019-06-03

Note that Office2019 DO NOT support activate via simple copy/paste plist license file which is the simplest way to activate Office 2016. Fortunately, you can also use the VL Serializer tool, just install Office 2019 and Serializer, then run Serializer to activate.

Ref

/**
* Formula para sacar distancia entre dos puntos dada la latitud y longitud de dos puntos.
* Esta distancia tiene que estar dada en notación DECIMAL y no en SEXADECIMAL (Grados, minutos... etc)
* @param type $latitud 1
* @param type $longitud 1
* @param type $latitud 2
* @param type $longitud 2
* @return type, Distancia en Kms, con 1 decimal de precisión
*/
function GetGeoDistancia($lat1, $long1, $lat2, $long2){
@maitret
maitret / chucherias.md
Last active October 11, 2023 22:37 — forked from epsa-dev/chucherias.md
Terminal: Buscar, mover, listar, eliminar

** Listar y ordenar por tamaño Linux **

du -sh * | sort -h

** Listar y ordenar por tamaño NuShell**

ls -d | sort-by size -r

Buscar archivos con cierta ext:

@maitret
maitret / README.md
Created April 4, 2019 05:01 — forked from noahbass/README.md
google docs - insert data from an external form to a spreadsheet