Skip to content

Instantly share code, notes, and snippets.

💻
Backend Development at CXC

Daniel Jacales heptorsj

💻
Backend Development at CXC
Block or report user

Report or block heptorsj

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View LoginSecurity
-- This configure the EXEC privlige mode
enable
conf ter
enable secret [password]
exit
-- This add a password for the EXEC user mode
line console 0
password [password]
login
exit
@heptorsj
heptorsj / vlanforcisco
Created Dec 12, 2018
How To Create A VLAN
View vlanforcisco
enable
conf ter
vlan 2
name Oficina
end
interface fa0/1
switchport mode acces
switchport acces vlan
end
View CodeSignal ChangeRoot.js
function findRoot(p){
for(var i = 0; i < p.length; i++){
if(i == p[i]){
//console.log("we found " + i);
return i;
}
}
}
function changeRoot(parent, newRoot) {
@heptorsj
heptorsj / atbash.rb
Created Feb 21, 2018
Algortimo para descifrar un mensaje encriptado en atbash
View atbash.rb
#dicionarios
reverse={"A"=>"Z","B"=>"Y","C"=>"X","D"=>"W","E"=>"V","F"=>"U",
"G"=>"T","H"=>"S","I"=>"R","J"=>"Q","K"=>"P","L"=>"O","M"=>"N","N"=>"M",
"O"=>"L","P"=>"K","Q"=>"J","R"=>"I","S"=>"H","T"=>"G","U"=>"F","V"=>"E","W"=>"D","X"=>"C","Y"=>"B","Z"=>"A"
}
texto="vwfxzxrlmvholjfvjfvwzwvhkfvhwvloerwzioljfvhvszzk
ivmwrwlvmozvhxfvoz"
dec=[]
texto.upcase.split("").each do |c|
dec.push(reverse[c])
View unicas.sh
#!/bin/bash
awk '/http/' fuentes_informacion.txt | grep -o 'http[^ ]*'|sort -u | grep -o 'http.*' | sort | uniq | grep -o '.*\.[a-z]*' | sort -u | wc
#por Héctor Jacales
View Sudoku Validation.d
bool cuadrante(char v,ulong n,ulong m,ulong n2,ulong m2, char [][] grid){
ulong i,j;
ulong lim,lim2;
lim = 3 * (n+1);
lim2 = 3 * (m+1);
bool bandera = true;
for (i=3*n;i<lim;i++){
for(j=3*m;j<lim2;j++){
if(i != n2 || j!=m2){
if(v == grid[i][j] ){
@heptorsj
heptorsj / sorensenDice.js
Last active Nov 16, 2017
Ejemplo De SImilitud De Cadenas De Texto. Aproximación con el coeficiente de Sørensen-Dice
View sorensenDice.js
/* Implementación del algoritmo Sørense-Dice para evaluar similitud de cadenas*/
// Función que obtiene bi-grams, conjuto de cadenas de dos letras, de cada
// palabra ingresada
// Recibe : Una cadena de texto
// Obtiene: Un arreglo de cadenas de texto de dos letras.
function bi_grams(cadena){
var grams = [];
for(var i = 0; i <= cadena.length-2;i++){
var pareja = [cadena[i].toString() + cadena[i+1]].toString();
@heptorsj
heptorsj / distribucionBinomial.rb
Created Oct 25, 2017
Implementación de una función que cálcula la distribución binomial.
View distribucionBinomial.rb
# Programa auxiliar
aciertos = 1..10
suma = 0.0
class Integer
def !
(1..self).inject(:*)
end
end
def combinaciones(n,m)
@heptorsj
heptorsj / bnf.rb
Last active Oct 26, 2017
Programa que obtiene el arbol de una expresión aritmetica.
View bnf.rb
# sea expr una expresion aritmetica obtener su arbol de notación infija
@arboles = 0
def centraarbol(n)
for i in 1..n
print " "
end
end
def imprime_raices(sarbol)
centraarbol(@arboles)
print sarbol[1][0]
View ReglaDelProducto.rb
# Ejemplo de la regla del producto de Probabílidad
# Con remplazo
def reglaProducto(n,m)
l = []
for i in 0...n
for j in 0...m
l.push(m)
end
end
You can’t perform that action at this time.