SlideShare a Scribd company logo
1 of 37
Linux for Programmers 
Md. Al-Amin opu 
Programmer and *nix user
Essential tools 
gedit 
Sublime Text
Installing gedit 
sudo apt-get install gedit
Installing Sublime Text 
1. sudo add-apt-repository ppa:webupd8team/sublime-text-3 
2. sudo apt-get update 
3. sudo apt-get install sublime-text-installer 
OR 
Download .deb file http://www.sublimetext.com/3
Setting up environment 
cd ~/ 
mkdir programming 
cd programming 
mkdir cprogram 
mkdir cppprogram 
mkdir python 
mkdir php
C/C++ Programming
Installing C/C++ compiler 
C compiler comes with default packages in Ubuntu/Mint 
We need to install C++ compiler for programming in C++ 
sudo apt-get install build-essential 
sudo apt-get install g++
Creating a new file/ c program 
Go to your home folder 
cd ~/ 
Then go to your “cprogram” folder 
cd programming 
cd cprogram 
Create a new file or c program 
nano hello.c 
OR 
gedit hello.c
View the content of file 
cat filename 
cat hello.c
Compile and debug c program 
Compiling without flags 
gcc hello.c -o helloWorld 
Compiling with flags 
gcc -Wall -W -Werror hello.c -o HelloWorld 
Run program 
./HelloWorld
Creating a c++ program 
Go to your home folder 
cd ~/ 
Then go to your “cprogram” folder 
cd programming 
cd cppprogram 
Create a new file or c program 
nano new.cpp 
OR 
gedit new.cpp
Compile and debug c++ program 
Compiling without flags 
g++ new.cpp -o NewWorld 
Compiling with flags 
g++ -Wall -W -Werror new.cpp -o NewWorld 
Run program 
./NewWorld
Python Programming
Python Interpreter 
Python comes with build in package in Ubuntu/Mint 
Check python is installed or not 
python –version 
If not, install python using following command 
sudo apt-get install python 
Run python interpreter using 
python 
Type 
print “Hello World”
Run Python from a separate file 
cd ~/ 
cd programming 
cd python 
Creating a new python program 
nano hello.py 
OR 
gedit hello.py
Things to Remember 
Add this line to indicate python interpreter 
#! /usr/bin/python 
Give proper permission to the file 
chmod a+x hello.py 
u stands for user. 
g stands for group. 
o stands for others. 
a stands for all. x stand for execute 
r stand for read 
w stand for right
More about permission 
# Permission rwx 
7 read, write and execute 111 
6 read and write 110 
5 read and execute 101 
4 read only 100 
3 write and execute 011 
2 write only 010 
1 execute only 001 
0 none 000 
To know more visit: http://en.wikipedia.org/wiki/Chmod
Ah!!! Lets run now 
To run python program 
python hello.py
PHP-MySQL 
Programming
LAMP Stack 
LAMP stands for L=Linux , A = Apache , M=MySQL P=PHP 
Alternative of LAMP is LEMP 
L= Linux , E= nginx (Engine X) , M= MySQL, P=PHP
Setting up Apache Server 
Update software package source 
sudo apt-get update 
Installing apache2 
sudo apt-get install apache2 
Testing Web Server 
http://localhost 
Web Server default folder 
/var/www/html
Install and Configure MySQL 
First we need to install MySQL Server 
sudo apt-get install mysql-server 
Configure MySQL server 
mysql_secure_installation
Creating database and user 
First login to mysql 
mysql -u root -p // root is default user. 
To create a database 
create database lollipop; // 'lolipop' is our database name 
To create user and give permission 
grant all on lollipop.* to 'candy' identified by '5t1ck'; 
// 'candy' is username. '5t1ck' is password 
Update privileges 
flush privileges; 
To know more about MySQL CLI : http://dev.mysql.com/doc/refman/5.6/en/mysql.html
Installing PHP and helper package 
Installing PHP5 
sudo apt-get install php5 
Lib-apache module for php5 
sudo apt-get install libapache2-mod-php5 
To connect mysql with php 
sudo apt-get install php5-mysql 
GD module for php 
sudo apt-get install php5-gd 
PHP CLI 
sudo apt-get install php5-cli
Creating and Running PHP file 
Go to web server folder 
cd /var/www/html 
Create a new file 
nano info.php or gedit info.php 
Inside the file , paste this code 
<?php phpinfo(); ?> 
Run the file from your browser 
http://localhost/info.php
Change apache, PHP, MySQL configuration 
To change apache configuration 
sudo gedit /etc/apach2/apache2.conf 
To change PHP configuration 
sudo gedit /etc/php5/apache2/php.ini 
To change MySQL configuration 
sudo gedit /etc/mysql/my.cnf
Changing Web Server Server Directory 
Edit apache2 config file 
sudo gedit /etc/apach2/apache2.conf 
Change directory to your own directory 
<Directory /home/programming/php/> 
Options Indexes 
FollowSymLinks 
AllowOverride All 
Require all granted 
</Directory> 
<Directory /var/www/> 
Options Indexes 
FollowSymLinks 
AllowOverride All 
Require all granted 
</Directory>
Restarting apache Server 
If we make any change on the server configuration, always 
need to restart the server 
To restart apache server 
sudo service apache2 restart
Installing phpmyadmin 
To install 
sudo apt-get install phpmyadmin 
It should automatically configure the phpmyadmin. Can be 
run through http://localhost/phpmyadmin 
If you need to re-cofigure phpmyadmin run 
sudo dpkg-reconfigure -plow phpmyadmin 
Then edit apache config file and add this line add the end of 
that file. 
Include /etc/phpmyadmin/apache.conf 
Restart web server
Virtual Host
Creating Virtual Host 
Go to apache sites-available directory 
cd /etc/apache2/sites-available/ 
Create a new file 
sudo gedit dev.conf 
Paste this code on the file 
<VirtualHost *:80> 
ServerAdmin webmaster@local.dev 
ServerName local.dev 
ServerAlias www.local.dev 
DocumentRoot /home/programming/php/dev/ 
ErrorLog /home/programming/php/dev/error.log 
</VirtualHost>
Configure Virtual host 
cd ~/ 
cd programming 
cd php 
mkdir dev 
chown -R user:user dev 
chmod 755 -R dev
Enable and Run Virtual host 
To enable virtual host 
sudo a2ensite dev.conf 
Edit host file to assign local IP (Option) 
sudo gedit /etc/hosts 
Restart apache 
sudo service apache2 restart 
To run newly created host 
http://local.dev
Remote Server
Login Via SSH 
ssh user@hostname 
Example : ssh root@23.95.55.245 
To logout use 
exit or logout
Questions???
Thank You

