Skip to content

Instantly share code, notes, and snippets.

@nictuku
nictuku / weird-error
Created February 6, 2018 04:33
disappeared after a `bazel clean`
ERROR: /private/var/tmp/_bazel_yves/c3e06ba6f17336f9b3516ab2697dfd1a/external/local_config_cc/BUILD:50:5: in apple_cc_toolchain rule @local_config_cc//:cc-compiler-ios_i386: Xcode version must be specified to use an Apple CROSSTOOL
ERROR: Analysis of target '//cli/zerospace:zerospace' failed; build aborted: Analysis of target '@local_config_cc//:cc-compiler-ios_i386' failed; build aborted
INFO: Elapsed time: 0.488s
FAILED: Build did NOT complete successfully (0 packages loaded)
@nictuku
nictuku / hello.go
Created February 6, 2018 01:22
Example Golang HTTP Server
package main
import (
"fmt"
"log"
"net/http"
)
type helloWorldHandler struct{}
@nictuku
nictuku / YB_CLA
Created January 26, 2018 01:08
YourBase Contributor License Agreement
Fiduciary License Agreement 2.0
-------------------------------
based on the
Individual Contributor exclusive License Agreement
--------------------------------------------------
(including the Traditional Patent License OPTION)
-------------------------------------------------
yves@MacBook-Air:~/src/github.com/nictuku/microclusters$ bazel build @com_github_grpc_grpc//test/cpp/util:grpc_cli
INFO: (12-25 15:46:16.877) Loading package: @local_config_cc//
INFO: (12-25 15:46:24.620) Found 1 target...
INFO: (12-25 15:47:45.555) From Compiling external/com_google_protobuf/src/google/protobuf/compiler/js/embed.cc [for host]:
external/com_google_protobuf/src/google/protobuf/compiler/js/embed.cc:37:12: warning: unused variable 'output_file' [-Wunused-const-variable]
const char output_file[] = "well_known_types_embed.cc";
^
{
"apiVersion": "v1",
"items": [
{
"apiVersion": "extensions/v1beta1",
"kind": "Deployment",
"metadata": {
"name": "service-app-deployment"
},
"spec": {
$ for run in {1..3}; do time bazel build //helloworld/server:hello_server_kube_dev_deploy.create;done
INFO: (12-14 15:11:11.353) Found 1 target...
Target //helloworld/server:hello_server_kube_dev_deploy.create up-to-date:
bazel-bin/helloworld/server/hello_server_kube_dev_deploy.create
INFO: (12-14 15:11:11.688) Elapsed time: 0.680s, Critical Path: 0.00s
real 0m0.899s
user 0m0.159s
sys 0m0.054s
INFO: (12-14 15:11:12.137) Found 1 target...
$ for run in {1..3}; do time bazel build //helloworld/server:hello_server_kube_dev_deploy.create;done
INFO: (12-14 14:17:29.488) Found 1 target...
Target //helloworld/server:hello_server_kube_dev_deploy.create up-to-date:
bazel-bin/helloworld/server/hello_server_kube_dev_deploy.create
INFO: (12-14 14:17:37.956) Elapsed time: 27.153s, Critical Path: 2.84s
real 0m28.737s
user 0m41.797s
sys 0m6.843s
INFO: (12-14 14:17:55.494) Found 1 target...
Target //helloworld/server:hello_server_kube_dev_deploy.create up-to-date:
#!/bin/bash
# Creates a 1GB swapfile and permanently enables it.
# thanks to:
# https://www.digitalocean.com/community/tutorials/how-to-add-swap-space-on-ubuntu-16-04
set -eu
sudo fallocate -l 1G /swapfile
sudo chmod 600 /swapfile
#!/bin/bash
# Expects Ubuntu 16.06 (xenial) and kernel 4.x.
# Based upon a blog post by Zach at http://zachzimm.com/blog/?p=191
set -eux
# Have the user call sudo early so the credentials is valid later on
sudo whoami
@nictuku
nictuku / netIP.go
Last active August 29, 2015 14:06
net.IP Marshalling in JSON and YAML
package main
import (
"encoding/json"
"fmt"
"net"
"github.com/GoogleCloudPlatform/kubernetes/Godeps/_workspace/src/gopkg.in/v1/yaml"
)