TLP – Quickly Increase and Optimize Linux Laptop Battery Life

TLP is a free open source, feature-rich and command line tool for advanced power management, which helps to optimize battery life in laptops powered by Linux. It runs on every laptop brand, and ships in with a default configuration already tunned to effectively and reliably maintain battery life, so you can simply install and use it.

It performs power saving by allowing you to configure how devices such as CPU, disk, USBs, PCIs, radio devices should utilize power when your laptop is running on battery.

TLP Features:

  • It is highly configurable through various power saving parameters.
  • It uses automated background tasks.
  • Uses kernel laptop mode and dirty buffer timeouts.
  • Supports processor frequency scaling including “turbo boost” and “turbo core”.
  • Has a power aware process scheduler for multi-core/hyper-threading.
  • Provides for runtime power management for PCI(e) bus devices.
  • PCI Express active state power management (PCIe ASPM).
  • Supports radeon graphics power management (KMS and DPM).
  • Has a I/O scheduler (per disk).
  • Offers USB autosuspend with blacklist.
  • Supports Wifi power saving mode.
  • Also offers Audio power saving mode.
  • Offers hard disk advanced power management level and spin down timeout (per disk).
  • Also supports SATA aggressive link power management (ALPM) and so much more.

How to Install TLP Battery Management Tool in Linux

TLP package can be easily installed on Ubuntu as well as corresponding Linux Mint using TLP-PPA repository as shown.

$ sudo add-apt-repository ppa:linrunner/tlp
$ sudo apt-get update
$ sudo apt-get install tlp tlp-rdw 

On Debian add the following line to your /etc/apt/sources.list file and then update the system package cache and install it.

# echo "deb http://ftp.debian.org/debian jessie-backports main" >> /etc/apt/sources.list
# apt-get update # apt-get install tlp tlp-rdw 


On Fedora, Arch Linux and OpenSuse, execute the following command as per your distribution.

# dnf install tlp tlp-rdw [On Fedora]
# pacman -S tlp tlp-rdw [On Arch Linux]
# zypper install tlp tlp-rdw [On OpenSUSE]

How to Use TLP to Optimize Battery Life in Linux

Once you have installed TLP, its configuration file is /etc/default/tlp and you will have the following commands to use:

  • tlp – apply laptop power saving settings
  • tlp-stat – displays all power saving settings
  • tlp-pcilist – displays PCI(e) device data
  • tlp-usblist – for viewing USB devices data

It should start automatically as a service, you can check if it is running under SystemD using systemctl command.

$ sudo systemctl status tlp

After the service starts running, you have to restart the system to actually start using it. But you can prevent this by manually applying the current laptop power saving settings with root privileges using the sudo command, like so.

$ sudo tlp start 

Afterwards, confirm that it is running using the following command, which actually shows system information and TLP status.

$ sudo tlp-stat -s 
Show System and TLP Information

Show System and TLP Information

Important: As we mentioned before, it uses automated background tasks but you will not see any TLP background process or daemon in ps command output.

To view current TLP configuration, run the following command with -c option.

$ sudo tlp-stat -c
Show TLP Configuration

Show TLP Configuration

To display all power settings run the following command.

$ sudo tlp-stat
Show Power Saving Settings

Show Power Saving Settings

To display Linux battery information, run the following command with -b switch.

$ sudo tlp-stat -b
Show Linux Battery Information

Show Linux Battery Information

To display Temperatures and Fan Speed of system, run the following command with -t switch.

$ sudo tlp-stat -t
Show CPU Temperature and Fan Speed

Show CPU Temperature and Fan Speed

To display Processor Data, run the following command with -p switch.

$ sudo tlp-stat -p
Show Processor Data

Show Processor Data

To display any Warnings, run the following command with -w switch.

$ sudo tlp-stat -w

Note: If your are using ThinkPad, there are certain specific packages you need to install for your distribution, that you can check from the TLP homepage. You will also find more information and a number of other usage commands there.

Read Also: PowerTop – Monitors Total Power Usage and Improve Linux Laptop Battery Life

TLP is a useful tool for all laptops powered by Linux operating systems. Give us your thought about it via the comment form below, and you can let us know of any other similar tools you have come across as well.

A school in India defies the traditional education model

Located in a sleepy village just two hours away from the bustling metropolis of Mumbai is a school that defies traditional educational models by collaboratively owning, building, and sharing knowledge and technology. The school uses only open source software and hardware in its approach to learning, and takes pride in the fact that none of its students have used or even seen proprietary software, including the ubiquitous Windows operating system.

The Tamarind Tree School, located in Dahanu Taluka, Maharashtra, India, is an experiment in open education. Open education is a philosophy about how people produce, share, and build on knowledge and technology, advocating a world in which education is for social good, and everyone has equal opportunity and access to education, training, and knowledge.

Why open education?

The school’s founders believe that the commodification and ownership of knowledge is the primary reason for the inequity in access to quality educational resources. While the Internet may have created a proliferation of digital content and learning tools, the relationship between technology creation, knowledge building, access, and ownership remains skewed for most people in society.

The trend toward expensive primary schools in India, copyrights on learning videos, academic journals, and software, “free” educational apps, and the manufacturing of laptops and devices support the idea that knowledge is owned and controlled by a few.

Many people confuse free usage with free access. But freedom such as ownership and collaboration among users is reduced or eliminated when learning communities do not feel empowered to build their own digital devices, set up their own networks, or create their own digital learning tools. As a result, many learners unknowingly become thieves (as seen in the rampant use of pirated software in India) or compromise their fundamental freedom to own and engage with the digital world on their terms. This reality is even more grim in rural India, where disadvantaged communities are denied access or equal opportunity to the digital world.

How do we create a world where everyone enjoys access to quality education? One approach is to fundamentally change the way knowledge and technology are owned and controlled.

The open source movement offers a solution.

Open education is based on the premise that knowledge should be collaboratively built and shared by all. It believes in creating producers and collaborators of knowledge rather than consumers of it.

How we implement open education

Based on these values and philosophies, the Tamarind Tree school has been experimenting with several open source options:

1. Single-board computers

The school has been able to avoid proprietary hardware, thanks to the work of organizations around the world that build single-board computers. A single-board computer (SBC) is a complete computer built on a single circuit board, complete with microprocessor(s), memory, input/output (I/O), and other required features.

The school selected a robust, affordable SBC built by the Raspberry Pi Foundation, and uses it to teach children programming skills and computational thinking. Students at Tamarind Tree enjoy coding and programming using the visual programming tool Scratch on these hardy open source machines.

2. Open source gamified software and open educational resources

The school, which uses only open educational resources (OERs), employs a combination of open digital tools like Gcompris, Tux Math, Tux Paint, Jfraction, and programs from the open source KDE Community to teach English, math, and science in a fun, interactive manner.

3. My Big Campus learning management system

To enable relevant, contextual learning, Tamarind Tree set up its own learning management system, which is hosted on the open source platform Moodle. Students as young as 7 years old can log on to their courses, along with a facilitator, and are guided to different online and offline activities. The system also supports individualized learning. The curriculum hosted at My Big Campus is derived from the National Council of Educational Research and Training in New Delhi. Students enjoy answering quizzes, commenting on images and blogs, creating digital art, and more. Courses are created contextually, grading can be done online, and students can learn at their own pace.

4. E-library

Tamarind Tree also has a facility where any student with a digital device can read books, articles, or news reports from a collection of more than 3,000 resources hosted on the school’s e-library server. The e-library, which is updated continuously, has been set up on the single-board computer and uses the Calibre open source library management system to organize, tag, and upload resources. All books hosted on the server are in the public domain or hold a Creative Commons license.

As students build knowledge by creating and playing their own computer games and participating in other educational activities, teachers can customize course materials to fit the needs of individual learners through digital content and local resources. The school’s goal is to establish that knowledge and technology can be entirely built, owned, and controlled by learning communities by using open source educational resources.

Is the future of education open?

Open education can help build a society that can provide free and open access to education and knowledge for all people with a desire to learn. The Tamarind Tree School demonstrates the potential of creating an educational model that believes in the democratization of knowledge.

An introduction to Eclipse MicroProfile

Enterprise Java has been defined by two players: Spring on one side and Java Enterprise Edition on the other. The Java EE set of specifications was developed in the Java Community Process under the stewardship of Oracle. The current Java EE 8 was released in September 2017; the prior version came out in 2013.

Between those releases, the industry saw a lot of change, most notably containers, the ubiquitous use of JSON, HTTP/2, and microservices architectures. Unfortunately there was not much related activity around Java EE; but users of the many Java EE-compliant servers demanded adoption of those new technologies and paradigms.

As a result, a group of vendors and community members founded MicroProfile to develop new specifications for using Java EE in microservice architectures that could be added into future versions of Java EE.

