Reading view

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

SSH – A View

SSH, also known as Secure Shell or Secure Socket Shell, is a network protocol that gives users, particularly system administrators, a secure way to access a computer over an unsecured network.

By default SSH is installed in linux.We can check the version by using this below command.

ssh -V

Otherwise we can install it by..,

sudo apt install openssh-server openssh-client
sudo systemctl status ssh

Also we can check the status of SSH.The default Port Number assigned by ssh is 22.We can change it in the configuration file also we can allow or deny users or groups and Alive Interval in the configuration file.
NOTE :
Restart the ssh after configured.

nano /etc/ssh/sshd_config
AllowUsers user_name
AllowGroups group_name

To allow permissions to specific users and groups to access ssh.

DenyUsers user_name
DenyGroups group_name

To deny the permission to specific users and groups.

LoginGraceTime specify_time

(i.e) 1m ==> 1 minute.
If a user can’t make a successful login with the specific time,it will not allow the user to enter into the remote machine.

ClientAliveInterval 600
ClientAliveCountMax 0 ==> Default it is zero.

(i.e) 600 ==> 600 seconds = 10 minutes.
The tunnel will break after the mentioned time (600 seconds) if there is no actions were performed by the user in the server.

NOTE: Restart the service once changes are made in configuration file.

ssh user_name@remote_ip
ssh user_name@remote_hostname -p port_number

To connect to the ssh server we must need three credentials of the remote machine.

  • Username.
  • Password.
  • Ip Address or Hostname.
scp file_to_transfer user_name@hostname:/path_to_copy_the_file_in_remote_server

scp -P specific_port_number file_to_transfer user_name@hostname:/path_to_copy_the_file_in_remote_server ===> For using Port Number other than 22.

Example : scp hello.go student@ip_address:/home/student/Checking_scp_command/
scp -P 2027 hello.go student@ip_address:/home/student/Checking_scp_command/

SCP ==> Secure Copy.
To copy a file securely to the remote server’s directory named “Checking_scp_command”.

scp user_name@hostname:/path_of_the_file/file /path_to_copy_in_local_system

scp -P specific_port_number user_name@hostname:/path_of_the_file/file /path_to_copy_in_local_system ===> For using Port Number other than 22.

Example : scp student@ip_address:/home/student/Checking_scp_command/Remote_to_Local.txt /home/g/Downloads/
scp -P 2027 student@ip_address:/home/student/Checking_scp_command/Remote_to_Local.txt /home/g/Downloads/

In this command,we are going to get the file from remote server to our local system.

NOTE:

There is a command called “ssh-keygen” which generates a unique key for accessing the remote server via local system.
This never ask passwords to enter into the system,But be careful of handling this key.If you are not familiar with this method,just practice with the password type few times.
Keygen will be discussed later in our next post.Stay tuned…

That’s it..!

SSH – A View

SSH, also known as Secure Shell or Secure Socket Shell, is a network protocol that gives users, particularly system administrators, a secure way to access a computer over an unsecured network.

By default SSH is installed in linux.We can check the version by using this below command.

ssh -V

Otherwise we can install it by..,

sudo apt install openssh-server openssh-client
sudo systemctl status ssh

Also we can check the status of SSH.The default Port Number assigned by ssh is 22.We can change it in the configuration file also we can allow or deny users or groups and Alive Interval in the configuration file.
NOTE :
Restart the ssh after configured.

nano /etc/ssh/sshd_config
AllowUsers user_name
AllowGroups group_name

To allow permissions to specific users and groups to access ssh.

DenyUsers user_name
DenyGroups group_name

To deny the permission to specific users and groups.

LoginGraceTime specify_time

(i.e) 1m ==> 1 minute.
If a user can’t make a successful login with the specific time,it will not allow the user to enter into the remote machine.

ClientAliveInterval 600
ClientAliveCountMax 0 ==> Default it is zero.

(i.e) 600 ==> 600 seconds = 10 minutes.
The tunnel will break after the mentioned time (600 seconds) if there is no actions were performed by the user in the server.

NOTE: Restart the service once changes are made in configuration file.

ssh user_name@remote_ip
ssh user_name@remote_hostname -p port_number

To connect to the ssh server we must need three credentials of the remote machine.

  • Username.
  • Password.
  • Ip Address or Hostname.
scp file_to_transfer user_name@hostname:/path_to_copy_the_file_in_remote_server

scp -P specific_port_number file_to_transfer user_name@hostname:/path_to_copy_the_file_in_remote_server ===> For using Port Number other than 22.

Example : scp hello.go student@ip_address:/home/student/Checking_scp_command/
scp -P 2027 hello.go student@ip_address:/home/student/Checking_scp_command/

SCP ==> Secure Copy.
To copy a file securely to the remote server’s directory named “Checking_scp_command”.

scp user_name@hostname:/path_of_the_file/file /path_to_copy_in_local_system

scp -P specific_port_number user_name@hostname:/path_of_the_file/file /path_to_copy_in_local_system ===> For using Port Number other than 22.

