❌

Normal view

There are new articles available, click to refresh the page.
Before yesterdayJabez

Day 7 – notes

13 February 2024 at 06:44

Today we have seen step by step instructions to install apache2 webserver on our linux machines.

  • apache2
  • nginx
  • IIS
  • httpd

These are some common webserver applications being widely used around the world. In this sessio, we have seen how to install apache2 on debian based OS machine.

apache2 is a webserver daemon application(kind of background processes that start at system boot and continue running until the system is shut down)

sudo apt install apache2 -y

Above command install apache2 on our machine. The argument -y is added in the same command to pass it when the terminal prompts for an answer.

After installation, if incase the system is restarted, by default the apache2 service would be in β€˜disabled’ state. So, in order to keep it active always at any time although if restart occurs, we need to use below command.

sudo systemctl enable apache2
sudo systemctl status apache2

This command is used to check if apache2 webserver’s status or to check if it is installed.

To check in which port the apache2 webserver is running, use command as below

It shows the application is running in port 80

By default – post apache2 installation, if we try β€œlocalhost” in browser, it will display index page of apache2 that is present in /var/www/index.html

We have seen how to edit that html through vim and how to keep custom html page.

Post editing html – when we invoke β€œlocalhost” the updated html page is visible in browser. Moreover, the same html content can be seen in the terminal through below command

We have also seen how to install such application in WAN. Dhanasekar showed how to procure a cloud machine from linode akamai website. I will try the same after some time.

We have see how to transfer a file from localmachine to remote machine using scp command. As per below screenshot – the index.html file from local machine has been transferred to remote machine to display the home page when apache2 server runs in remote machine.

Below commands can be used to start/stop the webserver

systemctl start apache2
systemctl stop apache2
systemctl restart apache2

Day 7 – notes

13 February 2024 at 06:44

Today we have seen step by step instructions to install apache2 webserver on our linux machines.

  • apache2
  • nginx
  • IIS
  • httpd

These are some common webserver applications being widely used around the world. In this sessio, we have seen how to install apache2 on debian based OS machine.

apache2 is a webserver daemon application(kind of background processes that start at system boot and continue running until the system is shut down)

sudo apt install apache2 -y

Above command install apache2 on our machine. The argument -y is added in the same command to pass it when the terminal prompts for an answer.

After installation, if incase the system is restarted, by default the apache2 service would be in β€˜disabled’ state. So, in order to keep it active always at any time although if restart occurs, we need to use below command.

sudo systemctl enable apache2
sudo systemctl status apache2

This command is used to check if apache2 webserver’s status or to check if it is installed.

To check in which port the apache2 webserver is running, use command as below

It shows the application is running in port 80

By default – post apache2 installation, if we try β€œlocalhost” in browser, it will display index page of apache2 that is present in /var/www/index.html

We have seen how to edit that html through vim and how to keep custom html page.

Post editing html – when we invoke β€œlocalhost” the updated html page is visible in browser. Moreover, the same html content can be seen in the terminal through below command

We have also seen how to install such application in WAN. Dhanasekar showed how to procure a cloud machine from linode akamai website. I will try the same after some time.

We have see how to transfer a file from localmachine to remote machine using scp command. As per below screenshot – the index.html file from local machine has been transferred to remote machine to display the home page when apache2 server runs in remote machine.

Below commands can be used to start/stop the webserver

systemctl start apache2
systemctl stop apache2
systemctl restart apache2

Day 6 – linux commands

12 February 2024 at 05:52

join command

joins lines of two files with common fields

If there are any rows/lines that does not match, it will be ignored. Here, a row about β€œdelhi” is available in sample1.txt but not in sample2.txt. Hence see the result as below

file command

gives file type

Here -b argument denotes brief information. The last command you see that it return only the file type without file name.

If you check for an empty file – it returns empty.

file * gives file type of all files in the present directory

touch command

creates an empty file. This can also be used to create bulk files by giving commands like touch file{1..10}.txt and it creates 10 empty files.

touch -r "fromFilename" "toFileName"

This command helps to change timestamp or date from one file to other file. See the result below.

Cal command

gives calendar information. cal -y gives the complete year calendar

rev and tac command

