Cloud Network

Networking | Support | Tricks | Troubleshoot | Tips

Buymecoffe

Buy Me A Coffee

Thursday, March 5, 2015

Shell Scripts for Linux Newbies to Learn Shell Programming – Part II

March 05, 2015
Shell Scripts for Linux Newbies to Learn Shell Programming – Part II


Hello Everyone,

In this tutorial,

Let Us Shell Scripts for Linux to Learn Shell Programming – Part II

You Can also Configure in Redhat Linux, Ubuntu, Fedora, CentOS, LinuxMint, Oracle Linux, Cloud Linux.

Script 1: Drawing a Special Pattern
#!/bin/bash
MAX_NO=0
echo -n "Enter Number between (5 to 9) : "
read MAX_NO
if ! [ $MAX_NO -ge 5 -a $MAX_NO -le 9 ] ; then
               echo "WTF... I ask to enter number between 5 and 9, Try Again“
               exit 1
fi
clear
for (( i=1; i<=MAX_NO; i++ )) do         for (( s=MAX_NO; s>=i; s-- ))
          do
             echo -n " "
          done
          for (( j=1; j<=i; j++ )) do echo -n " ." done echo "" done ###### Second stage ###################### for (( i=MAX_NO; i>=1; i-- ))
do
         for (( s=i; s<=MAX_NO; s++ ))
         do
               echo -n " "
         done
         for (( j=1; j<=i; j++ ))
         do
            echo -n " ."
         done
         echo ""
done
echo -e "\n\n\t\t\t Whenever you need help, cloudnetwork.in is always there"



Script 2: Creating Colorful Script

#!/bin/bash

clear

echo -e "33[1m Hello World"

# bold effect

echo -e "33[5m Blink"

# blink effect

echo -e "33[0m Hello World"

# back to normal

echo -e "33[31m Hello World“

 # Red color

echo -e "33[32m Hello World"

# Green color

echo -e "33[33m Hello World"

# See remaining on screen

echo -e "33[34m Hello World"

echo -e "33[35m Hello World"

echo -e "33[36m Hello World"

echo -e -n "33[0m"

# back to normal

echo -e "33[41m Hello World"

echo -e "33[42m Hello World"

echo -e "33[43m Hello World"

echo -e "33[44m Hello World"

echo -e "33[45m Hello World"

echo -e "33[46m Hello World"

echo -e "33[0m Hello World"


Script 3: Encrypt a File/Directory

yum install pinentry-gui

apt-get install pinentry-gui

Touch Encrypt.sh

Vi Encrypt.sh

#!/bin/bash

echo "Welcome, I am ready to encrypt a file/folder for you"

echo "currently I have a limitation, Place me to thh same folder, where a file to be encrypted is present“

echo "Enter the Exact File Name with extension"

read file;

gpg -c $file

echo "I have encrypted the file successfully..."

echo "Now I will be removing the original file"

rm -rf $file

 Script 4: Checking Server Utilization

#!/bin/bash

    date;

    echo "uptime:"

    uptime

    echo "Currently connected:"

    w

    echo "--------------------"

    echo "Last logins:"

    last -a |head -3

    echo "--------------------"

    echo "Disk and memory usage:"

    df -h | xargs | awk '{print "Free/total disk: " $11 " / " $9}'

    free -m | xargs | awk '{print "Free/total memory: " $17 " / " $8 " MB"}'

    echo "--------------------"

    start_log=`head -1 /var/log/messages |cut -c 1-12`

    oom=`grep -ci kill /var/log/messages`

    echo -n "OOM errors since $start_log :" $oom

    echo ""

    echo "--------------------"

echo "Utilization and most expensive processes:"

    top -b |head -3

    echo

  top -b |head -10 |tail -4

    echo "--------------------"

    echo "Open TCP ports:"

    nmap -p- -T4 127.0.0.1

    echo "--------------------"

    echo "Current connections:"

    ss -s

    echo "--------------------"

    echo "processes:"

    ps auxf --width=200

    echo "--------------------"

    echo "vmstat:"

    vmstat 1 5

  
1.   ‘>‘ : the redirection operator causes a file creation, and if it does exist, the contents are overwritten.