Example : scp student@ip_address:/home/student/Checking_scp_command/Remote_to_Local.txt /home/g/Downloads/
scp -P 2027 student@ip_address:/home/student/Checking_scp_command/Remote_to_Local.txt /home/g/Downloads/

In this command,we are going to get the file from remote server to our local system.

NOTE:

There is a command called “ssh-keygen” which generates a unique key for accessing the remote server via local system.
This never ask passwords to enter into the system,But be careful of handling this key.If you are not familiar with this method,just practice with the password type few times.
Keygen will be discussed later in our next post.Stay tuned…

That’s it..!

WordPress – Installation

Let us know how to install wordpress in debian linux with the command line.
First,we need to create a database for a new user mainly for wordpress in mariadb.
Start the Apache server and mariadb service.Switch into mariadb then create a new user,which is already we discussed in mariadb installation.

I created a unique Database named “database_wordpress” specially for wordpress,also i created a new user.

wget https://wordpress.org/latest.zip
unzip latest.zip
sudo mv wordpress/ /var/www/html/
sudo chown www-data:www-data -R /var/www/html/wordpress/
sudo chmod -R 755 /var/www/html/wordpress/
sudo nano /etc/apache2/sites-available/wordpress.conf
<VirtualHost *:80>
ServerAdmin admin@example.com
DocumentRoot /var/www/html/wordpress
ServerName <server_ip>
<Directory /var/www/html/wordpress/>
Options FollowSymLinks
AllowOverride All
Require all granted
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

These content must be written in the wordpress.conf file.
NOTE: Replace “localhost” in the pace of <server_ip> (4th line).

sudo systemctl reload apache2
sudo a2ensite wordpress.conf
sudo a2enmod rewrite
sudo systemctl restart apache2
rm latest.zip

You have successfully installed wordpress,by checking it open a browser and pass the url as “localhost” it will displays the wordpress page containing language selection dropdown.

That’s it…
Start publishing your thoughts to the world..!

WordPress – Installation

Let us know how to install wordpress in debian linux with the command line.
First,we need to create a database for a new user mainly for wordpress in mariadb.
Start the Apache server and mariadb service.Switch into mariadb then create a new user,which is already we discussed in mariadb installation.

I created a unique Database named “database_wordpress” specially for wordpress,also i created a new user.

wget https://wordpress.org/latest.zip
unzip latest.zip
sudo mv wordpress/ /var/www/html/
sudo chown www-data:www-data -R /var/www/html/wordpress/
sudo chmod -R 755 /var/www/html/wordpress/
sudo nano /etc/apache2/sites-available/wordpress.conf
<VirtualHost *:80>
ServerAdmin admin@example.com
DocumentRoot /var/www/html/wordpress
ServerName <server_ip>
<Directory /var/www/html/wordpress/>
Options FollowSymLinks
AllowOverride All
Require all granted
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

These content must be written in the wordpress.conf file.
NOTE: Replace “localhost” in the pace of <server_ip> (4th line).

sudo systemctl reload apache2
sudo a2ensite wordpress.conf
sudo a2enmod rewrite
sudo systemctl restart apache2
rm latest.zip

You have successfully installed wordpress,by checking it open a browser and pass the url as “localhost” it will displays the wordpress page containing language selection dropdown.

That’s it…
Start publishing your thoughts to the world..!

SQL Day -1

Definition for SQL

Structured query language (SQL) is a programming language for storing and processing information in a relational database. A relational database stores information in tabular form, with rows and columns representing different data attributes and the various relationships between the data values. You can use SQL statements to store, update, remove, search, and retrieve information from the database. You can also use SQL to maintain and optimize database performance.


In this article,we are going to discuss how to create a table in a database,insert the values in the table.First start the mariadb server,follow the steps in the article if mariadb is not installed in your system.Refer the Installation guide for mariadb is below link.

https://opendiaryofgowthamg.wordpress.com/2024/02/14/installation-mariadb/

After opening the terminal,we need to know the databases presented in mariadb.So that,use..,

SHOW DATABASES;

It will show the available databases.Next we need to create a database and switch into that new database.Using Capital letters for keywords is a good practice in SQL.

CREATE DATABASE database_name;
USE database_name;

Now,we created a database and switched into it.We need to create a table for this database.

CREATE TABLE table_name (Sno int(3),Name varchar (30),Mobile No int (13));

We created a new table with three columns.
Sno has Integer datatype and it can stores upto 3 integer values (i.e up-to 999).
Name has varchar datatype and it stores up-to 30 Characters.
Mobile No has Integer datatype and stores up-to 13 integer value

DESC table_name;

This command allow us to view the description of that table.Practice is the database name which i was created and testing is the name i given to this table.We will discuss about NULL,Key,Default,Extra are in the later sessions.

This is how we create a simple basic table.Let’s see hoe to insert values to this table.

INSERT INTO table_name values (1,"person_1",1231231231);
INSERT INTO table_name values (2,"person_2",97979797),(3,"person_3",34343434),(4,'person_4',456789123);

