Skip to content

Instantly share code, notes, and snippets.

💭
show me the way to grayskull

randy rand99

  • none
  • Austria
View GitHub Profile
@rand99
rand99 / csv2xlsx.go
Last active May 3, 2017
csv with custom sperator to xlsx converter
View csv2xlsx.go
package main
import (
"bufio"
"fmt"
"log"
"os"
"github.com/tealeg/xlsx"
"strings"
"path/filepath"
@rand99
rand99 / simple-gpg-enc.go
Created Feb 22, 2017 — forked from stuart-warren/simple-gpg-enc.go
golang gpg/openpgp encryption/decryption example
View simple-gpg-enc.go
package main
import (
"bytes"
"code.google.com/p/go.crypto/openpgp"
"encoding/base64"
"io/ioutil"
"log"
"os"
)
@rand99
rand99 / templates.go
Created May 21, 2016
labstack echo template inheritance recipe
View templates.go
package bla
import (
"io"
"html/template"
"path/filepath"
"strings"
)
// folder structure
@rand99
rand99 / main.go
Created Feb 25, 2016
golang invert png images in current folder
View main.go
package main
import (
"io/ioutil"
"log"
"github.com/disintegration/imaging"
"image"
"os"
)
@rand99
rand99 / a_golang_job_queue.md
Created Nov 10, 2015 — forked from harlow/golang_job_queue.md
Job queues in Golang
View a_golang_job_queue.md
View sshd.go
// A small SSH daemon providing bash sessions
//
// Server:
// cd my/new/dir/
// #generate server keypair
// ssh-keygen -t rsa
// go get -v .
// go run sshd.go
//
// Client:
View benchmark+go+nginx.md

Benchmarking Nginx with Go

There are a lot of ways to serve a Go HTTP application. The best choices depend on each use case. Currently nginx looks to be the standard web server for every new project even though there are other great web servers as well. However, how much is the overhead of serving a Go application behind an nginx server? Do we need some nginx features (vhosts, load balancing, cache, etc) or can you serve directly from Go? If you need nginx, what is the fastest connection mechanism? This are the kind of questions I'm intended to answer here. The purpose of this benchmark is not to tell that Go is faster or slower than nginx. That would be stupid.

So, these are the different settings we are going to compare:

  • Go HTTP standalone (as the control group)
  • Nginx proxy to Go HTTP
  • Nginx fastcgi to Go TCP FastCGI
  • Nginx fastcgi to Go Unix Socket FastCGI
View sshd.go
package main
import (
"fmt"
"io"
"io/ioutil"
"log"
"code.google.com/p/go.crypto/ssh"
"code.google.com/p/go.crypto/ssh/terminal"
@rand99
rand99 / rails_loginjection.rb
Created Mar 13, 2011
(only on intranet webapps) 3.0.5
View rails_loginjection.rb
#Encoding: UTF-8
#
# Log-File-Injection - Ruby on Rails 3.05
# possibilities:
# - possible date back attacks (tried with request-log-analyzer: worked but teaser_check_warnings)
# - ip spoofing
# - terminal injection
# - binary log-injections
# - DOS if ip is used with an iptables-ban-script
#
View gist:843665
role admin sA
subject / rvka
/ rwcdmlxi
role default
subject / {
/ h
-CAP_ALL
connect disabled
bind disabled
You can’t perform that action at this time.