Category: LPU:B.Tech (IT): 2014

Build, Run, Emulate [platform] in IONIC

To perform any operation of ionic:

1. Open Command prompt (for Windows) / Terminal (for Linux/Ubuntu).
2. Change directory to the App folder.

To add a platform to your App:

$ ionic cordova platform add android (for Android)
$ ionic cordova platform add ios (for ios)
$ ionic cordova platform add windows (for windows)

To build your App on your desired platform:

$ ionic cordova build [platform]
[platform] could be android, ios, windows

After performing this operation, the output file will be in “yourAppFolder/platforms/android/build/outputs/apk/“. (For Android)
You can transfer to your phone and install it.

To emulate your App on Emulator:

$ ionic cordova emulate android (for Android)

To deploy your App directly to your phone:

$ ionic cordova run android (for Android)

For more information about IONIC, visit  https://ionicframework.com/

Thank you

Advertisements

Setting up and Running IONIC App

To set for IONIC, here are the steps to follow:
1. Download Java Development Kit (jdk) 1.8 or higher.

2. Set the path for java.
C prop
Adv sys setenv set
i. Right click in Computer Icon -> Properties
ii. Choose Advanced system settings
iii. Click on Environment Variables…
user var
java path
iv. Click on New under User variables
v. Give variable name as “path
vi. Give variable value as “C:\Program Files (x86)\Java\jdk1.8.0_92\bin

3. Install Node.js (https://nodejs.org/en/download/)
Continue reading “Setting up and Running IONIC App”

Setting up of Apache2 and Project Directory along with security in Linux / Ubuntu

Setting Apache2:

Installation of Apache2:
       Open terminal
       Run the command: $ sudo apt-get install apache2

To start the apache2:
       $ sudo /etc/init.d/apache2 start

To stop the apache2:
       $ sudo /etc/init.d/apache2 stop

To restart the apache2:
       $ sudo /etc/init.d/apache2 restart

To work with apache server, work with root access:
       $ sudo su or $ su (for some other linux/ubuntu)
       Type your password and press Enter

 root access

To open apache2.config file in terminal:
       # cd /etc/apache2
       # nano apache2.conf

apache2 conf1

       Hit Enter

apache2 configur

To modify the content:
       Edit your content
       Press Ctrl + X
       Confirm saving the file by pressing Y
       Then Press Enter

To Exit from the file:
       Press Ctrl + X

To check the working of apache2:
       Open browser and type localhost in the address bar and hit Enter

localhost

Continue reading “Setting up of Apache2 and Project Directory along with security in Linux / Ubuntu”

Some Shell Scripting Programs

Friends,

Here are some of the shell scripting programs:

  1. Write a shell script to check whether the name passed as first argument is the name of a file or directory.

Ans:     #!/bin/bash
             if [ -f $1 ] 
             then
                        echo “$1 is a file”
             else
                        echo “$1 is not a file”
             fi

  1. Write a shell script to print the “long list” of all the file names passed at command line.

Ans:     #!/bin/bash
                        for i in $*
                        do
                                    ls -l $i
                        done
           

  1. Write a shell script to enter a file/directory name at command line. Change its permissions to      user – rwx
    group – rw-
    others – r–

Ans:     #!/bin/bash
                        if [ -f $1 ]
                        then
                                    chmod 764 $1
                                    ls -l $1
                        elif [ -d $1 ]
                        then
                                    chmod 764 $1
                                    ls -ld $1                        else
                                    echo “Not a file nor a directory”
                        fi
                       

  1. Write a shell script to create a file and a directory. The name given as first argument should be used for creating the file and the second argument should be used as the name of directory.

Ans:    #!/bin/bash
                  touch $1
                  mkdir $2
 

  1. Write shell script to create a file inside a directory. The file name should be passed as first argument and the directory name/path should be passed as second argument.

Ans:    #!/bin/bash
                  mkdir $2
                  cd $2
                  touch $1

Continue reading “Some Shell Scripting Programs”