Skip to content

Instantly share code, notes, and snippets.

@jonlo
jonlo / hyper.txt
Last active May 1, 2021 10:17
[Hyper v enable/disable] #docker #devops
Open 'Turn Windows features on or off' (search for that in the start menu)
Untick hyper-v, Windows hypervisior platform and virtual machine platform.
Start the command prompt as an administrator. (type cmd in the start menu, right click 'command prompt' and select 'run as administrator')
- Run the following command bcdedit /set hypervisorlaunchtype off
Or
- Run the following command bcdedit /set hypervisorlaunchtype auto
@jonlo
jonlo / tomcatWeb.conf
Created March 20, 2021 10:50
[NGINX tomcat webpack reverse proxy] a reverse proxy config to point from webpack to tomcat #devops #nginx
#user nobody;
worker_processes 1;
#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;
#pid logs/nginx.pid;
@jonlo
jonlo / dockerArti.sh
Last active February 28, 2021 21:05
[Docker artifactory deploy] push image to artifactory #docker #artifactory
docker login digicon-docker-dev.artifact.tecnalia.com
build:
docker image build -t digicon-docker-dev.artifact.tecnalia.com/<imageName> ./
docker image build --build-arg REG=https://artifact.tecnalia.com/artifactory/api/npm/digicon-npm-dev/ --build-arg NPM_TKN=Y2lfZGlnaWNvbjpBS0NwNWVtNllkZFhrUDd4TlBLUmZQOUtiTm5zaEV2cGNqeFlOOTNUOHVCZ0VNbVRrY2s4VndFd1J0RDVyemlSbk1LZmZiYXVq --build-arg US=ci_digicon --build-arg CI_TOKEN=AKCp5em6YddXkP7xNPKRfP9KbNnshEvpcjxYN93T8uBgEMmTkck8VwEwRtD5rziRnMKffbauj -t digicon-docker-dev.artifact.tecnalia.com/core ./
test:
docker container run -it --publish 8081:8080 digicon-docker-dev/<imageName>
@jonlo
jonlo / azureconn.sh
Created February 21, 2021 07:21
[Azure connection] connect to azure machine #azure
ssh -i C:\Users\Jon\.ssh\azureuser.pem azureuser@23.102.42.243
@jonlo
jonlo / mavendep.sh
Last active February 16, 2021 07:51
[maven deploy] deploy vscode maven projects #maven
mvn clean install -Pproduction
mvn clean install -Pdevelopment
mvn validate cargo:run
@jonlo
jonlo / linuxCom.md
Created November 15, 2020 20:04
[Linux commands] #linux

This is a list of useful Linux commands. Most of them are basic and they can be used as a reference for developers.

files and directories ls => list all files ls -a => list all files along with hidden ones ls -R => list all files and folders recursively ls -l => list in long format (shows more info)

rm {filename} => deletes a file

@jonlo
jonlo / webpackTest.md
Created October 18, 2020 16:51
[Webpack test settings] Set webpack testing environment

npm install mocha

in package.json

´´´javascript "scripts": { "test": "env TESTBUILD=true webpack && mocha test-dist/index_bundle.js && rm -rf test-dist", } ´´´

@jonlo
jonlo / drawRay.js
Created October 15, 2020 10:07
[Threejs Draw ray] Draw raycasted ray #threejs
import { ArrowHelper } from 'three';
scene.add(new ArrowHelper(this.selection.raycaster.ray.direction, this.selection.raycaster.ray.origin, 300, 0xff0000));
@jonlo
jonlo / git_pull_repos.sh
Created September 16, 2020 09:08
[git pull all subdirectories] run git pull in all subdirectories #devops
#! /usr/bin/env bash
for dir in ./*/
do
cd ${dir}
git status >/dev/null 2>&1
# check if exit status of above was 0, indicating we're in a git repo
[ $(echo $?) -eq 0 ] && echo "Updating ${dir%*/}..." && git pull
cd ..
done
@jonlo
jonlo / dockerManag.sh
Last active May 15, 2020 09:54
[Docker images management] remove, start, stop.. #docker
BUild & run
# docker image build -t your_name/some-app location_of_dockerfi
docker image build -t your_name/some-app-image ./
docker image build -t jonlodg/webserver -f dockers/webserver/Dockerfile .
# now if you check list of images in your docker, you will see as
# your_name/some-app-image image in it...
docker image ls
# creating and running a container
docker container run -it --publish 8081:8080 your_name/some-app-image