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/

lundi, décembre 29, 2014

Dictionary of web dev ecosystem and javascript galaxy - nodejs, angularjs, mean, express, mongodb and so on ...


client side javascript and tools


AngularJS
javascript framework - app oriented

AngularJS based starter kit/template/generator
http://www.dancancro.com/comparison-of-angularjs-application-starters/
angular-seed - template project for angular
angular-app - example project for angular
ng-boilerplate - template project for angular
generator-angular - based on yeoman
generator-angular-fullstack - based on yeoman

javascript library/toolkit - app oriented

Bootstrap
javascript framework - UI responsive design oriented

Bower
dependencies manager for webapp - manage js dependencies or asset - dependencies are deployed in flat way (opposite of npm which deploy each dependency nested) - use bower.json and .bowerrc

Compass
CSS framework based on Sass

Dojo
javascript framework - app oriented

javascript framework - app oriented

HTML5 Boilerplate
Web project template

jQuery
javascript framework - UI oriented

Less
CSS derivated language

MooTools
javascript library - UI oriented

Sass
CSS derivated language

Stylus
CSS derivated language

Underscore.js
javascript library

Server side javascript and tools


Node.js
server-side javascript

npm
Node package manager - installed with nodejs - each dependency is deployed in a nested way (opposite of bower which deploy each dependency in a flat way) - use package.json

Express
server-side javascript framework

Jade
Javascript template engine

Swig
Javascript template engine

Other



MEAN
conceptual javascript stack - MongoDB, Express, Angular, Nodejs
Different mean stack implementation : http://meanjs.org http://mean.io
mean.js is a fork of mean.io - difference between them

Yeoman
project generator

MongoDB
document oriented database

Redis
key/value store

CoffeeScript
javascript derivated language

TypeScript
javascript derivated language

Grunt
javascript task manager/build tool - like maven or ant - use Gruntfile.js

Gulp
http://gulpjs.com/
javascript task manager/build tool - use gulpfile.js

Use npm as build tool
http://blog.keithcirkel.co.uk/how-to-use-npm-as-a-build-tool/

JSLint
javascript code quality tool

JSHint
javascript code quality tool - fork of JSLint

JSFiddle
online javascript sandbox

RequireJS
javascript module loader

Karma (formerly Testacular)
Test runner

Jasmine
Javascript test framework

Mocha
Javascript test framework

HTTP Archive
Web technology statistic

BuiltWith
Web technology statistic