First line shows,inserting only a single row data to the table.Whereas,second one shows multi data insertion to the table.We can use either Double Quote (” “) or Single Quote (‘ ‘) to the Character datatype.

Let’s see how to view this table entirely or only a specific column.

SELECT * FROM table_name;
SELECT column_name FROM table_name;

The first image shows the full table contents.
Second image shows only a particular column named “books”.

EXIT;

Exit from mariadb.

We will discuss how to edit,update the table in next article.

That’s it..!

கடந்திட கற்றுக்கொள்…

காதல் பிறந்தது போலும்
முதன்முதலாய் வெட்கப்பட்டது
எந்தன் கண்ணாடி..!
அவள் பெயரின் அழகை
நாள் முழுதும் உச்சரித்தேன்..!
உணவும் உயிராய்
தெரிந்த நிமிடம்
உட்கொள்ள மறுத்தேன்..!
அரட்டை பேச்சும்
அளவாய் மாறின
ம்ம்ம்- என்று
அவள் வாசிக்கும்
மெட்டிற்க்கு பாட்டமைக்க
நானே கவிஞனானேன்..!
ஊதாப் பூவாய்
எதிரே வந்தாள்
ஒரு நாள்..!
தூக்கமும் துக்கமும்
என்னை விட்டுப் பிரிந்து
நாட்களாகின என
அறிந்தேன் அவள்
மாலை சூடுகையில்..!
காதல் சொல்லத் தவறியது
எந்தன் பிழையா இல்லை
பழைய நிலையா..!?
- அவளும் இப்படித்தான்
காதல் கொண்டாள்
போலும்...


- கெளதம்.கோ

SQL Day -1

Definition for SQL

Structured query language (SQL) is a programming language for storing and processing information in a relational database. A relational database stores information in tabular form, with rows and columns representing different data attributes and the various relationships between the data values. You can use SQL statements to store, update, remove, search, and retrieve information from the database. You can also use SQL to maintain and optimize database performance.


In this article,we are going to discuss how to create a table in a database,insert the values in the table.First start the mariadb server,follow the steps in the article if mariadb is not installed in your system.Refer the Installation guide for mariadb is below link.

https://opendiaryofgowthamg.wordpress.com/2024/02/14/installation-mariadb/

After opening the terminal,we need to know the databases presented in mariadb.So that,use..,

SHOW DATABASES;

It will show the available databases.Next we need to create a database and switch into that new database.Using Capital letters for keywords is a good practice in SQL.

CREATE DATABASE database_name;
USE database_name;

Now,we created a database and switched into it.We need to create a table for this database.

CREATE TABLE table_name (Sno int(3),Name varchar (30),Mobile No int (13));

We created a new table with three columns.
Sno has Integer datatype and it can stores upto 3 integer values (i.e up-to 999).
Name has varchar datatype and it stores up-to 30 Characters.
Mobile No has Integer datatype and stores up-to 13 integer value

DESC table_name;

This command allow us to view the description of that table.Practice is the database name which i was created and testing is the name i given to this table.We will discuss about NULL,Key,Default,Extra are in the later sessions.

This is how we create a simple basic table.Let’s see hoe to insert values to this table.

INSERT INTO table_name values (1,"person_1",1231231231);
INSERT INTO table_name values (2,"person_2",97979797),(3,"person_3",34343434),(4,'person_4',456789123);

First line shows,inserting only a single row data to the table.Whereas,second one shows multi data insertion to the table.We can use either Double Quote (” “) or Single Quote (‘ ‘) to the Character datatype.

Let’s see how to view this table entirely or only a specific column.

SELECT * FROM table_name;
SELECT column_name FROM table_name;

The first image shows the full table contents.
Second image shows only a particular column named “books”.

EXIT;

Exit from mariadb.

We will discuss how to edit,update the table in next article.

That’s it..!

கடந்திட கற்றுக்கொள்…

காதல் பிறந்தது போலும்
முதன்முதலாய் வெட்கப்பட்டது
எந்தன் கண்ணாடி..!
அவள் பெயரின் அழகை
நாள் முழுதும் உச்சரித்தேன்..!
உணவும் உயிராய்
தெரிந்த நிமிடம்
உட்கொள்ள மறுத்தேன்..!
அரட்டை பேச்சும்
அளவாய் மாறின
ம்ம்ம்- என்று
அவள் வாசிக்கும்
மெட்டிற்க்கு பாட்டமைக்க
நானே கவிஞனானேன்..!
ஊதாப் பூவாய்
எதிரே வந்தாள்
ஒரு நாள்..!
தூக்கமும் துக்கமும்
என்னை விட்டுப் பிரிந்து
நாட்களாகின என
அறிந்தேன் அவள்
மாலை சூடுகையில்..!
காதல் சொல்லத் தவறியது
எந்தன் பிழையா இல்லை
பழைய நிலையா..!?
- அவளும் இப்படித்தான்
காதல் கொண்டாள்
போலும்...


