Skip to content

Instantly share code, notes, and snippets.

View igomez10's full-sized avatar

Ignacio Gomez igomez10

View GitHub Profile
@eriknovak
eriknovak / logstash-pg-es.md
Last active February 10, 2024 17:53
Instructions for setting up the Logstash configuration for synching PostgreSQL with Elasticsearch

Populating Elasticsearch Index with Logstash

Logstash is a free and open server-side data processing pipeline that ingests data from a multitude of sources, transforms it, and then sends it to your favorite "stash."

This section describes how one can use it on UNIX to migrate data from a PostgreSQL database to elasticsearch.

The Prerequisites

@wongoo
wongoo / rsautil.go
Created August 1, 2019 03:19
golang RSA utility, include encrypt/decrypt/signature
//author: http://github.com/wongoo
//date: 20190717
package rsautil
import (
"bytes"
"crypto"
"crypto/rand"
"crypto/rsa"
@miguelmota
miguelmota / rsa_util.go
Last active July 24, 2024 08:34
Golang RSA encrypt and decrypt example
package ciphers
import (
"crypto/rand"
"crypto/rsa"
"crypto/sha512"
"crypto/x509"
"encoding/pem"
"log"
)
@dominiek
dominiek / EtherDelta Trade Logic.sol
Created February 8, 2018 04:52
EtherDelta Trade Logic
mapping (address => mapping (bytes32 => bool)) public orders;
mapping (address => mapping (bytes32 => uint)) public orderFills;
function trade(address tokenGet, uint amountGet, address tokenGive, uint amountGive, uint expires, uint nonce, address user, uint8 v, bytes32 r, bytes32 s, uint amount) {
bytes32 hash = sha256(this, tokenGet, amountGet, tokenGive, amountGive, expires, nonce);
if (!(
(orders[user][hash] || ecrecover(sha3("\x19Ethereum Signed Message:\n32", hash),v,r,s) == user) &&
block.number <= expires &&
safeAdd(orderFills[user][hash], amount) <= amountGet
)) throw;
@barseghyanartur
barseghyanartur / ELK with Nginx.md
Created September 8, 2017 15:20 — forked from Dev-Dipesh/ELK with Nginx.md
Setting up Elasticsearch, Logstash and Kibana with Nginx.

ELK (Elasticsearch Logstash Kibana)

Though we're focused more on server setup procedure in this document, I will still give a very brief explanation in laymen terms for ELK. To those who are starting new in this stack, must have already heard of MVC (Model View Controller), so take it like this:

  • Model => Elasticsearch (for Storage, Indexing & Search)
  • View => Kibana (for DataViz & G-Man, yeah the one in half life 😏)
  • Controller => Logstash (For Logs & Filtering)

@ryboe
ryboe / .travis.yml
Last active November 23, 2023 05:37
Example .travis.yml for Golang
# use the latest ubuntu environment (18.04) available on travis
dist: bionic
language: go
# You don't need to test on very old versions of the Go compiler. It's the user's
# responsibility to keep their compiler up to date.
go:
- 1.16.x
@nikhita
nikhita / update-golang.md
Last active July 19, 2024 17:55
How to update the Go version

How to update the Go version

System: Debian/Ubuntu/Fedora. Might work for others as well.

1. Uninstall the exisiting version

As mentioned here, to update a go version you will first need to uninstall the original version.

To uninstall, delete the /usr/local/go directory by:

@jupaneira
jupaneira / README.md
Last active March 9, 2021 19:51
Administrative divisions of Bogotá

This is an interactive Map of the Administrative divisions of Bogotá, made with TopoJSON and D3.

Inspired by the Mexican municipalities map, it shows the Administrative division of Colombia's capital city.

Bogotá has 20 localities and each of them is compound of smaller divisions called Barrios. There are 1900 Barrios in Bogotá

It uses TopoJSON to diferentiate the Departments boundaries through the function topojson.mesh and a special filter.

To obtain the TopoJSON, first I converted the .shp file of the Municipality divition of Colombia by Maurix Suárez to GeoJSON, using:

@byrnedo
byrnedo / ComputeHmac256.go
Created September 12, 2016 07:32
Compute a hmac for a message in golang
func ComputeHmac256(message string, secret string) string {
key := []byte(secret)
h := hmac.New(sha256.New, key)
h.Write([]byte(message))
return base64.StdEncoding.EncodeToString(h.Sum(nil))
}
@kevin-smets
kevin-smets / iterm2-solarized.md
Last active July 23, 2024 04:22
iTerm2 + Oh My Zsh + Solarized color scheme + Source Code Pro Powerline + Font Awesome + [Powerlevel10k] - (macOS)

Default

Default

Powerlevel10k

Powerlevel10k