Skip to content

Instantly share code, notes, and snippets.

View KBeDevel's full-sized avatar
📖
Studing again

Benjamin KBeDevel

📖
Studing again
View GitHub Profile
# ¿Como se determina la puntuación de riesgo?

La puntuación de riesgo se determina a partir de la cantidad y gravedad de las alertas de seguridad que se han generado en un equipo o servidor durante los últimos 30 días.

- **Bajo**: No se han generado alertas de seguridad.
- **Medio**: Se han generado alertas de seguridad de gravedad media.
- **Alto**: Se han generado alertas de seguridad de gravedad alta.
  • Crítico: Se han generado alertas de seguridad de gravedad crítica.
@KBeDevel
KBeDevel / hosts_ports_scanner.sh
Last active November 14, 2023 15:41
Scan and save network hosts ports output autmatically. Needs nmap installed.
#! /usr/bin/bash
# Script to scan hosts ports using NMAP
# Created by: Benjamin Calisto <kbedev@proton.me>
check_nmap_installation() {
is_nmap_installed=$(command -v nmap > /dev/null && echo 1 || echo 0)
if [ "$is_nmap_installed" -eq 0 ] ; then
echo "nmap is not installed"
exit 1
@KBeDevel
KBeDevel / similarity-calculator.ts
Last active November 8, 2022 19:23
Similarity calculator for string inputs implemented in TypeScript
/**
* Get the similarity percentage between two strings.
* Based on @link{https://gist.github.com/sumn2u/0e0b5d9505ad096284928a987ace13fb#file-jaro-wrinker-js}
*/
export const calculateStringsSimilarity = (
firstString: string,
secondString: string,
config?: {
/**
* If true, the function will return the similarity percentage as a float number between 0 and 1.
@KBeDevel
KBeDevel / custom-modal.tsx
Last active January 6, 2022 17:39
Custom (React Bootstrap 2) Modal
import { useStyleModules } from 'helpers/functions';
import { FC, useEffect, useLayoutEffect, useState } from 'react';
import { Modal } from 'react-bootstrap';
import ModalStyles from 'styles/modules/modal.module.sass';
type CustomModalProps = {
show: boolean;
title?: string;
buttons?: JSX.Element[];
onModalClose?: () => void;
@KBeDevel
KBeDevel / password-input-view.directive.ts
Last active September 2, 2020 20:47
Angular password visivility toggle directive
// This directive consider the use of Bootstrap 4 + Font Awesome 5
import { Directive, ElementRef, NgModule } from '@angular/core';
@Directive({
selector: '[appPasswordVisibilityToggler]' // <- Use this as an attribute in the targeted password input
})
export class PasswordInputViewDirective {
private shown = false;