- கெளதம்.கோ

BASIC LINUX COMMANDS – GENERAL COMMANDS P-2

Let’s see some general commands once again.

pidof process_name

This command will display the PID (i.e Process ID) of a particular process.
For Eg :- “pidof firefox”.

pwdx PID_No

This command will display the path of the process.
For Eg :- “pwdx 2074” ==> PID for firefox works on /home/user.

nice -n 11 specific_command

Nice is used to modify program’s priority.Values ranges from [ -20 to +19 ].
-20 has highest priority.Where +19 has lowest priority.
-n ==> denotes number.
11 ==> is the value from the range.
NOTE : [ From -20 to 0 ] were root user permitted.
Value 10 is default.Sudo command must use for set the priority to -20 to 0.

renice -n 7 -p PID_No

Renice is nothing but,to change the priority order.Here PID should mention.
This will change the priority from 11 to 7.

BASIC USER MANAGEMENT COMMANDS

Now,we can see some User management commands.

sudo useradd username

This command will add a new user.By default this is password free.We need to set the password later.It will automatically generates User ID.

sudo useradd -u 0127 username

In this command,we made a custom ID (0127) to the username.
Conform this by using the below command.

tail /etc/passwd

A user is created named “sampleuser” with a ID ‘1002’.

sudo passwd -Sa

Using this command,we can check the password is allocated or not to a user.

P ==> denotes it is Password protected.
L ==> denotes for Locked.
NP ==> denotes No Password.

sudo passwd username

Here,we can set a password to that user.

There is another method for creating a user with interactive.We can see the method below..,

sudo adduser username

In this method,we can set password,Name,and some user details.

sudo userdel username

For deleting the user,we can use this command.
NOTE :
This will delete the user,but the folder created for that user won’t be deleted.The folder will only create when the user create on interactive method.We need to remove that folder manually.

sudo userdel -r username

This will delete the user with the user’s folder.
We can check the by changing our directory to home.

cd /home
ls

Here, we can see the user folders is created or not.Like the below image.

Now,we can create groups.

sudo groupadd group_name
sudo groupadd -g custom_group_ID group_name

This will create a new group.
Also we can use a custom group_ID.

sudo useradd -G group_name username
sudo usermod -a -G group_name username

Using any one of these commands we can add the respective user to the group.

sudo groupdel group_name

This will delete the group.

That’s it..!

BASIC LINUX COMMANDS – GENERAL COMMANDS P-2

Let’s see some general commands once again.

pidof process_name

This command will display the PID (i.e Process ID) of a particular process.
For Eg :- “pidof firefox”.

pwdx PID_No

This command will display the path of the process.
For Eg :- “pwdx 2074” ==> PID for firefox works on /home/user.

nice -n 11 specific_command

Nice is used to modify program’s priority.Values ranges from [ -20 to +19 ].
-20 has highest priority.Where +19 has lowest priority.
-n ==> denotes number.
11 ==> is the value from the range.
NOTE : [ From -20 to 0 ] were root user permitted.
Value 10 is default.Sudo command must use for set the priority to -20 to 0.

renice -n 7 -p PID_No

Renice is nothing but,to change the priority order.Here PID should mention.
This will change the priority from 11 to 7.

BASIC USER MANAGEMENT COMMANDS

Now,we can see some User management commands.

sudo useradd username

This command will add a new user.By default this is password free.We need to set the password later.It will automatically generates User ID.

sudo useradd -u 0127 username

In this command,we made a custom ID (0127) to the username.
Conform this by using the below command.

tail /etc/passwd

A user is created named “sampleuser” with a ID ‘1002’.

sudo passwd -Sa

Using this command,we can check the password is allocated or not to a user.

P ==> denotes it is Password protected.
L ==> denotes for Locked.
NP ==> denotes No Password.

sudo passwd username

Here,we can set a password to that user.

There is another method for creating a user with interactive.We can see the method below..,

sudo adduser username

In this method,we can set password,Name,and some user details.

sudo userdel username

For deleting the user,we can use this command.
NOTE :
This will delete the user,but the folder created for that user won’t be deleted.The folder will only create when the user create on interactive method.We need to remove that folder manually.

sudo userdel -r username

This will delete the user with the user’s folder.
We can check the by changing our directory to home.

cd /home
ls

Here, we can see the user folders is created or not.Like the below image.

Now,we can create groups.

sudo groupadd group_name
sudo groupadd -g custom_group_ID group_name

This will create a new group.
Also we can use a custom group_ID.

sudo useradd -G group_name username
sudo usermod -a -G group_name username

Using any one of these commands we can add the respective user to the group.

sudo groupdel group_name

This will delete the group.

That’s it..!

Basic Linux Commands -GENERAL COMMANDS

We can see some general commands which should be useful for a new linux user.

jobs

“jobs” it displays the works which are executed by the current terminal.

jobs -l
jobs -p