The first release of MicroProfile, in summer 2016, included three existing standards to serve as a baseline. At the end of 2016, MicroProfile joined the Eclipse Foundation (which explains Eclipse in the name) to leverage Eclipse’s strong governance and intellectual property expertise.

In 2017, there were two additional releases, and the next one is right around the corner. MicroProfile aims to release an update roughly every three months with specific content in a time-boxed way. Releases consist of a series of specifications, each developed at its own pace, and the umbrella release contains all of the specifications’ current versions.

What’s in the box?

Sweets for my sweet, sugar for my honey.

Well, luckily not, as too much sugar is bad for your health. But the individual specifications do have some pretty tasty content. Development of new specifications started after the first release.

The specifications that make up MicroProfile 1.2, which was released at JavaOne 2017, are:

  • Metrics: Deals with telemetry data and how it is exposed in a uniform way. This includes data from the underlying Java virtual machine as well as data from applications.
  • Health: Reports whether a service is healthy. This is important for schedulers like Kubernetes to determine if an application (container) should be killed and a new one started.
  • Config: Provides a uniform way of relaying configuration data into the application independent of the configuration source.
  • Fault tolerance: Includes mechanisms to make microservices resilient to failures in the network or other services they rely on, such as defining timeouts for calls to remote services, retrying policies in case of failure, and setting fallback methods.
  • JWT propagation: JSON Web Token (JWT) is a token-based authentication/authorization system that allows to authenticate, authorize, and verify identities based on a security token. JWT propagation defines the interoperability and container integration requirements for JWT for use with Java EE style role-based access control.

The just-released MicroProfile 1.3 includes updates to some of the above and adds the following new specifications:

  • OpenTracing: A mechanism for distributed tracing of calls across a series of microservices.
  • OpenAPI: A way to document data models and REST APIs so they can be read by machines and automatically build client code from this documentation. OpenAPI was derived from the Swagger specification.
  • REST client: A type-safe REST client that builds on the standard JAX-RS client to do more heavy lifting so consumer code can rely on strongly typed data and method invocations.

Upcoming releases are expected to pick up some APIs and new API versions from Java EE 8, such as JSON-B 1.0, JSON-P 1.1, CDI 2.0, and JAX-RS 2.1.

Where can I learn more?

How can I get involved?

The main communication channel is the MicroProfile discussion group. All specifications have a GitHub repository under the Eclipse organization, so they are using GitHub issues and pull requests. Also, each specification usually has a Gitter discussion group.

If you have an idea for a new MicroProfile specification, join the discussion group, present your idea, and hack away. Once others support your idea, a new repository will be created, and the more formal process can begin.

How to Enable Syntax Highlighting in Vi/Vim Editor

One of the easiest ways to boost the readability and context of the text in a configuration file or your source code for various programing languages, is by using a text editor that supports “syntax highlighting”.

Syntax highlighting is a simple but useful component in most if not all text editors that are used for programming, scripting, or markup languages, which enables for displaying colored text, notably source code, in different colors (and possibly fonts) corresponding to the category of terms.

Read Also: 10 Reasons Why You Should Use Vi/Vim Text Editor in Linux

In this article, we will show how to turn on syntax highlighting temporarily or permanently in Vi/Vim text editor.


VIM is an alternative and advanced version of VI editor that enables Syntax highlighting feature in VI. Syntax highlighting means it can show some parts of text in another fonts and colors. VIM doesn’t show whole file but have some limitations in highlighting particular keywords or text matching a pattern in a file. By default VIM works on all Linux terminals, but some terminals have minimal highlighting capabilities to run.

VIM has another great feature that enable us to Turn Off or Turn On syntax highlighting using option syntax on and syntax off.

How to Install VIM

Most of the Linux system already included VIM package, if not then install it using YUM tool.

# yum -y install vim-enhanced

How to Enable Syntax Highlighting in VI and VIM

To enable Syntax Highlighting feature in VI editor, open the file called /etc/profile.

# vi /etc/profile

Add the alias function to VI by pointing to VIM in /etc/profile file. This file is used to set alias functions globally.

alias vi=vim

If you would like to set user specific aliases and functions, then you need to open the file .bashrc under user directory.

# vi /home/tecmint/.bashrc

Add the alias function. For example we set alias for tecmint user.

alias vi=vim

After making changes to file you need to reset the changes by executing following command.

# source /etc/profile
OR
# source /home/tecmint/.bashrc

Test Syntax Highlighting in Vi Editor