More Related Content

What's hot

Install apache on centos
Install apache on centosInstall apache on centos
Install apache on centoshengko
 
How to Install LAMP in Ubuntu 14.04
How to Install LAMP in Ubuntu 14.04How to Install LAMP in Ubuntu 14.04
How to Install LAMP in Ubuntu 14.04Sanjary Edu
 
Installing apache sqoop
Installing apache sqoopInstalling apache sqoop
Installing apache sqoopEnrique Davila
 
Ansible Network Automation session1
Ansible Network Automation session1Ansible Network Automation session1
Ansible Network Automation session1Dhruv Sharma
 
Installing hive on ubuntu 16
Installing hive on ubuntu 16Installing hive on ubuntu 16
Installing hive on ubuntu 16Enrique Davila
 
Installing hadoop on ubuntu 16
Installing hadoop on ubuntu 16Installing hadoop on ubuntu 16
Installing hadoop on ubuntu 16Enrique Davila
 
Dockerizing WordPress
Dockerizing WordPressDockerizing WordPress
Dockerizing WordPressdotCloud
 
Linux Webserver Installation Command and GUI.ppt
Linux Webserver Installation Command and GUI.pptLinux Webserver Installation Command and GUI.ppt
Linux Webserver Installation Command and GUI.pptwebhostingguy
 
Red Hat Certified Engineer (RHCE) EX294 Exam Questions
Red Hat Certified Engineer (RHCE) EX294 Exam QuestionsRed Hat Certified Engineer (RHCE) EX294 Exam Questions
Red Hat Certified Engineer (RHCE) EX294 Exam QuestionsStudy Material
 
