This file contains hidden or 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
| #/etc/security/limits.conf | |
| * hard nofile 1024000 | |
| * soft nofile 1024000 | |
| root hard nofile 1024000 | |
| root soft nofile 1024000 |
This file contains hidden or 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/rand" | |
| "fmt" | |
| "io" | |
| ) | |
| func newId(size int) string { | |
| k := make([]byte, size) |
This file contains hidden or 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
| Step 0. Install git | |
| yum install git | |
| Step 1. Clone repository | |
| git clone git://github.com/kr/beanstalkd.git | |
| cd beanstalkd | |
| make | |
| cp beanstalkd /usr/bin/beanstalkd |
This file contains hidden or 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
| import pycurl | |
| import cStringIO | |
| c = pycurl.Curl() | |
| c.setopt(pycurl.VERBOSE, 1) | |
| dummydata = "HI THIS IS SOME DATA" | |
| c.setopt(pycurl.URL, "http://127.0.0.1:9000/noreadbody") |
This file contains hidden or 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/env bash | |
| # script: watch | |
| # author: Mike Smullin <mike@smullindesign.com> | |
| # license: GPLv3 | |
| # description: | |
| # watches the given path for changes | |
| # and executes a given command when changes occur | |
| # usage: | |
| # watch <path> <cmd...> | |
| # |
This file contains hidden or 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" | |
| func calc(values []int) int { | |
| var ( | |
| left = 0 | |
| right = len(values) - 1 | |
| lmax = values[0] | |
| rmax = values[right] |
This file contains hidden or 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 ( | |
| "flag" | |
| "net/http" | |
| ) | |
| var port = flag.String("p", ":8080", "port") | |
| var dir = flag.String("d", "web", "directory") |
This file contains hidden or 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" | |
| "flag" | |
| "fmt" | |
| "io/ioutil" | |
| "strconv" | |
| "strings" |
This file contains hidden or 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" | |
| "image" | |
| _ "image/jpeg" | |
| _ "image/png" | |
| "os" | |
| "path/filepath" | |
| "strings" |