mardi, septembre 01, 2015

REDIRECT TRAFFIC : DOUBLE TUNNEL SSH



REDIRECT TRAFFIC : DOUBLE TUNNEL SSH


ssh -L PORT1:HOST2:PORT2 -N HOST1

It will listen connection on localhost:port1 redirect traffic through host1 (so you will need an account on host 1 -but not on host2-) and finally redirect traffic to host2:port2

example
from your localhost:9999 through 192.168.0.50 to 192.168.0.70:32400


ssh -L 9999:192.168.0.70:32400 -N 192.168.0.50


Other more secured methods : http://superuser.com/a/97007/486518
French tutorial : http://www.linux-france.org/prj/edu/archinet/systeme/ch13s04.html

dimanche, mai 24, 2015

What is MSys - MinGW - Cygwin


To make the milky 'soup' of project names more clear:
  • Cygwin - a Linux like environment, it provides tools and executable built upon cygwin dll
  • MinGW - is a minimalist development environment for native Microsoft Windows applications (think: GCC to compile native Win32 applications). This is a C/C++ compiler suite which allows you to create Windows executables (without dependency on DLLs such Cygwin DLL - you only need the normal MSVC runtime)
  • MSYS - is a minimal POSIX emulation layer providing a Bourne Shell command line interpreter system. It's a perfect environment for MinGW. In the past, it was forked from Cygwin
  • MSys2 - is another fork of Cygwin with the same idea as MSYS, but it is kept up-to-date with Cygwin and it comes with a package management system called Pacman(calling pacman -Syu will update all of the installed packages to their newest versions). MSys2 is the basis for the upcoming successor of msysGit.
  • msysGit - is the name of this project, a build environment to develop (i.e. not to use) Git for Windows, which releases the official binaries

So,

MinGW-w64 is an up to date MinGW version ===> pick it if you need a compiler
MSys2 is an up to date MSYS version (a POSIX env) ===> pick it if you need an env
                    AND a POSIX env for MinGW-w64 and others
                    AND a package manager for itself and MinGW-w64 (or others?)


https://github.com/msysgit/msysgit/wiki 
http://stackoverflow.com/questions/771756/what-is-the-difference-between-cygwin-and-mingw

mardi, mars 24, 2015

apache spark vs apache hadoop map reduce

SOURCE : http://www.quora.com/What-is-the-difference-between-Apache-Spark-and-Apache-Hadoop-Map-Reduce
Suman Bharadwaj

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

vendredi, janvier 16, 2015

Call powershell command in batch script


powershell -Command "& { 1..10 | foreach-object { "Current output:"; $_; } }"
https://dmitrysotnikov.wordpress.com/2008/06/27/powershell-script-in-a-bat-file/