Skip to content

Instantly share code, notes, and snippets.

View JohannesBertens's full-sized avatar

Johannes JohannesBertens

View GitHub Profile
@JohannesBertens
JohannesBertens / genesis.json
Last active September 12, 2018 10:00
Genesis JSON for our private Ethereum network
{
"config": {
"chainId": 0,
"homesteadBlock": 0,
"eip155Block": 0,
"eip158Block": 0
},
"alloc": {
"0x0000000000000000000000000000000000000001": {"balance": "111111111"},
"0x0000000000000000000000000000000000000002": {"balance": "222222222"}
@JohannesBertens
JohannesBertens / Dockerfile
Created September 12, 2018 09:39
Geth-init Dockerfile
FROM ethereum/client-go:alpine
ADD genesis.json .
CMD ["init", "genesis.json"]
@JohannesBertens
JohannesBertens / info.sh
Created September 12, 2018 09:30
Grab info from Geth nodes
# For node 1 (bound on port 8545)
curl -X POST -H "Content-Type: application/json" --data '{"jsonrpc":"2.0","method":"admin_nodeInfo","params":[],"id":67}' http://127.0.0.1:8545
# For node 2 (bound on port 8546)
curl -X POST -H "Content-Type: application/json" --data '{"jsonrpc":"2.0","method":"admin_nodeInfo","params":[],"id":67}' http://127.0.0.1:8546
@JohannesBertens
JohannesBertens / start_network.sh
Last active October 10, 2018 12:42
Start private Ethereum multi-node network
# Create network & volumes
docker network create geth
docker volume create datadir1
docker volume create datadir2
# Pull images
docker pull dapps/geth-init
docker pull dapps/geth-mine
# Create and init nodes
@JohannesBertens
JohannesBertens / genesis.json
Created August 29, 2018 10:17
Genesis JSON file
{
"config": {
"chainId": 4321,
"homesteadBlock": 0,
"eip155Block": 0,
"eip158Block": 0
},
"alloc": {},
"difficulty" : "0x20000",
"gasLimit" : "0x8880000"
#!/bin/sh
echo %wheel ALL=NOPASSWD:ALL > /etc/sudoers.d/wheel
adduser johannes
usermod -aG wheel johannes
mkdir /home/johannes/.ssh/
cp /root/.ssh/authorized_keys /home/johannes/.ssh/authorized_keys
chown johannes.johannes /home/johannes/.ssh/authorized_keys
yum update -y
{
"insecure-registries": ["172.30.0.0/16"]
}
#!/bin/sh
sudo docker pull djbnjack/metricbeat
sudo docker rm mb --force
sudo docker run --restart=always -d --pid=host --volume=/proc:/hostfs/proc:ro --volume=/sys/fs/cgroup:/hostfs/sys/fs/cgroup:ro --volume=/:/hostfs:ro --net=host --name=mb djbnjack/metricbeat
@JohannesBertens
JohannesBertens / LogstashSearch.md
Last active September 18, 2016 13:25
Elasticsearch DSL Query
GET /logstash-*/_search
{
   "_source": ["@timestamp", "container_name", "host", "message"],
   "sort" : [
        { "@timestamp" : {"order" : "desc"}}
    ],
    "query": {
        "match" : {
 "message" : {