NOTE: this gist can be outdated, refer to this repository instead - https://github.com/ghaiklor/iterm-fish-fisherman-osx
- Download and install iTerm2 (it has better color fidelity than the built in Terminal).
NOTE: this gist can be outdated, refer to this repository instead - https://github.com/ghaiklor/iterm-fish-fisherman-osx
// An example on how to generate a local SSL certificate in Go | |
// and serve HTTPS traffic with it. | |
// | |
// Code taken from the book Go Web Programming by Sau Sheong Chang | |
// https://github.com/sausheong/gwp | |
// | |
// Run with `--https` to serve traffic via HTTPS (it will create the certificate | |
// and private key files if they don't exist) | |
// | |
// Run with no parameters to serve traffic via HTTP (no certificates needed) |
package main | |
import ( | |
"crypto/tls" | |
"github.com/facebookgo/grace/gracehttp" | |
"log" | |
"net/http" | |
"rsc.io/letsencrypt" | |
) |
package main | |
import ( | |
"crypto/tls" | |
"golang.org/x/crypto/acme/autocert" | |
"log" | |
"net" | |
"net/http" | |
) |
package main | |
import ( | |
"fmt" | |
"net/url" | |
"github.com/PuerkitoBio/goquery" | |
"time" | |
"strings" | |
"strconv" | |
"math/rand" |
We will be using 3 virtual machines as 3 Ethereum node. We used 'Ubuntu Server 14.04 LTS trusty', and 'Ubuntu 15.10 wily' for this experiment. Root Ethereum node will be referred as 'root node', client nodes will be referred as 'client node A' & 'client node B' respectively. On root node port 30303 must be accessible from outside.
Below are the installation instructions for the latest versions of Ubuntu. This step must be executed and Ethereum go client 'geth' must be installed on every node.
server { | |
listen 3000 ssl; | |
listen [::]:3000; | |
error_log /usr/local/var/log/nginx/error.log; | |
access_log /usr/local/var/log/nginx/access.log; | |
# Google DNS, Open DNS, Dyn DNS | |
resolver 8.8.8.8 8.8.4.4 208.67.222.222 208.67.220.220 216.146.35.35 216.146.36.36 valid=300s; | |
resolver_timeout 3s; |
server { | |
listen 80 default_server; | |
listen [::]:80 default_server ipv6only=on; | |
server_name www.dipl.io dipl.io; | |
return 301 https://dipl.io$request_uri; | |
} | |
server { | |
listen 443 ssl http2; | |
listen [::]:443 ssl http2; |
class AdminFileHandler(BaseHandler): | |
@authenticated | |
def get(self, file_name): | |
_file_dir = os.path.abspath("")+"/my/path/downloads" | |
_file_path = "%s/%s" % (_file_dir, file_name) | |
if not file_name or not os.path.exists(_file_path): | |
raise HTTPError(404) | |
self.set_header('Content-Type', 'application/force-download') | |
self.set_header('Content-Disposition', 'attachment; filename=%s' % file_name) |
# -*- coding: utf-8 -*- | |
import asyncio | |
import uvloop | |
from aiohttp.web import Application, MsgType, WebSocketResponse | |
def add_socket(app, socket, user_id): | |
if user_id in app['connections']: | |
pass |