Saturday, March 12, 2016

The difference between native, web & hybrid mobile applications

NodeJS + Ionic : Fixing " Error: Cannot find module 'wordwrap' "

$ ionic
module.js:327
throw err;
^
Error: Cannot find module 'wordwrap'
at Function.Module._resolveFilename (module.js:325:15)
at Function.Module._load (module.js:276:25)
at Module.require (module.js:353:17)
at require (internal/module.js:12:17)
at Object. (/usr/lib/node_modules/ionic/node_modules/optimist/index.js:3:16)
at Module._compile (module.js:409:26)
at Object.Module._extensions..js (module.js:416:10)
at Module.load (module.js:343:32)
at Function.Module._load (module.js:300:12)
at Module.require (module.js:353:17)
at require (internal/module.js:12:17)

Solution:

$ sudo npm install -g wordwrap

NodeJS + Ionic : Fixing " Error: Cannot find module 'wordwrap "

$ ionic
module.js:327
throw err;
^
Error: Cannot find module 'wordwrap'
at Function.Module._resolveFilename (module.js:325:15)
at Function.Module._load (module.js:276:25)
at Module.require (module.js:353:17)
at require (internal/module.js:12:17)
at Object. (/usr/lib/node_modules/ionic/node_modules/optimist/index.js:3:16)
at Module._compile (module.js:409:26)
at Object.Module._extensions..js (module.js:416:10)
at Module.load (module.js:343:32)
at Function.Module._load (module.js:300:12)
at Module.require (module.js:353:17)
at require (internal/module.js:12:17)

$ sudo npm install -g wordwrap

NodeJS + Ionic : Fixing " Error: Cannot find module 'archiver' "

$ ionic
module.js:327
throw err;
^
Error: Cannot find module 'archiver'
at Function.Module._resolveFilename (module.js:325:15)
at Function.Module._load (module.js:276:25)
at Module.require (module.js:353:17)
at require (internal/module.js:12:17)
at Object. (/usr/lib/node_modules/ionic/node_modules/ionic-app-lib/lib/utils.js:3:16)
at Module._compile (module.js:409:26)
at Object.Module._extensions..js (module.js:416:10)
at Module.load (module.js:343:32)
at Function.Module._load (module.js:300:12)
at Module.require (module.js:353:17)

Solution:
$ sudo npm install -g archiver

NodeJS + Ionic : Fixing " Error: Cannot find module 'xmlbuilder' "

$ ionic start todo blank
module.js:327
throw err;
^
Error: Cannot find module 'xmlbuilder'
at Function.Module._resolveFilename (module.js:325:15)
at Function.Module._load (module.js:276:25)
at Module.require (module.js:353:17)
at require (internal/module.js:12:17)
at Object. (/usr/lib/node_modules/ionic/node_modules/xml2js/lib/xml2js.js:12:13)
at Object. (/usr/lib/node_modules/ionic/node_modules/xml2js/lib/xml2js.js:436:4)
at Module._compile (module.js:409:26)
at Object.Module._extensions..js (module.js:416:10)
at Module.load (module.js:343:32)
at Function.Module._load (module.js:300:12)


Solution :
$ sudo npm install -g bplist-parser xmlbuilder

Preparing ionic development enviroment (Fedora 23)

It is quite simple and straight foward..
$ sudo curl --silent --location https://rpm.nodesource.com/setup_4.x | bash -
$ sudo dnf nodejs
$ sudo npm install -g cordova
$ sudo npm install -g ionic

If you have module problem when creating object, try to install the modules
$ sudo npm install -g bplist-parser xmlbuilder archiver wordwrap winston

Saturday, March 5, 2016

Git - Remove all file in repository based on gitignore file

$ git rm -r --cached .
$ git add .
$ git commit -m "Removing all files in .gitignore"

Tuesday, March 1, 2016

Joomla! security jday2015 - Security Hardening by Shaiffulnizam Mohamad

Security hardening : suPHP

Use suPHP
PHP files are run under the user of the website instead of the Apache user and globally reset all files (user,group,file and directory):
$ sudo chown -R user:group *
$ sudo find . -type f -exec chmod 644 {} \;
$ sudo find . -type d -exec chmod 755 {} \;