Skip to content

Instantly share code, notes, and snippets.

View TravisMullen's full-sized avatar

Travis Mullen TravisMullen

View GitHub Profile
@TravisMullen
TravisMullen / mongo-docker.bash
Created April 30, 2017 04:42 — forked from davideicardi/mongo-docker.bash
Running mongodb inside a docker container (with mongodb authentication)
# Create a container from the mongo image,
# run is as a daemon (-d), expose the port 27017 (-p),
# set it to auto start (--restart)
# and with mongo authentication (--auth)
# Image used is https://hub.docker.com/_/mongo/
docker pull mongo
docker run --name YOURCONTAINERNAME --restart=always -d -p 27017:27017 mongo mongod --auth
# Using the mongo "localhost exception" (https://docs.mongodb.org/v3.0/core/security-users/#localhost-exception)
# add a root user
pragma solidity ^0.4.19;
// CryptoRoulette
//
// Guess the number secretly stored in the blockchain and win the whole contract balance!
// A new number is randomly chosen after each try.
//
// To play, call the play() method with the guessed number (1-20). Bet price: 0.1 ether
contract CryptoRoulette {