Instance | Branch |
---|
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
ssh-keygen -t rsa -b 4096 -f jwtRS256.key | |
# Don't add passphrase | |
openssl rsa -in jwtRS256.key -pubout -outform PEM -out jwtRS256.key.pub | |
cat jwtRS256.key | |
cat jwtRS256.key.pub |
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" | |
"runtime" | |
// "runtime/debug" | |
) | |
func foo(m *runtime.MemStats) { | |
runtime.ReadMemStats(m) |
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 ( | |
"database/sql" | |
"time" | |
"log" | |
_ "github.com/go-sql-driver/mysql" | |
"github.com/jinzhu/gorm" |
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 ( | |
"crypto/tls" | |
"log" | |
"math/rand" | |
"syscall" | |
"time" | |
"github.com/canhlinh/log4go" |
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
[Unit] | |
Description= Video Streaming Proxy | |
[Service] | |
LimitNOFILE=64000 | |
User=ubuntu | |
Group=ubuntu | |
Restart=always | |
WorkingDirectory=/opt/video-proxy | |
ExecStart=/opt/video-proxy/proxy_streaming |
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" | |
"database/sql" | |
"encoding/base32" | |
"encoding/binary" | |
"math/rand" | |
"testing" |
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
[Unit] | |
Description=MongoDB Database Service | |
Wants=network.target | |
After=network.target | |
[Service] | |
ExecStart=/usr/bin/mongod --quiet --config /etc/mongodb.conf | |
ExecStop=/usr/bin/mongod -f /etc/mongodb.conf --shutdown | |
Restart=always | |
User=mongodb |
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
func NewBufferQueue() *BufferQueue { | |
return &BufferQueue{ | |
Q: make(model.Queue, 100), | |
quitRr: make(chan bool, 1), | |
quitWr: make(chan bool, 1), | |
W: &sync.WaitGroup{}, | |
} | |
} | |
type BufferQueue 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
# update packages | |
sudo apt-get update | |
# install python and graphite dependencies | |
sudo apt-get install -y python python-dev python-virtualenv libevent-dev python-pip python-cairo python-django-tagging python-twisted python-memcache python-pysqlite2 | |
# install web server | |
sudo apt-get install -y nginx uwsgi uwsgi-plugin-python | |
# install postgresql and dependencies |
OlderNewer