Skip to content

Instantly share code, notes, and snippets.

View stephaneerard's full-sized avatar

Stéphane Erard stephaneerard

  • Pragmatism & Enthusiasm
  • Nice, France
View GitHub Profile
$json = get-content "$PSScriptRoot/../init.json" -raw -Encoding ascii | convertfrom-json
$machinesTypes = $json.vagrant.'machines-types';
foreach($machineType in $machinesTypes) {
frenchex2 vagrant:machine-type:add `
--name "${machineType.Name}" `
--vcpus "${machineType.Vcpus}" `
--cpucap "${machineType.CpuCap}" `
@stephaneerard
stephaneerard / watch.ts
Created April 13, 2021 11:13
A simple watch.ts for development life cycle
#!/usr/bin/env ts-node
const chokidar = require('chokidar');
const watcher = chokidar.watch(['src', 'test'], {
ignored: null,
ignoreInitial: false,
followSymlinks: true,
cwd: '.',
disableGlobbing: false,
PS C:\code\frenchex2\cli.ts_i1\tmp> frenchex2 vagrant:machine-type:provision:add `
>> --os-type "Debian_64" `
>> --os-version "10.9.0" `
>> --name "apt.configure" `
>> --type "dev" `
>> --code-bash `
>> @'
>> apt_conf=$(cat <<EOF
>> APT::Get::Install-Recommends " false";
>> APT::Get::Install-Suggests "false";
PS C:\code\frenchex2\cli.ts_i1\tmp> docker-compose ps
Name Command State Ports
-------------------------------------------------------------------------------
tmp_db_1 docker-entrypoint.sh mysqld Up 3306/tcp, 33060/tcp
tmp_wordpress_1 docker-entrypoint.sh apach ... Up 0.0.0.0:8000->80/tcp
Exception ignored in: <function Popen.__del__ at 0x000001D045DED670>
Traceback (most recent call last):
File "c:\python39\lib\subprocess.py", line 1055, in __del__
self._internal_poll(_deadstate=_maxsize)
File "c:\python39\lib\subprocess.py", line 1457, in _internal_poll
PS C:\code\frenchex2\cli.ts_i1\tmp> ssh-add .\.vagrant\machines\vdi-00-control-00\virtualbox\private_key
Identity added: .\.vagrant\machines\vdi-00-control-00\virtualbox\private_key (.\.vagrant\machines\vdi-00-control-00\virtualbox\private_key)
PS C:\code\frenchex2\cli.ts_i1\tmp> C:\Users\steph\Downloads\docker-compose-Windows-x86_64.exe ps
Traceback (most recent call last):
File "urllib3\connectionpool.py", line 670, in urlopen
File "urllib3\connectionpool.py", line 426, in _make_request
File "<string>", line 3, in raise_from
File "urllib3\connectionpool.py", line 421, in _make_request
File "http\client.py", line 1349, in getresponse
File "http\client.py", line 935, in close
PS C:\code\\platform_i1\Docker> docker context create --docker "host=ssh://vagrant@vdi-00-dev-00" vdi00dev00
vdi00dev00
Successfully created context "vdi00dev00"
PS C:\code\\platform_i1\Docker> docker context use vdi00dev00
vdi00dev00
Current context is now "vdi00dev00"
PS C:\code\\platform_i1\Docker> docker ps -a
PS C:\code\xx\platform_i1> $Env:DOCKER_CONTEXT="remote"
PS C:\code\xx\platform_i1> docker-compose up -d
Traceback (most recent call last):
File "urllib3\connectionpool.py", line 670, in urlopen
File "urllib3\connectionpool.py", line 426, in _make_request
File "<string>", line 3, in raise_from
File "urllib3\connectionpool.py", line 421, in _make_request
File "http\client.py", line 1349, in getresponse
File "http\client.py", line 935, in close
File "docker\transport\sshconn.py", line 102, in close
"provisioning": {
"cat-infos": {
"env": {
"device": "eth1"
}
},
"ipv6.disable": {},
"apt-cacherng.install": {}
}
{
"projects": {
"lib": {
"name": "lib",
"template": {
"name":"lib"
}
},
"api": {
"name": "api",
{
"vagrant": {
"plugins": {
"vagrant-hostmanager": {
"version": ">= 1.8.9",
"enabled": true,
"config": {
"hostmanager.enabled": true,
"hostmanager.manage_host": true,
"hostmanager.manage_guest": true