golang binaries

Embedding anything in a golang binary What is it about? One good thing about golang is that you compile everything to a binary. So easy to deploy, so easy to manage, so small. But what happens when you need to embed files in there? Migration files, static files, whatever you can think of? Well, you can simply deploy it in a container, add this files, you are going to say, and you are probably right, that’s imho, the cleanest solution....

September 29, 2018 · 5 min · Me

a taste of wasm

Here it is, go 1.11 is out, and with it a new compilation target, Web Assembly! Let’s try it out! The test As dumb as it sounds, I needed a simple usecase to test this out. I decided to settle for the dumbest possible thing: a for loop incrementing a variable for 100000000 times. The git repo Here it is I uploaded it as well on surge for you to see without the hassle...

August 27, 2018 · 1 min · Me

Using GKE with multiple accounts and clusters

Google cloud configs Download and install gcloud Simply follow this link Listing existing configurations gcloud config configurations list NAME IS_ACTIVE ACCOUNT PROJECT DEFAULT_ZONE DEFAULT_REGION This should give you only one line, with a default account. Creating a configuration gcloud config configurations create testconf This will guide you through the configuration of a new configuration. It allows you to set one config per account, project, cluster… Activating a configuration gcloud config configurations activate testconf As simple as this to change your account/config....

June 13, 2018 · 1 min · Me

Bluetooth activation at startup on arch linux

Why? You might not have reach that point yet but bluez has been deprecating hciconfig and other tools. In bluez 5.44, it’s not there anymore. What is the problem? All hciconfig udev rules to activate bluetooth at startup won’t work anymore. Most forum posts solving bluetooth issues are now outdated. Once I updated to bluez 5.44, my service leveraging hciconfig to activate bluetooth at startup didn’t work anymore! What is the solution?...

April 3, 2017 · 1 min · Me

Golang and Oracle

Which library To this day, the most up to date library seems to be rana/ora How to install (linux & macosx) Download Oracle Instant Client for linux x64: both packages Basic and SDK Unzip each of them in the same folder /opt/oracle mkdir -p /opt/oracle cd /opt/oracle unzip ~/Downloads/instantclient-basiclite-linux.x64-12.2.0.1.0.zip unzip ~/Downloads/instantclient-sdk-linux.x64-12.2.0.1.0.zip cd /opt/oracle/instantclient_12_1 Add the necessary env variables and paths: # Oracle export LD_LIBRARY_PATH=/opt/oracle/instantclient_12_2:$LD_LIBRARY_PATH export PKG_CONFIG_PATH=/opt/oracle export ORACLE_HOME=$LD_LIBRARY_PATH copy from the go package ....

December 27, 2016 · 1 min · Me

Ethereum react dapps

I finished my first dapp with (react-boilerplate)[https://github.com/mxstbr/] this week and here are the few things I learnt. I won’t get into the redux, redux-saga details, I let you play with the amazing boilerplate. Interacting with constant functions Let’s use the typical balanceOf function of the EIP20 contracts: function balanceOf(address _owner) constant returns (uint256 balance) { return balances[_owner]; } Here are the sagas (redux-sagas) I used to interact: import { take, call, put, cancel, select, fork } from 'redux-saga/effects'; import { BALANCE_OF_GET, } from '....

October 27, 2016 · 6 min · Me

Ethereum contracts and Golang

The contract contract Trigger { function () { throw; } address owner; function Trigger() { owner = msg.sender; } event TriggerEvt(address _sender, uint _trigger); function trigger(uint _trigger) { TriggerEvt(msg.sender, _trigger); } function getOwner() constant returns (address) { return owner; } } This is a very simple contract that we will take as an example. Getting the right tools for binding A good starting point is this wiki. You will need to follow the install procedure of go-ethereum....

October 10, 2016 · 3 min · Me

Summary of UBER lessons on scaling microservices

I just watched that amazing videos from Matt Ranney Here are my takeaways and opinionated summary: Use RPC for service to service communications: gRPC seems to be a good way of tackling it Use many repositories Profiling should be unified: flamegraphs seem to be a good solution (Go profiling is great too) Premature optimization is bad but performance monitoring is crucial! Trace requests, keep context within all logs Log a lot, but only on a portion of your production architecture as logging can have a big cost....

September 30, 2016 · 1 min · Me

Blockchain week in Shanghai!

I participated to the devcon2 and blockchain summit last week. Here is my summary!

September 16, 2016 · 1 min · Me

Ethereum first dapp - part 3

setting up a light wallet In order to have a setup close to what the DAPP would be, we will use (metamask) [http://www.metamask.io] as a light wallet (there are other choices). Metamask allows you to connect to a custom node. We will then connect to our node, http://localhost:9012 If everthing is fine, metamasks should indicate it’s connected. Then, we can import the metamask account to our local node by simply specifying the datadir we have setup the node data....

August 12, 2016 · 1 min · Me