jobs -l ==> [1]+ 3668  Stopped  man ls
Here,a work has been initiated (i.e man ls).This job was listed.
[1] ==> Job ID.
3668 ==> PID stands for Process ID.
Stopped ==> This work is currently stopped.
NOTE :
PID should be any digit,not only six digit.It could a single digit also.

fg %job_ID
bg %job_ID

Above commands represents foreground and background process.
fg %job_ID (i.e job_ID = 1).It execute the work in foreground.
bg %job_ID.It execute the work in background.

runlevel 
sudo runlevel

Runlevels are predefined operating states or configurations that determine which processes and services are running.It range from 0 – 6.
0 ==> Halt or Shutdown the system.
1 ==> Single-user mode [ used for system maintenance or troubleshooting].
2 ==> Basic multi-user mode without networking.
3 ==> Full multi-user mode with networking.
4 ==> Not commonly used but can be customized for specific purposes.
5 ==> Full multi-user mode with networking and a graphical user interface.
6 ==> Reboot the system.

init 0 - 6

User can use any one of those range mentioned above using init command.

ps

‘ps’ displays information about a selection of the active processes.

ps -x
ps -A
ps aux

ps -x ==> displays the information with PID and STAT.
ps -A ==> displays with PID only.
ps aux ==> displays every information.both user and root.

ps -ef
ps -ef | grep process_name

This shows the system process which is used widely.We can filter the process by using grep.

pstree

It displays the system process in a tree structure.

pstree -p username

-p ==> pass your username or root.
It displays the specific users tree structure.

kill -l

To kill a process we can use the command kill.
kill -l ==> It lists the KILL Commands.

kill -9 1527
kill -SIGKILL 1527

Let’s assume,a program (Gimp) got stuck while processing.We need to shutdown the program,but it can’t works on GUI.So we need to forcefully kill the process.For that,
we need to mention a kill command [ 9 ] to kill the process having a Process ID [ 1527 ] of Gimp.User can also use “-SIGKILL” instead of ‘-9’.

NOTE :
If we didn’t mention kill number,it will take ’15’ by default which is a soft kill process.
We must enter the PID of that process not name.

killall gimp

Killall will kill the entire gimp program.
Here,we can use the name of the program.No need to use the PID.

top
top -u username

The top program provides a dynamic real-time view of a running system. It can display system summary
information as well as a list of processes or threads currently being managed by the Linux kernel. The
types of system summary information shown and the types, order and size of information displayed for
processes are all user configurable and that configuration can be made persistent across restarts.

top -u username ==> We can filter it with a specific user.

That’s it…!

Installation – MARIADB

Let’s know the installation of mariadb in debian.

sudo apt update
sudo apt install mariadb-server mariadb-client

First of all,we need to update the package manager and then type the install command.

Here we are going to install two packages i.e.., for server side and client side.You can skip the “mariadb-client” if you don’t need.

sudo systemctl status mariadb.service

Using this command,we can check the status of mariadb.Refer the image.

Now,we successfully done with the installation.After this we need to set a password to the root user.Because,by default the root user doesn’t have any password.So,we need to use this command..,

sudo mysql_secure_installation

Simply,press enter and then press ‘N’ next press ‘Y’ for further steps.

Also,you can create a new user.Let’s see how to create a new user.

CREATE USER 'your_username'@'localhost' IDENTIFIED BY 'your_password';

GRANT ALL PRIVILEGES ON *.* TO 'your_username'@'localhost' WITH GRANT OPTION;

FLUSH PRIVILEGES;

User has been created.

Let’s enter into mariadb.

mariadb -u your_username -p

NOTE: Don’t pass “@localhost” here.Simply pass username only.

Now,enter the created password.

If the output displayed like this,you were done…

SHOW DATABASES;

Here,we can see the databases.

We can discuss it later on MySQL topics.

EXIT;

Exit from mariadb.

sudo nano /etc/mysql/mariadb.conf.d/50-server.cnf

Getting this configuration file,we can change some configuration.

NOTE :

After configure,we must restart the mariadb.

sudo systemctl start mariadb.service
sudo systemctl stop mariadb.service
sudo systemctl enable mariadb.service
sudo systemctl disable mariadb.service
sudo systemctl restart mariadb.service

We can use these commands as per our convenience like we discussed in Apache installation.

That’s it..!

Basic Linux Commands -GENERAL COMMANDS

We can see some general commands which should be useful for a new linux user.

jobs

“jobs” it displays the works which are executed by the current terminal.

jobs -l
jobs -p

jobs -l ==> [1]+ 3668  Stopped  man ls
Here,a work has been initiated (i.e man ls).This job was listed.
[1] ==> Job ID.
3668 ==> PID stands for Process ID.
Stopped ==> This work is currently stopped.
NOTE :
PID should be any digit,not only six digit.It could a single digit also.

fg %job_ID
bg %job_ID

Above commands represents foreground and background process.
fg %job_ID (i.e job_ID = 1).It execute the work in foreground.
bg %job_ID.It execute the work in background.