Open any example code of file with vi editor. By default Syntax Highlighting is automatically turned on in /etc/vimrc file.

Example of Syntax Highlighting in VI

Syntax Highlighting in Vi

Syntax Highlighting in Vi

Turn On or Turn Off Syntax Highlighting in VI

You can Turn On or Turn Off syntax highlighting by pressing ESC  button and use command as :syntax on and :syntax off in Vi editor. Refer example screenshots.

Turn On Syntax Highlighting in VI

Enable Syntax Highlighting in Vi Editor

Enable Syntax Highlighting in Vi Editor

Turn Off Syntax Highlighting in VI

Disable Syntax Highlighting in Vi Editor

Disable Syntax Highlighting in Vi Editor

If you are new to vi/vim, you will find the following guides useful:

  1. Learn Vi/Vim as a Full Text Editor in Linux
  2. Learn Useful Vi/Vim Editor Tricks and Tips in Linux
  3. 8 Interesting Vi/Vim Editor Tricks for Every Linux User
  4. How to Password Protect a Vim File in Linux

You can share with us any other useful vi/vim tips or tricks you have come across, via the comment form below.

20 Free Open Source Applications I Found in Year 2017

It is time to share a list of the best 20 Free and Open Source Software I found during the year 2017. Some of these programs may not be new in that they weren’t released for the first time in 2017, but they are new and have been helpful to me. It is in the spirit of sharing that I’m writing this article hoping you find some of these programs useful as well.

To begin, you may want to search for the program using your distribution’s package manager, like so:

Fedora and derivatives:

# yum search all package
Or
# dnf search all package

Debian and derivatives:

# aptitude search package


OpenSUSE and derivatives:

# zypper search package

Arch Linux and derivatives:

# pacman -Ss package

If your search returns no results, head over to the website of each tool where you will find the standalone package for download and installation instructions, along with information on dependencies.

1. SimpleScreenRecorder

You can use Simple Screen Recorder to make audio and video screen casts (entire screen or selected area). It is easy to install and use, but powerful at the same time.

We already covered Simple Screen Recorder in depth here: How to record programs and games using Simple Screen Recorder.

Simple Scree Recorder

Simple Scree Recorder

Website: http://www.maartenbaert.be/simplescreenrecorder/

2. Jaspersoft Studio

Jaspersoft Studio is a report designer program that allows you to create simple and sophisticated reports as well with charts, tabs, tables (and everything you can expect to see in a world-class report) and export them to a wide variety of formats (with PDF perhaps being the most common).

With Q&A forums and User groups, plus several samples and examples, the community web site is a great resource of help to master this versatile program.

Jaspersoft Studio

Jaspersoft Studio

Website: http://community.jaspersoft.com/

3. Visual Studio Code

Visual Studio Code has reached a significant level of popularity among web and cloud developers who are also Linux users since it provides a nice programming environment out of the box that supports extensions to add functionality.

Visual Studio Code

Visual Studio Code

Website: https://code.visualstudio.com/

4. TuxGuitar

If you’re like me and music (especially the guitar) is one of your passions, you’ll love this program, which will let you edit and play guitar tablatures like a pro.

TuxGuitar

TuxGuitar

Website: http://sourceforge.net/projects/tuxguitar/

5. Ekiga

An alternative to Microsoft’s Skype, Ekiga is a video conferencing and VoIP solution for GNOME in Linux (but also available for Windows).

Ekiga

Ekiga

Website: http://www.ekiga.org/

6. Childsplay

Great for parents with little children, Childsplay provides fun memory activities to learn sounds, images, letters, numbers, how to use input peripherals (keyboard and mouse) and more.

Childsplay

Childsplay

Website: http://childsplay.sourceforge.net/

7. Dia

As you will probably guess from its name and based on the image above, Dia is a versatile diagram editor comparable to Microsoft Visio. Besides the native shapes, others can be added very easily by editing a XML file. Diagrams can be exported to several known formats (EPS, SVG, XFIG, WMF and PNG, to name a few) for sharing and easier visualization.

Dia Diagram Editor

Dia Diagram Editor

Website: http://live.gnome.org/Dia

8. FreeCAD

FreeCAD is a general purpose 3D Computer-Aided Design program fit for use in engineering and architecture. Given the fact that FreeCAD is FOSS, it is easily customizable and extensible through the use of Python scripts.

FreeCAD

FreeCAD

Website: http://www.freecadweb.org/

9. Owncloud

