This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import hashlib,binascii,codecs,base58,ecdsa | |
class Wallet(object): | |
def __init__(self): | |
""" | |
private key | |
public key | |
address | |
https://github.com/burakcanekici/BitcoinAddressGenerator | |
https://medium.com/coinmonks/bitcoin-address-generation-on-python-e267df5ff3a3 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import socket | |
import threading | |
class ThreadedServer(object): | |
def __init__(self, host, port): | |
self.host = host | |
self.port = port | |
self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) | |
self.sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) | |
self.sock.bind((self.host, self.port)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
A simple Blockchain in Python | |
""" | |
import hashlib | |
class GeekCoinBlock: | |
def __init__(self, previous_block_hash, transaction_list): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package org.example.keypair; | |
import org.bitcoinj.core.Base58; | |
import org.bouncycastle.jce.provider.BouncyCastleProvider; | |
import org.bouncycastle.util.encoders.Hex; | |
import org.bouncycastle.util.io.pem.PemObject; | |
import org.bouncycastle.util.io.pem.PemReader; | |
import org.bouncycastle.util.io.pem.PemWriter; | |
import java.io.File; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mvn archetype:generate -DgroupId={project-packaging} -DartifactId={project-name} -DarchetypeArtifactId=maven-archetype-webapp -DinteractiveMode=false |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(function () { | |
var data = [ | |
{ "id" : "ajson1", "parent" : "#", "text" : "Simple root node" }, | |
{ "id" : "ajson2", "parent" : "#", "text" : "Root node 2" }, | |
{ "id" : "ajson3", "parent" : "ajson2", "text" : "Child 1" }, | |
{ "id" : "ajson4", "parent" : "ajson2", "text" : "Child 2" }, | |
]; | |
$("#jstree").jstree({ | |
"core" : { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
docker run -d --name elastic -d --name elasticsearch -p 9200:9200 -p 9300:9300 -e "xpack.security.enabled=true" -e "discovery.type=single-node" elasticsearch:6.5.0 | |
docker run -d --name kibana -p 5601:5601 --link elasticsearch:elasticsearch -e "ELASTICSEARCH_URL=http://elasticsearch:9200" -e "XPACK_SECURITY_ENABLED=true" -e "ELASTICSEARCH_USERNAME=elastic" -e "ELASTICSEARCH_PASSWD=changeme" -e XPACK_GRAPH_ENABLED=true -e XPACK_WATCHER_ENABLED=true -e XPACK_ML_ENABLED=true -e XPACK_MONITORING_ENABLED=true -e XPACK_MONITORING_UI_CONTAINER_ELASTICSEARCH_ENABLED kibana:6.4.1 | |
docker run -d --name logstash --link elasticsearch:elasticsearch -e "XPACK.MONITORING.ELASTICSEARCH.URL=http://elasticsearch:9200" logstash:6.5.1 | |
docker run -d --name elastichq --link elasticsearch:elasticsearch -p 5000:5000 elastichq/elasticsearch-hq:release-v3.5.0 | |
curl -s -H "Content-Type: application/json" -XPOST http://localhost:9200/info/info/1 -d @fakedata.json |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
# All Vagrant configuration is done below. The "2" in Vagrant.configure | |
# configures the configuration version (we support older styles for | |
# backwards compatibility). Please don't change it unless you know what | |
# you're doing. | |
Vagrant.configure("2") do |config| | |
# Servidor do Gestão DB | |
config.vm.define "consul" do |consul| |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl \ | |
-d "client_id=myclient" \ | |
-d "client_secret=40cc097b-2a57-4c17-b36a-8fdf3fc2d578" \ | |
-d "username=user" \ | |
-d "password=password" \ | |
-d "grant_type=password" \ | |
"http://localhost:8080/auth/realms/master/protocol/openid-connect/token" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html ng-app="App"> | |
<head> | |
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.2.12/angular.js"></script> | |
<script src="//angular-ui.github.io/bootstrap/ui-bootstrap-tpls-0.10.0.js"></script> | |
<link href="//netdna.bootstrapcdn.com/bootstrap/3.0.3/css/bootstrap.min.css" rel="stylesheet"> | |
</head> | |
<body ng-controller="MainCtrl"> | |
<stopwatch title="Stopwatch #1" time="sharedTime"></stopwatch> | |
<div stopwatch title="Stopwatch #2" time="sharedTime"></div> | |
<hr /> |
NewerOlder