Skip to content

Instantly share code, notes, and snippets.

@luisbebop
luisbebop / install-rbenv-amazon-linux-ami.sh
Created November 26, 2017 16:32
Install rbenv on Amazon Linux AMI
sudo yum install -y git gcc make readline-devel openssl-devel
git clone git://github.com/rbenv/rbenv.git ~/.rbenv
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc
echo 'eval "$(rbenv init -)"' >> ~/.bashrc
source ~/.bashrc
# Install ruby-build system-widely
git clone git://github.com/rbenv/ruby-build.git /tmp/ruby-build
cd /tmp/ruby-build
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <assert.h>
#include <errno.h>
#include <ctype.h>
#include "bencode.h"
#define MAX_ALLOC (((size_t) -1) / sizeof(struct bencode *) / 2)

Here are the instructions to build the CloudWalk Testnet. This chain is EVM compatible based on Substrate.

I have used Amazon Linux 2 AMI. You will need at least 40GB, 4CPU, 8GB mem to start. Need to go further in transactions benchmarks and see how the nodes will behave at scale.

First install compiler utils on the machine you will generate the node binary for the network. I recommend you use a faster machine to compile (it takes time 20-30 minutes). Then use the binary on the nodes on the network that don't need to be that fast.

sudo yum install -y cmake pkg-config libssl-dev git build-essential clang libclang-dev curl
@luisbebop
luisbebop / server-euforia.go
Last active May 17, 2016 20:58
Go websocket echo server with permessage-deflate extension enabled
// Copyright 2015 The Gorilla WebSocket Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// +build ignore
package main
import (
"flag"
@luisbebop
luisbebop / httpbenchmark.go
Last active May 6, 2016 12:36
http benchmark tool
import (
"flag"
"fmt"
"net/http"
)
var (
n = flag.Int("n", 100, "number of GETs to run")
s = flag.Bool("s", false, "whether to use HTTPS")
c = flag.Bool("c", false, "whether to run concurrently")
@luisbebop
luisbebop / inicio.c
Last active December 28, 2015 16:59
Generated using the little inicio.xml here (https://github.com/planobe/posxml/tree/master/Plano%20Be%20-%20WALK%20Downloaders/WALK_Downloader_Universal_modded_to_WalkServices_en_lite) with the command: hexdump -v -e '16/1 "0x%02x,"' -e '"\n"' inicio.posxml
const unsigned char simple_init_data[] = {
0x6d,0x33,0x0a,0x31,0x0a,0x0d,0x3e,0x0a,0x32,0x0a,0x0d,0x3e,0x0a,0x33,0x0a,0x0d,
0x3e,0x0a,0x34,0x0a,0x0d,0x3e,0x0a,0x35,0x0a,0x0d,0x3e,0x0a,0x36,0x0a,0x0d,0x3e,
0x63,0x6f,0x6e,0x66,0x69,0x67,0x2e,0x64,0x61,0x74,0x0a,0x37,0x0a,0x0d,0x3e,0x0a,
0x38,0x0a,0x0d,0x3e,0x0a,0x39,0x0a,0x0d,0x3e,0x0a,0x31,0x30,0x0a,0x0d,0x3e,0x0a,
0x31,0x31,0x0a,0x0d,0x3e,0x0a,0x31,0x32,0x0a,0x0d,0x3e,0x0a,0x31,0x33,0x0a,0x0d,
0x3e,0x0a,0x31,0x34,0x0a,0x0d,0x3e,0x0a,0x31,0x35,0x0a,0x0d,0x3e,0x0a,0x31,0x36,
0x0a,0x0d,0x3e,0x0a,0x31,0x37,0x0a,0x0d,0x3e,0x0a,0x31,0x38,0x0a,0x0d,0x3e,0x0a,
0x31,0x39,0x0a,0x0d,0x3e,0x0a,0x32,0x30,0x0a,0x0d,0x3e,0x0a,0x32,0x31,0x0a,0x0d,
0x3e,0x0a,0x32,0x32,0x0a,0x0d,0x3e,0x70,0x61,0x63,0x6b,0x61,0x67,0x65,0x2e,0x7a,
$ rake
~/Documents/c/mobiruby-ios/submodules/libffi/armv7-ios ~/Documents/c/mobiruby-ios/submodules/libffi
autoreconf: 'configure.ac' or 'configure.in' is required
checking build system type... i386-apple-darwin12.5.0
checking host system type... arm-apple-darwin10
checking target system type... arm-apple-darwin10
checking for gsed... sed
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for arm-apple-darwin10-strip... no
/*
** mruby - An embeddable Ruby implementation
**
** Copyright (c) mruby developers 2010-2013
**
** Permission is hereby granted, free of charge, to any person obtaining
** a copy of this software and associated documentation files (the
** "Software"), to deal in the Software without restriction, including
** without limitation the rights to use, copy, modify, merge, publish,
** distribute, sublicense, and/or sell copies of the Software, and to
#Bound to this address so that external hosts can access it, VERY IMPORTANT!
set :bind, '0.0.0.0'
set :logging, true
FROM greglearns/ruby
RUN git clone https://github.com/planobe/cloudwalk-http-echo.git /opt/cloudwalk-http-echo/
RUN gem install bundler
EXPOSE 5000
ENV PORT 5000
RUN cd /opt/cloudwalk-http-echo && git pull && bundle install
CMD ["/usr/local/bin/foreman","start","-d","/opt/cloudwalk-http-echo"]