Although not a new kid on the block in any way, I chose to include OwnCloud in this review due to its importance. As an alternative to commercial Dropbox, security and privacy are achieved without much hassle and allow you to easily set up a customized cloud storage and file sharing solution.

We already covered installation about Owncloud in depth here: Create Personal/Private Cloud Storage Solution in Linux

Owncloud Storage Solutions

Owncloud Storage Solutions

Website: http://www.owncloud.com

10. MediaWiki

MediaWiki is a program for creating and managing a Wikipedia-like website (in fact, Wikipedia itself is based on MediaWiki) where a community can add, remove, update and revert entries, and authors are notified upon such changes.

MediaWiki

MediaWiki

Website: http://www.mediawiki.org

11. Bleachbit

You can think of Bleachbit as the CCleaner for Linux – but more powerful. It will not only recover disk space by deleting temporary or otherwise unnecessary files, but will also improve Firefox performance and securely destroy unnecessary files to prevent recovery.

We already covered installation about Bleachbit in depth here: Disk Space Cleaner and Privacy Guard for Linux

Bleachbit

Bleachbit

Website: http://bleachbit.sourceforge.net/

12. CodeMirror

CodeMirror is a very powerful Javascript-based text editor for the web browser. CodeMirror includes syntax highlighting for over 100 languages and a robust API. If you own a website or blog that provides programming tutorials, you will find CodeMirror to be a very useful tool.

CodeMirror Syntax Highlighting

CodeMirror Syntax Highlighting

Website: http://codemirror.net

13. GNUMed (Client + Server)

Having been extensively tested by real doctors in their practice, GNUMed enable health professionals to keep a medical record of their patients history. To use GNUMed, you will need to install both the client and the server, and take necessary precautions to protect and back up data as you would do in any other case where information is highly valuable.

GNUMed

GNUMed

Website: http://wiki.gnumed.de

14. OCS Inventory NG

Open Computer and Software Inventory Next Generation, or OCS Inventory NG for short, is a lightweight web application that can help network and system administrators to keep track of 1) all the devices connected to the network, and 2) machine configuration and software installed in them.

The project’s website (listed below) has a fully functional demo in case you want to check it out before attempting to actually install the program. In addition, OCS Inventory NG relies on well-known technologies as Apache and MySQL / MariaDB, making it a robust program.

OCS Inventory NG

OCS Inventory NG

Website: http://www.ocsinventory-ng.org/en/

15. GLPI

Often used in conjunction with OCS Inventory NG, GLPI is a multilingual, free IT asset management software that not only provides the tools to build up a database with an inventory of your network devices, but also includes a job-tracking-system with mail notifications.

Other distinguishing features include, but are not limited to:

  1. Interventions history
  2. Solution approval
  3. Satisfaction survey
  4. Exporting inventory to PDF, spreadsheet, or PNG formats

We already covered installation about GLPI IT Asset Management tool in depth here: Install GLPI IT and Asset Management Tool in Linux

GLPI IT Asset Management

GLPI IT Asset Management

Website: http://glpi-project.org/spip.php?lang=en

16. Ampache

With Ampache, you can set up your own home media center or online audio and video streaming application and access it from anywhere with an Internet connection.

Although it is designed as a personal application, Ampache allows for public registration if an administrator chooses to enable that feature.

Ampache MP3 Steaming

Ampache MP3 Steaming

Website: http://ampache.org/

17. PDFEdit

As a complete pdf document editing solution, PDFEdit lets you edit and manipulate PDF documents very easily. PDFEditor includes a rich API that allows you to extend its native functionality through the use of scripts.

The website and the wiki provide detailed documentation on how to use and tweak PDFEdit.

PDFEdit PDF Editor

PDFEdit PDF Editor

Website: http://pdfedit.cz/

18. Lemon POS

If you own a small or medium business you will undoubtedly need a Point Of Sale program. As such, Lemon POS may be a lifesaver for you. It uses a MySQL / MariaDB database for data storage, and thus a single database can be used with multiple active terminals at the same time. On top of all that, Lemon POS also includes a search panel, a price-checker utility, and a tool to create printed reports.

Lemon POS

Lemon POS

Website: http://sourceforge.net/projects/lemonpos/

19. OpenShot

OpenShot is a FOSS video editor for Linux that can help you create “the film you have always dreamed of” (in the words of its developers) with your home videos, pictures, and music files. It also allows you to add subtitles, transition effects, and export the resulting video file to DVD and many other common formats.

OpenShot Video Editor

OpenShot Video Editor

