Skip to content

Instantly share code, notes, and snippets.

View alphanetEX's full-sized avatar
⚒️
Devalator mode

AlphanetEX alphanetEX

⚒️
Devalator mode
View GitHub Profile
@alphanetEX
alphanetEX / kernel-discover.sh
Created October 4, 2021 12:16
Verify-kernel-conf
#!/bin/bash
unset kernel_data[6]
unset tegra_version[3]
unset cpu_verstion
Green='\033[0;32m'
Red='\033[0;31m'
Blue='\033[0;34m'
<VirtualHost *:80>
# The ServerName directive sets the request scheme, hostname and port that
# the server uses to identify itself. This is used when creating
# redirection URLs. In the context of virtual hosts, the ServerName
# specifies what hostname must appear in the request's Host: header to
# match this virtual host. For the default virtual host (this file) this
# value is not decisive as it is used as a last resort host regardless.
# However, you must set it for any further virtual host explicitly.
#ServerName www.example.com
@alphanetEX
alphanetEX / lamp_conf.sh
Last active April 26, 2022 02:47
automatization apache + mysql
#!/bin/bash
#AUTHOR: AlphanetEX, APACHE2 + MYSQL CONFIGURATION
apache_conf="/etc/apache2/sites-available/"
#read .env file it works
[ ! -f .env ] || export $(grep -v '^#' .env | xargs)
if [[ ! -d /u01 ]]; then
mkdir /u01
fi
@alphanetEX
alphanetEX / index_DG03.JS
Created May 2, 2022 17:06
example exercise
// Los árboles utópicos crecen de una forma particular, en dos ciclos:
// Cada primavera duplican su tamaño
// Cada verano crecen un metro
// Si Laura planta un árbol utópico de un metro, al fin del otoño, ¿cuánto medirá de alto después de N ciclos?
// Algunos ejemplos:
// Si N = 0, su altura será 1 metro (no creció nada)
// Si N = 1, su altura será de 2 metros (duplicó su altura en primavera)
// Si N = 2, su altura será de 3 metros (creció un metro más en verano)
@alphanetEX
alphanetEX / index_DG05.JS
Created May 2, 2022 17:32
array probability of type of number
// Necesitamos una función masMenos que reciba un array y devuelva otro con los siguientes tres números:
// En la primera posición, la fracción de números que son positivos
// En la segunda posición, la fracción de números que son cero
// En la última posición, la fracción de números que son negativos
// Por ejemplo, masMenos([1, 2, 0, -1]) debería devolver [0.5, 0.25, 0.25],
// dado que hay 50% de positivos, 25% de ceros, y 25% de negativos.
/*
La función masMenos([0,0,0,0]) debe retornar [0,1,0]
@alphanetEX
alphanetEX / load_dotenv.sh
Created May 20, 2022 04:54 — forked from mihow/load_dotenv.sh
Load environment variables from dotenv / .env file in Bash
if [ ! -f .env ]
then
export $(cat .env | xargs)
fi
@alphanetEX
alphanetEX / last.js
Created October 31, 2022 21:02
stable request
lastProduct: (req, res) => {
console.log("ejecutando request");
db.Product.findAll({
include : ["Images"],
order: [[ ,'id' , 'DESC']],
})
.then(data => {
let object = data[0].dataValues;
let producto = {
@alphanetEX
alphanetEX / prototypecode.js
Created January 20, 2023 18:32
prototype code schematic
"use strict";
global.alphanet = `alphanet`;
//aplciando closure
function makeMoney(){
let gcant=0
return {
//this apuntara a lo que este dentro de este objeto
@alphanetEX
alphanetEX / authproto.js
Created January 20, 2023 18:35
secondPrototypeworks
"use strict";
//aplciando closure
function makeMoney(){
let gcant=0
return {
//this apuntara a lo que este dentro de este objeto
@alphanetEX
alphanetEX / start.c
Created March 8, 2023 10:47
manifiesto algoritmos
#include <stdio.h>
/* ingrese numeros mayores a 0 y vamos a calular el
- promedio de los numeros impares
- la cantidad de numeros mayoyes que a 24 y pares
- la sumatoria de los numeros primos
*/
void cargar(int vec[], int dim){
int cont=0, num=0, contPar=0, contImp=0, itemb=0;