Aeon mike guide transparent ssl filtering (1)
Aeon mike guide transparent ssl filtering (1)Aeon mike guide transparent ssl filtering (1)
Aeon mike guide transparent ssl filtering (1)Conrad Cruz
 
Aeon mike guide transparent ssl filtering
Aeon mike guide transparent ssl filteringAeon mike guide transparent ssl filtering
Aeon mike guide transparent ssl filteringConrad Cruz
 
Compcon 2016 Workshop
Compcon 2016 WorkshopCompcon 2016 Workshop
Compcon 2016 WorkshopSteven Cooper
 
Deploying with Super Cow Powers (Hosting your own APT repository with reprepro)
Deploying with Super Cow Powers (Hosting your own APT repository with reprepro)Deploying with Super Cow Powers (Hosting your own APT repository with reprepro)
Deploying with Super Cow Powers (Hosting your own APT repository with reprepro)Simon Boulet
 
Installing and running Postfix within a docker container from the command line
Installing and running Postfix within a docker container from the command lineInstalling and running Postfix within a docker container from the command line
Installing and running Postfix within a docker container from the command linedotCloud
 
Installing softwares in linux
Installing softwares in linuxInstalling softwares in linux
Installing softwares in linuxvedantsharma
 
How to install and configure LEMP stack
How to install and configure LEMP stackHow to install and configure LEMP stack
How to install and configure LEMP stackRootGate
 
WE18_Performance_Up.ppt
WE18_Performance_Up.pptWE18_Performance_Up.ppt
WE18_Performance_Up.pptwebhostingguy
 

What's hot (20)

Install apache on centos
Install apache on centosInstall apache on centos
Install apache on centos
 
How to Install LAMP in Ubuntu 14.04
How to Install LAMP in Ubuntu 14.04How to Install LAMP in Ubuntu 14.04
How to Install LAMP in Ubuntu 14.04
 
Installing apache sqoop
Installing apache sqoopInstalling apache sqoop
Installing apache sqoop
 
Ansible Network Automation session1
Ansible Network Automation session1Ansible Network Automation session1
Ansible Network Automation session1
 
Installing hive on ubuntu 16
Installing hive on ubuntu 16Installing hive on ubuntu 16
Installing hive on ubuntu 16
 
Installing hadoop on ubuntu 16
Installing hadoop on ubuntu 16Installing hadoop on ubuntu 16
Installing hadoop on ubuntu 16
 
Dockerizing WordPress
Dockerizing WordPressDockerizing WordPress
Dockerizing WordPress
 
Drupal from scratch
Drupal from scratchDrupal from scratch
Drupal from scratch
 
Linux Webserver Installation Command and GUI.ppt
Linux Webserver Installation Command and GUI.pptLinux Webserver Installation Command and GUI.ppt
Linux Webserver Installation Command and GUI.ppt
 
Ex407
Ex407Ex407
Ex407
 
Red Hat Certified Engineer (RHCE) EX294 Exam Questions
Red Hat Certified Engineer (RHCE) EX294 Exam QuestionsRed Hat Certified Engineer (RHCE) EX294 Exam Questions
Red Hat Certified Engineer (RHCE) EX294 Exam Questions
 
Aeon mike guide transparent ssl filtering (1)
Aeon mike guide transparent ssl filtering (1)Aeon mike guide transparent ssl filtering (1)
Aeon mike guide transparent ssl filtering (1)
 
Aeon mike guide transparent ssl filtering
Aeon mike guide transparent ssl filteringAeon mike guide transparent ssl filtering
Aeon mike guide transparent ssl filtering
 
Compcon 2016 Workshop
Compcon 2016 WorkshopCompcon 2016 Workshop
Compcon 2016 Workshop
 
Deploying with Super Cow Powers (Hosting your own APT repository with reprepro)
Deploying with Super Cow Powers (Hosting your own APT repository with reprepro)Deploying with Super Cow Powers (Hosting your own APT repository with reprepro)
Deploying with Super Cow Powers (Hosting your own APT repository with reprepro)
 
