Skip to content

Instantly share code, notes, and snippets.

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

Miguel Angel fitorec

🏠
Working from home
View GitHub Profile
@fitorec
fitorec / 00-checksum-clabe-bancaria-estandarizada.md
Last active March 20, 2024 19:01
Suma de validación(checksum) de la CLABE Bancaria Estandarizada en MX
@fitorec
fitorec / RFC-mx-metadata.js
Created April 28, 2022 19:48
Extracción de meta-datos a partir del RFC Mexicano
const altisonantes = [
'BACA', 'BAKA', 'BUEI', 'BUEY', 'CACA', 'CACO', 'CAGA', 'CAGO', 'CAKA',
'CAKO', 'COGE', 'COGI', 'COJA', 'COJE', 'COJI', 'COJO', 'COLA', 'CULO',
'FALO', 'FETO', 'GETA', 'GUEI', 'GUEY', 'JETA', 'JOTO', 'KACA', 'KACO',
'KAGA', 'KAGO', 'KAKA', 'KAKO', 'KOGE', 'KOGI', 'KOJA', 'KOJE', 'KOJI',
'KOJO', 'KOLA', 'KULO', 'LILO', 'LOCA', 'LOCO', 'LOKA', 'LOKO', 'MAME',
'MAMO', 'MEAR', 'MEAS', 'MEON', 'MIAR', 'MION', 'MOCO', 'MOKO', 'MULA',
'MULO', 'NACA', 'NACO', 'PEDA', 'PEDO', 'PENE', 'PIPI', 'PITO', 'POPO',
'PUTA', 'PUTO', 'QULO', 'RATA', 'ROBA', 'ROBE', 'ROBO', 'RUIN', 'SENO',
'TETA', 'VACA', 'VAGA', 'VAGO', 'VAKA', 'VUEI', 'VUEY', 'WUEI', 'WUEY'
#include<stdio.h>
int main(int n, char **args) {
printf("FCFS: FIRST COME FIRST SERVERED");
int np=11, procesos[10];
double tf = 0, tp;// tiempo promedio.
while (np > 10 || np <= 0) {
printf("\nNumero de procesos: ");
scanf("%d", &np);
}
@fitorec
fitorec / AES.php
Last active June 3, 2023 18:19
Implementación del Algoritmo AES-256-CBC usando las librerías de OpenSSL
<?php
namespace App\Encryption;
class AES {
public static function generate_iv()
{
return openssl_random_pseudo_bytes(
openssl_cipher_iv_length('aes-256-cbc')
);
@fitorec
fitorec / DbDump.php
Created March 2, 2020 19:58
Agregar comando Artisan de Laravel para backups de la base de datos
<?php
namespace App\Console\Commands;
use Illuminate\Console\Command;
use Illuminate\Foundation\Application;
use Illuminate\Foundation\Bootstrap\LoadEnvironmentVariables;
use Dotenv\Dotenv;
/**
@fitorec
fitorec / android.logo.html
Created September 19, 2012 09:13
logo android en puro HTML & CSS
<!DOCTYPE html>
<html lang="es-MX">
<head>
<title>logo android</title>
<meta http-equiv="content-type" content="text/html;charset=utf-8" />
<style type="text/css" media="all">
#perspective-container { position: absolute; top: 0px; width: 264px; height: 336px; background-color: rgba(0,0,0,.05); -moz-transform-style: preserve-3d; -moz-perspective: 800px;}
#android { position: absolute; top: 0px; width: 264px; height: 336px;}
#android .body { position: absolute; top: 110px; left: 48px; width: 168px; height: 152px; border-radius: 0px 0px 30px 30px; background-color: #ED8415;}
#android .head { position: absolute; top: 30px; left: 48px; width: 168px; height: 68px; border-top-left-radius: 50% 100%; border-top-right-radius: 50% 100%; background-color: #ED8415; }
@fitorec
fitorec / chmod_R.php
Created October 22, 2011 02:50
Chmod Recursive for PHP.
<?php
/*
* Description: chmod recursive.
* Code-Base: official documentation php.net chmod function
* Link: http://www.php.net/manual/en/function.chmod.php#105570
*
* Example usage :
* chmod_R( 'mydir', 0666, 0777);
*
*/
@fitorec
fitorec / stop_service_on_port.sh
Last active September 3, 2022 22:45
Stopping service on specific port
#!/bin/bash
#
#
# PROBLEM:
# ---------------------
# If we run:
# pkill gunicorn
# We stop all gunicorn services, in this case to start gunicorn we only need to stop the parent
# process associated with the service that attends the port where gunicorn will be executed.
#
@fitorec
fitorec / README.md
Created October 31, 2018 00:39
Haciendo un deploy en servidor 1and1

👌 Haciendo un deploy en servidor 1and1

En ocasiones los clientes FTP suelen ser lentos conforme nuestras estructuras de archivos se vuelven complejas, por otra parte suele ser algo incomodo para un desarrollador estar saliendoce de entorno de lineas de comandos (CLI) para realza esta tarea.

El siguiente POST describe un mecanismo simple para realizar esta tarea utilizando, Git y una conexión SSH de un servidor 1and1 (hoy ionos).

Consideraciones:

  1. Se considerea que el lector cuenta con conocimientos básicos de Git, asi como del manejo del CLI en entornos *nix.
@fitorec
fitorec / diaSiete.sh
Created November 28, 2009 05:21
descarga todas las revistas de dia siete (diasiete.com)
#!/bin/bash
# Copyright 2009 Fitorec Rey sol <chanerec@gmail.com>
#
# diaSiete.sh
# Creado : 27.11.2009 23:10:35 CST
# modificadodo: 27.11.2009 23:10:35 CST
#
# Este programa descarga todas las revistas de dia siete (diasiete.com) usando
# el comando wget con los siguientes parametros:
# Nota: este script fue probado y ejecutado sobre GNU/Linux usando bash y GNU/Wget 1.11.4