Website: http://www.openshot.org

20. LAN Messenger

LAN Messenger is a multilingual (a language pack is needed) and cross-platform (works in Linux, Windows, and Mac) IM program for communication over a LAN. It provides file transfers, message logging, and event notifications – all without the need to set up a server!

LAN Messenger

LAN Messenger

Website: http://lanmsngr.sourceforge.net/

Summary

In this article I have described 20 free and open source applications that I have found during the year 2017, and hope that it sparks your interest in one or more of them.

Would you like us to cover any of them in greater detail on this site? Have you found another great FOSS application that you would like to share with the rest of the community? Just let us know using the comment form below. Questions, comments, and suggestions are also welcome.

PyCharm: Python IDE for Professional Developers

‘,
enableHover: false,
enableTracking: true,
buttons: { twitter: {via: ‘tecmint’}},
click: function(api, options){
api.simulateClick();
api.openPopup(‘twitter’);
}
});
jQuery(‘#facebook’).sharrre({
share: {
facebook: true
},
template: ‘{total}’,
enableHover: false,
enableTracking: true,
click: function(api, options){
api.simulateClick();
api.openPopup(‘facebook’);
}
});
jQuery(‘#googleplus’).sharrre({
share: {
googlePlus: true
},
template: ‘{total}’,
enableHover: false,
enableTracking: true,
urlCurl: ‘https://www.tecmint.com/wp-content/themes/tecmint/js/sharrre.php’,
click: function(api, options){
api.simulateClick();
api.openPopup(‘googlePlus’);
}
});
jQuery(‘#linkedin’).sharrre({
share: {
linkedin: true
},
template: ‘{total}’,
enableHover: false,
enableTracking: true,
buttons: {
linkedin: {
description: ‘PyCharm: Python IDE for Professional Developers’,media: ‘https://www.tecmint.com/wp-content/uploads/2018/01/Pycharm-Python-IDE.png’ }
},
click: function(api, options){
api.simulateClick();
api.openPopup(‘linkedin’);
}
});
// Scrollable sharrre bar, contributed by Erik Frye. Awesome!
var shareContainer = jQuery(“.sharrre-container”),
header = jQuery(‘#header’),
postEntry = jQuery(‘.entry’),
$window = jQuery(window),
distanceFromTop = 20,
startSharePosition = shareContainer.offset(),
contentBottom = postEntry.offset().top + postEntry.outerHeight(),
topOfTemplate = header.offset().top;
getTopSpacing();
shareScroll = function(){
if($window.width() > 719){ var scrollTop = $window.scrollTop() + topOfTemplate,
stopLocation = contentBottom – (shareContainer.outerHeight() + topSpacing);
if(scrollTop > stopLocation){
shareContainer.offset({top: contentBottom – shareContainer.outerHeight(),left: startSharePosition.left});
}
else if(scrollTop >= postEntry.offset().top-topSpacing){
shareContainer.offset({top: scrollTop + topSpacing, left: startSharePosition.left});
}else if(scrollTop 1024)
topSpacing = distanceFromTop + jQuery(‘.nav-wrap’).outerHeight();
else
topSpacing = distanceFromTop;
}
});
]]>

How to Get Domain and IP Address Information Using WHOIS Command

‘,
enableHover: false,
enableTracking: true,
buttons: { twitter: {via: ‘tecmint’}},
click: function(api, options){
api.simulateClick();
api.openPopup(‘twitter’);
}
});
jQuery(‘#facebook’).sharrre({
share: {
facebook: true
},
template: ‘{total}’,
enableHover: false,
enableTracking: true,
click: function(api, options){
api.simulateClick();
api.openPopup(‘facebook’);
}
});
jQuery(‘#googleplus’).sharrre({
share: {
googlePlus: true
},
template: ‘{total}’,
enableHover: false,
enableTracking: true,
urlCurl: ‘https://www.tecmint.com/wp-content/themes/tecmint/js/sharrre.php’,
click: function(api, options){
api.simulateClick();
api.openPopup(‘googlePlus’);
}
});
jQuery(‘#linkedin’).sharrre({
share: {
linkedin: true
},
template: ‘{total}’,
enableHover: false,
enableTracking: true,
buttons: {
linkedin: {
description: ‘How to Get Domain and IP Address Information Using WHOIS Command’,media: ‘https://www.tecmint.com/wp-content/uploads/2018/01/Whois-Command-Examples.png’ }
},
click: function(api, options){
api.simulateClick();
api.openPopup(‘linkedin’);
}
});
// Scrollable sharrre bar, contributed by Erik Frye. Awesome!
var shareContainer = jQuery(“.sharrre-container”),
header = jQuery(‘#header’),
postEntry = jQuery(‘.entry’),
$window = jQuery(window),
distanceFromTop = 20,
startSharePosition = shareContainer.offset(),
contentBottom = postEntry.offset().top + postEntry.outerHeight(),
topOfTemplate = header.offset().top;
getTopSpacing();
shareScroll = function(){
if($window.width() > 719){ var scrollTop = $window.scrollTop() + topOfTemplate,
stopLocation = contentBottom – (shareContainer.outerHeight() + topSpacing);
if(scrollTop > stopLocation){
shareContainer.offset({top: contentBottom – shareContainer.outerHeight(),left: startSharePosition.left});
}
else if(scrollTop >= postEntry.offset().top-topSpacing){
shareContainer.offset({top: scrollTop + topSpacing, left: startSharePosition.left});
}else if(scrollTop 1024)
topSpacing = distanceFromTop + jQuery(‘.nav-wrap’).outerHeight();
else
topSpacing = distanceFromTop;
}
});
]]>

