Posts

Node-RED

Image
 Node-RED server can be spine using docker as bellow, - docker run --rm --net tulip-net -it -p 1880:1880 -v myNodeREDdata:/data   --name mynodered nodered/node-red It is important that run on specific network, if you have several docker containers running. Eg. MQTT or Mongo... How to run a MQTT broker, - docker run --rm --net tulip-net -p 8080:8080 -p 1883:1883 --name hivemq hivemq/hivemq4 How to run a Mongodb, docker run --rm --net tulip-net -d -p 27018:27017 --name nodered_mongo -e MONGO_INITDB_ROOT_USERNAME=admin -e MONGO_INITDB_ROOT_PASSWORD=admin mongo Node-RED can be installed new extensions as necessary. Use `Mange Pelette` link for that, dsfasdf

Angular 5

Angular 5 released a few days ago. Let's try to go through all the important features that we want to know, in order to create a super application. First, you need to install angular CLI to make your life easier. You can run the bellow code to install angular CLI as a global package,  npm install -g @angular/cli All the needed helps are located at https://github.com/angular/angular-cli . You can directly use the 'ng' commands provided there to create Component, Directive, Service, Interface, etc... When you use the tool, it will be inject all the import lines into the 'app-module' automatically. Before start looking into the Angular, you need to have some development tools installed in your computer. I prefer to use 'Microsoft Visual Code' which is free software from Microsoft. You can download the appropriate installer for your operating system from here  https://code.visualstudio.com/download Once you install VS Code, you may install the followin...

Laravel 5.3

# Create a new project composer create-project --prefer-dist laravel/laravel <project-name> # Check existing version php artisan -V # Make controllers php artisan make:controller ProductController # Make models php artisan make:model <modal name> # Make views # Database Using migration script: - Migration scripts will be stored at 'database/migrations' folder - Can create a blueprint of migration script using,   php artisan make:migration <name of script to identify> --create=<table name>   eg. php artisan make:migration create_table_customer --create=customer - Can get the help using,    php artisan help make:migration - Can run all the migration scripts using,   php artisan migrate - Can rollback current change using,   php artisan migrate:rollback # Seeder - seeding database with test data using seed classes - Create seeding script   php artisan make:seeder <seeder name> ...

Node Commands

# How install specific node version on Ubuntu -  https://github.com/nodesource/distributions/blob/master/README.md  npm commands:  npm init - To initalize the package. This will create package.json on the fly  npm install - This will look for package.json and install all the listed packages npm insall -g <package name> - To install packages globally npm install --save <package name> - To install packages locally, as well as add entry to package.json file npm install --save-dev <package name> - To install packages locally, as well as add entry to dev section in the package.json npm list -g --depth=0 - To list all the globally installed packages. Without depth, will list down all the installed packages and sub packages npm view cordova versions - List down all the released versions  npm uninstall --save <package name> - To  remove packages from locally. --save will remove entry from package.json npm cache cl...

REST API using Node/Express/MongoDB

REST API How to initalize node app, - npm init - Will create basic setup including package.json - npm install express --save - Installing main tool express js. What --save means, it will update the package.json file for dependancy - npm install --save mongoose node-restful body-parser - General extra modules that need for REST which doesn't come up with express Task monitoring system (using gulp): Node change monitoring tool. Once do a change on the file system, app will restart automatically. - npm install -g gulp - npm install --save gulp - npm install --save-dev gulp-nodemon Note:     - npm global installations will keep in '/usr/local/lib/node_modules' in Mac. Refer Github for codes:  https://github.com/dilumdarshana/nodeREST

Mobile application using Ionic

This is my first mobile (hybrid) application created using Ionic framework. I am using Mac OS along with the Android Studio/Android SDK to compile and simulate the application. Here are the steps need to follow from the sketch. First, need to install Ionic and Cordova on your Mac/PC, npm install -g cordova ionic Can check all installed properly using the following commands, ionic -v AND  cordova -v Second, need to install and setup Android SDK, The simple way in install Android Studio and to go, Tools->Android->SDK Manager Can see all the available android versions over there. Do check the appropriate version you want and proceed with the installation. Then make sure that, android PATH set in the global paths. To do that simply open ~/.bash_profile and add the following lines, export ANDROID_HOME="Users/ <USERNAME> /Library/Android/sdk" export PATH=${PATH}:/Users/ <USERNAME> /Library/Android/sdk/platform-tools:/Users/ <USERNAME>...

Continuous Integration with Jenkins

# Install Jenkins wget -q -O - https://jenkins-ci.org/debian/jenkins-ci.org.key | sudo apt-key add - sudo sh -c 'echo deb http://pkg.jenkins-ci.org/debian binary/ > /etc/apt/sources.list.d/jenkins.list' sudo apt-get update sudo apt-get install jenkins OR java -jar xxx.war # Create jobs from config.xml file - Can create config.xml file directly from the '/Users/Shared/Jenkins/Home/jobs/<job folder name>/config.xml - Then, need to reload the configurations from, Manage Jenkins->Reload Configuration from Disk # Notes: - In Mac, Jenkings home folder: /Users/Shared/Jenkins/Home