Normally, it is sufficient to grab the Go MSI installer from the website in order to set up the toolchain. However, some packages that provide Go wrappers for C libraries rely on cgo tool, which in turn, needs the GCC toolchain in order to build the glue code. Also, 3rd-party dependencies are usually hosted on services like GitHub, thus Git is also needed. This mini-guide illustrates how to setup a convenient development environment on Windows using MSYS2.
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
This is an attempt to show that Raft's safety is | |
preserved with single-server membership changes as | |
described in the dissertation plus the patch that a | |
leader may not append a new configuration entry to | |
its log until it's committed an entry from its | |
current term. | |
This extends the safety argument in the | |
paper/dissertation. The only part that's different | |
(as far as I can tell) for membership changes is Step |
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
(env3) jaten@Jasons-MBP ~/go/src/github.com/cosmos72/gomacro (generate) $ go version | |
go version | |
go version go1.12beta2 darwin/amd64 | |
(env3) jaten@Jasons-MBP ~/go/src/github.com/cosmos72/gomacro (generate) $ time go install -a -toolexec=time -x | |
time go install -a -toolexec=time -x | |
WORK=/var/folders/2x/hm9gp5ys3k9gmm5f_vzm_6wc0000gn/T/go-build619075523 | |
mkdir -p $WORK/b004/ | |
mkdir -p $WORK/b010/ | |
cat >$WORK/b004/importcfg << 'EOF' # internal | |
# import config |
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
void * | |
luaL_pushcdata(struct lua_State *L, uint32_t ctypeid, uint32_t size) | |
{ | |
/* | |
* ctypeid is actually has CTypeID type. | |
* CTypeId is defined somewhere inside luajit's internal headers | |
* which should not be included in init.h header. | |
*/ | |
static_assert(sizeof(ctypeid) == sizeof(CTypeID), |
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
--[[ | |
ProFi v1.3, by Luke Perkin 2012. MIT Licence http://www.opensource.org/licenses/mit-license.php. | |
Example: | |
ProFi = require 'ProFi' | |
ProFi:start() | |
some_function() | |
another_function() | |
coroutine.resume( some_coroutine ) | |
ProFi:stop() |
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
#!/usr/bin/env bash | |
set -x | |
NS="ns1" | |
VETH="veth1" | |
VPEER="vpeer1" | |
VETH_ADDR="10.200.1.1" | |
VPEER_ADDR="10.200.1.2" |
This file has been truncated, but you can view the full file.
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
~/go/src/github.com/cockroachdb/cockroach (master) $ git checkout beta-20170112 | |
Note: checking out 'beta-20170112'. | |
You are in 'detached HEAD' state. You can look around, make experimental | |
changes and commit them, and you can discard any commits you make in this | |
state without impacting any branches by performing another checkout. | |
If you want to create a new branch to retain commits you create, you may | |
do so (now or later) by using -b with the checkout command again. Example: |
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
#!/usr/bin/perl | |
# | |
# Brad's el-ghetto do-our-storage-stacks-lie?-script | |
# | |
sub usage { | |
die <<'END'; | |
Usage: diskchecker.pl -s <server[:port]> verify <file> | |
diskchecker.pl -s <server[:port]> create <file> <size_in_MB> | |
diskchecker.pl -l [port] |
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
package main | |
// simple example to show how to process one message at a time with nsq using the go-nsq client library. | |
// see config stuff in var below to play around with different scenarios. | |
import ( | |
"log" | |
"os" | |
"os/signal" | |
"strconv" |
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
// A small SSH daemon providing bash sessions | |
// | |
// Server: | |
// cd my/new/dir/ | |
// #generate server keypair | |
// ssh-keygen -t rsa | |
// go get -v . | |
// go run sshd.go | |
// | |
// Client: |
NewerOlder