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 | |
# Save this script somewhere (chmod it 777) and add this to cron: | |
# 0 */2 * * * cd ~; dd.sh | |
# | |
# There are some configuration variables to change below these comments | |
# | |
# You'll want to set where the dd command prints to, as well as what command it runs | |
# |
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
types { | |
text/html html htm shtml; | |
text/css css; | |
text/xml xml; | |
image/gif gif; | |
image/jpeg jpeg jpg; | |
application/javascript js; | |
application/atom+xml atom; | |
application/rss+xml rss; |
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 | |
OFFICIAL_DOTDEB="http://packages.dotdeb.org" | |
APT_FOLDER="/etc/apt/sources.list.d/" | |
DOTDEB_FILE="dotdeb.list" | |
# Make sure we're running this as root! | |
if [[ $UID -ne 0 ]]; then | |
echo "$0 must be run as root" | |
exit 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
### Keybase proof | |
I hereby claim: | |
* I am nickvanw on github. | |
* I am nickvanw (https://keybase.io/nickvanw) on keybase. | |
* I have a public key whose fingerprint is 9549 9ACC 64DE 7476 0624 2871 67A9 7259 F9FC 4628 | |
To claim this, I am signing this object: |
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/cipher" | |
"crypto/rand" | |
"crypto/sha1" | |
"encoding/base64" | |
"errors" | |
"fmt" | |
"math/big" |
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/csv" | |
"encoding/json" | |
"fmt" | |
"io/ioutil" | |
"net/http" | |
"strings" | |
"sync" |
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 datastore | |
import ( | |
"database/sql" | |
) | |
const ( | |
createUser = ` | |
INSERT INTO users (name, email) | |
VALUES(?, |
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
nick@nick-mbp ~/.g/s/g/n/cbzip2 (master) [2]> go build -work -x | |
WORK=/var/folders/fz/80y95njs0wb4hyd9b3j84zd40000gn/T/go-build955903386 | |
mkdir -p $WORK/github.com/nickvanw/cbzip2/_obj/ | |
mkdir -p $WORK/github.com/nickvanw/ | |
cd /Users/nick/.gopath/src/github.com/nickvanw/cbzip2 | |
CGO_LDFLAGS="-g" "-O2" /usr/local/Cellar/go/1.4.2/libexec/pkg/tool/darwin_amd64/cgo -objdir $WORK/github.com/nickvanw/cbzip2/_obj/ -- -I $WORK/github.com/nickvanw/cbzip2/_obj/ -Werror=implicit -Werror=implicit reader.go writer.go | |
/usr/local/Cellar/go/1.4.2/libexec/pkg/tool/darwin_amd64/6c -F -V -w -trimpath $WORK -I $WORK/github.com/nickvanw/cbzip2/_obj/ -I /usr/local/Cellar/go/1.4.2/libexec/pkg/darwin_amd64 -o $WORK/github.com/nickvanw/cbzip2/_obj/_cgo_defun.6 -D GOOS_darwin -D GOARCH_amd64 $WORK/github.com/nickvanw/cbzip2/_obj/_cgo_defun.c | |
clang -I . -fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fno-common -print-libgcc-file-name | |
clang -I . -fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments - |
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 cbzip2 | |
/* | |
#cgo CFLAGS: -Werror=implicit | |
#include "bzip2/bzlib.h" | |
*/ | |
import "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
// WithUUID returns a new Context that carries a uuid. If the UUID | |
// already exists, nothing is done. Otherwise a new one is created. | |
func WithUUID(c context.Context) (context.Context, string) { | |
if u, ok := c.Value("request.id").(string); ok { | |
return c, u | |
} | |
uuid := uuid.New() | |
return context.WithValue(c, "request.id", uuid), uuid | |
} |
OlderNewer