How to View Configuration Files Without Comments in Linux

‘,
enableHover: false,
enableTracking: true,
buttons: { twitter: {via: ‘tecmint’}},
click: function(api, options){
api.simulateClick();
api.openPopup(‘twitter’);
}
});
jQuery(‘#facebook’).sharrre({
share: {
facebook: true
},
template: ‘{total}’,
enableHover: false,
enableTracking: true,
click: function(api, options){
api.simulateClick();
api.openPopup(‘facebook’);
}
});
jQuery(‘#googleplus’).sharrre({
share: {
googlePlus: true
},
template: ‘{total}’,
enableHover: false,
enableTracking: true,
urlCurl: ‘https://www.tecmint.com/wp-content/themes/tecmint/js/sharrre.php’,
click: function(api, options){
api.simulateClick();
api.openPopup(‘googlePlus’);
}
});
jQuery(‘#linkedin’).sharrre({
share: {
linkedin: true
},
template: ‘{total}’,
enableHover: false,
enableTracking: true,
buttons: {
linkedin: {
description: ‘How to View Configuration Files Without Comments in Linux’,media: ‘https://www.tecmint.com/wp-content/uploads/2017/12/View-Files-Without-Comments-in-Linux.png’ }
},
click: function(api, options){
api.simulateClick();
api.openPopup(‘linkedin’);
}
});
// Scrollable sharrre bar, contributed by Erik Frye. Awesome!
var shareContainer = jQuery(“.sharrre-container”),
header = jQuery(‘#header’),
postEntry = jQuery(‘.entry’),
$window = jQuery(window),
distanceFromTop = 20,
startSharePosition = shareContainer.offset(),
contentBottom = postEntry.offset().top + postEntry.outerHeight(),
topOfTemplate = header.offset().top;
getTopSpacing();
shareScroll = function(){
if($window.width() > 719){ var scrollTop = $window.scrollTop() + topOfTemplate,
stopLocation = contentBottom – (shareContainer.outerHeight() + topSpacing);
if(scrollTop > stopLocation){
shareContainer.offset({top: contentBottom – shareContainer.outerHeight(),left: startSharePosition.left});
}
else if(scrollTop >= postEntry.offset().top-topSpacing){
shareContainer.offset({top: scrollTop + topSpacing, left: startSharePosition.left});
}else if(scrollTop 1024)
topSpacing = distanceFromTop + jQuery(‘.nav-wrap’).outerHeight();
else
topSpacing = distanceFromTop;
}
});
]]>

How to Send a Message to Logged Users in Linux Terminal

