Following steps from https://blog.ralch.com/articles/golang-sharing-libraries/
.
├── _wale.c
└── nautilus.go
go build -buildmode=c-archive -o nautilus.a nautilus.go
.
import math | |
# x_n+1 : x_n * a + c % m | |
# x_0 : seed | |
examples = [ | |
{"a": 2, "c": 3, "m": 5 "seed": 1}, | |
{"a": 9656501935081, "c" : 73755019183457, "m" : 82852957687500, "seed" : 4719414047169}, | |
{"a": 179088735505681, "c" : 36802983139387, "m" : 182797296932250, "seed" : 53695366949483}, | |
{"a": 9682768815721, "c" : 4894180310753, "m" : 42130424626290, "seed" : 30179788743147}, | |
] |
Following steps from https://blog.ralch.com/articles/golang-sharing-libraries/
.
├── _wale.c
└── nautilus.go
go build -buildmode=c-archive -o nautilus.a nautilus.go
.
package main | |
import ( | |
"flag" | |
"fmt" | |
"io" | |
"log" | |
"net" | |
"os" | |
"os/signal" |
TASK [launch-instance : nginx - os - launch instance] ************************** | |
task path: /home/ubuntu/git/services-ansible/roles/launch-instance/tasks/main.yml:32 | |
Using module file /usr/local/lib/python2.7/dist-packages/ansible/modules/core/cloud/openstack/os_server.py | |
<127.0.0.1> ESTABLISH LOCAL CONNECTION FOR USER: ubuntu | |
<127.0.0.1> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo $HOME/.ansible/tmp/ansible-tmp-1475290735.9-140508241290004 `" && echo ansible-tmp-1475290735.9-140508241290004="` echo $HOME/.ansible/tmp/ansible-tmp-1475290735.9-140508241290004 `" ) && sleep 0' | |
<127.0.0.1> PUT /tmp/tmp6xrd2V TO /home/ubuntu/.ansible/tmp/ansible-tmp-1475290735.9-140508241290004/os_server.py | |
<127.0.0.1> EXEC /bin/sh -c 'chmod u+x /home/ubuntu/.ansible/tmp/ansible-tmp-1475290735.9-140508241290004/ /home/ubuntu/.ansible/tmp/ansible-tmp-1475290735.9-140508241290004/os_server.py && sleep 0' | |
<127.0.0.1> EXEC /bin/sh -c '/usr/bin/python /home/ubuntu/.ansible/tmp/ansible-tmp-1475290735.9-140508241290004/os_server.py; |
package main | |
import ( | |
"compress/gzip" | |
"io" | |
"net/http" | |
"strings" | |
) | |
// Gzip Compression |