rev reverses the file content character by character.

tac reverses line by line

redirection command

β€˜>’ denotes output redirection(write to a file)

β€˜<β€˜ denotes input redirection(read from a file)

echo "welcome to linux" > file1.txt

The output redirection operator uses to replace the file content.

In this example, word count is read from file1.txt and the output is written to file2.txt

wc < file1.txt > file2.txt

>> – this operator appends the content that is already present in the file

tee command

writes standard output to another file. One can give any number of files where the output to be copied.

grep command

helps to find a string from a file. In real time scenario – mainly used to file keywords in error logs. Note: Here the search is case-sensitive

One can also instruct to search in multiple files.

Day 6 – linux commands

12 February 2024 at 05:52

join command

joins lines of two files with common fields

If there are any rows/lines that does not match, it will be ignored. Here, a row about β€œdelhi” is available in sample1.txt but not in sample2.txt. Hence see the result as below

file command

gives file type

Here -b argument denotes brief information. The last command you see that it return only the file type without file name.

If you check for an empty file – it returns empty.

file * gives file type of all files in the present directory

touch command

creates an empty file. This can also be used to create bulk files by giving commands like touch file{1..10}.txt and it creates 10 empty files.

touch -r "fromFilename" "toFileName"

This command helps to change timestamp or date from one file to other file. See the result below.

Cal command

gives calendar information. cal -y gives the complete year calendar

rev and tac command

rev reverses the file content character by character.

tac reverses line by line

redirection command

β€˜>’ denotes output redirection(write to a file)

β€˜<β€˜ denotes input redirection(read from a file)

echo "welcome to linux" > file1.txt

The output redirection operator uses to replace the file content.

In this example, word count is read from file1.txt and the output is written to file2.txt

wc < file1.txt > file2.txt

>> – this operator appends the content that is already present in the file

tee command

writes standard output to another file. One can give any number of files where the output to be copied.

grep command

helps to find a string from a file. In real time scenario – mainly used to file keywords in error logs. Note: Here the search is case-sensitive

One can also instruct to search in multiple files.

Basic Linux shell commands

6 February 2024 at 09:53

ls

Lists the files from present working directory

ls command can accept many arguments. Let us see one by one. These are all not the only commands. I am listing the commands that we have seen during the session.

ls -a  #lists all files including hidden files
ls -l  # lists in long list format(including who created, size..)
ls -lh # lists in long list with human readeable format
ls -lSh # lists files based on Size in human readable format
ls -R # recursive list(includes all files inside all directories)

whoami

gives username of the current session

hostname

gives hostname where the current session is

hostname #gives hostname
sudo hostname "new host name" # changes hostname to new host name

date

gives current date and time

date #gives current date and time
date --date="3 years ago" #gives same date three years ago
date --date="yesterday" #gives yesterday's date

cat

concatenate files and print output in the console

cat sample.txt #display the content from sample.txt
cat test1.txt test2.txt test3.txt # display all file contents

history

keeps history of all the commands entered so far

history | head #gives first 10 commands being used
history | tail #gives last 10 commands being used
#Usually it stores 1k commands in memory

rm

removes file or directories permanently

rm -d "filename" # removes empty directories
rm "filename" #removes the file
rm -i "filename" #prompts user once before delete
rm -r "folder" #deletes recursively all files inside the folder
rm *.xml #deletes all file with the given extension in the pwd.

man

it is a manual for all shell commands. Through this one can get know details of all commands and its arguments.

man rm #gives manual for rm command
man cat #gives manual for cat command

Basic Linux shell commands

6 February 2024 at 09:53

ls

Lists the files from present working directory

ls command can accept many arguments. Let us see one by one. These are all not the only commands. I am listing the commands that we have seen during the session.

ls -a  #lists all files including hidden files
ls -l  # lists in long list format(including who created, size..)
ls -lh # lists in long list with human readeable format
ls -lSh # lists files based on Size in human readable format
ls -R # recursive list(includes all files inside all directories)

whoami

gives username of the current session

hostname

gives hostname where the current session is

hostname #gives hostname
sudo hostname "new host name" # changes hostname to new host name

date

gives current date and time

