Skip to content

Instantly share code, notes, and snippets.

*underlineColor: rgb:9e/00/00
*cursorColor: rgb:9e/00/00
*foreground: rgb:e7/e7/e7
*background: rgb:00/00/00
!black
*color0: rgb:00/00/00
*color8: rgb:25/25/25
@mrosset
mrosset / clientDoGzip.go
Created March 16, 2012 15:45 — forked from elazarl/clientDoGzip.go
Client.Do will not uncompress response body
package main
// run this file with `go run clientDoGzip.go, and then file tmp.out to verify body is gzipped
import "compress/gzip"
import "net/http"
import "fmt"
import "io"
import "log"
import "os"
{
"Name": "linux-headers",
"Url": "http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.38.tar.bz2",
"Version": "2.6.38",
"Desc": "Linux Kernel API",
"PreBuild": "",
"Build": [
"make mrproper",
"make headers_check"
],
@mrosset
mrosset / util.go
Created March 27, 2011 05:06
tar bzip2 gzip decompressor
// Decompress bzip2 or gzip file to destination directory
func untar(file string, dest string) (err os.Error) {
f, err := os.Open(file, os.O_RDONLY, RMASK)
if err != nil {
return err
}
defer f.Close()
var cr io.Reader
switch path.Ext(file) {
case ".bz2":
@mrosset
mrosset / gist:888137
Created March 26, 2011 08:41
gofmt --help
-r="": rewrite rule (e.g., 'α[β:len(α)] -> α[β:]')
func cp(src string, dest string) os.Error {
fsrc, err := os.Open(src, os.O_RDONLY, 0644)
si, err := os.Stat(fsrc.Name())
if err != nil {
return err
}
defer fsrc.Close()
if err != nil {
return err
}
exec 3<> /dev/tcp/aur3.org/1819
cat <&3
exec 3<&-
echo
func ExecIn(path string, format string, a ...interface{}) {
fork := &Fork{path}
fork.Exec(format, a...)
}
package main
import (
"io/ioutil"
)
func init() {
var (
name = "glibc"
++ checking tool chain sanity
Toolchain:
sh /opt/via/bin/sh
make /usr/bin/make
cc /usr/lib/ccache/bin/cc
wget /usr/bin/wget
tar /bin/tar
bogus command "bogus" not found in $PATH
superlongbogustoolthatgoesonforever command "superlongbogustoolthatgoesonforever" not found in $PATH