runlevel 
sudo runlevel

Runlevels are predefined operating states or configurations that determine which processes and services are running.It range from 0 – 6.
0 ==> Halt or Shutdown the system.
1 ==> Single-user mode [ used for system maintenance or troubleshooting].
2 ==> Basic multi-user mode without networking.
3 ==> Full multi-user mode with networking.
4 ==> Not commonly used but can be customized for specific purposes.
5 ==> Full multi-user mode with networking and a graphical user interface.
6 ==> Reboot the system.

init 0 - 6

User can use any one of those range mentioned above using init command.

ps

‘ps’ displays information about a selection of the active processes.

ps -x
ps -A
ps aux

ps -x ==> displays the information with PID and STAT.
ps -A ==> displays with PID only.
ps aux ==> displays every information.both user and root.

ps -ef
ps -ef | grep process_name

This shows the system process which is used widely.We can filter the process by using grep.

pstree

It displays the system process in a tree structure.

pstree -p username

-p ==> pass your username or root.
It displays the specific users tree structure.

kill -l

To kill a process we can use the command kill.
kill -l ==> It lists the KILL Commands.

kill -9 1527
kill -SIGKILL 1527

Let’s assume,a program (Gimp) got stuck while processing.We need to shutdown the program,but it can’t works on GUI.So we need to forcefully kill the process.For that,
we need to mention a kill command [ 9 ] to kill the process having a Process ID [ 1527 ] of Gimp.User can also use “-SIGKILL” instead of ‘-9’.

NOTE :
If we didn’t mention kill number,it will take ’15’ by default which is a soft kill process.
We must enter the PID of that process not name.

killall gimp

Killall will kill the entire gimp program.
Here,we can use the name of the program.No need to use the PID.

top
top -u username

The top program provides a dynamic real-time view of a running system. It can display system summary
information as well as a list of processes or threads currently being managed by the Linux kernel. The
types of system summary information shown and the types, order and size of information displayed for
processes are all user configurable and that configuration can be made persistent across restarts.

top -u username ==> We can filter it with a specific user.

That’s it…!

Installation – MARIADB

Let’s know the installation of mariadb in debian.

sudo apt update
sudo apt install mariadb-server mariadb-client

First of all,we need to update the package manager and then type the install command.

Here we are going to install two packages i.e.., for server side and client side.You can skip the “mariadb-client” if you don’t need.

sudo systemctl status mariadb.service

Using this command,we can check the status of mariadb.Refer the image.

Now,we successfully done with the installation.After this we need to set a password to the root user.Because,by default the root user doesn’t have any password.So,we need to use this command..,

sudo mysql_secure_installation

Simply,press enter and then press ‘N’ next press ‘Y’ for further steps.

Also,you can create a new user.Let’s see how to create a new user.

CREATE USER 'your_username'@'localhost' IDENTIFIED BY 'your_password';

GRANT ALL PRIVILEGES ON *.* TO 'your_username'@'localhost' WITH GRANT OPTION;

FLUSH PRIVILEGES;

User has been created.

Let’s enter into mariadb.

mariadb -u your_username -p

NOTE: Don’t pass “@localhost” here.Simply pass username only.

Now,enter the created password.

If the output displayed like this,you were done…

SHOW DATABASES;

Here,we can see the databases.

We can discuss it later on MySQL topics.

EXIT;

Exit from mariadb.

sudo nano /etc/mysql/mariadb.conf.d/50-server.cnf

Getting this configuration file,we can change some configuration.

NOTE :

After configure,we must restart the mariadb.

sudo systemctl start mariadb.service
sudo systemctl stop mariadb.service
sudo systemctl enable mariadb.service
sudo systemctl disable mariadb.service
sudo systemctl restart mariadb.service

We can use these commands as per our convenience like we discussed in Apache installation.

That’s it..!

Basic linux commands – Join

Here, we discuss about a command called “Join”.

join file_name1.txt file_name2.txt

Let’s assume file_name1.txt has the content like..,

1 Hi Everybody..,

2 We are going to launch a truck

And file_name2.txt has the content as.,

1 Have a pleasant morning!.

2 in India.

Now,using the above command the output we get.

1 Hi Everybody.., Have a pleasant morning!.

2 We are going to launch a truck in India.

It joins two file into a single file,by using join command.

NOTE :

There must be a common field should present.

i.e In both files, [ 1 and 2 ] were present and it has two lines.Those serial numbers are present in column one.

join -1 2 -2 1 file_name1.txt file_name2.txt

Let’s discuss what we done in this command.

In file_name1.txt

1 Hi Everybody..,

2 Today we are going to launch truck

And in file_name2.txt

Have a pleasant morning!. 1

in India. 2

The column [ 1 AND 2 ] were shuffled in the respective file.So,we must mention the common field as..,

“ -1 1 -2 1 file_name1.txt file_name2.txt”

NOTE :

-1 ==> refers file_name1.txt

1 ==> refers the column number 1

-2 ==> refers file_name2.txt

