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 | |
# Creates a 1GB swapfile and permanently enables it. | |
# thanks to: | |
# https://www.digitalocean.com/community/tutorials/how-to-add-swap-space-on-ubuntu-16-04 | |
set -eu | |
sudo fallocate -l 1G /swapfile | |
sudo chmod 600 /swapfile |
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" | |
"math/rand" | |
"time" | |
"github.com/gonum/matrix/mat64" | |
// Switch to cblas for the C implementation of BLAS. | |
blas "github.com/gonum/blas/goblas" | |
) |
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
// this is not complete and doesn't compile, but hopefully it's a useful guideline. | |
randInfoHash := false | |
if infoHash != "" { | |
if infoHash == "rand" { | |
randInfoHash = true | |
// No need to insist in getting peers for a specific infohash, | |
// since we're probing the address space. | |
numTargetPeers = 1 |
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" | |
logpkg "log" | |
"log/syslog" | |
"net" | |
"net/http" | |
"os" | |
"os/exec" |
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 ( | |
"bufio" | |
"bytes" | |
"encoding/base64" | |
"flag" | |
"fmt" | |
"io" | |
"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
// You can edit this code! | |
// Click here and start typing. | |
package main | |
import "fmt" | |
func main() { | |
fmt.Println("Hello, 世界") | |
} |
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" | |
"rand" | |
"time" | |
) | |
func main() { | |
a := []int64{0, 1, 2, 3, 4, 5, 6} |
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
POST /accounts/OAuthGetRequestToken HTTP/1.1 | |
Host: www.google.com | |
User-Agent: Go http package | |
Connection: close | |
Transfer-Encoding: chunked | |
Authorization: OAuth oauth_callback="http%3A%2F%2Flocalhost%3A8080%2Fcallback%2Foauth", oauth_consumer_key="cetico.org", oauth_nonce="5577006791947779410", oauth_signature_method="HMAC-SHA1", oauth_timestamp="1282521243", oauth_version="1.0", oauth_signature="pVrdPTu2u5nYy2x5UgJZCTeKF6w%3D" | |
Content-Type: application/x-www-form-urlencoded | |
0 |
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
include $(GOROOT)/src/Make.$(GOARCH) | |
all : webirc | |
TARG=webirc | |
GOFILES=main.go | |
include $(GOROOT)/src/Make.cmd |
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" | |
"net" | |
"github.com/GoogleCloudPlatform/kubernetes/Godeps/_workspace/src/gopkg.in/v1/yaml" | |
) |