openssl genrsa -out server.key 2048
openssl req -new -x509 -key server.key -out server.pem -days 3650
| package main | |
| // using asymmetric crypto/RSA keys | |
| import ( | |
| "crypto/rsa" | |
| "fmt" | |
| "io/ioutil" | |
| "log" | |
| "net/http" |
| package main | |
| import ( | |
| "bytes" | |
| "fmt" | |
| "io" | |
| "log" | |
| "mime/multipart" | |
| "net/http" | |
| "os" |
| package main | |
| import ( | |
| "net/http" | |
| "database/sql" | |
| "fmt" | |
| "log" | |
| "os" | |
| ) |
| func EncodeStreamingVideo(streamingFile io.Reader, request ShouldCanceler) (*os.File, error) { | |
| outputFilename := generateFilename("mp4") | |
| // Actually start the command. | |
| cmd := exec.Command("ffmpeg", | |
| // Read input from stdin. | |
| "-i", "-", | |
| // ... environment-specific ffmpeg options ... | |
| "-y", outputFilename) |
| // Copyright 2013 René Kistl. All rights reserved. | |
| // Use of this source code is governed by a BSD-style | |
| // license that can be found in the LICENSE file. | |
| package srpc | |
| import ( | |
| "errors" | |
| "fmt" | |
| "github.com/pcdummy/skynet2/rpc/bsonrpc" |
| func logger(prefix string, h http.Handler) http.HandlerFunc { | |
| return func(w http.ResponseWriter, r *http.Request) { | |
| // Save a copy of this request for debugging. | |
| requestDump, err := httputil.DumpRequest(r, false) | |
| if err != nil { | |
| log.Println(err) | |
| } | |
| log.Println(prefix, string(requestDump)) |
| /* | |
| gittip: a basic git http server. | |
| DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE | |
| Version 2, December 2004 | |
| Copyright 2014 Chase Zhang <yun.er.run@gmail.com> | |
| Everyone is permitted to copy and distribute verbatim or modified | |
| copies of this license document, and changing it is allowed as long |
#256 colors in putty, tmux/screen and vim There is a detailed answer on stackoverflow. If you are looking for a short one, here it is.
putty
Set Connection -> Data -> Terminal-type string to xterm-256color
tmux
Add this line to ~/.tmux.conf