2 ==> refers the column number 2

Basic linux commands – Join

Here, we discuss about a command called “Join”.

join file_name1.txt file_name2.txt

Let’s assume file_name1.txt has the content like..,

1 Hi Everybody..,

2 We are going to launch a truck

And file_name2.txt has the content as.,

1 Have a pleasant morning!.

2 in India.

Now,using the above command the output we get.

1 Hi Everybody.., Have a pleasant morning!.

2 We are going to launch a truck in India.

It joins two file into a single file,by using join command.

NOTE :

There must be a common field should present.

i.e In both files, [ 1 and 2 ] were present and it has two lines.Those serial numbers are present in column one.

join -1 2 -2 1 file_name1.txt file_name2.txt

Let’s discuss what we done in this command.

In file_name1.txt

1 Hi Everybody..,

2 Today we are going to launch truck

And in file_name2.txt

Have a pleasant morning!. 1

in India. 2

The column [ 1 AND 2 ] were shuffled in the respective file.So,we must mention the common field as..,

“ -1 1 -2 1 file_name1.txt file_name2.txt”

NOTE :

-1 ==> refers file_name1.txt

1 ==> refers the column number 1

-2 ==> refers file_name2.txt

2 ==> refers the column number 2

ரசவாதி/The Alchemist

ரசவாதி

இப்பெயரின் அர்த்தம் அறிந்திடாமல் தான் நான் இப்புத்தகத்தை வாசிக்க துடங்கினேன்.புதையல் சார்ந்த புத்தகம் என கேள்விபட்டுள்ளேன்.அப்படி தான் என் கை விரல் அதன் பக்கங்களில் பதிந்தது.

கதையின் நாயகனாக சான்டியாகோ வருகிறான்.இடையன் தொழிலை ஆர்வமுடன் பார்க்கும் மனிதன்.தனது ஆடுகளின் மேல் மிகுந்த அன்பு கொண்டவன்.உலகை சுற்ற வேண்டும் என தன் பெற்றோரிடம் தெரிவிக்க,அவர்களும் சம்மதிக்க இவன் இடையனாகிறான்.

அவன் ஓர் கனவு காண்கிறான்.அதில் புதையல் தனக்கு கிடைக்க போவதாக வந்தது.அதனை மீண்டும் காணவே,கனவை விவரிக்க கூடிய பழங்குடி பெண் ஒருவளை காண செல்கிறான்.அவளிடம் கனவை விவரிக்கிறான்.நேரம் அதிகமாக அவனிடமும் போதிய பணம் கைவசம் இல்லாததால்,விடை பெற்றுக்கொள்ள எத்தனித்தவுடன் அவள் எனக்கு பணம் வேண்டாம்…,மாற்றாக உன் புதையலின் பத்தில் ஒரு பங்கினை எனக்கு தர வேண்டும் என்கிறாள்.அவனோ கனவு நிஜத்தில் நடந்திட போவதில்லை என்றும் நமக்கு பணம் மிச்சம் என யோசித்து அங்கிருந்து செல்கிறான்.

ஒருமுறை ஓர் ஊரில் பெண் ஒருவளை கண்டு காதல் கொள்கிறான்.வருடம் கடந்தது.இம்முறை மீண்டும் அந்த ஊருக்கு செல்ல நினைத்து தனது ஆடுகளுடன் செல்கிறான்.

அங்கே ஓர் முதிவரை சந்திக்கிறான்.அவர் தன்னை அரசர் என அறிமுகம் செய்துகொள்கிறார்.அவரும் இவன் தன் கனவை பின் தொடரவேண்டும் என கூறுகிறார்.அப்பழங்குடி பெண் தான் இவரிடம் என் கனவை பற்றி கூறியிருக்க வேண்டும் என யோசித்தான்.பிறகு கனவை பின் தொடற விருப்பம் கொள்கிறான்.இவர் சில ஆலோசனை வழங்க,அதற்கு சில ஆடுகளை பெற்றுக்கொண்டார்.இவன் கையில் இரண்டு கற்களை தந்து “துவும்” இதன் பெயர் என்றார்.இதனை குழப்பம் வரும் சூழலில் பயன் படுத்த கேட்டுக்கொண்டார்.

தனது ஆடுகளை விற்றுவிட்டு பயணத்திற்கு புறப்பட்டான்.அக்கறையில் இருந்து,இக்கறை வந்தான்.மொழி தெரியவில்லை.இருந்தும் சமாளித்தான்.

திருடன் என தெரியாமல் அவனிடம் தனது பணத்தை பறிகொடுக்க,பின் விற்பனையில் மந்தமான ஒரு படிகக் கடையில் வேளை செய்யும் சூழல் வருகிறது.வருடம் ஓட…,பணம் சேர்த்துவிட்டான்அக்கடையையும் பிரபலமாக்கினான்…அவரிடமும் உங்கள் கனவை தொடருங்கள் என கூறி விடைபெற்றான் அவ்விடம் விட்டு.

