Sunday, April 23, 2017

Find/Locate Commands in Linux ?

Locate is the best command in Linux terminal to determine the files in server or path of the file .

syntax :- locate <filename>

Find also similar to the locate command

syntax :-  find </foldername> -name <filename?
ex :-   find /tmp -name file1


I just created a file which doesnt showup with locate/find command ?

yes usually database will update by linux cronjob which typically runs during night. In order to update the database right away run # updatedb


[root@linuxtechnotes ~]#
[root@linuxtechnotes ~]# locate file20
locate: can not stat () `/var/lib/mlocate/mlocate.db': No such file or directory
[root@linuxtechnotes ~]# touch /tmp/file20
[root@linuxtechnotes ~]# locate file20
locate: can not stat () `/var/lib/mlocate/mlocate.db': No such file or directory
[root@linuxtechnotes ~]# updatedb
[root@linuxtechnotes ~]# locate file20
[root@linuxtechnotes ~]# locate file20
[root@linuxtechnotes ~]# find /tmp/ -name file20
/tmp/file20
[root@linuxtechnotes ~]# updatedb
[root@linuxtechnotes ~]# locate file20
[root@linuxtechnotes ~]# find /tmp/ -name file21
[root@linuxtechnotes ~]# touch /tmp/file21
[root@linuxtechnotes ~]# find /tmp/ -name file21
/tmp/file21
[root@linuxtechnotes ~]#

How to set cronjobs ? Syntax and examples ?


crontab - maintain crontab files for individual users


How to get all list of crontab scheduled users on server

#ls /var/spool/cron/


files :-
/etc/crontab  >> is main file
/etc/cron.allow  >> who all have access to cronjobs
/etc/cron.deny >> who all doesnt have access to cronjobs

syntax :-


# Example of job definition:
# .---------------- minute (0 - 59)
# |  .------------- hour (0 - 23)
# |  |  .---------- day of month (1 - 31)
# |  |  |  .------- month (1 - 12) OR jan,feb,mar,apr ...
# |  |  |  |  .---- day of week (0 - 6) (Sunday=0 or 7) OR sun,mon,tue,wed,thu,fri,sat
# |  |  |  |  |
# *  *  *  *  * user-name command to be executed


* * * * * root touch /tmp/file1

* means every minute/hour/dat of month/month/day of week


*/2  * * * * root touch /tmp/file1    means it will exicute every 2ms of every hour ,every day.

Below lets take example of minute

*/3 >> is every 3ms
3,5  >> at 3ms and 5ms
2-9  >> every 2ms,3ms---9ms.
 

Saturday, April 22, 2017

Basic/Easy Overview of Cloud computing ? What is Cloud Computing ? Available types of services ? What are cloud models ?

What is cloud computing ?

Cloud computing is a type of internet based computing that provides computer processing resources and data to computer and other devices on demand . Could is available from anywhere in the world to get access which over comes the current problem of accessing the within the network/using VPN.
The main advantage of cloud is , It will provide the resources on demand by itself like servers,storage ,networking and application etc.

what are could computing service models ?

IAAS  -Infrastructure as a service
PAAS  - platform as a service
SAAS  - software as a service
MBaas  - MObile Backend as a service


IAAS  -Infrastructure as a service  ?

IN this service model cloud will provide all the infrastructure stuff as a service like servers,storage,networking on demand

PAAS -platform as a service ?

PAAS service will provide the development environment for developers . Using this service developers can provide   operating systems ,programming language execution environment,database and webserver.

SAAS  - software as a service  ?


In this  model, users gain access to application software and databases. Cloud providers manage the infrastructure and platforms that run the applications.
Cloud users do not manage the cloud infrastructure and platform where the application runs.
This eliminates the need to install and run the application on the cloud user's own computers, which simplifies maintenance and support.

MBaas  - MObile Backend as a service  ?


In this service model web app and mobile app developers are provided with a way to link their applications to cloud storage and cloud computing services with application programming interfaces (APIs)
exposed to their applications and custom software development kits . Services include user management, push notifications, integration with social networking services and more.


What are different types of could deployment models ?

private cloud
public cloud
hybrid  cloud
community cloud

Private cloud :- In this model ,services delicately assigned to single  organization which will available within the data centers to organization .Also the services are managed by the organization

The main advantage is security over the data

public cloud :- In this model , service are managed by cloud provider. The services are provisioned based on the demand . IT will suitable for non-sensitive data only as services are supports for the multiple customers .
The main advantage is cost saving as organization needs to pay based on usage only .

Hybrid cloud :- Hybrid cloud is combination of private and public cloud . using this model organization can use private cloud for sensitive data and can use public cloud for non-sensitive data.

Community cloud :-  This will be used to share the services within the organization like trusted partners