Saturday, 7 October 2017

What is Dark Web , Deep Web And Surface Web ?

Friends, We all use internet daily. Did you you know that there is a very big section of internet which you would never use? Today I will tell you about those sections which are Deep Web and Dark Web.
Internet is divided in to 3 sections or you can say layers, Surface Web, Deep Web and Dark Web.
Every one of you might know about Surface Web Internet, if not I will tell you about it today.


SURFACE WEB

It is the internet which is used most commonly by everyone in the world, and will be using in future and even which I use.That is called as Surface Web, in fact this video which you are watching now is also a part of Surface Web. Surface Web is the internet which is accessible anywhere in the world without any special permission, And Information about Surface Web is easily accessible in a simple Google search. That means all the information you get in Google search results such as links
or websites are all part of Surface Web because it is publicly available for everyone. For example, all your Entertainment Websites, News Websites, Music Websites, Torrents, and all the information you were using till today is all part of Surface Web. But do you really know that Surface Web is only 5% of actual internet? According the recent studies nearly 95% of internet is on Deep Web, if you compare Deep Web to Surface Web with an Ice Berg then Surface Web is just a tip which is seen in the sea which you were using it till now and will be using in future. But actual mass below is the Deep Web.

DEEP WEB :

Now let’s see what happens in Deep Web and what is stored in it. All online storage like Google Drive, Dropbox, Big University Documents, Research Data, Big Companies and Banks Information & Databases, Government Secret Projects & Files or basically the data which you will never get with a simple Google search are stored in Deep Web. If you want to access Deep Web, you will need a special URL, special address for website or server and you need permission to access that information. It might be a login id and password or any type of authentication, but without that address you will never be able to access the Deep Web. All the websites or web pages, data, information are not indexed by Google, Yahoo or Bing search engine, so in that case you will never be able to see what is stored in my normal Google drive or cloud storage even if you keep searching for it forever. It is accessible only if you have permission for that particular file or folder when shared. We need Deep Web to store all our data to cloud but don’t want to share it with everyone and only to the eligible ones. Its as simple as a company intranet page whereas project document would be shared only with the selected users or employees , but not with all employees and the same is not available on internet search. Deep Web is anyways not a hidden Internet all together, But there is another layer of internet which is hidden from everyone and that is called as Dark Web.

DARK WEB

This is just information we are providing about Dark Web, I request you or either warn you that usage of Dark Web is completely illegal, so never use it. Dark Web is the internet where you can do anything, for example Drugs Trading, Drugs Smuggling, Arms Trading, Arms Smuggling, all other illegal activities which we don’t want to discuss about. We just want to inform you that Dark Web is a Black Stop for Internet where you can do anything and everything, and also this is never shown in any simple search results. If you want to use it, then you will need a special browser called as Onion Router also known as Tor Browser. Dark web can be accessed using Tor Browser through a VPN, but I remind you that this is completely illegal. All the black market can be accessed in Dark Web since it uses Tor Browser which will be bouncing your address all over the world with different notes, only those users can trace you. Currently there is no back trace available for Tor Browser. It was invented for US Navy but nowadays Tor Network is there all over the world connecting entire black market
and many agencies are working to take down the websites in Dark Web as well. Even after all these corrective & preventive techniques, Dark Web still exists in the current Internet and there are lot of
illegal stuff and activities happening which is accessible only on Tor Browser.


**** END ****

Saturday, 30 September 2017

Cron Job In Linux | Scheduling job with crontab in Linux

Cron job are used to schedule commands to be executed periodically. You can setup commands or scripts, which will repeatedly run at a set time. Cron is one of the most useful tool in Linux or UNIX like operating systems. The cron service (daemon) runs in the background and constantly checks the
/etc/crontab file, and /etc/cron.*/ (cron.d/,cron.daily/,cron.hourly/,cron.monthly/,cron.weekly/) directories. It also checks the /var/spool/cron/ directory. Each user can have their own crontab file.

Other than crontab there are 2 more services to schedule the job the "at" command and "batch" command. The "at" command is used to schedule a one-time task at a specific time. The batch command is used to schedule a one-time task to be executed when the systems load average drops below 0.8.

Install or create or edit my own cron jobs:

To edit your crontab file, type the following command at the UNIX / Linux shell prompt:

$ crontab -e

Syntax of crontab (field description)

The syntax is:

    1 2 3 4 5 /path/to/command arg1 arg2

OR

    1 2 3 4 5 /root/backup-script.sh

Where,

1: Minute (0-59)
2: Hours (0-23)
3: Day (0-31)
4: Month (0-12 [12 == December])
5: Day of the week(0-7 [7 or 0 == sunday])

/path/to/command - Script or command name to schedule

Easy to remember format:


Examples of Run backup cron job script:
If you wish to run a backup-script.sh daily at 2.00 AM then first install your cronjob by running the following command as following .
$ crontab -e
append the following entry at the end
0 2 * * * /root/backup-script.sh

save and close the crontab file . The backup-script.sh will run every day at 2.00 AM.