Installing and running Postfix within a docker container from the command line
Installing and running Postfix within a docker container from the command lineInstalling and running Postfix within a docker container from the command line
Installing and running Postfix within a docker container from the command line
 
Installing softwares in linux
Installing softwares in linuxInstalling softwares in linux
Installing softwares in linux
 
are available here
are available hereare available here
are available here
 
How to install and configure LEMP stack
How to install and configure LEMP stackHow to install and configure LEMP stack
How to install and configure LEMP stack
 
WE18_Performance_Up.ppt
WE18_Performance_Up.pptWE18_Performance_Up.ppt
WE18_Performance_Up.ppt
 

Similar to Essential Linux Tools and Programming Guide for Beginners

Installing Lamp Stack on Ubuntu Instance
Installing Lamp Stack on Ubuntu InstanceInstalling Lamp Stack on Ubuntu Instance
Installing Lamp Stack on Ubuntu Instancekamarul kawnayeen
 
Open erp on ubuntu
Open erp on ubuntuOpen erp on ubuntu
Open erp on ubuntuIker Coranti
 
How to install r1 soft
    How to install  r1 soft    How to install  r1 soft
How to install r1 softIdeastack
 
Install and configure linux
Install and configure linuxInstall and configure linux
Install and configure linuxVicent Selfa
 
Ansible presentation
Ansible presentationAnsible presentation
Ansible presentationJohn Lynch
 
Linux Webserver Installation Command and GUI.ppt
Linux Webserver Installation Command and GUI.pptLinux Webserver Installation Command and GUI.ppt
Linux Webserver Installation Command and GUI.pptwebhostingguy
 
Dockerizing Symfony Applications - Symfony Live Berlin 2014
Dockerizing Symfony Applications - Symfony Live Berlin 2014Dockerizing Symfony Applications - Symfony Live Berlin 2014
Dockerizing Symfony Applications - Symfony Live Berlin 2014D
 
Professional deployment
Professional deploymentProfessional deployment
Professional deploymentIvelina Dimova
 
Installaling Puppet Master and Agent
Installaling Puppet Master and AgentInstallaling Puppet Master and Agent
Installaling Puppet Master and AgentRanjit Avasarala
 
Ubuntu Practice and Configuration
Ubuntu Practice and ConfigurationUbuntu Practice and Configuration
Ubuntu Practice and ConfigurationManoj Sahu
 
Deploying Symfony | symfony.cat
Deploying Symfony | symfony.catDeploying Symfony | symfony.cat
Deploying Symfony | symfony.catPablo Godel
 
Tame Your Build And Deployment Process With Hudson, PHPUnit, and SSH
Tame Your Build And Deployment Process With Hudson, PHPUnit, and SSHTame Your Build And Deployment Process With Hudson, PHPUnit, and SSH
Tame Your Build And Deployment Process With Hudson, PHPUnit, and SSHDavid Stockton
 
Hands on Docker - Launch your own LEMP or LAMP stack
Hands on Docker -  Launch your own LEMP or LAMP stackHands on Docker -  Launch your own LEMP or LAMP stack
Hands on Docker - Launch your own LEMP or LAMP stackDana Luther
 

Similar to Essential Linux Tools and Programming Guide for Beginners (20)

Linux Presentation
Linux PresentationLinux Presentation
Linux Presentation
 
Installing Lamp Stack on Ubuntu Instance
Installing Lamp Stack on Ubuntu InstanceInstalling Lamp Stack on Ubuntu Instance
Installing Lamp Stack on Ubuntu Instance
 
Its3 Drupal
Its3 DrupalIts3 Drupal
Its3 Drupal
 
Its3 Drupal
Its3 DrupalIts3 Drupal
Its3 Drupal
 
Open erp on ubuntu
Open erp on ubuntuOpen erp on ubuntu
Open erp on ubuntu
 
How to install r1 soft
    How to install  r1 soft    How to install  r1 soft
How to install r1 soft
 
Lumen
LumenLumen
Lumen
 
Install and configure linux
Install and configure linuxInstall and configure linux
Install and configure linux
 
Ansible presentation
Ansible presentationAnsible presentation
Ansible presentation
 
