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 ( | |
// "bytes" | |
"encoding/json" | |
"fmt" | |
"io/ioutil" | |
"net/http" | |
// "unicode/utf8" | |
) |
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
server { | |
listen 80; | |
server_name s.ckeyer.com search.ckeyer.com; | |
location / { | |
proxy_pass https://s.ckeyer.com/; | |
} | |
} | |
server { | |
listen 443; | |
server_name s.ckeyer.com search.ckeyer.com; |
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 ( | |
"encoding/json" | |
"fmt" | |
"time" | |
) | |
type JsonTime struct { | |
time.Time |
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 controllers | |
import ( | |
"github.com/astaxie/beego" | |
) | |
type Controller struct { | |
beego.Controller | |
} |
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 CkString string | |
func (c *CkString) String() string { | |
return fmt.Sprint(c) |
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
#!/usr/bin/python | |
import os | |
kernel_version = os.popen('''/bin/uname -a | awk \'{print $1,$3}\'''').read().strip('\n') | |
ip = os.popen('''/sbin/ifconfig | grep 'inet'|awk '{print $2}'|cut -d ":" -f 2''').read().strip('\n') | |
ipv6 = os.popen('''/sbin/ifconfig | grep 'inet6'|awk '{print $3}' ''').read().strip('\n') | |
memory = os.popen('''free -m | head -2''').read().strip('\n') | |
disk = os.popen('''df -hT''').read().strip('\n') | |
print "Kernel Version:",kernel_version |
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" | |
"sync" | |
"time" | |
) | |
type Set struct { | |
Name string |
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 monitor | |
import ( | |
"errors" | |
"net" | |
"net/http" | |
"time" | |
“crypto/tls" | |
) | |
// 返回Get数据 |
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 ( | |
"sort" | |
) | |
// 选择排序:从所有序列中先找到最小的,然后放到第一个位置。 | |
// 之后再看剩余元素中最小的,放到第二个位置…… | |
func SelectionSort(data interface{}, args ...int) { | |
if v, ok := data.(sort.Interface); ok { |
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 ( | |
"sort" | |
) | |
// 直接插入排序是一种简单的插入排序法,其基本思想是: * 把待排序的纪录 | |
// 按其关键码值的大小逐个插入到一个已经排好序的有序序列中,直到所有的纪 | |
// 录插入完为止,得到一个新的有序序列 | |
func InsertionSort(data interface{}, args ...int) { |
OlderNewer