DomTerm is a free open-source feature-rich, modern terminal emulator and screen multiplexer (like tmux or GNU screen), which is based on web technologies and a rich-text console written mostly in JavaScript.
It uses libwebsockets as a backend and a byte-protocol to communicate with the back-end, this implies that you can invoke it in a browser using web sockets; embed it in a third-party application; or simply run it as a generic terminal emulator program.
DomTerm Terminal Emulator for Linux
DomTerm Features:
It is xterm-compatible and supports multiple sub-commands.
It comes with multiple applications which include a: xterm-compatible terminal emulator, command console, chat/talk window and a read-eval-print-loop for an interactive scripting language.
Supports multiplexing and sessions.
Its back-end allows for printing images, graphics as well as rich text.
Supports controlling of user preferences via a CSS file.
Supports keyboard shortcuts with smart line-wrapping.<./li>
Optionally allows for input editing and movement of cursor using mouse.
Supports preserving of TAB characters with automatic pagination.
Support draggable tabs and panes.
Automatically turn URLs and mail addresses in output into links and much more.
An experimental package atom-domterm for the Atom editor.
How to Install DomTerm Terminal Emulator in Linux
There are no pre-built DomTerm packages available, therefore you need to install it from source, but before downloading the source code and compiling it. First you need to install following dependencies on your respective Linux distributions using package manager as shown.
DomTerm also requires libwebsockets version 2.2 or later. Therefore, you need to build and install the latest version from source as shown.
$ cd ~/Downloads
$ git clone https://github.com/warmcat/libwebsockets
$ cd libwebsockets
$ mkdir build
$ cd build
$ cmake -DLWS_WITH_SSL=0 -DLWS_WITH_ZIP_FOPS=1 . .
$ make
Next clone the DomTerm source repository, build and install it using the following commands.
$ cd ~/Downloads/
$ git clone https://github.com/PerBothner/DomTerm
$ cd DomTerm
$ autoreconf
$ ./configure --with-qtwebengine --with-libwebsockets=$HOME/Downloads/libwebsockets/build
$ make
$ sudo make install
Once you have successfully installed DomTerm on your Linux distribution, you can search for it from your system menu or run the following command to launch it.
Linux commandline is the best and most powerful thing that fascinates a new user and provides extreme power to experienced users and geeks. For those who work on Server and Production, they are already aware of this fact. It would be interesting to know that Linux console was one of those first features of the kernel that was written by Linus Torvalds way back in the year 1991.
Terminal is a powerful tool that is very reliable as it does not have any movable part. Terminal serves as an intermediate between console and GUI environment. Terminal themselves are GUI application that run on top of a desktop environment. There are a lot of terminal application some of which are Desktop Environment specific and rest are universal. Terminator, Konsole, Gnome-Terminal, Terminology, XFCE terminal, xterm are a few terminal emulators to name.
Last day while surfing web, I came across a terminal namely ‘guake‘ which is a terminal for gnome. Though this is not the first time I have learned about Guake. I’d known this application nearly one year ago but somehow I could not write on this and later it was out of my mind until I heard it again. So finally the article is here. We will be taking you to Guake features, installation on Debian, Ubuntu and Fedora followed by quick testing.
What is Guake?
Guake is a Drop Down Terminal for Gnome Environment. Written from scratch mostly in Python and a little in C this application is released under GPLv2+ and is available for Linux and alike systems. Guake is inspired by a console in computer game Quake which slides down from the top by pressing a specially Key (Default is F12) and then slides-up when the same key is pressed.
Important to mention that Guake is not the first of this kind. Yakuake which stands for Yet Another Kuake, a terminal emulator for KDE Desktop Environment and Tilda which is a GTK+ terminal Emulator are also inspired by the same slide up/down console of computer game Quake.
Features of Guake
Lightweight
Simple Easy and Elegant
Functional
Powerful
Good Looking
Smooth integration of terminal into GUI
Appears when you call and disappear once you are done by pressing a predefined hot key
Support for hotkeys, tabs, background transparency makes it a brilliant application, must for every Gnome User.
Extremely configurable
Plenty of color palette included, fixed and recognized
Shortcut for transparency level
Run a script when Guake starts via Guake Preferences.
Able to run on more than one monitor
Guake 0.7.0 was released recently, which brings numerous fixes as well as some new features as discussed above. For complete Guake 0.7.0 changelog and source tarball packages can be found Here.
Installing Guake Terminal in Linux
If you are interested in compiling Guake from source you may download the source from the link above, build it yourself before installing.
However Guake is available to be installed on most of the distributions from repository or by adding an additional repository. Here, we will be installing Guake on Debian, Ubuntu, Linux Mint and Fedora systems.
First get the latest software package list from the repository and then install Guake from the default repository as shown below.
---------------- On Debian, Ubuntu and Linux Mint ----------------
$ sudo apt-get update
$ apt-get install guake
After installation, start the Guake from another terminal as:
$ guake
After starting it, use F12 (Default) to roll down and roll up the terminal on your Gnome Desktop.
Seems very beautiful specially the transparent background. Roll down… Roll up… Roll down… Roll up…. run command. Open another tab run command… Roll up… Roll down…
Guake Terminal in Action
If your wallpaper or working windows color don’t match you may like to change your wallpaper or reduce the transparency of the Guake terminal color.
Next is to look into Guake Properties to edit settings as per requirements. Run Guake Preferences either by running it from Application Menu or by running the below command.
$ guake --preferences
Guake Terminal Properties
Scrolling Properties..
Guake Scrolling Settings
Appearance Properties – Here you can modify text and background color as well as tune transparency.
Appearance Properties
Keyboard Shortcuts – Here you may edit and Modify Toggle key for Guage Visibility (default is F12).
Keyboard Shortcuts
Compatibility Setting – Perhaps you won’t need to edit it.
Compatibility Setting
Conclusion
This Project is not too young and not too old, hence has reached certain level of maturity and is quiet solid and works out of the box. For someone like me who need to switch between GUI and Console very often Guake is a boon. I don’t need to manage an extra window, open and close frequently, use tab among a huge pool of opened applications to find terminal or switch to different workspace to manage terminal now all I need is F12.
I think this is a must tool for any Linux user who makes use of GUI and Console at the same time, equally. I am going to recommend it to anyone who want to work on a system where interaction between GUI and Console is smooth and hassle free.
Terminal is one of the most important application in Linux which makes it possible for the end user to communicate to the Linux shell and pass instructions. There are several Terminal-like Application, available either in repository or by third party for most of the Standard Linux Distribution. But this time it is a bit different.
Yeah! We are going to test “Nautilus Terminal”. The name itself tells a lot about itself. The Nautilus is default file browser for GNOME Desktop Environment. Nautilus Terminal is an embedded terminal into the nautilus file browser.
What is Nautilus Terminal?
Nautilus Terminal is a Nautilus file browser embedded terminal, which follows your movement and automatically cd to your current directory. Nautilus Terminal makes it possible to work in command line while navigating in Real GUI.
Features of Nautilus Terminal
Completely compatible with Nautilus File Browser.
Designed to follow your movement and Instructions within directories.
Feature of Hide/Show Terminal in file browser, as required makes it very much useful.
Supports Copy and Paste in Terminal.
Supports Drag and Drop of files/folders in Terminal.
The Embedded Terminal is re-sizeable, as per need.
Install Nautilus Terminal in Linux
Nautilus can be downloaded from the link below. Download the correct package, according to your System architecture.
After Downloading the package which is in the form of *.tar.gz from its official website, as pointed out above, we need to do rest of it, as described below.
$ cd Downloads/
$ tar -zxvf nautilus-terminal_1.0_src.tar.gz
$ cd nautilus-terminal_1.0_src
# ./install.sh -i
Sample Output
:: Checking the Runtime Dependencies...
> Python (>= 2.6) [ OK ]
> PyGObject [ OK ]
> GObject Introspection (and Gtk) [MISS]
> VTE [MISS]
> Nautilus Python (>= 1.0) [MISS]
> Nautilus (>= 3.0) [ OK ]
E: Some dependencies are missing.
We need to resolve dependencies manually. These dependencies were required to be fixed on my Debian 6.0.9 (Squeeze). This may not be the case with you.
On Ubuntu/Debian/Linux Mint
On an Debian based systems, you can use the official PPA to install nautilus from repository as shown below.
After successful installation of Nautilus Terminal, we are ready to test it but before that it is necessary to restart nautilus as.
$ nautilus -q
Next, start the nautilus terminal using the following command.
$ nautilus
Nautilus Terminal
Conclusion
Nautilus Terminal is a wonderful tool, which lets your execution in GUI to be visible in embedded command line and Vice-versa. It is a very nice tool for those newbies who are afraid of Linux command Line and/or Newbie.
There are multiple terminal emulators you can find on the Linux platform today, with each of them offering users some remarkable features.
But sometimes, we find it difficult to choose which terminal emulator to work with, depending on our preferences. In this overview, we shall cover one exciting terminal emulator for Linux called Tilix.
Tlix (previously called Terminix – name changed due to a trademark issue) is a tiling terminal emulator that uses GTK+ 3 widget called VTE (Virtual Terminal Emulator). It is developed using GTK 3 with aims of conforming to GNOME HIG (Human Interface Guidelines).
Additionally, this application has been tested on GNOME and Unity desktops, although users have also tested it successfully on various other Linux desktops environments.
Just like the rest of Linux terminal emulators, Tilix comes with some illustrious features and these include:
Enables users to layout terminals in any style by splitting them vertically or horizontally
Supports drag and drop functionality to re-arrange terminals
Supports detaching of terminals from windows using drag and drop
Supports input synchronization between terminals, therefore commands typed in one terminal can be reproduced in another
Terminal grouping can be saved and loaded from disk
Supports transparent backgrounds
Allows use of background images
Supports automatic profile switches based on hostname and directory
Also supports notification for out of view process completion
Color schemes stored in files and new files can be created for custom color schemes
How to Install Tilix on Linux Systems
Let us now uncover the steps you can follow to install Tilix on the various Linux distributions, but before we move any further, we have to list the various requirements for Tilix to work on Linux.
Dependencies
To work very well, the application requires the following libraries:
GTK 3.14 and above
GTK VTE 0.42 and above
Dconf
GSettings
Nautilus-Python for Nautilus integration
If you have all the above requirements on your system, then proceed to install Tilix as follows.
On RHEL/CentOS 7 and Fedora 22-27
First, you need to add the package repository by creating a file /etc/yum.repos.d/tilix.repo using your favorite text editor as follows.
# vi /etc/yum.repos.d/tilix.repo
Then copy and paste the text below into the file above:
[ivoarch-Tilix]
name=Copr repo for Tilix owned by ivoarch
baseurl=https://copr-be.cloud.fedoraproject.org/results/ivoarch/Tilix/epel-7-$basearch/
type=rpm-md
skip_if_unavailable=True
gpgcheck=1
gpgkey=https://copr-be.cloud.fedoraproject.org/results/ivoarch/Tilix/pubkey.gpg
repo_gpgcheck=0
enabled=1
enabled_metadata=1
Save the file and exit.
Then update your system and install Tilix as shown:
OpenSUSE users can install tilix from the default repository and Arch Linux users can install the AUR Tilix package.
# pacman -S tilix
Tilix Screenshot Tour
Tilix with Two Horizontal Linux Terminal Windows
Tilix with Two Vertical Linux Terminal Windows
Tilix with One Vertical and Two Horizontal Linux Terminals
Tilix with Multiple Linux Terminal Windows
How to Uninstall or Remove Tilix Terminal
In case you installed it manually and want to remove it, then you can follow the steps below to uninstall it. Download the uninstall.sh from Github repository, make it executable and then run it:
In this overview, we have looked at an important Linux terminal emulator that is just an alternative to the multiple terminal emulators out there. Having installed it you can try out the different features and also compare it with the rest that you have probably used.
Importantly, for any questions or extra information that you have about Tilix, please use the comment section below and do not forget to also give us feedback about your experience with it.
A Terminal emulator is a computer program that reproduces a video terminal within some other display structure. In other words the Terminal emulator has an ability to make a dumb machine appear like a client computer networked to the server. The terminal emulator allows an end user to access console as well as its applications such as text user interface and command line interface.
20 Linux Terminal Emulators
You may find huge number of terminal emulators to choose from this open source world. Some of them offers large range of features while others offers less features. To give a better understanding to the quality of software that are available, we have gathered a list of marvelous terminal emulator for Linux. Each title provides its description and feature along with screenshot of the software with relevant download link.
1. Terminator
Terminator is an advanced and powerful terminal emulator which supports multiple terminals windows. This emulator is fully customizable. You can change the size, colour, give different shapes to the terminal. Its very user friendly and fun to use.
Features of Terminator
Customize your profiles and colour schemes, set the size to fit your needs.
Use plugins to get even more functionality.
Several key-shortcuts are available to speed up common activities.
Split the terminal window into several virtual terminals and re-size them as needed.
Tilda is a stylish drop-down terminal based on GTK+. With the help of a single key press you can launch a new or hide Tilda window. However, you can add colors of your choice to change the look of the text and Terminal background.
Features of Tilda
Interface with Highly customization option.
You can set the transparency level for Tilda window.
Guake is a python based drop-down terminal created for the GNOME Desktop Environment. It is invoked by pressing a single keystroke, and can make it hidden by pressing same keystroke again. Its design was determined from FPS (First Person Shooter) games such as Quake and one of its main target is be easy to reach.
Guake is very much similar to Yakuaka and Tilda, but it’s an experiment to mix the best of them into a single GTK-based program. Guake has been written in python from scratch using a little piece in C (global hotkeys stuff).
Yakuake (Yet Another Kuake) is a KDE based drop-down terminal emulator very much similar to Guake terminal emulator in functionality. It’s design was inspired from fps consoles games such as Quake.
Yakuake is basically a KDE application, which can be easily installed on KDE desktop, but if you try to install Yakuake in GNOME desktop, it will prompt you to install huge number of dependency packages.
ROXterm is yet another lightweight terminal emulator designed to provide similar features to gnome-terminal. It was originally constructed to have lesser footprints and faster start-up time by not using the Gnome libraries and by using a independent applet to bring the configuration interface (GUI), but over the time it’s role has shifted to bringing a higher range of features for power users.
However, it is more customizable than gnome-terminal and anticipated more at “power” users who make excessive use of terminals. It is easily integrated with GNOME desktop environment and provides features like drag & drop of items into terminal.
Eterm is a lightest color terminal emulator designed as a replacement for xterm. It is developed with a Freedom of Choice ideology, leaving as much power, flexibility, and freedom as workable in the hands of the user.
Rxvt stands for extended virtual terminal is a color terminal emulator application for Linux intended as an xterm replacement for power users who don’t need to have a feature such as Tektronix 4014 emulation and toolkit-style configurability.
Wterm is a another light weight color terminal emulator based on rxvt project. It includes features such as background images, transparency, reverse transparency and an considerable set or runtime options are accessible resulting in a very high customizable terminal emulator.
LXTerminal is a default VTE-based terminal emulator for LXDE (Lightweight X Desktop Environment) without any unnecessary dependency. The terminal has got some nice features such as.
LXTerminal Features
Multiple tabs support
Supports common commands like cp, cd, dir, mkdir, mvdir.
TermKit is a elegant terminal that aims to construct aspects of the GUI with the command line based application using WebKit rendering engine mostly used in web browsers like Google Chrome and Chromium. TermKit is originally designed for Mac and Windows, but due to TermKit fork by Floby which you can now able to install it under Linux based distributions and experience the power of TermKit.
GNOME terminal is a built-in terminal emulator for GNOME desktop environment developed by Havoc Pennington and others. It allow users to run commands using a real Linux shell while remaining on the on the GNOME environment. GNOME Terminal emulates the xterm terminal emulator and brings a few similar features.
The Gnome terminal supports multiple profiles, where users can able to create multiple profiles for his/her account and can customize configuration options such as fonts, colors, background image, behavior, etc. per account and define a name to each profile. It also supports mouse events, url detection, multiple tabs, etc.
Final Term is a open source stylish terminal emulator that has some exciting capabilities and handy features into one single beautiful interface. It is still under development, but provides significant features such as Semantic text menus, Smart command completion, GUI terminal controls, Omnipotent keybindings, Color support and many more. The following animated screen grab demonstrates some of their features. Please click on image to view demo.
Terminology is yet another new modern terminal emulator created for the Enlightenment desktop, but also can be used in different desktop environments. It has some awesome unique features, which do not have in any other terminal emulator.
Apart features, terminology offers even more things that you wouldn’t assume from a other terminal emulators, like preview thumbnails of images, videos and documents, it also allows you to see those files directly from Terminology.
You can watch a following demonstrations video created by the Terminology developer (the video quality isn’t clear, but still it’s enough to get the idea about Terminology).
Xfce terminal is a lightweight modern and easy to use terminal emulator specially designed for Xfce desktop environment. The latest release of xfce terminal has some new cool features such as search dialog, tab color changer, drop-down console like Guake or Yakuake and many more.
The xterm application is a standard terminal emulator for the X Window System. It maintain DEC VT102 and Tektronix 4014 compatible terminals for applications that can’t use the window system directly.
The LilyTerm is a another less known open source terminal emulator based off of libvte that desire to be fast and lightweight. LilyTerm also include some key features such as:
Support for tabbing, coloring and reordering tabs
Ability to manage tabs through keybindings
Support for background transparency and saturation.
The sakura is a another less known Unix style terminal emulator developed for command line purpose as well as text-based terminal programs. Sakura is based on GTK and livte and provides not more advanced features but some customization options such as multiple tab support, custom text color, font and background images, speedy command processing and few more.
The rxvt-unicode (also known as urxvt) is a yet another highly customizable, lightweight and fast terminal emulator with xft and unicode support was developed by Marc Lehmann. It got some outstanding features such as support for international language via Unicode, the ability to display multiple font types and support for Perl extensions.
eDEX-UI is a geeky, fullscreen, highly configurable and cross-platform desktop application resembling a movie-like futuristic computer interface, that runs on Linux, Windows and MacOS. It creates the illusion of a desktop environment without windows.
It is heavily inspired from DEX-UI and the TRON Legacy movie effects. It uses a number of open-source libraries, frameworks and tools. It was designed and intended to be used on devices with large touchscreens, but it works well on a regular desktop computer or perhaps a tablet PC or laptops with touchscreens.
eDEX-UI runs the shell of your choice in a real terminal, and displays live system information about the CPU, memory, temperature, top processes, and network. By default, eDEX runs bash on Linux, but this is configurable. It also has a file manager, and an onscreen keyboard. It comes with various customization options, including multiple themes that you can load from the interface itself.
eDEX-UI – Linux Terminal Emulator
This application is not built for doing any practical work on your system; it just makes your device or computer feel insanely geeky. You can use it to impress your friends or colleagues at work or any one around you.
How to Install eDEX-UI Terminal Emulator in Linux
To install eDEX-UI, download the pre-compiled binaries available on the release page using following wget utility from the command line as shown.
You will be asked “Would you like to integrate eDEX-UI.Linux.x86_64.AppImage with your system?”, click on Yesto continue.
The application with boot up, once the process is complete, you will be connected to the eDEX-UI frontend, with the default theme.
eDEX-UI Terminal Emulator
To change the theme, under FILESYSTEM, click on themes directory, then click on the .json file for the theme you want to use (you can do the same to change the fonts or keyboard settings).
The following screenshot shows the blade theme.
eDEX-UI Blade Theme
To exit the application, type “exit” in the terminal embedded in its interface, or simply press Alt + F4.
Attention: The onscreen keyboard displays each key you press on the keyboard (it shows what you are typing), so you probably shouldn’t type passwords while using this application. Secondly, if you observe carefully from the list of top processes, eDEX-UI consumes a lot of CPU and RAM. These are some of its downsides.
That’s all! eDEX-UI is a geeky, fullscreen and cross-platform desktop application resembling a sci-fi futuristic computer interface. Its not built for doing any practical work your system, but to make your device or computer feel insanely geeky.
Terminator is a terminal emulator released under General Public License and is available for GNU/LinuxPlatform. The application program lets you use multiple splitted and resized terminals, all at once on a single screen similar to tmux terminal multiplexer.
How it is Different
Having multiple Gnome Terminal in one window in a very flexible manner is a plus for Linux nerds.
Who Should use It
Terminator is aimed at those who normally arrange lots of terminals near each other, but don’t want to use a frame based window manager.
What are its Features
Automatically logs of all the terminal sessions.
Drag and Drop features for text and URLs.
Horizontal scrolling is supported.
Find, a function to search for any specific text within the terminal.
Support for UTF8.
Intelligent Quit – It knows about the running process, if any.
Vertical scrolling is convenient.
Freedom of use, General Public License.
Support for Tab based Browsing.
Portal written in Python.
Platform – Support for GNU/Linux Platform.
Installation of Terminator Emulator on Linux
On most of the standard Linux Distributions, terminator 0.97 version is available in the repository, and cab be installed using apt or yum.
On RHEL/CentOS/Fedora
First, you need to enable RPMForge repository under your system and then you install Terminator emulator using yum command as shown.
# yum install terminator
On Debian/Ubuntu/Linux Mint
On Debian based distributions, you can easily install using apt-get command as shown.
# apt-get install terminator
How to use Terminator
Run the “terminator” command in the terminal to use it. Once, you fire the command you will see a screen similar to below.
Terminator Terminal Window
Terminal Emulator Keyboard Shortcuts
To get the most out of Terminator it is crucial to know the key-bindings to control Terminator. The default shortcut keys that I use most are shown below.
Split Terminal Horizontally – Ctrl+Shift+0
Split Terminal Windows
Split Terminal Vertically – Ctrl+Shift+E
Split Terminal Vertically
Move Parent Dragbar Right – Ctrl+Shift+Right_Arrow_key
Move Parent Dragbar Left – Ctrl+Shift+Left_Arrow_key
Move Parent Dragbar Up – Ctrl+Shift+Up_Arrow_key
Move Parent Dragbar Down – Ctrl+Shift+Down_Arrow_key
Hide/Show Scrollbar – Ctrl+Shift+s
Hide/Show Terminal Scrollbar
Note: Check the hidden scrollbar above, it can again be made visible using the same above key combination.
Search for a Keyword – Ctrl+Shift+f
Move to Next Terminal – Ctrl+Shift+N or Ctrl+Tab
Move to Next Terminal
Move to the Above Terminal – Alt+Up_Arrow_Key
Move to the Below Terminal – Alt+Down_Arrow_Key
Move to the Left Terminal – Alt+Left_Arrow_Key
Move to the Right Terminal – Alt+Right_Arrow_Key
Copy a text to clipboard – Ctrl+Shift+c
Paste a text from Clipboard – Ctrl+Shift+v
Close the Current Terminal – Ctrl+Shift+w
Quit the Terminator – Ctrl+Shift+q
Toggle Between Terminals – Ctrl+Shift+x
Open New Tab – Ctrl+Shift+t
Move to Next Tab – Ctrl+page_Down
Move to Previous Tab – Ctrl+Page_up
Increase Font size – Ctrl+(+)
Decrease Font Size – Ctrl+()
Reset Font Size to Original – Ctrl+0
Toggle Full Screen Mode – F11
Reset Terminal – Ctrl+Shift+R
Reset Terminal and Clear Window – Ctrl+Shift+G
Remove all the terminal grouping – Super+Shift+t
Group all Terminal into one – Super+g
Note: Super is a key with the windows logo right of left CTRL.
We will see what is the use of SciPy library in Python and how it helps us to work with mathematical equations and algorithms in an interactive manner. The good thing about SciPy Python package is that if we want classes or construct web pages, SciPy is fully compatible with the system as a whole and can provide seamless integration.
As SciPy is open source, it has a very active and vibrant community of developers due to which there are enormous number of modules present for a vast amount of scientific applications and calculations available with SciPy. Some of the complex mathematical operations which can be performed with SciPy are:
Interpolation
Integration
Optimization
Image processing
Statistics
Special function calculations etc.
SciPy can be compared to most command and standard libraries like GSL library for C++ and Matlab. As SciPy is built on top of NumPy package, these two packages can be integrated completely as well. If you can think of a mathematical operation which needs to be done, make sure you check SciPy library before you implement that module on your own because in most cases, SciPy have all the operations for you fully implemented already.
Install SciPy Library
Let’s install SciPy library before we move to the actual examples and concepts. There are two ways to install this package. First one includes using the Python package manager, pip:
pip install scipy
The second way relates to Anaconda, we can install the package as:
conda install -c anaconda scipy
Once the library is installed, we can import it as:
import scipy
Finally, as we will be using NumPy as well (It is recommended that for all NumPy operations, we use NumPy directly instead of going through the SciPy package):
import numpy
It is possible that in some cases, we will also like to plot our results for which we will use the Matplotlib library. Perform the following import for that library:
import matplotlib
I will be using the Anaconda manager for all the examples in this lesson. I will launch a Jupyter Notebook for the same:
Now that we are ready with all the import statements to write some code, let’s start diving into SciPy package with some practical examples.
Working with Polynomial Equations
We will start by looking at simple Polynomial equations. There are two ways with which we can integrate Polynomial functions into our program. We can make use of poly1d class which makes use of coefficients or the roots of a polynomial for initialising a polynomial. Let’s look at an example:
from numpy import poly1d
first_polynomial = poly1d([3,4,7]) print(first_polynomial)
When we run this example, we will see the following output:
Clearly, the polynomial representation of the equation is printed as the output so that the result is pretty easy to understand. We can perform various operations on this polynomial as well, like square it, find its derivative or even solve it for a value of x. Let’s try doing all of these in the next example:
print(“Derivative of Polynomial: \n“) print(first_polynomial.deriv())
print(“Solving the Polynomial: \n“) print(first_polynomial(3))
When we run this example, we will see the following output:
Just when I was thinking that this is all we could do with SciPy, I remembered that we can integrate a Polynomial as well. Let’s run a final example with Polynomials:
print(“Integrating the Polynomial: \n“) print(first_polynomial.integ(1))
The integer we pass tells the package how many times to integrate the polynomial:
We can simply pass another integer which tells the package how many times to integrate this polynomial.
Solving Linear Equations
It is even possible to solve linear equations with SciPy and find their roots, if they exist. To solve linear equations, we represent the set of equations as NumPy arrays and their solution as a separate NumPy arrays. Let’s visualise it with an example where we do the same and make use of linalg package to find the roots of the equations, here are the equations we will be solving:
print(“\n Dot product should be zero if the solutions are correct:”) print(equation.dot(roots) – solution)
When we run the above program, we will see that the dot product equation gives zero result, which means that the roots which the program found were correct:
Fourier Transformations with SciPy
Fourier Transformations helps us to express a function as separate components that make up that function and guides us about the way through which we can recombine those components to get the original function back.
Let’s look at a simple example of Fourier Transformations where we plot the sum of two cosines using the Matplotlib library:
Here, we started by constructing a sample space and cosine equation which we then transformed and plotted. Here is the output of the above program:
This is one of the good example where we see SciPy being used in a complex mathematical equation to visualise things easily.
Vectors and Matrix with SciPy
Now that we know a lot of things which SciPy is capable of, we can be sure that SciPy can also work with Vectors and Matrix. The matrices are an important part of linear algebra as matrices is something we use to represent Vector mappings as well.
Just like we looked at solving linear equations with SciPy, we can represent vectors with np.array() functions. Let’s start by constructing a matrix:
Whenever we talk about matrices, we always talk about Eigenvalues and Eigenvectors. To put in simple words, Eigenvectors are the vectors which, when multiplied with a matrix, do not change their direction, as opposed to most of the vectors. This means that even when you multiply an Eigenvectors with a matrix, there exists a value (or eigenvalue) which is one of the factor of the multiplication. This means:
Ax = λx.
In above equation, A is the matrix, λ is the Eigenvalue and x is the Vector. Let’s write a simple code snippet to find the Eigenvalues for a given Vector:
la, vector = linalg.eig(my_matrix)
print(vector[:,0]) print(vector[:,1])
print(linalg.eigvals(my_matrix))
When we run this example, we will see the following output:
Calculating Matrix Determinant
The next operation we will carry out with SciPy is to calculate the determinant of a 2-dimensional matrix. We will reuse the matrix we used in the last code snippet here:
linalg.det( my_matrix )
When we run this example, we will see the following output:
Conclusion
In this lesson, we looked at a lot of good examples where SciPy can help us by carrying out complex mathematical computations for us with an easy to use API and packages.
In Hollywood movies, hacking always seems interesting, especially because the whole action is spiced up with fancy desktop environments/backgrounds, rapidly uncontrolled typing (with loud typing noise/keystrokes) and rapid scrolling of command output on colorful terminals.
To make it all seem real, the hackers normally keep on explaining real-world hacking concepts (and mentioning used tools/commands) while breaking into computer systems or networks and the action gets done in a matter of seconds or minutes, which is far different from the practical real-world scenario.
However, if you want to get a feel of hacking in the movies, easily on your Linux console, then you need to install the Hollywood terminal emulator: developed by Canonical’s Dustin Kirkland.
Watch how Hollywood Terminal works:
This terminal emulator produces Hollywood melodrama technobabble in your byobu console. In this article, we will show you how to setup the byubo console and Hollywood movies hackers’ terminal emulator in Ubuntu and it’s derivatives such as Linux Mint, Kubuntu etc.
First, add the appropriate repository to your system software sources, then update the packages’ sources list and finally install the packages as follows:
That’s all. Hope you find this interesting but remember real life hacking is complicated, you need to take time to learn, understand and penetrate operating systems or applications and beyond.
If you know of any similar fancy command line utilities out there, do share with us including any other thoughts about this article
GoTTY is a simple GoLang based command line tool that enables you to share your terminal(TTY) as a web application. It turns command line tools into web applications.
It employs Chrome OS’ terminal emulator (hterm) to execute a JavaScript based terminal on a web browsers. And importantly, GoTTY runs a web socket server that basically transfers output from the TTY to clients and receives input from clients (that is if input from clients is permitted) and forwards it to the TTY.
The command above will install the GoTTY binary in your GOBIN environment variable, try to check if that is the case:
# ls $GOPATH/bin/
Check GOBIN Environment
How To Use GoTTY in Linux
To run it, you can use the GOBIN env variable and command auto-completion feature as follows:
# $GOBIN/gotty
Else, run GoTTY or any other Go program without typing the full path to the binary, add your GOBIN variable to PATH in the ~/.profile file using the export command below:
export PATH="$PATH:$GOBIN"
Save the file and close it. Then source the file to effect the changes above:
Now run GoTTY with any command such as the df command to view system disk partitions space and usage from the web browser:
# gotty df -h
GoTTY will start a web server at port 8080 by default. Then open the URL: http://127.0.0.1:8080/ on your web browser and you will see the running command as if it were running on your terminal:
Gotty Linux Disk Usage
How To Customize GoTTY in Linux
You can alter default options and your terminal (hterm) in the profile file ~/.gotty, it will load this file by default in case it exists.
This is the main customization file read by gotty commands, so, create it as follows:
# touch ~/.gotty
And set your own valid values for the config options (find all config options here) to customize GoTTY for example:
// Listen at port 9000 by default
port = "9000"
// Enable TSL/SSL by default
enable_tls = true
// hterm preferences
// Smaller font and a little bit bluer background color
preferences {
font_size = 5,
background_color = "rgb(16, 16, 32)"
}
You can set your own index.html file using the --index option from the command line:
# gotty --index /path/to/index.html uptime
How to Use Security Features in GoTTY
Because GoTTY doesn’t offer reliable security by default, you need to manually use certain security features explained below.
Permit Clients to Run Commands/Type Input in Terminal
Note that, by default, GoTTY doesn’t permit clients to type input into the TTY, it only enables window resizing.
However, you can use the -w or --permit-write option to allow clients to write to the TTY, which is not recommended due to security threats to the server.
The following command will use vi command line editor to open the file fossmint.txt for editing in the web browser:
# gotty -w vi fossmint.txt
Below is the vi interface as seen from the web browser (use vi commands here as usual):
Gotty Web Vi Editor
Use GoTTY with Basic (Username and Password) Authentication
Try to activate a basic authentication mechanism, where clients will be required to input the specified username and password to connect to the GoTTY server.
The command below will restrict client access using the -c option to ask users for specified credentials (username: test and password: @67890):
# gotty -w -p "9000" -c "test:@67890" glances
Gotty with Basic Authentication
Gotty Generate Random URL
Another way of restricting access to the server is by using the -r option. Here, GoTTY will generate a random URL so that only users who know the URL can get access to the server.
Also use the –title-format “GoTTY – {{ .Command }} ({{ .Hostname }})” option to define the web browsers interface title and glances command is used to show system monitoring stats:
The following is result of the command above as seen from the web browser interface:
Gotty Random URL for Glances Linux Monitoring
Use GoTTY with SSL/TLS
Because by default, all connections between the server and clients are not encrypted, when you send secret information through GoTTY such as user credentials or any other info, you have to use the -t or --tls option which enables TLS/SSL on the session:
GoTTY will by default read the certificate file ~/.gotty.crt and key file ~/.gotty.key, therefore, start by creating a self-signed certification as well as the key file using the openssl command below (answer the question asked in order to generate the cert and key files):
You can make use of terminal multiplexers for sharing a single process with multiple clients, the following command will start a new tmux session named gotty with glances command (make sure you have tmux installed):
# gotty tmux new -A -s gotty glances
To read a different config file, use the –config “/path/to/file” option like so: