Skip to main content

Posts

Ubuntu 20.04 LTS | Installing OpenJDK 11 (LTS) JDK, JRE, HotSpot

https://adoptopenjdk.net/installation.html#linux-pkg ctrl + f => Linux RPM and DEB installer packages bboy@bboy-LE7450:~$ cat /etc/os-release | grep UBUNTU_CODENAME UBUNTU_CODENAME=focal bboy@bboy-LE7450:~$ sudo apt-get install wget apt-transport-https gnupg [sudo] password for bboy: Reading package lists... Done Building dependency tree       Reading state information... Done wget is already the newest version (1.20.3-1ubuntu1). wget set to manually installed. gnupg is already the newest version (2.2.19-3ubuntu2.1). gnupg set to manually installed. The following packages were automatically installed and are no longer required:   linux-headers-5.8.0-45-generic linux-hwe-5.8-headers-5.8.0-45   linux-image-5.8.0-45-generic linux-modules-5.8.0-45-generic   linux-modules-extra-5.8.0-45-generic Use 'sudo apt autoremove' to remove them. The following NEW packages will be installed:   apt-transport-https 0 upgraded, 1 newly installed, 0 to remove and 21 not upgraded. Need to get 1,
Recent posts

NuxtJS Problem on @babel/present-env/lib/utils

Problem: Module build failed (from ./node_modules/babel-loader/lib/index.js): Error: /home/mccrazy/Documents/codes/napp/.nuxt/client.js: Cannot find module '@babel/preset-env/lib/utils' Require stack: - /home/mccrazy/Documents/codes/napp/node_modules/@nuxt/babel-preset-app/src/polyfills-plugin.js - /home/mccrazy/Documents/codes/napp/node_modules/@nuxt/babel-preset-app/src/index.js - /home/mccrazy/Documents/codes/napp/node_modules/@babel/core/lib/config/files/module-types.js - /home/mccrazy/Documents/codes/napp/node_modules/@babel/core/lib/config/files/configuration.js - /home/mccrazy/Documents/codes/napp/node_modules/@babel/core/lib/config/files/index.js - /home/mccrazy/Documents/codes/napp/node_modules/@babel/core/lib/index.js - /home/mccrazy/Documents/codes/napp/node_modules/babel-loader/lib/index.js - /home/mccrazy/Documents/codes/napp/node_modules/webpack/node_modules/loader-runner/lib/loadLoader.js - /home/mccrazy/Documents/codes/napp/node_modules/webpack/node_modules/load

Visual Studio Code : .devcontainer | Dockerfile.yml (mongodb with mongo-express)

version : '3' services : app : build : context : . dockerfile : Dockerfile args : # [Choice] Node.js version: 14, 12, 10 VARIANT : 14 # On Linux, you may need to update USER_UID and USER_GID below if not your local UID is not 1000. USER_UID : 1000 USER_GID : 1000 volumes : - ..:/workspace:cached # Overrides default command so things don't shut down after the process ends. command : sleep infinity # Runs app on the same network as the database container, allows "forwardPorts" in devcontainer.json function. network_mode : service:db # Uncomment the next line to use a non-root user for all processes. # user: node # Use "forwardPorts" in **devcontainer.json** to forward an app port locally. # (Adding the "ports" property to this file will not forward from a Codespace.) db : image : mongo:latest restart : unless-stopped volumes :
node ➜ /workspace $ yarn init yarn init v1.22.5 question name (workspace): lotto-backend question version (1.0.0): question description: PCSO Lotto BackEnd with Express.Js & MongoDB question entry point (index.js): index.js question repository url: question author: bbytnz question license (MIT): question private: success Saved package.json Done in 330.16s. node ➜ /workspace $ npm install --save express morgan http-errors dotenv npm notice created a lockfile as package-lock.json. You should commit this file. npm WARN lotto-backend@1.0.0 No repository field. + http-errors@1.8.0 + morgan@1.10.0 + express@4.17.1 + dotenv@8.2.0 added 61 packages from 37 contributors and audited 61 packages in 6.877s found 0 vulnerabilities node ➜ /workspace $

docker-compose : mongodb mongo-express redis rediscommander

version : "3" services : redis : image : redis:alpine container_name : redis_db command : redis-server --appendonly yes ports : - 6379:6379 volumes : - ./data:/data restart : always redis-commander : image : rediscommander/redis-commander:latest environment : - REDIS_HOSTS=local:redis:6379 ports : - 8082:8081 depends_on : - redis mongo : image : mongo restart : always ports : - "27017:27017" environment : MONGO_INITDB_ROOT_USERNAME : uroot MONGO_INITDB_ROOT_PASSWORD : usecret volumes : - ./mongo-data:/data/db mongo-express : image : mongo-express restart : always ports : - "8081:8081" environment : ME_CONFIG_MONGODB_ADMINUSERNAME : uroot ME_CONFIG_MONGODB_ADMINPASSWORD : usecret volumes : mongo-data :

Typescript Express Project base

Create repo on github with gitignore set to node $ mkdir <path/foldername> && cd <path/foldername> $ git init $ git remote add origin https://github.com/biboyatienza/typescript-expressjs.git $ git pull origin master $ echo "# typescript-expressjs" >> README.md $ npm init $ git add . $ git commit -m "first commit" $ git push -u origin master $ npm i -D typescript tslint $ npm i express -S $ npm i @types/express -D $ code tsconfig.json {     "compilerOptions": {       "module": "commonjs",       "esModuleInterop": true,       "target": "es6",       "moduleResolution": "node",       "sourceMap": true,       "outDir": "dist"     },     "lib": ["es2015"]   } $ code tslint.json {     "defaultSeverity": "error",     "extends": [         "tslint:recommended"     ],     "jsRule