date #gives current date and time
date --date="3 years ago" #gives same date three years ago
date --date="yesterday" #gives yesterday's date

cat

concatenate files and print output in the console

cat sample.txt #display the content from sample.txt
cat test1.txt test2.txt test3.txt # display all file contents

history

keeps history of all the commands entered so far

history | head #gives first 10 commands being used
history | tail #gives last 10 commands being used
#Usually it stores 1k commands in memory

rm

removes file or directories permanently

rm -d "filename" # removes empty directories
rm "filename" #removes the file
rm -i "filename" #prompts user once before delete
rm -r "folder" #deletes recursively all files inside the folder
rm *.xml #deletes all file with the given extension in the pwd.

man

it is a manual for all shell commands. Through this one can get know details of all commands and its arguments.

man rm #gives manual for rm command
man cat #gives manual for cat command

Linux installation & commonly used commands

3 February 2024 at 10:26

Below notes are taken by me during the session given by Dhanasekhar T(DevOps and Linux Admin) on 3rd Feb 2024.

Dhanasekhar explained about:

  • How to install Ubuntu and Linux mint on virtual machines from people windows machine. Seen a demo with Kishore and Giridhar on their windows machine connecting Linux VMs.
  • MobaXterm GUI(ssh kind of client). Pretty useful for windows users to connect their linux VM boxex.
  • Common/basic commands to check user login/sessions
  • Classic vs Block editor to create a post in WordPress

Some common commands used during the session are below

sudo password root

This command prompts to set the password for root user. In General, root user does not have password.

su - 

This command is used to switch to root user

whoami

This command tell under which user currently the session is.

If you see $ prompt – that means you logged as any particular user
If you see # prompt – that tell you logged as root user

logout

This command enables to signout from the existing user login

clear

This command clear the console in the terminal. Ctrl + L is a shortcut for the same command

free -h

This command gives how much free memory is available in RAM. See example below:

jabez@jabez-ThinkPad-E480:~$ free -h
total used free shared buff/cache available
Mem: 15Gi 3.4Gi 8.9Gi 656Mi 3.1Gi 11Gi
Swap: 2.0Gi 0B 2.0Gi

hostname -I

Gives hostname of the VM that you logged in. We can use that hostname on another machine to take a session through SSH.

Intro to GNU/Linux

3 February 2024 at 09:17

This is my first and post#0 on this free blog site. Kaniyam.com and its members have scheduled a series of sessions to learn Linux for everyone and the introduction session starts from 1st February 2024.

On this free WordPress blog site, I have decided to write a blog a day that should have what I learnt for any day.

Wish me good luck!

Why open source

3 February 2024 at 09:17

Usually, software that provides binary codes to user to use the application tends to control the functionalities in it and provide implementations only they tend to provide. But open source software provides access to the actual source code and allows user to view and modify functionalities according to individuals expectations. It leads to more collaboration, reviews among many users and opens multiple ways to improve/add functionality.

During the session – Srini provided a beautiful example of having a sealed car(engine, core functionalities are completely closed and nobody can repair other than who made that car if any issue arises). On the other hand – there is an another car called open car(functionalities open to the user and any mechanic can fix if any issue arises). Another apt example he provided was IDLI. Examples provided were very helpful to correlate and understand the importance of having a freedom to use the software and its advantages.

In a nutshell – propriety software:

restricts user(to be used only in 1 PC, to be used only in colleges etc.,)
not allows user to copy
owns the software and provides only in binary form

Free/Open source software:

No restriction to use it for any purpose
provides complete source source
allows to copy and distribute

GNU:

Richard Stallman took steps to create a separate operation system from Unix family called GNU Linux. He offers freedom to use the OS freely, enables permission to study, distribute.

Linux kernal + GNU Apps = GNU/Linux

(These are some rough notes I took on the first session taken by Shrinivasan about open source)

Linux installation & commonly used commands

3 February 2024 at 10:26

Below notes are taken by me during the session given by Dhanasekhar T(DevOps and Linux Admin) on 3rd Feb 2024.

