Cours langage GO - annotation - Anthony Le Goff
#INTRO ALGORITHME SOUS GO De l'écriture du premier programme à la logique informatique golang
Premier programme et présentation de "hello world"
/* | |
* UI testing with Horseman (phantomjs node integration) | |
* | |
* Installation | |
* see http://www.horsemanjs.org/ | |
* | |
* Run | |
* node <this-file.js> | |
* | |
* Debugging |
Here is one possible solution to the Game of Thrones problem we posed. Please note that we are passing a configuration document to ShardingTest. This will ensure the mongods are created using small files and without preallocating data files and journal files. It should eliminate problems with disk space that some students have reported when using ShardingTest. | |
config = { d0 : { smallfiles : "", noprealloc : "", nopreallocj : ""}, d1 : { smallfiles : "", noprealloc : "", nopreallocj : "" }, d2 : { smallfiles : "", noprealloc : "", nopreallocj : ""}}; | |
cluster = new ShardingTest( { shards : config } ); | |
// shard db | |
sh.enableSharding("houses"); | |
// shard collections | |
sh.shardCollection("houses.stark", {dire_wolves_owned:1}); | |
sh.shardCollection("houses.lannister", {debt_owed:1}); | |
sh.shardCollection("houses.targaryen", {followers:1}); |
> mongo --nodb | |
> config = { shard0 : { smallfiles : "", noprealloc : "", nopreallocj : ""}, shard1 : { smallfiles : "", noprealloc : "", nopreallocj : "" }, shard2 : { smallfiles : "", noprealloc : "", nopreallocj : ""}}; | |
{ | |
"shard0" : { | |
"smallfiles" : "", | |
"noprealloc" : "", | |
"nopreallocj" : "" | |
}, | |
"shard1" : { |
# Create a machine | |
# - Wait for the machine to come up | |
# - Check virtual box | |
# - Display the machine ip | |
CMD> docker-machine create --driver virtualbox <MACHINE> | |
CMD> docker-machine ip <MACHINE> | |
CMD> docker-machine inspect <MACHINE> | |
# Set env to the newly created machine | |
# Activate machine in the Windows Command Shell, ie sets the docker env |
# Install devd (en version 0.3 à minima) | |
# Create reverse proxy | |
# -H option to see headers | |
# -s for SSL support (DO NOT USE with localtunnel) | |
> devd -p 5000 https://tunnels.apispark.net:443/ -H | |
# Launch tunnel (internet reverse proxy) | |
# - you may need to create an account first... | |
> npm install -g localtunnel | |
> lt --port 5000 --subdomain sfartz |
{ | |
"Outputs": { | |
"PublicSlaveDnsAddress": { | |
"Description": "Public slaves", | |
"Value": { | |
"Fn::GetAtt": [ | |
"PublicSlaveLoadBalancer", | |
"DNSName" | |
] | |
} |
# Install + check sails version, 0.11.3 actually | |
npm install -g sails | |
sails -v | |
# Create new app | |
sails new SailsDemo | |
# Launch, open a browser http://localhost:1337 | |
cd SailsDemo |
1st step : Create a Dockerfile | |
------------------------------- | |
> touch Dockerfile | |
> notepad Dockerfile | |
''' | |
# Start from argon (latest long term supported version of node) | |
# - argon : Full node dev env (640 MB) | |
# - argon-slim : Full node dev env (200 MB) |
Cours langage GO - annotation - Anthony Le Goff
#INTRO ALGORITHME SOUS GO De l'écriture du premier programme à la logique informatique golang
Premier programme et présentation de "hello world"
Pasted from http://stackoverflow.com/questions/8283668/cygwin-running-script-from-one-batch-file
Start a WINDOWS CMD script with :
: <<TRAMPOLINE
@echo off
bash -c "exit 0" || (echo.No bash found in PATH! & exit /b 1)
bash "%~f0" "%*"
goto :EOF