2.1 原厂固件中,直接web页面升级 2.2 已刷openwrt的话,telent/ssh登录,下载bin文件到/tmp,运行'sysupgrade -i /tmp/openwrt-ar71xx-ubnt-rspro-squashfs-sysupgrade.bin'
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"compress/gzip" | |
"io" | |
"net/http" | |
"strings" | |
) | |
type gzipResponseWriter struct { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
) | |
type Node struct { | |
Value int | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import "fmt" | |
import "os" | |
import "io" | |
import "io/ioutil" | |
import "log" | |
// Copies file source to destination dest. | |
func CopyFile(source string, dest string) (err error) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Implementation of a UDP proxy | |
package main | |
import ( | |
"flag" | |
"fmt" | |
"log" | |
"net" | |
"os" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"reflect" | |
) | |
type Foo struct { | |
FirstName string `tag_name:"tag 1"` | |
LastName string `tag_name:"tag 2"` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mgo.SetDebug(true) | |
var aLogger *log.Logger | |
aLogger = log.New(os.Stderr, "", log.LstdFlags) | |
mgo.SetLogger(aLogger) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"os" | |
) | |
import ( | |
"labix.org/v2/mgo" | |
"labix.org/v2/mgo/bson" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
host="http://docs.qiniu.com" | |
IFS=$(echo -en "\n\b") | |
code=0 | |
for file in `find $1 -name *.html`; do | |
for href in `egrep -o 'href="(.*?)".*?>(.*?)<' < $file | sed -E 's/href="([^\"]*)".*>(.*)</\1•\2/g'`; do | |
name=${href##*•} | |
href=${href%%•*} | |
if [ ${href:0:1} == "#" ]; then | |
path=$file$href |
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
OlderNewer