Linux Webserver Installation Command and GUI.ppt
Linux Webserver Installation Command and GUI.pptLinux Webserver Installation Command and GUI.ppt
Linux Webserver Installation Command and GUI.ppt
 
PHP selber bauen
PHP selber bauenPHP selber bauen
PHP selber bauen
 
Dockerizing Symfony Applications - Symfony Live Berlin 2014
Dockerizing Symfony Applications - Symfony Live Berlin 2014Dockerizing Symfony Applications - Symfony Live Berlin 2014
Dockerizing Symfony Applications - Symfony Live Berlin 2014
 
Professional deployment
Professional deploymentProfessional deployment
Professional deployment
 
Installaling Puppet Master and Agent
Installaling Puppet Master and AgentInstallaling Puppet Master and Agent
Installaling Puppet Master and Agent
 
Ubuntu Practice and Configuration
Ubuntu Practice and ConfigurationUbuntu Practice and Configuration
Ubuntu Practice and Configuration
 
Hadoop completereference
Hadoop completereferenceHadoop completereference
Hadoop completereference
 
Deploying Symfony | symfony.cat
Deploying Symfony | symfony.catDeploying Symfony | symfony.cat
Deploying Symfony | symfony.cat
 
Tame Your Build And Deployment Process With Hudson, PHPUnit, and SSH
Tame Your Build And Deployment Process With Hudson, PHPUnit, and SSHTame Your Build And Deployment Process With Hudson, PHPUnit, and SSH
Tame Your Build And Deployment Process With Hudson, PHPUnit, and SSH
 
Hands on Docker - Launch your own LEMP or LAMP stack
Hands on Docker -  Launch your own LEMP or LAMP stackHands on Docker -  Launch your own LEMP or LAMP stack
Hands on Docker - Launch your own LEMP or LAMP stack
 
Sahu
SahuSahu
Sahu
 

Recently uploaded

SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AIABDERRAOUF MEHENNI
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Modelsaagamshah0812
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfkalichargn70th171
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdfWave PLM
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Steffen Staab
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionSolGuruz
 
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceCALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceanilsa9823
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️Delhi Call girls
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...Health
 

Recently uploaded (20)

SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS LiveVip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
 
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceCALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 