என்ன இன்னும் ரசவாதி வரவில்லையே….நானும் காத்திருக்கிறேன்…

காத்திருப்போம்……..,

ரசவாதி/The Alchemist

ரசவாதி

இப்பெயரின் அர்த்தம் அறிந்திடாமல் தான் நான் இப்புத்தகத்தை வாசிக்க துடங்கினேன்.புதையல் சார்ந்த புத்தகம் என கேள்விபட்டுள்ளேன்.அப்படி தான் என் கை விரல் அதன் பக்கங்களில் பதிந்தது.

கதையின் நாயகனாக சான்டியாகோ வருகிறான்.இடையன் தொழிலை ஆர்வமுடன் பார்க்கும் மனிதன்.தனது ஆடுகளின் மேல் மிகுந்த அன்பு கொண்டவன்.உலகை சுற்ற வேண்டும் என தன் பெற்றோரிடம் தெரிவிக்க,அவர்களும் சம்மதிக்க இவன் இடையனாகிறான்.

அவன் ஓர் கனவு காண்கிறான்.அதில் புதையல் தனக்கு கிடைக்க போவதாக வந்தது.அதனை மீண்டும் காணவே,கனவை விவரிக்க கூடிய பழங்குடி பெண் ஒருவளை காண செல்கிறான்.அவளிடம் கனவை விவரிக்கிறான்.நேரம் அதிகமாக அவனிடமும் போதிய பணம் கைவசம் இல்லாததால்,விடை பெற்றுக்கொள்ள எத்தனித்தவுடன் அவள் எனக்கு பணம் வேண்டாம்…,மாற்றாக உன் புதையலின் பத்தில் ஒரு பங்கினை எனக்கு தர வேண்டும் என்கிறாள்.அவனோ கனவு நிஜத்தில் நடந்திட போவதில்லை என்றும் நமக்கு பணம் மிச்சம் என யோசித்து அங்கிருந்து செல்கிறான்.

ஒருமுறை ஓர் ஊரில் பெண் ஒருவளை கண்டு காதல் கொள்கிறான்.வருடம் கடந்தது.இம்முறை மீண்டும் அந்த ஊருக்கு செல்ல நினைத்து தனது ஆடுகளுடன் செல்கிறான்.

அங்கே ஓர் முதிவரை சந்திக்கிறான்.அவர் தன்னை அரசர் என அறிமுகம் செய்துகொள்கிறார்.அவரும் இவன் தன் கனவை பின் தொடரவேண்டும் என கூறுகிறார்.அப்பழங்குடி பெண் தான் இவரிடம் என் கனவை பற்றி கூறியிருக்க வேண்டும் என யோசித்தான்.பிறகு கனவை பின் தொடற விருப்பம் கொள்கிறான்.இவர் சில ஆலோசனை வழங்க,அதற்கு சில ஆடுகளை பெற்றுக்கொண்டார்.இவன் கையில் இரண்டு கற்களை தந்து “துவும்” இதன் பெயர் என்றார்.இதனை குழப்பம் வரும் சூழலில் பயன் படுத்த கேட்டுக்கொண்டார்.

தனது ஆடுகளை விற்றுவிட்டு பயணத்திற்கு புறப்பட்டான்.அக்கறையில் இருந்து,இக்கறை வந்தான்.மொழி தெரியவில்லை.இருந்தும் சமாளித்தான்.

திருடன் என தெரியாமல் அவனிடம் தனது பணத்தை பறிகொடுக்க,பின் விற்பனையில் மந்தமான ஒரு படிகக் கடையில் வேளை செய்யும் சூழல் வருகிறது.வருடம் ஓட…,பணம் சேர்த்துவிட்டான்அக்கடையையும் பிரபலமாக்கினான்…அவரிடமும் உங்கள் கனவை தொடருங்கள் என கூறி விடைபெற்றான் அவ்விடம் விட்டு.

என்ன இன்னும் ரசவாதி வரவில்லையே….நானும் காத்திருக்கிறேன்…

காத்திருப்போம்……..,

Install / Uninstall Apache server in Linux

Here,we are going to discuss about how to install apache server in debian.

sudo apt update
sudo apt install apache2

Once,the packages are installed in your system.Run the server by the following command.

sudo systemctl start apache2

Now you can check the status whether it is running or not by using..,

sudo systemctl status apache2

Active: active (running) since Thu 2024-02-08 18:37:49 IST; 11s ago
You can check that it is running.Also there is a another method to check by entering http://localhost/ in any of your browser.

sudo systemctl enable apache2

If you don’t want to start every time and by default the server should be on running,use the above command.It starts automatically when the system boots.

sudo systemctl stop apache2

This command will stop the server.

sudo systemctl disable apache2

This will disable the server and is not running after the system boots.

Now,we can see how to remove apache server.

sudo apt remove --purge apache2

This will remove the apache2 server from your system.

sudo apt autoremove

This command is used to remove the apache related dependencies automatically from the system.

That’s it…

❌