Skip to content

Instantly share code, notes, and snippets.

View hery84's full-sized avatar
😴
Boring

Hery hery84

😴
Boring
View GitHub Profile
@flymrc
flymrc / aes-cbc-padding.kts
Last active September 30, 2024 20:19
Kotlin AES Encryption and Decryption
// ref: https://www.baeldung.com/java-aes-encryption-decryption
import java.util.*
import javax.crypto.Cipher
import javax.crypto.spec.IvParameterSpec
import javax.crypto.spec.SecretKeySpec
fun decrypt(algorithm: String, cipherText: String, key: SecretKeySpec, iv: IvParameterSpec): String {
val cipher = Cipher.getInstance(algorithm)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@diegovalle
diegovalle / censo_2020.sh
Last active July 27, 2023 15:45
Download the shapefiles from the 2020 Mexican census
#!/usr/bin/env bash
####################################################
# Make sure `rename` is available on your system
####################################################
# Exit on error, undefined and prevent pipeline errors,
# use '|| true' on commands that intentionally exit non-zero
set -euo pipefail
# The directory from which the script is running
readonly LOCALDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
readonly TARGET_DIR="$LOCALDIR/censo2020"
@diegovalle
diegovalle / mapa_covid.R
Created April 15, 2020 16:00
Mapa de casos COVID-19
## Auto-Install the following packages
.packs <- c("tidyverse", "lubridate", "ggrepel", "viridis", "scales")
.success <- suppressWarnings(sapply(.packs, require, character.only = TRUE))
if (length(names(.success)[!.success])) {
install.packages(names(.success)[!.success])
sapply(names(.success)[!.success], require, character.only = TRUE)
}
if (!require(mxmaps))
devtools::install_github("diegovalle/mxmaps")
library(mxmaps)
@up1
up1 / 1.sql
Last active September 8, 2020 17:36
Elasticsearch :: sync data with RDBMS
CREATE DATABASE sample_db;
USE sample_db;
DROP TABLE IF EXISTS product;
CREATE TABLE product (
id BIGINT(20) UNSIGNED NOT NULL,PRIMARY KEY (id),UNIQUE KEY unique_id (id),
name VARCHAR(32) NOT NULL,
modification_time TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
insertion_time TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
);
library(tm)
library(SnowballC)
library(wordcloud)
library(RColorBrewer)
library(tidyverse)
library(ggwordcloud)
# Hecho por Rafa @GonzalezGouveia
# Con gusto para #DatosDeMiercoles, propuesto por @R4DS_es
@jidolstar
jidolstar / ChCrypto.java
Last active February 26, 2024 16:04
AES 256 encrypt / decrypt - JAVA, PHP, Kotlin
package chela.spring.core;
import javax.crypto.Cipher;
import javax.crypto.spec.IvParameterSpec;
import javax.crypto.spec.SecretKeySpec;
import java.util.Base64;
final public class ChCrypto {
final static Base64.Encoder encorder = Base64.getEncoder();
final static Base64.Decoder decorder = Base64.getDecoder();
@fernandoaleman
fernandoaleman / install-rabbitmq-centos-7.md
Last active December 12, 2024 12:38
Install RabbitMQ on CentOS 7

Install RabbitMQ on CentOS 7

sudo yum -y install epel-release
sudo yum -y update

Install Erlang

Download repository

@graphadvantage
graphadvantage / neo4j-kakfa-demo.md
Last active February 25, 2025 14:54
Neo4j GraphGist: Enterprise Architectures - Real-time Neo4j Graph Updates using Kafka Messaging

##Neo4j GraphGist - Enterprise Architectures: Real-time Graph Updates using Kafka Messaging

Neo4j Use Case: Low Latency Graph Analytics & OLTP - Update 1M Nodes in 90 secs with Kafka and Neo4j Bolt

Introduction

A recent Neo4j whitepaper describes how Monsanto is performing real-time updates on a 600M node Neo4j graph using Kafka to consume data extracted from a large Oracle Exadata instance.

This modern data architecture combines a fast, scalable messaging platform (Kafka) for low latency data provisioning and an enterprise graph database (Neo4j) for high performance, in-memory analytics & OLTP - creating new and powerful real-time graph analytics capabilities for your enterprise applications.

@nrollr
nrollr / Commands.sh
Last active August 20, 2024 20:36
Install PHP and NGINX on Amazon Linux AMI
## Install NGINX
## when installing on Amazon Linux AMI, use:
$ sudo yum install nginx -y
## when installing on Amazon Linux 2 AMI, use
$ sudo amazon-linux-extras install nginx1.12 -y
## Install PHP and PHP-FPM
# for PHP version 7.1 use php71 and php71-fpm instead
$ sudo yum install php -y
$ sudo yum install php-fpm -y