每个平台的信号定义或许有些不同。下面列出了POSIX中定义的信号。 Linux 使用34-64信号用作实时系统中。 命令man 7 signal提供了官方的信号介绍。
在POSIX.1-1990标准中定义的信号列表
| #Before we can use the script, we have to make it executable with the chmod command: | |
| #chmod +x ./go-executable-build.sh | |
| #then we can use it ./go-executable-build.sh yourpackage | |
| #!/usr/bin/env bash | |
| package=$1 | |
| if [[ -z "$package" ]]; then | |
| echo "usage: $0 <package-name>" | |
| exit 1 | |
| fi |
每个平台的信号定义或许有些不同。下面列出了POSIX中定义的信号。 Linux 使用34-64信号用作实时系统中。 命令man 7 signal提供了官方的信号介绍。
在POSIX.1-1990标准中定义的信号列表
One bash script to install google test (and mock) on your Mac. I assume you already had install cmake (if not, use brew - brew install cmake).
It use brew directories to store gmock and gtest.
#!/usr/bin/env bash| package main | |
| import ( | |
| "strings" | |
| ) | |
| func main() { | |
| strings.HasPrefix("foobar", "foo") // true | |
| } |
| package main | |
| import ( | |
| "io" | |
| "log" | |
| "net" | |
| "time" | |
| ) | |
| func reader(r io.Reader) { |
| func ip2int(ip net.IP) uint32 { | |
| if len(ip) == 16 { | |
| return binary.BigEndian.Uint32(ip[12:16]) | |
| } | |
| return binary.BigEndian.Uint32(ip) | |
| } | |
| func int2ip(nn uint32) net.IP { | |
| ip := make(net.IP, 4) | |
| binary.BigEndian.PutUint32(ip, nn) |
| # Create a container from the mongo image, | |
| # run is as a daemon (-d), expose the port 27017 (-p), | |
| # set it to auto start (--restart) | |
| # and with mongo authentication (--auth) | |
| # Image used is https://hub.docker.com/_/mongo/ | |
| docker pull mongo | |
| docker run --name YOURCONTAINERNAME --restart=always -d -p 27017:27017 mongo mongod --auth | |
| # Using the mongo "localhost exception" (https://docs.mongodb.org/v3.0/core/security-users/#localhost-exception) | |
| # add a root user |
| # Hello, and welcome to makefile basics. | |
| # | |
| # You will learn why `make` is so great, and why, despite its "weird" syntax, | |
| # it is actually a highly expressive, efficient, and powerful way to build | |
| # programs. | |
| # | |
| # Once you're done here, go to | |
| # http://www.gnu.org/software/make/manual/make.html | |
| # to learn SOOOO much more. |