lundi, février 09, 2015

Horton Works 2.1 Customisation

login:root
password:hadoop

Some tools

yum install nano



Set french environment

Change

nano /etc/sysconfig/keyboard

with

KEYTABLE=”fr-latin1″
MODEL=pc105+inet″
LAYOUT=”fr”
KEYBOARDTYPE=”pc”

(All available options can be found in subdirectories under /lib/kbd/keymaps/i386.)


Change

nano /root/.bashrc

with

LANG=fr_FR.ISO-8859-1
LC_CTYPE="fr_FR.ISO-8859-1"
LC_NUMERIC="fr_FR.ISO-8859-1"
LC_TIME="fr_FR.ISO-8859-1"
LC_COLLATE="fr_FR.ISO-8859-1"
LC_MONETARY="fr_FR.ISO-8859-1"
LC_MESSAGES="fr_FR.ISO-8859-1"
LC_PAPER="fr_FR.ISO-8859-1"
LC_NAME="fr_FR.ISO-8859-1"
LC_ADDRESS="fr_FR.ISO-8859-1"
LC_TELEPHONE="fr_FR.ISO-8859-1"
LC_MEASUREMENT="fr_FR.ISO-8859-1"
LC_IDENTIFICATION="fr_FR.ISO-8859-1"
LC_ALL=

if [ -n "$SSH_CLIENT" ]; then
       export LANG="fr_FR.ISO-8859-1"
fi

samedi, février 07, 2015

Cross compiling Go app



Cross compiling Go app


First build cross compiling toolchain


cd go/src
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 ./make.bash  --no-clean
CGO_ENABLED=0 GOOS=windows GOARCH=amd64 ./make.bash --no-clean

Second build your file


GOOS=windows GOARCH=386 go build -o appname.exe appname.go
GOOS=linux GOARCH=386 CGO_ENABLED=0 go build -o appname.linux appname.go


CGO_ENABLED=0 will deactivate use of CGo. So it will be a portable app. But if your app use CGo (for example by using go package "net"), it will not build.


Option : use gonative


If you want to use CGo and do cross compiling, use gonative which download each binary distribution for each platform and build cross compiling toolchain with theses binaries, so you can use CGo.

https://github.com/inconshreveable/gonative
https://inconshreveable.com/04-30-2014/cross-compiling-golang-programs-with-native-libraries/

And then use gox https://github.com/mitchellh/gox
to cross compile your application


Some links

http://www.goinggo.net/2013/10/cross-compile-your-go-programs.html
http://solovyov.net/en/2012/cross-compiling-go/
http://stackoverflow.com/questions/12168873/cross-compile-go-on-osx