Essential Linux Tools and Programming Guide for Beginners

  • 1. Linux for Programmers Md. Al-Amin opu Programmer and *nix user
  • 2. Essential tools gedit Sublime Text
  • 3. Installing gedit sudo apt-get install gedit
  • 4. Installing Sublime Text 1. sudo add-apt-repository ppa:webupd8team/sublime-text-3 2. sudo apt-get update 3. sudo apt-get install sublime-text-installer OR Download .deb file http://www.sublimetext.com/3
  • 5. Setting up environment cd ~/ mkdir programming cd programming mkdir cprogram mkdir cppprogram mkdir python mkdir php
  • 7. Installing C/C++ compiler C compiler comes with default packages in Ubuntu/Mint We need to install C++ compiler for programming in C++ sudo apt-get install build-essential sudo apt-get install g++
  • 8. Creating a new file/ c program Go to your home folder cd ~/ Then go to your “cprogram” folder cd programming cd cprogram Create a new file or c program nano hello.c OR gedit hello.c
  • 9. View the content of file cat filename cat hello.c
  • 10. Compile and debug c program Compiling without flags gcc hello.c -o helloWorld Compiling with flags gcc -Wall -W -Werror hello.c -o HelloWorld Run program ./HelloWorld
  • 11. Creating a c++ program Go to your home folder cd ~/ Then go to your “cprogram” folder cd programming cd cppprogram Create a new file or c program nano new.cpp OR gedit new.cpp
  • 12. Compile and debug c++ program Compiling without flags g++ new.cpp -o NewWorld Compiling with flags g++ -Wall -W -Werror new.cpp -o NewWorld Run program ./NewWorld
  • 14. Python Interpreter Python comes with build in package in Ubuntu/Mint Check python is installed or not python –version If not, install python using following command sudo apt-get install python Run python interpreter using python Type print “Hello World”
  • 15. Run Python from a separate file cd ~/ cd programming cd python Creating a new python program nano hello.py OR gedit hello.py
  • 16. Things to Remember Add this line to indicate python interpreter #! /usr/bin/python Give proper permission to the file chmod a+x hello.py u stands for user. g stands for group. o stands for others. a stands for all. x stand for execute r stand for read w stand for right
  • 17. More about permission # Permission rwx 7 read, write and execute 111 6 read and write 110 5 read and execute 101 4 read only 100 3 write and execute 011 2 write only 010 1 execute only 001 0 none 000 To know more visit: http://en.wikipedia.org/wiki/Chmod
  • 18. Ah!!! Lets run now To run python program python hello.py
  • 20. LAMP Stack LAMP stands for L=Linux , A = Apache , M=MySQL P=PHP Alternative of LAMP is LEMP L= Linux , E= nginx (Engine X) , M= MySQL, P=PHP
  • 21. Setting up Apache Server Update software package source sudo apt-get update Installing apache2 sudo apt-get install apache2 Testing Web Server http://localhost Web Server default folder /var/www/html
  • 22. Install and Configure MySQL First we need to install MySQL Server sudo apt-get install mysql-server Configure MySQL server mysql_secure_installation
  • 23. Creating database and user First login to mysql mysql -u root -p // root is default user. To create a database create database lollipop; // 'lolipop' is our database name To create user and give permission grant all on lollipop.* to 'candy' identified by '5t1ck'; // 'candy' is username. '5t1ck' is password Update privileges flush privileges; To know more about MySQL CLI : http://dev.mysql.com/doc/refman/5.6/en/mysql.html
  • 24. Installing PHP and helper package Installing PHP5 sudo apt-get install php5 Lib-apache module for php5 sudo apt-get install libapache2-mod-php5 To connect mysql with php sudo apt-get install php5-mysql GD module for php sudo apt-get install php5-gd PHP CLI sudo apt-get install php5-cli
  • 25. Creating and Running PHP file Go to web server folder cd /var/www/html Create a new file nano info.php or gedit info.php Inside the file , paste this code <?php phpinfo(); ?> Run the file from your browser http://localhost/info.php
  • 26. Change apache, PHP, MySQL configuration To change apache configuration sudo gedit /etc/apach2/apache2.conf To change PHP configuration sudo gedit /etc/php5/apache2/php.ini To change MySQL configuration sudo gedit /etc/mysql/my.cnf
  • 27. Changing Web Server Server Directory Edit apache2 config file sudo gedit /etc/apach2/apache2.conf Change directory to your own directory <Directory /home/programming/php/> Options Indexes FollowSymLinks AllowOverride All Require all granted </Directory> <Directory /var/www/> Options Indexes FollowSymLinks AllowOverride All Require all granted </Directory>
  • 28. Restarting apache Server If we make any change on the server configuration, always need to restart the server To restart apache server sudo service apache2 restart
  • 29. Installing phpmyadmin To install sudo apt-get install phpmyadmin It should automatically configure the phpmyadmin. Can be run through http://localhost/phpmyadmin If you need to re-cofigure phpmyadmin run sudo dpkg-reconfigure -plow phpmyadmin Then edit apache config file and add this line add the end of that file. Include /etc/phpmyadmin/apache.conf Restart web server
  • 31. Creating Virtual Host Go to apache sites-available directory cd /etc/apache2/sites-available/ Create a new file sudo gedit dev.conf Paste this code on the file <VirtualHost *:80> ServerAdmin webmaster@local.dev ServerName local.dev ServerAlias www.local.dev DocumentRoot /home/programming/php/dev/ ErrorLog /home/programming/php/dev/error.log </VirtualHost>
  • 32. Configure Virtual host cd ~/ cd programming cd php mkdir dev chown -R user:user dev chmod 755 -R dev
  • 33. Enable and Run Virtual host To enable virtual host sudo a2ensite dev.conf Edit host file to assign local IP (Option) sudo gedit /etc/hosts Restart apache sudo service apache2 restart To run newly created host http://local.dev
  • 35. Login Via SSH ssh user@hostname Example : ssh root@23.95.55.245 To logout use exit or logout