‘,
enableHover: false,
enableTracking: true,
buttons: { twitter: {via: ‘tecmint’}},
click: function(api, options){
api.simulateClick();
api.openPopup(‘twitter’);
}
});
jQuery(‘#facebook’).sharrre({
share: {
facebook: true
},
template: ‘{total}’,
enableHover: false,
enableTracking: true,
click: function(api, options){
api.simulateClick();
api.openPopup(‘facebook’);
}
});
jQuery(‘#googleplus’).sharrre({
share: {
googlePlus: true
},
template: ‘{total}’,
enableHover: false,
enableTracking: true,
urlCurl: ‘https://www.tecmint.com/wp-content/themes/tecmint/js/sharrre.php’,
click: function(api, options){
api.simulateClick();
api.openPopup(‘googlePlus’);
}
});
jQuery(‘#linkedin’).sharrre({
share: {
linkedin: true
},
template: ‘{total}’,
enableHover: false,
enableTracking: true,
buttons: {
linkedin: {
description: ‘How to Send a Message to Logged Users in Linux Terminal’,media: ‘https://www.tecmint.com/wp-content/uploads/2017/12/Send-Message-to-Linux-Users.png’ }
},
click: function(api, options){
api.simulateClick();
api.openPopup(‘linkedin’);
}
});
// Scrollable sharrre bar, contributed by Erik Frye. Awesome!
var shareContainer = jQuery(“.sharrre-container”),
header = jQuery(‘#header’),
postEntry = jQuery(‘.entry’),
$window = jQuery(window),
distanceFromTop = 20,
startSharePosition = shareContainer.offset(),
contentBottom = postEntry.offset().top + postEntry.outerHeight(),
topOfTemplate = header.offset().top;
getTopSpacing();
shareScroll = function(){
if($window.width() > 719){ var scrollTop = $window.scrollTop() + topOfTemplate,
stopLocation = contentBottom – (shareContainer.outerHeight() + topSpacing);
if(scrollTop > stopLocation){
shareContainer.offset({top: contentBottom – shareContainer.outerHeight(),left: startSharePosition.left});
}
else if(scrollTop >= postEntry.offset().top-topSpacing){
shareContainer.offset({top: scrollTop + topSpacing, left: startSharePosition.left});
}else if(scrollTop 1024)
topSpacing = distanceFromTop + jQuery(‘.nav-wrap’).outerHeight();
else
topSpacing = distanceFromTop;
}
});
]]>

How to Find All Failed SSH login Attempts in Linux

Each attempt to login to SSH server is tracked and recorded into a log file by the rsyslog daemon in Linux. The most basic mechanism to list all failed SSH logins attempts in Linux is a combination of displaying and filtering the log files with the help of cat command or grep command.

In order to display a list of the failed SSH logins in Linux, issue some of the commands presented in this guide. Make sure that these commands are executed with root privileges.

The most simple command to list all failed SSH logins is the one shown below.

# grep "Failed password" /var/log/auth.log
List All Failed SSH Login Attempts

List All Failed SSH Login Attempts

The same result can also be achieved by issuing the cat command.

# cat /var/log/auth.log | grep "Failed password"


In order to display extra information about the failed SSH logins, issue the command as shown in the below example.

# egrep "Failed|Failure" /var/log/auth.log
Find Failed SSH Logins

Find Failed SSH Logins

In CentOS or RHEL, the failed SSH sessions are recorded in /var/log/secure file. Issue the above command against this log file to identify failed SSH logins.

# egrep "Failed|Failure" /var/log/secure
Find Failed SSH Logins in CentOS

Find Failed SSH Logins in CentOS

A slightly modified version of the above command to display failed SSH logins in CentOS or RHEL is as follows.

# grep "Failed" /var/log/secure
# grep "authentication failure" /var/log/secure
Find SSH Authentication Failure Logins

Find SSH Authentication Failure Logins

To display a list of all IP addresses that tried and failed to log in to the SSH server alongside the number of failed attempts of each IP address, issue the below command.

# grep "Failed password" /var/log/auth.log | awk ‘{print $11}’ | uniq -c | sort -nr
Find IP Addresses of SSH Failed Logins

Find IP Addresses of SSH Failed Logins

On newer Linux distributions you can query the runtime log file maintained by Systemd daemon via journalctl command. In order to display all failed SSH login attempts you should pipe the result via grep filter, as illustrated in the below command examples.

# journalctl _SYSTEMD_UNIT=ssh.service | egrep "Failed|Failure"
# journalctl _SYSTEMD_UNIT=sshd.service | egrep "Failed|Failure" #In RHEL, CentOS 
Find Real Time Failed SSH Logins

Find Real Time Failed SSH Logins

In CentOS or RHEL, replace the SSH daemon unit with sshd.service, as shown in the below command examples.

# journalctl _SYSTEMD_UNIT=sshd.service | grep "failure"
# journalctl _SYSTEMD_UNIT=sshd.service | grep "Failed"

After you’ve identified the IP addresses that frequently hit your SSH server in order to log in to the system with suspicious user accounts or invalid user accounts, you should update your system firewall rules to block the failed SSH attempts IP addresses or use a specialized software, such as fail2ban to manage these attacks.