Dhanasekhar explained about:

  • How to install Ubuntu and Linux mint on virtual machines from people windows machine. Seen a demo with Kishore and Giridhar on their windows machine connecting Linux VMs.
  • MobaXterm GUI(ssh kind of client). Pretty useful for windows users to connect their linux VM boxex.
  • Common/basic commands to check user login/sessions
  • Classic vs Block editor to create a post in WordPress

Some common commands used during the session are below

sudo password root

This command prompts to set the password for root user. In General, root user does not have password.

su - 

This command is used to switch to root user

whoami

This command tell under which user currently the session is.

If you see $ prompt – that means you logged as any particular user
If you see # prompt – that tell you logged as root user

logout

This command enables to signout from the existing user login

clear

This command clear the console in the terminal. Ctrl + L is a shortcut for the same command

free -h

This command gives how much free memory is available in RAM. See example below:

jabez@jabez-ThinkPad-E480:~$ free -h
total used free shared buff/cache available
Mem: 15Gi 3.4Gi 8.9Gi 656Mi 3.1Gi 11Gi
Swap: 2.0Gi 0B 2.0Gi

hostname -I

Gives hostname of the VM that you logged in. We can use that hostname on another machine to take a session through SSH.

Intro to GNU/Linux

3 February 2024 at 09:17

This is my first and post#0 on this free blog site. Kaniyam.com and its members have scheduled a series of sessions to learn Linux for everyone and the introduction session starts from 1st February 2024.

On this free WordPress blog site, I have decided to write a blog a day that should have what I learnt for any day.

Wish me good luck!

Why open source

3 February 2024 at 09:17

Usually, software that provides binary codes to user to use the application tends to control the functionalities in it and provide implementations only they tend to provide. But open source software provides access to the actual source code and allows user to view and modify functionalities according to individuals expectations. It leads to more collaboration, reviews among many users and opens multiple ways to improve/add functionality.

During the session – Srini provided a beautiful example of having a sealed car(engine, core functionalities are completely closed and nobody can repair other than who made that car if any issue arises). On the other hand – there is an another car called open car(functionalities open to the user and any mechanic can fix if any issue arises). Another apt example he provided was IDLI. Examples provided were very helpful to correlate and understand the importance of having a freedom to use the software and its advantages.

In a nutshell – propriety software:

restricts user(to be used only in 1 PC, to be used only in colleges etc.,)
not allows user to copy
owns the software and provides only in binary form

Free/Open source software:

No restriction to use it for any purpose
provides complete source source
allows to copy and distribute

GNU:

Richard Stallman took steps to create a separate operation system from Unix family called GNU Linux. He offers freedom to use the OS freely, enables permission to study, distribute.

Linux kernal + GNU Apps = GNU/Linux

(These are some rough notes I took on the first session taken by Shrinivasan about open source)

Intro to GNU/Linux

31 January 2024 at 17:11

This is my first and Post#0 on this free blog site. Kaniyam.com and its members have scheduled a series of sessions to learn Linux for everyone and the introduction session starts from 1st February 2024.

On this free WordPress blog site, I have decided to write a blog a day that should have what I learnt for any day.

Wish me good luck!

Why open source?

31 January 2024 at 16:52

Usually, software that provides binary codes to user to use the application tends to control the functionalities in it and provide implementations only they tend to provide. But open source software provides access to the actual source code and allows user to view and modify functionalities according to individuals expectations. It leads to more collaboration, reviews among many users and opens multiple ways to improve/add functionality.

During the session – Srini provided a beautiful example of having a sealed car(engine, core functionalities are completely closed and nobody can repair other than who made that car if any issue arises). On the other hand – there is an another car called open car(functionalities open to the user and any mechanic can fix if any issue arises). Another apt example he provided was IDLI. Examples provided were very helpful to correlate and understand the importance of having a freedom to use the software and its advantages.

In a nutshell – propriety software:

  • restricts user(to be used only in 1 PC, to be used only in colleges etc.,)
  • not allows user to copy
  • owns the software and provides only in binary form

Free/Open source software:

  • No restriction to use it for any purpose
  • provides complete source source
  • allows to copy and distribute

GNU:

Richard Stallman took steps to create a separate operation system from Unix family called GNU Linux. He offers freedom to use the OS freely, enables permission to study, distribute.

Linux kernal + GNU Apps = GNU/Linux

❌
❌