Skip to content

Instantly share code, notes, and snippets.

View mehmetkose's full-sized avatar
:electron:
Reacting

Mehmet Kose mehmetkose

:electron:
Reacting
  • Sour Cream LTD
  • Dublin, Ireland
  • 23:38 (UTC)
  • X @mehmetkose
View GitHub Profile
@mehmetkose
mehmetkose / iterm-fish-fisherman-meslo-osx.md
Created March 27, 2018 22:28 — forked from ghaiklor/iterm-fish-fisherman-meslo-osx.md
iTerm 2 + fish + fisherman + Material Design + Meslo
@mehmetkose
mehmetkose / server.go
Created October 10, 2017 17:00 — forked from hectorcorrea/server.go
An example on how to generate a local SSL certificate in Go and serve HTTPS traffic with it
// 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)
@mehmetkose
mehmetkose / server.go
Created October 10, 2017 16:58 — forked from bouk/server.go
Go server with automatic Let's Encrypt registration and graceful restarts
package main
import (
"crypto/tls"
"github.com/facebookgo/grace/gracehttp"
"log"
"net/http"
"rsc.io/letsencrypt"
)
@mehmetkose
mehmetkose / https.go
Created October 10, 2017 16:57 — forked from kennwhite/https.go
Simple https http/2 static web server with HSTS & CSP (A+ SSLLabs & securityheaders.io rating) in Go using LetsEncrypt acme autocert
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"
@mehmetkose
mehmetkose / Ethereum_testnet.md
Created August 17, 2017 18:01 — forked from 0mkara/Ethereum_private_network.md
Ethereum testnet configuration guide.

Create your own Ethereum testnet

Introduction

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.

Installation

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.

@mehmetkose
mehmetkose / diplicity.conf
Created June 13, 2017 02:23 — forked from spamguy/diplicity.conf
An HTTPS reverse proxy configuration for Diplicity.
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;
@mehmetkose
mehmetkose / dipl.io.conf
Created June 13, 2017 02:22 — forked from spamguy/dipl.io.conf
An nginx configuration featuring HTTP/2, IPv6, Let's Encrypt SSL, and a decent cipher suite
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;
@mehmetkose
mehmetkose / handlers.py
Created December 23, 2016 11:27 — forked from alejandrobernardis/handlers.py
Tornado, Download File
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)
@mehmetkose
mehmetkose / ws_app.py
Created November 30, 2016 16:27 — forked from kracekumar/ws_app.py
Simple websocket server with uvloop.
# -*- 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