Skip to content

Instantly share code, notes, and snippets.

@edgardo001
edgardo001 / grafana_telegram_bot.md
Created June 13, 2023 17:37 — forked from ilap/grafana_telegram_bot.md
Grafana Telegram Alert

Config Telegrambot for grafana's alerts.

1. Create bot

Open Telegram and search for @BotFather user and message them the following:

You
/newbot 

BotFather
@edgardo001
edgardo001 / crypto_util_AES_CBC.py
Created December 21, 2022 19:25 — forked from chanchal-357/crypto_util_AES_CBC.py
AES CBC Encrypt-Decrypt using random IV (python 3.9)
import base64
import hashlib
from Cryptodome.Cipher import AES # from pycryptodomex v-3.10.4
from Cryptodome.Random import get_random_bytes
HASH_NAME = "SHA256"
IV_LENGTH = 16
ITERATION_COUNT = 65536
KEY_LENGTH = 32
@edgardo001
edgardo001 / download_ajax.js
Created June 1, 2022 13:04 — forked from AxelUser/download_ajax.js
How to download file in base64 format by ajax request to your api
$.ajax({
url: "http://api.yoursite.com",
data: data,
type: "POST"
}).done(function(result) {
var link = document.createElement("a");
document.body.appendChild(link);
link.setAttribute("type", "hidden");
link.href = "data:text/plain;base64," + result;
link.download = "data.zip";
@edgardo001
edgardo001 / neo4j_cypher_cheatsheet.md
Created November 12, 2021 19:49 — forked from DaniSancas/neo4j_cypher_cheatsheet.md
Neo4j's Cypher queries cheatsheet

Neo4j Tutorial

Fundamentals

Store any kind of data using the following graph concepts:

  • Node: Graph data records
  • Relationship: Connect nodes (has direction and a type)
  • Property: Stores data in key-value pair in nodes and relationships
  • Label: Groups nodes and relationships (optional)
@edgardo001
edgardo001 / encrypt_openssl.md
Created July 7, 2021 20:40 — forked from dreikanter/encrypt_openssl.md
File encryption using OpenSSL

Symmetic encryption

For symmetic encryption, you can use the following:

To encrypt:

openssl aes-256-cbc -salt -a -e -in plaintext.txt -out encrypted.txt

To decrypt:

@edgardo001
edgardo001 / centos-extras-on-OEL7.md
Created February 15, 2021 18:00 — forked from RulerOf/centos-extras-on-OEL7.md
Adding Centos Extras repo to Oracle Enterprise Linux 7

Adding CentOS Extras to Oracle Enterprise Linux

If you want to install a package like Docker Community Edition on OEL, you'll have to add the CentOS Extras repo, which as of release 7 is built-in to CentOS and not added on later like EPEL is. As a result, instructions for adding it to EL7 are hard to find. This should work for any build of Enterprise Linux that does not already include the CentOS Extras repo. I have absolutely no idea if it's apporpriate to use this repo on a build of Linux other than CentOS, but it should be.

This was tested on Oracle Enterprise Linux 7, but should be copy-pastable on any version or EL build assuming things don't change too much.

Download the CentOS GPG Key

# Get OS Release number
@edgardo001
edgardo001 / index.html
Last active January 7, 2023 16:04
Demo simple de Datatables , incluye Jquery, Datatables js, Bootstrap 4, Font Awesome 5 y Lenguaje Español para Datatables
<!DOCTYPE html>
<head>
<title>Untitled-2</title>
<link rel="icon" type="image/x-icon" href="./assets/favicon.ico" />
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.1.3/css/bootstrap.css">
<link rel="stylesheet" href="https://cdn.datatables.net/1.10.21/css/dataTables.bootstrap4.min.css">
@edgardo001
edgardo001 / app.py
Created November 20, 2019 17:21
Ejemplo básico de conexión a postgres con python sobre contenedores docker
# docker run --name some-postgres -p 5432:5432 -e POSTGRES_PASSWORD=postgres -tid postgres:12.0
# docker run -v C:\Users\Datasoft\Desktop\py:/script --rm python:3.7 bash -c "pip install psycopg2 && python /script/app.py"
import psycopg2
try:
connection = psycopg2.connect(user = "postgres",
password = "postgres",
host = "192.168.1.40",
port = "5432",
database = "postgres")
/**
Instalar libreria mux para perticiones http
$> go get github.com/gorilla/mux
Para ejecutar como script
$> go run demo-api.go
Para compilar Windows:
$> go build -o demo-api.exe demo-api.go
@edgardo001
edgardo001 / SQL Server commands and queries.md
Created August 26, 2019 01:53 — forked from ashish2199/SQL Server commands and queries.md
List of Microsoft SQL Server queries and commands

To create a Table

	create table risk_clos_rank(
		id_num int IDENTITY(1,1) NOT NULL,
	    username nvarchar(100),
	    datetime_of_decision DATETIME
	);
	
	CREATE TABLE TheNameOfYourTable (
 ID INT NOT NULL IDENTITY(1,1),