2.   ‘>>‘ : when you use >>, you are adding information, rather than replacing it.

3.   ‘>>‘ is safe, as compared to ‘>‘

Script 5: Check Disk Space and Sends an Email Alert

MAX=95

EMAIL=USER@domain.com

PART=sda1

USE=`df -h |grep $PART | awk '{ print $5 }' | cut -d'%' -f1`

 if [ $USE -gt $MAX ]; then

echo "Percent used: $USE" | mail -s "Running out of disk space" $EMAIL

fi

 
Comment,
Like and
Share  us  and  help us to spread.

####--------------------------------------------------------------------------------------####
Website    :-   http://www.cloudnetwork.in
Twitter     :-   http://twitter.com/itcloudnet
Skype Id  :-   cloud.network1
E-Mail Id :-   itcloudnet@gmail.com
####----------------------------------------------------------------------------------------####                         
Thanking You
Hope U Like it........


Comment Policy We’re eager to see your comment. However, Please Keep in mind that all comments are moderated manually by our human reviewers according to our comment policy, and all the links are nofollow. Using Keywords in the name field area is forbidden. Let’s enjoy a personal and evocative conversation.

Monday, March 2, 2015

Complete Installation Guide for Android Emulator SDK/ADT Manager With Eclipse on Ubuntu 14.10,15.04

March 02, 2015
Complete Installation Guide for Android Emulator SDK/ADT Manager With Eclipse on Ubuntu 14.10,15.04



Hello Everyone,

In this tutorial

Let Us Install Android Emulator SDK Manager with Eclipse on Ubuntu 14.04, 14.10 or 15.04 - 64bit

        You Can also Install in Debian 7.5, Linux Mint 17, Xubuntu & Lubuntu

Requirement
Internet speed should be good 64 bit only support

Empty space should be 5gb above for both installation and configuration

Installing Linux Distribution
Step1 :- sudo apt-get install ia32-libs
Step2 :- sudo apt-get install libgl1-mesa-dev


Watch the Video on Youtube.com/itcloudnet

For java installation

sudo apt-get Install openjdk-7-jdk
                     Or
sudo apt-get install openjre-7-jre


