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
// +build integration,!no-etcd | |
package integration | |
import ( | |
"crypto/tls" | |
"net/http" | |
"testing" | |
testutil "github.com/openshift/origin/test/util" |
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" | |
"time" | |
"github.com/GoogleCloudPlatform/kubernetes/pkg/util" | |
// "github.com/juju/ratelimit" | |
) |
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
/* | |
Generate a config like this: | |
openshift start master --write-config=requestheader --master=https://127.0.0.1:8443 --etcd-dir=requestheader/etcd | |
Update requestheader/master-config.yaml: | |
identityProviders: | |
- challenge: true | |
login: true | |
name: header |
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" | |
"fmt" | |
"io" | |
"os" | |
"time" | |
) |
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" | |
"crypto/x509" | |
"fmt" | |
"io/ioutil" | |
"net/http" | |
"net/http/httptest" | |
"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
package main | |
import "fmt" | |
func main() { | |
s1 := []int{1,2,3,4,5} | |
s2 := s1[0:1] | |
s2 = append(s2, -1) | |
fmt.Println(s1) | |
fmt.Println(s2) |
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" | |
func main() { | |
s := "样本" | |
fmt.Println(len(s)) | |
fmt.Println("") | |
fmt.Println("range index only:") |
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 recycler | |
import ( | |
"io/ioutil" | |
"os" | |
"path" | |
"testing" | |
) | |
var filenames = []string{ |
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 | |
mkdir -p 0-rwx-/1000-rwx-/2000-rwx-/0-rw-/1000-rw-/2000-rw-/0-r-/1000-r-/2000-r-/0--/1000--/2000--/x | |
mkdir -p 0--rwx/1000--rwx/2000--rwx/0--rw/1000--rw/2000--rw/0--r/1000--r/2000--r/0--/1000--/2000--/x | |
# create a file in each dir | |
find . -type d | xargs -n 1 bash -c 'touch "$@"/myfile' {} | |
# owned by some user/group | |
find . -name myfile | xargs chown 3000 | |
find . -name myfile | xargs chgrp 3000 |
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" | |
) | |
func main() { | |
zero := 0 | |
one := 0 |
OlderNewer