cat /etc/*-release
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
| type ( | |
| // BuoyCondition contains information for an individual station. | |
| BuoyCondition struct { | |
| WindSpeed float64 `bson:"wind_speed_milehour"` | |
| WindDirection int `bson:"wind_direction_degnorth"` | |
| WindGust float64 `bson:"gust_wind_speed_milehour"` | |
| } | |
| // BuoyLocation contains the buoy's location. | |
| BuoyLocation struct { |
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
| sudo wget http://repos.fedorapeople.org/repos/dchen/apache-maven/epel-apache-maven.repo -O /etc/yum.repos.d/epel-apache-maven.repo | |
| sudo sed -i s/\$releasever/6/g /etc/yum.repos.d/epel-apache-maven.repo | |
| sudo yum install -y apache-maven | |
| mvn --version |
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
| # n天内未修改 | |
| find /home/deploy/micro-services -name "*.log" -mtime +3 |while read line; do cat /dev/null > "$line"; done; | |
| # 大小超过800M | |
| find /home/deploy/micro-services -name "*.log" -size +800M |while read line; do cat /dev/null > "$line"; done; |
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
| docker cp CONTAINER:FILEPATH LOCALFILEPATH | |
| vi LOCALFILEPATH | |
| docker cp LOCALFILEPATH CONTAINER:FILEPATH |
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
| FROM ubuntu | |
| RUN echo "deb http://archive.ubuntu.com/ubuntu precise main universe" > /etc/apt/sources.list | |
| RUN apt-get update | |
| RUN apt-get upgrade | |
| RUN apt-get install -y openssh-server supervisor | |
| ADD sshd.conf /etc/supervisor/conf.d/sshd.conf | |
| RUN mkdir -p /var/run/sshd |
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
| func merge(a, b <-chan int) <-chan int { | |
| c := make(chan int) | |
| go func() { | |
| defer close(c) | |
| for a != nil || b != nil { | |
| select { | |
| case v, ok := <-a: | |
| if !ok { | |
| fmt.Println("a is done") | |
| a = nil |
$ ssh -A vm
$ git config --global url."git@github.com:".insteadOf "https://github.com/"
$ cat ~/.gitconfig
[url "git@github.com:"]
insteadOf = https://github.com/
$ go get github.com/private/repo && echo Success!
Success!... or Why Pipelining Is Not That Easy
Golang Concurrency Patterns for brave and smart.
By @kachayev