More examples:
To run /path/to/script.sh every 5 min , Enter following command:
*/5 * * * * /path/to/script.sh

To run /path/to/script.sh five minutes after midnight, every day, Enter following:
5 0 * * * /path/to/script.sh

To run /path/to/script.sh at 3:15 PM on the first of every month, Enter following:
15 14 1 * * /path/to/script.sh

To run /path/script.sh at 10 PM on weekdays(Mon,Tue,Wed,Thu,Fri), Enter following:
0 22 * * 1-5 /scripts/script.sh

To run /path/myscripts/script.pl at 23 minutes after midnight, 2am, 4am ..., everyday, Enter:
23 0-23/2 * * * /path/myscripts/script.pl

How do I use operators?

An operator allows you to specifying multiple values in a field. There are four operators:

The asterisk (*) :

This operator specifies all possible values for a field. For example, an asterisk in the hour time field would be equivalent to every hour or an asterisk in the month field would be equivalent to every month.

The comma (,) :

This operator specifies a list of values, for example: "1,5,10,15,20, 25".

The dash (-) :

This operator specifies a range of values, for example: "5-15" days , which is equivalent to typing "5,6,7,8,9,....,13,14,15" using the comma operator.

The separator (/) :

This operator specifies a step value, for example: "0-23/" can be used in the hours field to specify command execution every other hour. Steps are also permitted after an asterisk, so if you want to say every two hours, just use */2.

How To Send Email From Linux Command Line

In Linux the mail command is an essential in our practical life. There is lot of instance when we want to send mail from Unix/Linux server to our outlook or personal email inbox. For example in Linux server we have generated csv file from database and want to pull this in our window machine. In this case we can use mail command to send file in our mailbox direct from Linux rather using FTP to pull report in local window machine.


Also mail command is useful in our automation script in which we want to generate some kind of report and send to its in recipients email box.

Before starting we should make sure we have installed mailx command in our system. If not installed run the following commands.

# For ubuntu/debian
$ sudo apt-get install heirloom-mailx

# For fedora/centos
$ sudo yum install mailx

Usage of mail command:
Once installation done you are ready to use mail command from command line. Following are the couple of examples .

1. Simple mail :
Run the following command and hit enter then you can write message for email body and for new line just hit enter and write message.
Once message complete press Ctrl+D and it would display EOT at the end.

Check the below message in recipient email if you not getting mail in inbox then check in spam/junk folder.

$ mail -s "This is subject" xyz@example.com
Hi there
This is a simple email body
bye!
EOT

2. Redirect message into mail from a file:

We can send email body message from a file by redirecting file as following.
$ mail -s "This is subject" xyz@example.com < /home/mukesh/message/message-body.txt
3. Message body in echo :

We can write the body message with echo as following.
$ echo -e "This is message body \nHere is second line." | mail -s "This is subject" xyz@example.com
4. Send mail to multiple recipients:

To send email to multiple recipient just separate the email id's  by comma.
echo -e "This is message body \nHere is second line." | mail -s "This is subject" xyz@example.com,abc@example.com
5. Using CC and BCC option:

Use -c to add CC and -b to add BCC
$ echo -e "This is message body" | mail -s "This is subject" -c ccrecipient@example.com xyz@example.com

$ echo -e "This is message body" | mail -s "This is subject" -c ccrecipient@example.com -b bccrecipient@example.com xyz@example.com
6. Specifying from Email:
If you wish to put sender email for recipient use -r option as following.

$ echo "This is message body" | mail -s "This is Subject" -r "Mukesh<fromemail@example.com>" recipient@example.com
7.Email with attachment ( Important ):

To attach  file use -a option as following.
echo "This is Message Body" | mail -s "This is Subject" -a /home/mukesh/message/sampleFile.csv recipient@example.com

echo "This is Message Body" | mail -s "This is Subject" -r "Mukesh<fromemail@example.com>" -a /home/mukesh/message/sampleFile.csv recipient@example.com


**** End****

Wednesday, 20 September 2017

How to find the length of a string variable in UNIX.

You may need to find the length of string or size of string variable in your shell script program. Here are the 5 best ways through which you can acheive it.




Above picture may clear you whole story if not please go in details as following.


Consider we have a variable name VAR and it stores a string "Hello" which length is 5.
VAR="Hello"

1) echo : In the bash we can use echo command as following .
VAR="Hello"
echo ${#VAR}
5

2) echo with wc : Second method is echo with wc with -c option as following.
VAR="Hello"
echo -n $VAR | wc -m
5

or

echo -n $VAR | wc -c
5
Note:
Where -m print the character counts and -c print the byte counts .

3) printf with wc : 3rd method is to use printf with wc as following.
printf $VAR | wc -c
5

or

printf $VAR | wc -m
5

4) echo with awk : 4th method is echo with awk as following.
echo $VAR | awk '{print length ;}'
5

5) expr : 5th method to use expr as following.
expr length $VAR
5

or

expr $VAR : '.*'
5
Watch video in detail



Related Posts Plugin for WordPress, Blogger...