Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
674 changes: 674 additions & 0 deletions DockerTask2/LICENSE

Large diffs are not rendered by default.

119 changes: 119 additions & 0 deletions DockerTask2/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
__ ________ _______ _____ _ _ __
| | |__ __| | ____| | _ | | \ / | \ \
| | | | | |__ | |_| | | \_/ | \ \
| | o | | | | | __| | _ | \ \
| | o | | | __| | \ | | | | / /
| |____ o | | | |____ | \ | | | | / / ____
|_______| o |__| |_______| |__|\_\ |__| |__| /_/ |____|

# lterm: Online bash terminal(emulator) tutorial

Check out the site live at: [![lterm](https://img.shields.io/badge/webiste-live-brightgreen.svg?style=flat-square)](https://sr6033.github.io/lterm/) [![Gitter](https://badges.gitter.im/gitterHQ/gitter.svg)](https://gitter.im/lterm/Lobby?utm_source=share-link&utm_medium=link&utm_campaign=share-link)

**lterm** is an online **Terminal Emulator**. It is a step by step tutorial that will teach you the **bash** commands by making you execute them.

*Nothing is better than learning by doing.*

It is fully online and doesn't require any extra shitty access. Being an emulator, it only virtualizes a terminal environment and so the commands executed doesn't effect either the server or your local machine.

### List of commands available presently

Command| Does...
:-----:|:-----:
`echo`|To display a string
`pwd`|Shows you the present working directory
`ls`|Lists all the files
`cd`|To change directory - change the current working directory to a specific directory
`cd ..`|Moves you up one directory(parent)
`cat`|Concatenate and print the content of files
`clear`|Clears the terminal screen
`touch`|Changes file timestamps or creates a new file
`cp`/`mv`|To copy/move files
`rm`|Delets a file/directory
`uname`|Shows the name of the Linux/Unix system you are using
`date`|Shows the local standard date & time
`ifconfig`|Shows information about active network interfaces.
`mkdir`|Creates a new directory
`tty`|Prints the file name of the terminal connected to standard input
`history`|Shows all the commands which are used in the previous iterations

### List of commands that can be added

- `export`
- `less`
- `more`

### Contributing


1. Fork it (<https://github.com/sr6033/lterm/fork>)
2. Create your feature branch (`git checkout -b feature/fooBar`)
3. Commit your changes (`git commit -am 'Add some fooBar'`)
4. Push to the branch (`git push origin feature/fooBar`)
5. Create a new Pull Request

#### To add your new commands
- edit the file **<a href="https://github.com/sr6033/lterm/blob/master/js/main.js">main.js</a>** to add your commands.
- You don't have to worry about any other files or programs.

---

- If a **command** doesn't need further steps:

```
// without argument
ls: function() {
this.echo('This is the ls command\n');
}
```

```
// with argument
echo: function(arg1) {
this.echo('This is the echo command' + arg1 + '\n');
}
```

- If a **command** needs further steps:

```
cd: function(arg1) {
this.push(function(cmd, term) {
if(cmd == 'another_command')
this.echo('another_command');
}, {
prompt: '[[b;#44D544;]lterm@localhost/' + arg1 + ':~$] ',
}
);
}
```

---

**IMPORTANT**

- On addition of a new **command**, increase the size of `arr` array. This array acts like a counter to check if a **task/command** is completed or not.
- You need to add the new **command** into the second array `arr2` . This array stores all the commands and helps in fetching the **completed commands** when the **history** command is executed.
- Please make sure that you **do not alter the positions of commands** in `arr2`, You need to add the new command towards the last.
- Example: If I add the command - `echo`. I will add another 0 to the end of `arr`. Then I will make `arr[index] = 1` under `echo` command.
```
var arr = [0,0,0,0,0,0,0,0,0,0,0,0,0,0]; // Will add another 0 here. The place where you added is the index.
var arr2 = ['list of all other commands']; // Will add the 'echo' command here
...
...
echo: function(arg1) {
arr[index_where_you_added_0] = 1; // Will make the value at that index to 1.
this.echo(arg1 + '\n');
this.echo('> The [[b;#ff3300;]echo] command prints back your arguments.');
this.echo('> Type [[b;#ff3300;]help] and check your first task is completed.');
this.echo('> Now type [[b;#ff3300;]pwd] to continue.');
},

```
- If you face any problem or cannot understand anything, open up an **issue**.
- You can also edit the **readme** and make it more user friendly to help out new contributors.

> **NOTE: Kindly keep the display of the terminal intact while making an update. A single extra space can make the look of the emulator little odd. So keep that in mind while printing something using `echo` command.**

> Note: Kindly have interpretable & good commit messages. Don't assume me to be some **Jedi** with powers to be able to make out every commit with a single word as message.
*May the Force be with you.*
253 changes: 253 additions & 0 deletions DockerTask2/css/jquery.terminal-0.11.23.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,253 @@
/*!
* __ _____ ________ __
* / // _ /__ __ _____ ___ __ _/__ ___/__ ___ ______ __ __ __ ___ / /
* __ / // // // // // _ // _// // / / // _ // _// // // \/ // _ \/ /
* / / // // // // // ___// / / // / / // ___// / / / / // // /\ // // / /__
* \___//____ \\___//____//_/ _\_ / /_//____//_/ /_/ /_//_//_/ /_/ \__\_\___/
* \/ /____/ version 0.11.23
* http://terminal.jcubic.pl
*
* This file is part of jQuery Terminal.
*
* Copyright (c) 2011-2016 Jakub Jankiewicz <http://jcubic.pl>
* Released under the MIT license
*
* Date: Sun, 08 Jan 2017 11:44:40 +0000
*/
.terminal .terminal-output .format, .cmd .format,
.cmd .prompt, .cmd .prompt div, .terminal .terminal-output div div{
display: inline-block;
}
.terminal h1, .terminal h2, .terminal h3, .terminal h4, .terminal h5, .terminal h6, .terminal pre, .cmd {
margin: 0;
}
.terminal h1, .terminal h2, .terminal h3, .terminal h4, .terminal h5, .terminal h6 {
line-height: 1.2em;
}
/*
.cmd .mask {
width: 10px;
height: 11px;
background: black;
z-index: 100;
}
*/
.cmd .clipboard {
position: absolute;
left: -16px;
top: 0;
width: 10px;
height: 16px;
/* this seems to work after all on Android */
/*left: -99999px;
clip: rect(1px,1px,1px,1px);
/* on desktop textarea appear when paste */
/*
opacity: 0.01;
filter: alpha(opacity = 0.01);
filter: progid:DXImageTransform.Microsoft.Alpha(opacity=0.01);
*/
background: transparent;
border: none;
color: transparent;
outline: none;
padding: 0;
resize: none;
z-index: 0;
overflow: hidden;
}
.terminal .error {
color: #f00;
}
.terminal {
padding: 10px;
position: relative;
/*overflow: hidden;*/
overflow: auto;
}
.cmd {
padding: 0;
height: 1.3em;
position: relative;
/*margin-top: 3px; */
}
.terminal .inverted, .cmd .inverted, .cmd .cursor.blink {
background-color: #aaa;
color: #000;
}
.cmd .cursor.blink {
-webkit-animation: terminal-blink 1s infinite steps(1, start);
-moz-animation: terminal-blink 1s infinite steps(1, start);
-ms-animation: terminal-blink 1s infinite steps(1, start);
animation: terminal-blink 1s infinite steps(1, start);
}
@-webkit-keyframes terminal-blink {
0%, 100% {
background-color: #000;
color: #aaa;
}
50% {
background-color: #bbb;
color: #000;
}
}

@-ms-keyframes terminal-blink {
0%, 100% {
background-color: #000;
color: #aaa;
}
50% {
background-color: #bbb;
color: #000;
}
}

@-moz-keyframes terminal-blink {
0%, 100% {
background-color: #000;
color: #aaa;
}
50% {
background-color: #bbb;
color: #000;
}
}
@keyframes terminal-blink {
0%, 100% {
background-color: #000;
color: #aaa;
}
50% {
background-color: #bbb; /* not #aaa because it's seems there is Google Chrome bug */
color: #000;
}
}

.terminal .terminal-output div div, .cmd .prompt {
display: block;
line-height: 14px;
height: auto;
}
.cmd .prompt {
float: left;
}
.terminal, .cmd {
font-family: monospace;
/*font-family: FreeMono, monospace; this don't work on Android */
color: #aaa;
background-color: #000;
font-size: 12px;
line-height: 14px;
}
.terminal-output > div {
/*padding-top: 3px;*/
min-height: 14px;
}
.terminal-output > div > div * {
word-wrap: break-word; /* when echo html */
}
.terminal .terminal-output div span {
display: inline-block;
}
.cmd span {
float: left;
/*display: inline-block; */
}
/* fix double style of selecting text in terminal */
.terminal-output span, .terminal-output a, .cmd div, .cmd span, .terminal td,
.terminal pre, .terminal h1, .terminal h2, .terminal h3, .terminal h4,
.terminal h5, .terminal h6 {
-webkit-touch-callout: initial;
-webkit-user-select: initial;
-khtml-user-select: initial;
-moz-user-select: initial;
-ms-user-select: initial;
user-select: initial;
}
.terminal, .terminal-output, .terminal-output div {
-webkit-touch-callout: none;
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
/* firefox hack */
@-moz-document url-prefix() {
.terminal, .terminal-output, .terminal-output div {
-webkit-touch-callout: initial;
-webkit-user-select: initial;
-khtml-user-select: initial;
-moz-user-select: initial;
-ms-user-select: initial;
user-select: initial;
}
}
.terminal table {
border-collapse: collapse;
}
.terminal td {
border: 1px solid #aaa;
}
.terminal h1::-moz-selection,
.terminal h2::-moz-selection,
.terminal h3::-moz-selection,
.terminal h4::-moz-selection,
.terminal h5::-moz-selection,
.terminal h6::-moz-selection,
.terminal pre::-moz-selection,
.terminal td::-moz-selection,
.terminal .terminal-output div div::-moz-selection,
.terminal .terminal-output div span::-moz-selection,
.terminal .terminal-output div div a::-moz-selection,
.cmd div::-moz-selection,
.cmd > span::-moz-selection,
.cmd .prompt span::-moz-selection {
background-color: #aaa;
color: #000;
}
/* this don't work in Chrome
.terminal tr td::-moz-selection {
border-color: #000;
}
.terminal tr td::selection {
border-color: #000;
}
*/
.terminal h1::selection,
.terminal h2::selection,
.terminal h3::selection,
.terminal h4::selection,
.terminal h5::selection,
.terminal h6::selection,
.terminal pre::selection,
.terminal td::selection,
.terminal .terminal-output div div::selection,
.terminal .terminal-output div div a::selection,
.terminal .terminal-output div span::selection,
.cmd div::selection,
.cmd > span::selection,
.cmd .prompt span::selection {
background-color: #aaa;
color: #000;
}
.terminal .terminal-output div.error, .terminal .terminal-output div.error div {
color: red;
}
.tilda {
position: fixed;
top: 0;
left: 0;
width: 100%;
z-index: 1100;
}
.clear {
clear: both;
}
.terminal a {
color: #0F60FF;
}
.terminal a:hover {
color: red;
}
16 changes: 16 additions & 0 deletions DockerTask2/css/jquery.terminal-0.11.23.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading