by Anil Jalela | Nov 14, 2022 | Linux
The table below lists most features that I think would make you choose one shell over another. It is not intended to be a definitive list and does not include every single possible feature for every single possible shell. A feature is only considered to be in a shell if in the version that comes with the operating system, or if it is available as compiled directly from the standard distribution. In particular, the C shell specified below is available on SunOS X.*, a considerable number of vendors now ship either tcsh or their own enhanced C shell instead (they don’t always make it obvious that they are shipping tcsh.
Features |
sh |
csh |
ksh |
bash |
tcsh |
zsh |
rc |
es |
Job control |
N |
Y |
Y |
Y |
Y |
Y |
N |
N |
Aliases |
N |
Y |
Y |
Y |
Y |
Y |
N |
N |
Shell functions |
Y(1) |
N |
Y |
Y |
N |
Y |
Y |
Y |
“Sensible” Input/Output redirection |
Y |
N |
Y |
Y |
N |
Y |
Y |
Y |
Directory stack |
N |
Y |
Y |
Y |
Y |
Y |
F |
F |
Command history |
N |
Y |
Y |
Y |
Y |
Y |
L |
L |
Command line editing |
N |
N |
Y |
Y |
Y |
Y |
L |
L |
Vi Command line editing |
N |
N |
Y |
Y |
Y(3) |
Y |
L |
L |
Emacs Command line editing |
N |
N |
Y |
Y |
Y |
Y |
L |
L |
Rebindable Command line editing |
N |
N |
N |
Y |
Y |
Y |
L |
L |
User name lookup |
N |
Y |
Y |
Y |
Y |
Y |
L |
L |
Login/Logout watching |
N |
N |
N |
N |
Y |
Y |
F |
F |
Filename completion |
N |
Y(1) |
Y |
Y |
Y |
Y |
L |
L |
Username completion |
N |
Y(2) |
Y |
Y |
Y |
Y |
L |
L |
Hostname completion |
N |
Y(2) |
Y |
Y |
Y |
Y |
L |
L |
History completion |
N |
N |
N |
Y |
Y |
Y |
L |
L |
Fully programmable Completion |
N |
N |
N |
N |
Y |
Y |
N |
N |
Mh Mailbox completion |
N |
N |
N |
N(4) |
N(6) |
N(6) |
N |
N |
Co Processes |
N |
N |
Y |
N |
N |
Y |
N |
N |
Builtin arithmetic evaluation |
N |
Y |
Y |
Y |
Y |
Y |
N |
N |
Can follow symbolic links invisibly |
N |
N |
Y |
Y |
Y |
Y |
N |
N |
Periodic command execution |
N |
N |
N |
N |
Y |
Y |
N |
N |
Custom Prompt (easily) |
N |
N |
Y |
Y |
Y |
Y |
Y |
Y |
Sun Keyboard Hack |
N |
N |
N |
N |
N |
Y |
N |
N |
Spelling Correction |
N |
N |
N |
N |
Y |
Y |
N |
N |
Process Substitution |
N |
N |
N |
Y(2) |
N |
Y |
Y |
Y |
Underlying Syntax |
sh |
csh |
sh |
sh |
csh |
sh |
rc |
rc |
Freely Available |
N |
N |
N(5) |
Y |
Y |
Y |
Y |
Y |
Checks Mailbox |
N |
Y |
Y |
Y |
Y |
Y |
F |
F |
Tty Sanity Checking |
N |
N |
N |
N |
Y |
Y |
N |
N |
Can cope with large argument lists |
Y |
N |
Y |
Y |
Y |
Y |
Y |
Y |
Has a non-interactive startup file |
N |
Y |
Y(7) |
Y(7) |
Y |
Y |
N |
N |
Has non-login startup file |
N |
Y |
Y(7) |
Y |
Y |
Y |
N |
N |
Can avoid user startup files |
N |
Y |
N |
Y |
N |
Y |
Y |
Y |
Can specify startup file |
N |
N |
Y |
Y |
N |
N |
N |
N |
Low-level command redefinition |
N |
N |
N |
N |
N |
N |
N |
Y |
Has anonymous functions |
N |
N |
N |
N |
N |
N |
Y |
Y |
List Variables |
N |
Y |
Y |
N |
Y |
Y |
Y |
Y |
Full signal trap handling |
Y |
N |
Y |
Y |
N |
Y |
Y |
Y |
File no clobber ability |
N |
Y |
Y |
Y |
Y |
Y |
N |
F |
Local variables |
N |
N |
Y |
Y |
N |
Y |
Y |
Y |
Lexically scoped variables |
N |
N |
N |
N |
N |
N |
N |
Y |
Exceptions |
N |
N |
N |
N |
N |
N |
N |
Y |
Key to the table above.
Y Feature can be done using this shell.
N Feature is not present in the shell.
F Feature can only be done by using the shells function mechanism.
L The Readline library must be linked into the shell to enable this Feature.
Notes to the table above
1. This feature was not in the original version but has since become almost standard.
2. This feature is fairly new and so is often not found on many versions of the shell, it is gradually making its way into standard distribution.
3. The Vi emulation of this shell is thought by many to be incomplete.
4. This feature is not standard but unofficial patches exist to perform this.
5. A version called ‘pdksh’ is freely available, but does not have the full functionality of the AT&T version.
6. This can be done via the shells programmable completion mechanism.
7. Only by specifying a file via the ENV environment variable.
by Anil Jalela | Oct 23, 2022 | DevOps
Maven is a tool that can now be used for building and managing any Java-based project. We hope that we have created something that will make the day-to-day work of Java developers easier and generally help with the comprehension of any Java-based project.
Maven’s Objectives:-
Maven’s primary goal is to allow a developer to comprehend the complete state of a development effort in the shortest period of time. In order to attain this goal, Maven deals with several areas of concern:-
Making the build process easy.
Providing a uniform build system.
Providing quality project information.
Encouraging better development practices.
Making the build process easy.
While using Maven doesn’t eliminate the need to know about the underlying mechanisms, Maven does shield developers from many details.
Providing a uniform build system:-
Maven builds a project using its project object model (POM) and a set of plugins. Once you familiarize yourself with one Maven project, you know how all Maven projects build. This saves time when navigating many projects.
Providing quality project information:-
Maven provides useful project information that is in part taken from your POM and in part generated from your project’s sources. For example, Maven can provide:
Change log created directly from source control.
Cross-referenced sources.
Mailing lists are managed by the project.
Dependencies used by the project.
Unit test reports including coverage.
Third-party code analysis products also provide Maven plugins that add their reports to the standard information given by Maven.
Providing guidelines for best practices development:-
Maven aims to gather current principles for best practices development and make it easy to guide a project in that direction. For example, specification, execution, and reporting of unit tests are part of the normal build cycle using Maven. Current unit testing best practices were used as guidelines:
Keeping test source code in a separate, but parallel source tree. Using test case naming conventions to locate and execute tests. Having test cases set up their environment instead of customizing the build for test preparation.
Maven also assists in project workflows such as release and issue management.
Maven also suggests some guidelines on how to lay out your project’s directory structure. Once you learn the layout, you can easily navigate other projects that use Maven.
While Maven takes an opinionated approach to project layout, some projects may not fit with this structure for historical reasons. While Maven is designed to be flexible to the needs of different projects, it cannot cater to every situation without compromising its objectives. If your project has an unusual build structure that cannot be reorganized, you may have to forgo some features or the use of Maven altogether.
What is Maven Not?
You might have heard some of the following things about Maven:-
Maven is a site and documentation tool.
Maven extends Ant to let you download dependencies.
Maven is a set of reusable Ant scriptlets.
While Maven does these things, as you can read above in the What is Maven? section, these are not the only features Maven has, and its objectives are quite different.
1 |
https://maven.apache.org/download.cgi |
Find latest version of Maven |
2 |
Cd /tmp && wget https://dlcdn.apache.org/maven/maven-3/3.8.6/binaries/apache-maven-3.8.6-bin.tar.gz |
Download latest in /tmp |
3 |
Tar -zxvf apache-maven-3.8.6-bin.tar.gz |
Extract project |
|
mv apache-maven-3.8.6 /opt/maven |
Set maven home |
4 |
echo ‘export M2_HOME=/opt/maven’| tee -a /etc/profile |
Set M2_HOME for binary environment |
5 |
echo ‘export MAVEN_HOME=/opt/maven’| tee -a /etc/profile |
Set MAVEN_HOME |
6 |
echo ‘ export PATH=${M2_HOME}/bin:${PATH}’| tee -a /etc/profile |
Set binary environment |
7 |
source /etc/profile |
export configurations in current system environment |
by Anil Jalela | Oct 21, 2022 | DevOps
Jenkins:-
→ Jenkins is an Open-Source project Written in Java that runs on Windows, macOS, and Other Unix-like Operating Systems. It is free, Community Supported, and might be your first-choice tool for CI.
→ Jenkins automates the entire Software development life Cycle
→ Jenkins was Originally developed by Sun Microsystem in 2004 under the name Hudson.
→ The project was later named Jenkins when Oracle bought Microsystems.
→ It Can run on any major platform without any Compatibilities issues.
→ Whenever developers Write Code, we integrate all that Code of all developers at that point in time and we build, test, and deliver/Deploy to the client. This process is called CI/CD ..
→ Jenkins helps us to achieve fast development.
→ Because of CI, Now bugs will be reported fast and get rectified fast So the entire Software development happens fast.
Workflow of Jenkins:-
→ We Can attach git, Maven, Selenium, Sonarqube, and Artifactory plugins to Jenkins.
→ Once developers put Code in GitHub, – Jenkins pulls that Code & sends to Maven for build
→ Once the build is done Jenkins pulls that Code and sends it to Selenium for testing.
→ Once testing is done, then Jenkins will pull that Code and Send it to artifactory (archive) as per requirement and so on.
→ We Can also deploy codes with Jenkins.
Build means=( compile, code review, unit testing, Integration testing, packaging[tar,jar,exe] )
Advantages of Jenkins: –
→ It has lots of plug-ins available
→ You Can Write your own plug-in.
→ You Can use Community Plug-in.
→ Jenkins is not just a tool. It is a framework i.e.: – You Can do whatever you want All you need is plug-ins.
→ We Can attach Slaves (nodes) to Jenkins master. It instructs others (slaves) to do Job. If slaves are not available Jenkins itself does the job.
→ Jenkins also behaves as a crone Server Replacement. i.e.: – Can do the scheduled task.
→ It Can Create Labels
1 |
yum install yum install fontconfig java-11-openjdk.x86_64 |
install java |
2 |
alternatives –config java |
the set version of java |
3 |
cp /etc/profile /etc/profile_backup |
backup profile |
4 |
echo ‘export JAVA_HOME=/usr/lib/jvm/ /usr/lib/jvm/jre_11_openjdk’ |tee -a /etc/profile |
export java development kit home |
5 |
echo ‘export JRE_HOME=/usr/lib/jvm/jre’ | tee -a /etc/profile |
export JVM home |
6 |
source /etc/profile |
export configurations in the current system environment |
7 |
wget -O /etc/yum.repos.d/jenkins.repo https://pkg.jenkins.io/redhat-stable/jenkins.repo |
Download the stable repo for yum |
8 |
rpm –import https://pkg.jenkins.io/redhat-stable/jenkins.io.key |
Import key for package signature verification |
9 |
yum install jenkins |
Install Jenkins |
10 |
systemctl start jenkins.service |
Start Jenkins service |
11 |
systemctl enable jenkins.service |
Enable Jenkins service |
what needs to learn in Jenkins?
Introduction to Jenkins
Introduction to Continuous Integration
Continuous Integration vs Continuous Delivery
Jenkins Overview
Characteristics and features
Architecture
Concepts and Terms
Benefits and Limitations
Installation and Configuration
Jenkins Installation and Configuration
Plug-ins Overview
Integration with Git
Integration with Maven
Integration with Java
Installing plugins
Setting up Build Jobs
Jenkins Dashboard
Create the first job
Running the first job
Manage jobs – failing, disable, update and delete
Pipeline with Jenkinsfile
Freestyle Project Configuration
Git Hooks and Other Build Triggers
Workspace Environment Variables
Parameterized Projects
UpstreamDownstream Projects and the Parameterized Trigger Plugin
Build a Java application with Maven using Jenkins
Continuous Delivery Pipeline
Publishing Build Artifacts
Deployment Plug-in setup and configuration
Auto Deployment of build artifacts into the target server
Deploy a Java application with Maven using Jenkins
Executing selenium Functional Testing with deployment
Management, Security and Best Practices
Managing and Monitoring Jenkins Server
Scaling Jenkins
Securing Jenkins
Adding Linux Node and executing job on it
Adding windows node and executing job on it
Configuring access control on Jenkins
Configuring role-based access control
Jenkins logs
Management
Credentials in Jenkins
Best Practices
Jenkins Pipeline
Writing Jenkins Pipeline file for java application build and deployment
Storing Jenkins in git and configuring webhook
Difference between declarative and scripted pipeline
Specify an agent in the pipeline
Parameters in Pipeline
Schedule build in the pipeline
Webhook in pipeline
Approval in pipeline
Approval with timeout in the pipeline
Variables in pipeline
Email notification in the pipeline
Post-build action in the pipeline
Parallel stages in the pipeline
Condition in pipeline
Selenium Functional Testing in the pipeline
by Anil Jalela | Oct 20, 2022 | Linux
Yum (Yellowdog Update Modified) is an RPM Packet Management system for Fedora, CentOS, Red Hat, OpenSuse, etc. Yum, history (list, info, summary, repeat, redo, undo, new) commands is added on the 3.2.25 version. So this works for every Linux Distros, which uses yum 3.2.25 or newer. Yum, history command is really useful in situations where the need to example roll back the latest yum activity or undelete some deletes or just see what is updated lately.
Yum history and Yum history list
yum history lists all the latest yum operations and yum history list all operations or just selected package operations
Listing all operations
[root ~]> yum history
### OR ###
[root ~]> yum history list
Loaded plugins: dellsysidplugin2, fastestmirror, refresh-packagekit
ID | Login user | Date and time | Action(s) | Altered
————————————————————–
45 | System <unset> | 2010-01-18 09:57 | I, U | 21
44 | User <username> | 2010-01-14 15:31 | Install | 1
43 | System <unset> | 2010-01-14 08:13 | Update | 19
42 | System <unset> | 2010-01-13 10:39 | I, U | 40
41 | System <unset> | 2010-01-11 07:59 | Update | 16
40 | System <unset> | 2010-01-08 07:58 | Update | 38
39 | System <unset> | 2010-01-07 08:39 | I, O, U | 39
38 | System <unset> | 2010-01-05 08:23 | O, U | 18
37 | User <username> | 2010-01-04 15:43 | Install | 1
36 | System <unset> | 2010-01-04 07:56 | Update | 66
35 | User <username> | 2009-12-30 10:07 | Install | 2
34 | User <username> | 2009-12-30 10:01 | Update | 15
33 | User <username> | 2009-12-30 08:14 | Install | 13
32 | System <unset> | 2009-12-29 07:52 | I, U | 26
31 | System <unset> | 2009-12-28 08:31 | E, I, U | 66
30 | System <unset> | 2009-12-23 12:11 | Update | 7
29 | System <unset> | 2009-12-22 13:59 | Update | 36
28 | User <username> | 2009-12-21 13:21 | Install | 1
27 | System <unset> | 2009-12-18 14:59 | Update | 56
26 | User <username> | 2009-12-18 08:46 | Install | 1
history list
Listing Arora browser operations
[root ~]> yum history list arora
Loaded plugins: dellsysidplugin2, fastestmirror, refresh-packagekit
ID | Login user | Date and time | Action(s) | Altered
————————————————————–
2 | User <username> | 2010-01-19 15:10 | Erase | 1
history list
Yum history info
Show full information by history ID.
Remove Arora browser
[root ~]> yum remove arora
Loaded plugins: dellsysidplugin2, fastestmirror, refresh-packagekit
Setting up Remove Process
[…]
=====================================================
Package Arch Version Repository Size
=====================================================
Removing:
arora i686 0.10.2-2.fc12 installed 3.7 M
Transaction Summary
=====================================================
Remove 1 Package(s)
Reinstall 0 Package(s)
Downgrade 0 Package(s)
Is this ok [y/N]: y
[…]
Running Transaction
Erasing : arora-0.10.2-2.fc12.i686 1/1
Removed:
arora.i686 0:0.10.2-2.fc12
Complete!
Yum history list
[root ~]> yum history list
Loaded plugins: dellsysidplugin2, fastestmirror, refresh-packagekit
ID | Login user | Date and time | Action(s) | Altered
————————————————————–
2 | User <username> | 2010-01-19 15:10 | Erase | 1
1 | User <username> | 2010-01-19 14:55 | Update | 3
history list
Show history info for ID 2
[root ~]> yum history info 2
Loaded plugins: dellsysidplugin2, fastestmirror, refresh-packagekit
Transaction ID : 2
Begin time : Tue Jan 19 15:10:13 2010
Begin rpmdb : 2431:fe4c2c846fd45c9125fb8ab27542a27b22e0d3df
End time : 15:10:27 2010 (14 seconds)
End rpmdb : 2430:2eeb12b0b0f2ef3fcb31b4447b439e76e92e3866
User : User <username>
Return-Code : Success
Transaction performed with:
Installed rpm-4.7.2-1.fc12.i686
Installed yum-3.2.25-1.fc12.noarch
Installed yum-plugin-fastestmirror-1.1.24-2.fc12.noarch
Packages Altered:
Erase arora-0.10.2-2.fc12.i686
history info
Yum history summary
Shows summary of lates operations.
[root ~]> yum history summary
Loaded plugins: dellsysidplugin2, fastestmirror, refresh-packagekit
Login user | Time | Action(s) | Altered
————————————————————–
User <username> | Last day | E, U | 4
history summary
Yum history repeat
yum history repeat command repeats old operation by history ID.
[root ~]> yum history repeat 2
Loaded plugins: dellsysidplugin2, fastestmirror, refresh-packagekit
Loading mirror speeds from cached hostfile
* fedora: mirror.cogentco.com
* livna: rpm.livna.org
[…]
Repeating transaction 2, from Tue Jan 19 15:10:13 2010
Erase arora-0.10.2-2.fc12.i686
No package matched to remove
history repeat
Yum history undo
yum history undo simply undo operations by history ID.
Undo Arora browser erase
[root ~]> yum history undo 2
Loaded plugins: dellsysidplugin2, fastestmirror, refresh-packagekit
Loading mirror speeds from cached hostfile
[…]
Undoing transaction 2, from Tue Jan 19 15:10:13 2010
Erase arora-0.10.2-2.fc12.i686
Resolving Dependencies
–> Running transaction check
—> Package arora.i686 0:0.10.2-2.fc12 set to be updated
–> Finished Dependency Resolution
Dependencies Resolved
=====================================================
Package Arch Version Repository Size
=====================================================
Installing:
arora i686 0.10.2-2.fc12 updates 1.1 M
Transaction Summary
=====================================================
Install 1 Package(s)
Upgrade 0 Package(s)
Total download size: 1.1 M
Is this ok [y/N]: y
Downloading Packages:
arora-0.10.2-2.fc12.i686.rpm | 1.1 MB 00:00
[…]
Running Transaction
Installing : arora-0.10.2-2.fc12.i686 1/1
Installed:
arora.i686 0:0.10.2-2.fc12
Complete!
History list after undo
[root ~]> yum history list arora
Loaded plugins: dellsysidplugin2, fastestmirror, refresh-packagekit
ID | Login user | Date and time | Action(s) | Altered
————————————————————–
3 | User <username> | 2010-01-19 15:35 | Install | 1
2 | User <username> | 2010-01-19 15:10 | Erase | 1
history list
Yum history redo
yum history redo simply redos operation from yum history by ID.
[root ~]> yum history redo 2
Loaded plugins: dellsysidplugin2, fastestmirror, refresh-packagekit
[…]
Repeating transaction 2, from Tue Jan 19 15:10:13 2010
Erase arora-0.10.2-2.fc12.i686
Resolving Dependencies
–> Running transaction check
—> Package arora.i686 0:0.10.2-2.fc12 set to be erased
–> Finished Dependency Resolution
Dependencies Resolved
=====================================================
Package Arch Version Repository Size
=====================================================
Removing:
arora i686 0.10.2-2.fc12 installed 3.7 M
Transaction Summary
=====================================================
Remove 1 Package(s)
Reinstall 0 Package(s)
Downgrade 0 Package(s)
Is this ok [y/N]: y
[…]
Running Transaction
Erasing : arora-0.10.2-2.fc12.i686 1/1
Removed:
arora.i686 0:0.10.2-2.fc12
Complete!
Yum history new
yum history new command delete/clear old history listing.
[root ~]> yum history new
Loaded plugins: dellsysidplugin2, fastestmirror, refresh-packagekit
history new
[root ~]> yum history
Loaded plugins: dellsysidplugin2, fastestmirror, refresh-packagekit
ID | Login user | Date and time | Action(s) | Altered
————————————————————–
history list