Step3 :- sudo gedit ~/.pam_environment  or ~/.bashrc
PATH DEFAULT=${PATH}:/path/to/tools`
PATH DEFAULT=${PATH}:/path/to/platform-tools


Downloading Android SDK Manager
Step3 :-  wget http://dl.google.com/android/android-sdk_r24.0.2-linux.tgz
Step4 :-  tar -zxvf android-sdk_r24.0.2-linux.tgz
Step5 :-  ./android



NOTE :- For Any Clarification Please Below
 
Comment,
Like and
Share  us  and  help us to spread.

####--------------------------------------------------------------------------------------####
Website    :-   http://www.cloudnetwork.in
Twitter     :-   http://twitter.com/itcloudnet
Skype Id  :-   cloud.network1
E-Mail Id :-   itcloudnet@gmail.com
####----------------------------------------------------------------------------------------####                         
Thanking You
Hope U Like it........

Saturday, February 28, 2015

Unable to start systemd service in Docker container in Fedora Desktop or Server

February 28, 2015
 Unable to start systemd service in Docker container in Fedora Desktop or Server
The step 'systemctl start redis.service' failed with this error message:

Failed to get D-Bus connection: No connection to service manager. 
 


To Solve the Error's Just Type in Safe Mode

/usr/lib/systemd/systemd --system &

Wednesday, February 25, 2015

How to Install OwnCloud 8 to Create Personal Cloud Storage in Ubuntu

February 25, 2015
How to Install OwnCloud 8 to Create Personal Cloud Storage in Ubuntu

Hello Everyone,

In this tutorial,

Let Us Install OwnCloud 8 Released – Create Personal/Private Cloud Storage in Ubuntu 14.04, 14.10 LTS -

You Can also Install in Linux Mint17, Debian, Xbuntu

In order to setup your own personal cloud storage (ownCloud), you must have LAMP (Linux, Apache, MySQL, PHP) stack installed. Other than LAMP stack you might need Perl and Python based upon your use.

Step 1 :- sudo apt-get install apache2 apache2-doc apache2-utils mysql-server mysql-client php5 php5-mysql php5-curl.

Create Cloud Database
Once you setup LAMP stack on your personal box, just login to your database (MySQL, here).

Step 2 :- mysql -u root –p

Step 3 :- create database cloud ;

Step 4 :-  grant all on cloud.* to cloud@localhost identified by 'my_password';

Download and Install ownCloud Application



Step 5:- cp owncloud-8.0.0.tar.bz2 /var/www/

Step 6:- tar -jxvf owncloud-8.0.0.tar.bz2

Step 7:- rm -rf owncloud-8.0.0.tar.bz2

Step 8:- chmod -R 777 owncloud/

Configuring Apache for ownCloud

For security purpose ownCloud uses Apache‘s .htaccess files, in order to use them. We need to enable two Apache modules mod_rewrite and mod_headers for ownCloud to function properly.

Step 9:-   a2enmod rewrite
                a2enmod headers

Step 10:- nano /etc/apache2/apache2.conf
There, find “AllowOverride None”  under  Directory /var/www/ and change this to “AllowOverride All”

Step 11:- AllowOverride   All

Step 12:- service apache2 restart
Access ownCloud Application



OR


Error’s
404 Not Found
the requested URL /owncloud/ was not found on this server.
apache/2.4.7 (Ubuntu) Server at myIP Port 80

Edit    /etc/apache2/sites-available/000-default.conf
DocumentRoot  /var/www/html
to
DocumentRoot  /var/www/

Restarted apache

Error’s

sudo apt-get install php5-gd

/etc/init.d/apache2 restart

Error’s

First edit the file apache2

sudo gedit  /etc/apache2/apache2.conf
then find Directory /var/www/ change
AllowOverride none
to
AllowOverride  All

Save & Quit

Restarted apache
sudo service apache2 restart

NOTE :- For Any Clarification Please Below
 
Comment,
Like and
Share  us  and  help us to spread.

####--------------------------------------------------------------------------------------####
Website    :-   http://www.cloudnetwork.in
Twitter     :-   http://twitter.com/itcloudnet
Skype Id  :-   cloud.network1
E-Mail Id :-   itcloudnet@gmail.com
####----------------------------------------------------------------------------------------####                         
Thanking You
Hope U Like it........

Monday, February 23, 2015

How to Install Ubuntu Desktop 14.04.2 LTS in Virtual Box With Full Screen Resolutions

February 23, 2015
How to Install Ubuntu Desktop 14.04.2 LTS in Virtual Box With Full Screen Resolutions

Hello Everyone,

In this tutorial,

Let us Install Ubuntu Desktop 14.10.2 LTS –“Utopic Unicorn” on Virtual Box with Full Screen Resolution   --  64 Bit

You Can also Install in VMware Workstation 11 or Microsoft Hyper-V.

Minimum System Requirements
1.  x86-64 CPU (64-bit Macs, with an Intel Core 2 Duo, Intel Core i3, Intel Core i5, Intel Core i7, or Xeon processor).
2GB of System Memory (RAM).
3. 20GB of Disk Space(Hard Disk).
4. Graphics Card and Display capable of at least 1024x768.
5. Either a CD/DVD drive or a USB port for the installer media.
6. Internet Access.

Step1:- First Download Virtual box setup below is this link to download 
Or
Another Link to Download Virtual Box

Select -- Virtual Box 4.3.X for Windows hosts 32 or 64 bit.   
(Where 'X' is the Latest Version)

Step2:- See My Video How to Install virtual box... Click Below link

Step3:- Download ISO Image Ubuntu Desktop 14.04.2.....Click Below link
size -  5.11GB

For Full Screen Resolution….
Step4 :- sudo apt-get install virtualbox-guest-dkms virtualbox-guest-utils virtualbox-guest-x11                or
Step5 :- sudo apt-get install virtualbox-guest-dkms
Restart the VM and enjoy screen-size.

Mount the Guest Additions by selecting Devices --- Insert Guest Additions CD image… (or you can press Host + D)
Step6 :- run the VBoxLinuxAdditions.run script within the newly mounted cd
              or  sh VBoxLinuxAdditions.sh

Watch the Video on How to Reset Root Password in Ubuntu 14.04


NOTE :- For Any Clarification Please Below

Comment,
Like and
Share  us  and  help us to spread.

####--------------------------------------------------------------------------------------####
Website    :-   http://www.cloudnetwork.in
Twitter     :-   http://twitter.com/itcloudnet
Skype Id  :-   cloud.network1
E-Mail Id :-   itcloudnet@gmail.com
####----------------------------------------------------------------------------------------####                         
Thanking You
Hope U Like it........

Monday, February 16, 2015

Any Question on Andriod Ask Us

February 16, 2015
Any Question on Andriod Ask Us

You May Having Issue Like...

1. Emulator built on MacOS 10.7 Lion doesn't work.

2. Apps restart in background

3. Missing system.img error

4. Android 5 Wi-Fi Issues

5. Android 5 Bluetooth Problems

6. Android 5.0.1 Cellular Data Issues

AND Many More......

             So, Just Email Us Will Reply You Very Soon...

 

     E-Mail us on:- itcloudnet@gmail.com

 

 

 

Thanking You
Hope U Like it......

Thursday, February 12, 2015

Oracle Database 12c R1 - Description & Command

February 12, 2015
Oracle Database 12c R1 - Description & Command

Hello Everyone,

In this tutorial,

Step by Step Process on How to Install Oracle Database 12c R1 Enterprise Edition on Ubuntu 14.10 – 64Bit

You can also install in Ubuntu 14.04. Debian, Linux mint .

Note :- completed Installation time take around 1hr or 2hr above. Depends on Hardware configuration of system

AUCTION
Ubuntu-like Systems are Not in the List of Oracle 12c Database Supported. So you should Be Careful and Use It At Most for Development and Not As Production Database Server!

Download Oracle 12c R1 Database from Oracle Website for Linux :-
http://www.oracle.com/technetwork/database/enterprise-edition/downloads/index.html?ssSourceSiteId=ocomen

Hardware Requirements
1. For large-scale installation we need to use multicore processors with High availability.
2. Recommended minimum RAM needed for Oracle 12c is 2GB or more.
3. Swap must be enabled double the size of RAM.
4. Disk space must be more than 10GB, its depends on edition which are we going to choose for installing.
5. /tmp directory must have free space more than 1GB for error free installation.
6. Supported Linux operating systems are Linux Mint, Kubuntu, Debian.
7. Both x86_64 and i686 packages are required for installation.
8. Screen resolution must be more than 1024×768 resolution

Logging into ubuntu and Open Terminal
step1:- sudo apt-get update
step2:- sudo apt-get dist-upgrade
Restart the System (sudo reboot or sudo init 6)

step3:- sudo nano /etc/hosts  --- (To Edit Hosts File)
Eg :- <IP-address>  <fully-qualified-machine-name>  <machine-name>
        192.168.1.104   cloudnetwork.localdomain cloudnetwork

$uname –n  -- > to check machine name
$dnsdomainname -- > to check the localdomain
$arch -- > to check 32bit or 64bit of OS

Installation Dependencies
step4:-  sudo apt-get -y install alien binutils build-essential cpp-4.4
debhelper g++-4.4 gawk gcc-4.4 gcc-4.4-base gettext html2text lib32z1
lib32ncurses5 lib32bz2-1.0 intltool-debian ksh lib32bz2-dev lib32z1-dev
libaio-dev libaio1 libbeecrypt7 libc6 libc6-dev libc6-dev-i386
libelf-dev libelf1 libltdl-dev libltdl7 libmotif4 libodbcinstq4-1
libodbcinstq4-1:i386 libqt4-core libqt4-gui libsqlite3-0 libstdc++5
libstdc++6 libstdc++6-4.4-dev lsb lsb-core lsb-cxx lsb-desktop
lsb-graphics lsb-qt4 make odbcinst pax po-debconf rpm rpm-common sysstat
unixodbc unixodbc-dev unzip

Create New User and Groups
step5:- sudo addgroup oinstall
step6:- sudo addgroup dba
step7:- sudo addgroup nobody
step8:- sudo usermod -g nobody nobody
step9:- sudo useradd  -g oinstall -G dba -p password -d /home/oracle -s /bin/bash oracle
step10:- sudo mkdir /home/oracle
step11:- sudo chown -R oracle:dba /home/oracle

Create and Prepare location to install the oracle binaries
step12:- sudo mkdir -p /u01/app/oracle
step13:- sudo mkdir -p /u01/binaries
step14:- sudo chown -R oracle:dba /u01
step15:- sudo passwd oracle

some softlinks to start the Installation
step16 :-  echo 'Red Hat Linux release 6' | sudo tee -a  /etc/redhat-release
sudo mkdir /usr/lib64
sudo ln -s /etc /etc/rc.d
sudo ln -s /lib/x86_64-linux-gnu/libgcc_s.so.1 /lib64/
sudo ln -s /usr/bin/awk /bin/awk
sudo ln -s /usr/bin/basename /bin/basename
sudo ln -s /usr/bin/rpm /bin/rpm
sudo ln -s /usr/lib/x86_64-linux-gnu/libc_nonshared.a /usr/lib64/
sudo ln -s /usr/lib/x86_64-linux-gnu/libpthread_nonshared.a /usr/lib64/
sudo ln -s /usr/lib/x86_64-linux-gnu/libstdc++.so.6 /lib64/
sudo ln -s /usr/lib/x86_64-linux-gnu/libstdc++.so.6 /usr/lib64/

Run following command to shell configuration for oracle user
step17 :- sudo cp /etc/security/limits.conf /etc/security/limits.conf.original
echo "#Oracle 12C shell limits:" | sudo tee -a /etc/security/limits.conf
echo "oracle soft nproc 2048" | sudo tee -a /etc/security/limits.conf
echo "oracle hard nproc 16384"| sudo tee -a /etc/security/limits.conf
echo "oracle soft nofile 1024" | sudo tee -a /etc/security/limits.conf
echo "oracle hard nofile 65536" | sudo tee -a /etc/security/limits.conf

Run following command to change the kernel parameters
step18 :- echo "#" | sudo tee -a /etc/sysctl.conf
echo "# Oracle 12C entries" | sudo tee -a /etc/sysctl.conf
echo "fs.aio-max-nr=1048576" | sudo tee -a /etc/sysctl.conf
echo "fs.file-max=6815744" | sudo tee -a /etc/sysctl.conf
echo "kernel.shmall=2097152" | sudo tee -a /etc/sysctl.conf
echo "kernel.shmmni=4096" | sudo tee -a /etc/sysctl.conf
echo "kernel.sem=250 32000 100 128" | sudo tee -a /etc/sysctl.conf
echo "net.ipv4.ip_local_port_range=9000 65500" | sudo tee -a /etc/sysctl.conf
echo "net.core.rmem_default=262144" | sudo tee -a /etc/sysctl.conf
echo "net.core.rmem_max=4194304" | sudo tee -a /etc/sysctl.conf
echo "net.core.wmem_default=262144" | sudo tee -a /etc/sysctl.conf
echo "net.core.wmem_max=1048586" | sudo tee -a /etc/sysctl.conf
echo "kernel.shmmax=1073741824" | sudo tee -a /etc/sysctl.conf

Load new kernel parameters
Step19:- sudo sysctl -p

We need to do changes in start-up script -- Root
step20:-  mkdir /etc/rc.d
for i in 0 1 2 3 4 5 6 S
do sudo ln -s /etc/rc$i.d /etc/rc.d/rc$i.d
done

I have downloaded both the zip file and move to /u01/binaries. let check
step21:- cd /u01/binaries/
step22:- ls

Extract both the zip to start the installation. To unzip run,
step23:- unzip linuxamd64_12c_database_1of2.zip
step24:- unzip linuxamd64_12c_database_2of2.zip

You will see database folder after extracting the binaries
step25:- ls

Before doing the installation we need to give proper permission to the extracted file, to do the same run following command
step26:- chown -Rf oracle:dba /u01/binaries
or
chown -Rf oracle:oinstall /opt/oracle


Start installation using following command
step27:-   /u01/binaries/database
step28:-  ./runInstaller -ignoreSysPrereqs


For Any Clarification Please Comment Below

Thanking You
Hope U Like it........