How to Install GoLang (Go Programming Language) in Linux

Go (also referred to as GoLang) is an open source and lower level programming language designed to enable users to easily write simple, reliable, and highly efficient computer programs.

Developed in 2007 at Google by a team of programmers – Robert GriesemerRob Pike, and Ken Thompson, it is a compiled, statically typed language same as other system languages such as CC++Java and many more.

GoLang is highly productive, and readable with support for networking and multiprocessing and it is scalable in extensive systems as well. Below is a list of a few well known open source projects developed using GoLang:

  1. Docker
  2. Kubernetes
  3. Lime
  4. InfluxDB
  5. Gogs (Go Git Service) among others.

Install GoLang in Linux Systems

1. Go to https://golang.org/dl/ and download the latest version (i.e 1.7.3) of GoLang in an archive file as follows:

$ cd ~/Downloads
$ wget -c https://storage.googleapis.com/golang/go1.7.3.linux-amd64.tar.gz

2. Next, check the integrity of the tarball by verifying the SHA256 checksum of the archive file using the shasum command as below, where the flag -a is used to specify the algorithm to be used:

$ shasum -a 256 go1.7.3.linux-amd64.tar.gz

ead40e884ad4d6512bcf7b3c7420dd7fa4a96140  go1.7.3.linux-amd64.tar.gz

Important: To show that the contents of the downloaded archive file are the exact copy provided on the GoLang website, the 256-bit hash value generated from the command above as seen in the output should be the same as that provided along with the download link.

If that is the case, proceed to the next step, otherwise download a new tarball and run the check again.

3. Then extract the tar archive files into /usr/local directory using the command below.

$ sudo tar -C /usr/local -xvzf go1.7.3.linux-amd64.tar.gz

Where, -C specifies the destination directory..

Configuring GoLang Environment in Linux

4. First, setup your Go workspace by creating a directory ~/go_projects which is the root of your workspace. The workspace is made of three directories namely:

  1. bin which will contain Go executable binaries.
  2. src which will store your source files and
  3. pkg which will store package objects.

Therefore create the above directory tree as follows:

$ mkdir -p ~/go_projects/{bin,src,pkg}
$ cd ~/go_projects
$ ls

5. Now it’s time to execute Go like the rest of Linux programs without specifying its absolute path, its installation directory must be stored as one of the values of $PATH environment variable.

Now, add /usr/local/go/bin to the PATH environment variable by inserting the line below in your /etc/profile file for a system-wide installation or $HOME/.profile or $HOME./bash_profile for user specific installation:

Using your preferred editor, open the appropriate user profile file as per your distribution and add the line below, save the file and exit:

export  PATH=$PATH:/usr/local/go/bin

6. Then, set the values of GOPATH and GOBIN Go environment variables in your user profile file (~/.profile or ~/bash_profile) to point to your workspace directory.

export GOPATH="$HOME/go_projects"
export GOBIN="$GOPATH/bin"

Note: If you installed GoLang in a custom directory other than the default (/usr/local/), you must specify that directory as the value of GOROOT variable.

For instance, if you have installed GoLang in home directory, add the lines below to your $HOME/.profile or $HOME/.bash_profile file.

export GOROOT=$HOME/go
export PATH=$PATH:$GOROOT/bin

7. The final step under this section is to effect the changes made to the user profile in the current bash session like so:

$ source ~/.bash_profile
OR
$ source ~/.profile

Verify GoLang Installation

8. Run the commands below to view your Go version and environment:

$ go version
$ go env

Check GoLang Version and Environment

Check GoLang Version and Environment

Type the following command to display usage information for Go tool, which manages Go source code:

$ go help

9. To test your if your Go installation is working correctly, write a small Go hello world program, save the file in ~/go_projects/src/hello/ directory. All your GoLang source files must end with the .go extension.

Begin by creating the hello project directory under ~/go_projects/src/:

$ mkdir -p ~/go_projects/src/hello

Then use your favorite editor to create the hello.go file:

$ vi ~/go_projects/src/hello/hello.go

Add the lines below in the file, save it and exit:

package main 

import "fmt"

func main() {
    fmt.Printf("Hello, you have successfully installed GoLang in Linux\n")
}

10. Now, compile the program above as using go install and run it:

$ go install $GOPATH/src/hello/hello.go
$ $GOBIN/hello

First GoLang Program

First GoLang Program

If you see the output showing you the message in the program file, then your installation is working correctly.

11. To run your Go binary executables like other Linux commands, add $GOBIN to your $PATH environment variable.

Reference Linkshttps://golang.org/

That’s it! You can now go on and learn GoLang for writing simple, reliable, and highly efficient computer programs. Are you already make use of GoLang?

Share your experience with us and many other Linux users out there via the comment section below or imaginably, you can ask a question in relation to this guide or GoLang.

Source

fpaste – A Tool for Sharing Errors and Commandline Output to Pastebin

Software developers or users always encounter different problems during the process of software development or usage. Some of these problems may include errors, therefore one way to solve them is to share error messages, command output or the contents of given files with other developers or users on the Internet.

There are many online platforms for sharing such problems which can be referred to as online content-sharing tool. An online content-sharing tool is often called a pastebin.

The Fedora ecosystem has one such tool called fpaste, is a web-based pastebin and a command line tool used for debugging errors or simply looking for feedback on some text.

Therefore in this article we are going to look at ways of how you can use fpaste as a programmer or normal user to report errors from commandline to fpaste.org site..

In order to use fpaste, you need to access it using one of the two ways; via the website or the command line. In this guide we shall focus more on the command line but let us see how you can use it via the web-based interface.

To use it from the website, you can go to fpaste website, copy your error, paste it into the input box provided, and then submit it. A response page will be provided and it has the URL link that you can send to fellow debuggers.

The web user interface allows a user to:

  1. set the syntax of the paste.
  2. tag the paste with his or her alias.
  3. use a password.
  4. set a time for the pasted error to expire.

How to Install fpaste Tool in Linux

To install it on Fedora/CentOS/RHEL distributions, you can run the following command as a privileged user.

# yum install fpaste
# dnf install fpaste         [On Fedora 22+ versions]
Sample Output
Last metadata expiration check performed 0:21:15 ago on Fri Jan 22 15:25:34 2016.
Dependencies resolved.
=================================================================================
 Package         Arch            Version                   Repository       Size
=================================================================================
Installing:
 fpaste          noarch          0.3.8.1-1.fc23            fedora           38 k

Transaction Summary
=================================================================================
Install  1 Package

Total download size: 38 k
Installed size: 72 k
Is this ok [y/N]: y
Downloading Packages:
fpaste-0.3.8.1-1.fc23.noarch.rpm                       9.3 kB/s |  38 kB     00:04    
---------------------------------------------------------------------------------------
Total                                                  5.8 kB/s |  38 kB     00:06     
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Installing  : fpaste-0.3.8.1-1.fc23.noarch                                       1/1 
  Verifying   : fpaste-0.3.8.1-1.fc23.noarch                                       1/1 

Installed:
  fpaste.noarch 0.3.8.1-1.fc23                                                         

Complete!

Now we will see some ways on how to use fpaste from terminal.

You can paste a test.txt, as follows:

# fpaste test.txt

Uploading (1.9KiB)...
http://ur1.ca/ofuic -> http://paste.fedoraproject.org/313642/34569731

To use a nickname and password while pasting test.txt, run this command.

# fpaste test.txt -n “labmaster” --password “labmaster123” test.txt

Uploading (4.7KiB)...
http://ur1.ca/ofuih -> http://paste.fedoraproject.org/313644/57093145

To send a script file named test_script.sh, specify the language as bash, copy the returned URL link to the X clipboard and make the paste private as follows.

# fpaste -l bash --private --clipout test_script.sh 

Uploading (1.9KiB)...
http://ur1.ca/ofuit -> http://paste.fedoraproject.org/313646

To send the output of the w command, run this command.

# w | fpaste 

Uploading (0.4KiB)...
http://ur1.ca/ofuiv -> http://paste.fedoraproject.org/313647/53457312

To send your system information with a description and a confirmation, run this command below.

# fpaste --sysinfo -d "my laptop" --confirm -x "1800" 

Gathering system info .............................OK to send? [y/N]: y
Uploading (19.1KiB)...
http://ur1.ca/ofuj6 -> http://paste.fedoraproject.org/313648/53457500

You can also paste the output of more than one command. In the next example I am going to send the output of the following commands; uname -adate and who.

# (uname -a ; date ; who ) | fpaste --confirm -x "1800" 

Linux tecmint.com 4.2.6-301.fc23.x86_64 #1 SMP Fri Nov 20 22:22:41 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
Fri Jan 22 15:43:24 IST 2016
root     tty1         2016-01-22 15:24
root     pts/0        2016-01-22 15:32 (192.168.0.6)

OK to send? [y/N]: y
Uploading (0.4KiB)...
http://ur1.ca/ofujb -> http://paste.fedoraproject.org/313649/14534576

You can use many other options of fpaste in man pages.

# man fpaste

Summary

fpaste is a good content-sharing tool with easy to use methods. We have looked at some few examples of using it in this guide but you can explore more by trying out many other options.

If you encounter any errors while using it, you can post a comment or for those of who use fpaste, please add some information about how you use it and share your experience.

Source

Apache OpenOffice 4.1.2 Released – Install on RedHat and Debian Based Distributions

Apache OpenOffice is a most popular and open source application suit for LinuxWindows & Mac used for word processing, spreadsheets, presentations, drawings, database, formula and much more. OpenOffice is used by more than 130 millions of users across the globe in corporates, homes and research centers with almost in 38 languages. It is available freely for download and works on all common systems.

Install Apache OpenOffice in Linux

Install Apache OpenOffice in Linux

Update: Install LibreOffice 5.0.2 on RHEL/CentOS/Fedora and Debian/Ubuntu/Linux Mint

OpenOffice 4.1.2 Improvements/Enhancements

  1. Performance improvement for faster startup.
  2. 38 supported languages.
  3. Number of enhancements were added to the WebDAV management and file locking.
  4. Bug fixes in Writer, Calc, Impress/Draw, Base.
  5. The PDF export dialog was revamped for better usability on small laptop screens.
  6. Fixed several security vulnerabilities.

The complete list of features can be found at Apache OpenOffice 4.1.2.

Requirements for Apache OpenOffice 4.1.2

  1. JRE (Java Runtime Environment) 1.5
  2. Kernel 2.6 or higher and glibc2 2.11 or higher
  3. Minimum 256MB and recommended 512MB RAM.
  4. Disk space 400MB

Install Apache OpenOffice 4.1.2 on Linux

The following installation instructions shows you how to install Apache OpenOffice 4.1.2 using language US English on a 32-Bit and 64-bit Linux distributions.

For 64-Bit platforms, there will be a minor changes in directory names, but the installation instructions same for both the architectures.

Step 1: Installing Java JRE

As I said above, you must have a JRE version (32-bit or 64-bit) installed on your systems, if not install the latest Java JRE version using following article.

  1. Install Java on Linux Systems

Else, you can follow below instructions to install most recent version of Java JRE on Linux distributions such a Debian and RedHat based.

On Debian and its derivatives
$ sudo apt-get install openjdk-8-jre

Install Java JRE in Ubuntu

Install Java JRE in Ubuntu

On RedHat based Systems
# yum install java-1.8.0-openjdk

Install Java JDK on CentOS

Install Java JDK on CentOS

Once Java installed, you can verify the version using following command.

$ java -version

openjdk version "1.8.0_66-internal"
OpenJDK Runtime Environment (build 1.8.0_66-internal-b01)
OpenJDK 64-Bit Server VM (build 25.66-b01, mixed mode)

Step 2: Downloading Apache OpenOffice 4.1.2

Download OpenOffice 4.1.2 using Wget command based on your system bit.

On Debian and its derivatives
# cd /tmp

---------------------------- On 32-bit Systems ---------------------------- 
# wget http://sourceforge.net/projects/openofficeorg.mirror/files/4.1.2/binaries/en-US/Apache_OpenOffice_4.1.2_Linux_x86-64_install-deb_en-US.tar.gz


---------------------------- On 64-bit Systems ---------------------------- 
# wget http://sourceforge.net/projects/openofficeorg.mirror/files/4.1.2/binaries/en-US/Apache_OpenOffice_4.1.2_Linux_x86_install-deb_en-US.tar.gz
On RedHat based Systems
# cd /tmp

---------------------------- On 32-bit Systems ---------------------------- 
# wget http://sourceforge.net/projects/openofficeorg.mirror/files/4.1.2/binaries/en-US/Apache_OpenOffice_4.1.2_Linux_x86-64_install-rpm_en-US.tar.gz


---------------------------- On 64-bit Systems ---------------------------- 
# wget http://sourceforge.net/projects/openofficeorg.mirror/files/4.1.2/binaries/en-US/Apache_OpenOffice_4.1.2_Linux_x86_install-rpm_en-US.tar.gz

Step 3: Removing Old OpenOffice Version

$ sudo apt-get remove openoffice* libreoffice*		[On Debian based Systems]
# yum remove openoffice* libreoffice*			[on RedHat based Systems]

Step 4: Extracting OpenOffice 4.1.2 Package

Use Tar command to extract the package in the current directory.

-------------------- On Debian and its Derivatives -------------------- 
# tar -xvf Apache_OpenOffice_4.1.2_Linux_x86-64_install-deb_en-US.tar.gz	[For 32-bit]
# tar -xvf Apache_OpenOffice_4.1.2_Linux_x86_install-deb_en-US.tar.gz		[For 64-bit]

-------------------- On RedHat based Systems -------------------- 
# tar -xvf Apache_OpenOffice_4.1.2_Linux_x86_install-rpm_en-US.tar.gz		[For 64-bit]
# tar -xvf Apache_OpenOffice_4.1.2_Linux_x86-64_install-rpm_en-US.tar.gz	[For 32-bit]

Step 5: Installing OpenOffice 4.1.2 Package

Now execute following RPM command to install all the RPM packages at once.

-------------------- On Debian and its Derivatives -------------------- 
# dpkg -i en-US/DEBS/*.deb en-US/DEBS/desktop-integration/openoffice4.1-debian-*.deb


-------------------- On RedHat based Systems -------------------- 
# rpm -Uvh en-US/RPMS/*.rpm en-US/RPMS/desktop-integration/openoffice4.1.2-redhat-*.rpm

Step 6: Starting Apache OpenOffice 4.1.2

On the terminal execute following command to start the OpenOffice application.

# openoffice4

Step 7: Screenshots of Apache OpenOffice 4.0.1

Apache OpenOffice

Apache OpenOffice

About Apache OpenOffice 4.1.2

About Apache OpenOffice 4.1.2

Source

Testssl.sh – Testing TLS/SSL Encryption Anywhere on Any Port

testssl.sh is a free and open source, feature-rich command line tool used for checking TLS/SSL encryption enabled services for supported ciphers, protocols and some cryptographic flaws, on Linux/BSD servers. It can be run on MacOS X and Windows using MSYS2 or Cygwin.

Features of Testssl.sh

  • Easy to install and use; produces clear output.
  • Highly flexible, it can be used to check any SSL/TLS enabled and STARTTLS services.
  • Perform a general check or single checks.
  • Comes with several command line options for various categories of single checks.
  • Supports different output types, including colored output.
  • Supports SSL Session ID check.
  • Supports checking for multiple server certificates.
  • Offers absolute privacy, it’s only you who can sees the result, not a third party.
  • Supports logging in (flat) JSON + CSV format.
  • Supports mass testing in serial (default) or parallel modes.
  • Supports presetting of command line options via environment variables, and so much more.

Important: You should be using bash (which comes preinstalled on almost Linux distributions) and a newer OpenSSL version (1.0) is recommended for effective usage.

How to Install and Use Testssl.sh in Linux

You can install testssl.sh by cloning this git repository as shown.

# git clone --depth 1 https://github.com/drwetter/testssl.sh.git
# cd testssl.sh

After cloning testssl.sh, the general use case is probably just run the following command to run a test against a website.

# ./testssl.sh https://www.google.com/

Test SSL TLS Encryption

Test SSL TLS Encryption

To run a check against STARTTLS enabled protocols: ftp, smtp, pop3, imap, xmpp, telnet, ldap, postgres, mysql, use the -t option.

# ./testssl.sh -t smtp https://www.google.com/

By default, all mass tests are done in serial mode, you can enable parallel testing using the --parallel flag.

# ./testssl.sh --parallel https://www.google.com/

If you do not want to use the default system openssl program, use the –openssl flag to specify an alternative.

# ./testssl.sh --parallel --sneaky --openssl /path/to/your/openssl https://www.google.com/

You might want to keep logs for later analysis, testssl.sh has the --log (store log file in the current directory) or --logfile (specify log file location) option for that.

# ./testssl.sh --parallel --sneaky --logging https://www.google.com/

To disable DNS lookup, which can increase test speeds, use the -n flag.

# ./testssl.sh -n --parallel --sneaky --logging https://www.google.com/

Run Single Checks Using testssl.sh

You can also run single checks for protocols, server defaults, server preferences, headers, various types of vulnerabilities plus many other tests. There are a number of options provided for this.

For example, the -e flag enables you to check each local cipher remotely. If you want to make the test much faster, use include the --fast flag; this will omit some checks, in case you are using openssl for all ciphers, it only displays the first proffered cipher.

# ./testssl.sh -e --fast --parallel https://www.google.com/

The -p option allows for testing TLS/SSL protocols (including SPDY/HTTP2).

# ./testssl.sh -p --parallel --sneaky https://www.google.com/

You can view the server’s default picks and certificate using the -S option.

# ./testssl.sh -S https://www.google.com/

Next, to see the server’s preferred protocol+cipher, use the -P flag.

# ./testssl.sh -P https://www.google.com/

The -U option will help you test all vulnerabilities (if applicable).

# ./testssl.sh -U --sneaky https://www.google.com/

Unfortunately, we can not exploit all the options here, use the the command below to see a list of all options.

# ./testssl.sh --help

Find more at testssl.sh Github repository: https://github.com/drwetter/testssl.sh

Conclusion

testssl.sh is a useful security tool that every Linux system administrator needs to have and use for testing TSL/SSL enabled services. If you have any questions or thoughts to share, use the comment form below. In addition, you can also share with us any similar tools, that you have come across out there.

Source

How to Mount Remote Linux Filesystem or Directory Using SSHFS Over SSH

The main purpose of writing this article is to provide a step-by-step guide on how to mount remote Linux file system using SSHFS client over SSH.

This article is useful for those users and system administrators who want to mount remote file system on their local systems for whatever purposes. We have practically tested by installing SSHFS client on one of our Linux system and successfully mounted remote file systems.

Before we go further installation let’s understand about SSHFS and how it works.

Sshfs Mount Remote Linux Filesystem or Directory

Sshfs Mount Remote Linux Filesystem or Directory

What Is SSHFS?

SSHFS stands for (Secure SHell FileSystem) client that enable us to mount remote filesystem and interact with remote directories and files on a local machine using SSH File Transfer Protocol (SFTP).

Suggested Read: 10 sFTP Command Examples to Transfer Files on Remote Servers in Linux

SFTP is a secure file transfer protocol that provides file access, file transfer and file management features over Secure Shell protocol. Because SSH uses encryption while transferring files over the network from one computer to another computer and SSHFS comes with built-in FUSE (Filesystem in Userspace) kernel module that allows any non-privileged users to create their file system without modifying kernel code.

In this article, we will show you how to install and use SSHFS client on any Linux distribution to mount remote Linux filesystem or directory on a local Linux machine.

Step 1: Install SSHFS Client in Linux Systems

By default sshfs packages does not exists on all major Linux distributions, you need to enable epel repositoryunder your Linux systems to install sshfs with the help of Yum command with their dependencies.

# yum install sshfs
# dnf install sshfs              [On Fedora 22+ releases]
$ sudo apt-get install sshfs     [On Debian/Ubuntu based systems]

Step 2: Creating SSHFS Mount Directory

Once the sshfs package installed, you need to create a mount point directory where you will mount your remote file system. For example, we have created mount directory under /mnt/tecmint.

# mkdir /mnt/tecmint
$ sudo mkdir /mnt/tecmint     [On Debian/Ubuntu based systems]

Step 3: Mounting Remote Filesystem with SSHFS

Once you have created your mount point directory, now run the following command as a root user to mount remote file system under /mnt/tecmint. In your case the mount directory would be anything.

The following command will mount remote directory called /home/tecmint under /mnt/tecmint in local system. (Don’t forget replace x.x.x.x with your IP Address and mount point).

# sshfs tecmint@x.x.x.x:/home/tecmint/ /mnt/tecmint
$ sudo sshfs -o allow_other tecmint@x.x.x.x:/home/tecmint/ /mnt/tecmint     [On Debian/Ubuntu based systems]

If your Linux server is configured with SSH key based authorization, then you will need to specify the path to your public keys as shown in the following command.

# sshfs -o IdentityFile=~/.ssh/id_rsa tecmint@x.x.x.x:/home/tecmint/ /mnt/tecmint
$ sudo sshfs -o allow_other,IdentityFile=~/.ssh/id_rsa tecmint@x.x.x.x:/home/tecmint/ /mnt/tecmint     [On Debian/Ubuntu based systems]

Step 4: Verifying Remote Filesystem is Mounted

If you have run the above command successfully without any errors, you will see the list of remote files and directories mounted under /mnt/tecmint.

# cd /mnt/tecmint
# ls
[root@ tecmint]# ls
12345.jpg                       ffmpeg-php-0.6.0.tbz2                Linux                                           news-closeup.xsl     s3.jpg
cmslogs                         gmd-latest.sql.tar.bz2               Malware                                         newsletter1.html     sshdallow
epel-release-6-5.noarch.rpm     json-1.2.1                           movies_list.php                                 pollbeta.sql
ffmpeg-php-0.6.0                json-1.2.1.tgz                       my_next_artical_v2.php                          pollbeta.tar.bz2

Step 5: Checking Mount Point with df -hT Command

If you run df -hT command you will see the remote file system mount point.

# df -hT
Sample Output
Filesystem                          Type        Size  Used Avail Use% Mounted on
udev                                devtmpfs    730M     0  730M   0% /dev
tmpfs                               tmpfs       150M  4.9M  145M   4% /run
/dev/sda1                           ext4         31G  5.5G   24G  19% /
tmpfs                               tmpfs       749M  216K  748M   1% /dev/shm
tmpfs                               tmpfs       5.0M  4.0K  5.0M   1% /run/lock
tmpfs                               tmpfs       749M     0  749M   0% /sys/fs/cgroup
tmpfs                               tmpfs       150M   44K  150M   1% /run/user/1000
tecmint@192.168.0.102:/home/tecmint fuse.sshfs  324G   55G  253G  18% /mnt/tecmint

Suggested Read: 12 Useful “df” Commands to Check Disk Space in Linux

Step 6: Mounting Remote Filesystem Permanently

To mount remote filesystem permanently, you need to edit the file called /etc/fstab. To do, open the file with your favorite editor.

# vi /etc/fstab
$ sudo vi /etc/fstab     [On Debian/Ubuntu based systems]         

Go to the bottom of the file and add the following line to it and save the file and exit. The below entry mount remote server file system with default settings.

sshfs#tecmint@x.x.x.x:/home/tecmint/ /mnt/tecmint fuse.sshfs defaults 0 0

Make sure you’ve SSH Passwordless Login in place between servers to auto mount filesystem during system reboots..

If your server is configured with SSH key based authorization, then add this line:

sshfs#tecmint@x.x.x.x:/home/tecmint/ /mnt/tecmint fuse.sshfs IdentityFile=~/.ssh/id_rsa defaults 0 0

Next, you need to update the fstab file to reflect the changes.

# mount -a
$ sudo mount -a   [On Debian/Ubuntu based systems]

Step 7: Unmounting Remote Filesystem

To unmount remote filesystem, jun issue the following command it will unmount the remote file system.

# umount /mnt/tecmint

That’s all for now, if you’re facing any difficulties or need any help in mounting remote file system, please contact us via comments and if you feel this article is much useful then share it with your friends.

Source

How to Install Lua Scripting Language in Linux

Lua is a free and open source, powerful, robust, minimal and embeddable scripting language. It’s an extensible and interpreted scripting languages that is dynamically typed, run by interpreting bytecode with a register-based virtual machine.

Lua runs on all if not most Unix-like operating systems including Linux and Windows; on mobile operating systems (Android, iOS, BREW, Symbian, Windows Phone); on embedded microprocessors (ARM and Rabbit); on IBM mainframes and many more.

See how Lua programs works in the live demo.

Lua Features:

  • Builds on all systems with a standard C compiler.
  • It’s remarkably lightweight, fast, efficient and portable.
  • It’s easy to learn and use.
  • It has a simple and well documented API.
  • It supports several types of programming (such as procedural, object-oriented, functional and data-driven programming as well as data description).
  • Implements object-oriented via meta-mechanisms.
  • It also brings together straightforward procedural syntax with formidable data description constructs rooted around associative arrays and extensible semantics.
  • Comes with automatic memory management with incremental garbage collection (thus making it perfect for real-world configuration, scripting, and also breakneck prototyping).

How to Install Lua in Linux

Lua package is available in official repositories of major Linux distributions, you can install the latest version using the appropriate package manager on your system.

$ sudo apt install lua5.3	                #Debian/Ubuntu systems 
# yum install epel-release && yum install lua	#RHEL/CentOS systems 
# dnf install lua		                #Fedora 22+

Note: The current version of Lua package in EPEL repository is 5.1.4; therefore to install the current release, you need to build and install it from source as explained below.

Install Lua from Sources

First, ensure that you have development tools installed on your system, otherwise run the command below to install them.

$ sudo apt install build-essential libreadline-dev      #Debian/Ubuntu systems 
# yum groupinstall "Development Tools" readline		#RHEL/CentOS systems 
# dnf groupinstall "Development Tools" readline		#Fedora 22+

Then to build and install the latest release (version 5.3.4 at the time of this writing) of Lua, run the following commands to download the package tar ball, extract, build and install it.

$ mkdir lua_build
$ cd lua_build
$ curl -R -O http://www.lua.org/ftp/lua-5.3.4.tar.gz
$ tar -zxf lua-5.3.4.tar.gz
$ cd lua-5.3.4
$ make linux test
$ sudo make install

Once you have installed it, run Lua interpretor as shown.

$ lua 

Lua Interpretor

Lua Interpretor

Using your favorite text editor, you can create your first Lua program as follows.

$ vi hello.lua

And add the following code to the file.

print("Hello World")
print("This is Tecmint.com and we are testing Lua")

Save and close the file. Then run your program as shown.

$ lua hello.lua

Run Lua Program

Run Lua Program

For more information and to learn how to write Lua programs, go to: https://www.lua.org/home.html

Lua is a versatile programming language being used in numerous industries (from web to gaming to image processing and beyond), and it’s designed with a high priority for embedded systems.

If you encounter any errors during installation or simply want to know more, use the comment form below to send us your thoughts.

Source

Zammad – An Open Source Help Desk and Support Ticket System

Zammad is a free open source, fully featured web based ticketing system for helpdesk or customer support. It ships in with a multitude of features for handling customer communication through various channels such as social networks (Facebook and Twitter), live chat, e-mails as well as telephone. It has an API for integrating your telephone system into in and outgoing calls.

Zammad Help Desk & Ticket System

Zammad Help Desk & Ticket System

Zammad Features:

  • Supports full-text search.
  • Has flexible text modules.
  • Immediately reports changes to objects.
  • Supports auto-save.
  • Supports individual escalation or setting client solution time limit.
  • It is auditable and often used in banks.
  • Allows for creation of individual overviews.
  • Supports various security mechanisms such as device-logging and two-factor-authentication.
  • Provides a customer interface, where they can track the current editing at any time.
  • Supports external authentication via Twitter, Facebook, LinkedIn or Google via OAuth.
  • Supports nine languages and so much more.

Zammad Requirements:

  • Ruby 2.4.2
  • Database: PostgresSQL (supported by default), MariaDB or MySQL
  • Reverse Proxy: Nginx (supported by default) or Apache.
  • Elasticsearch for excellent search performance

Zammad Installation Prerequisites:

Zammad is an open source project which can be deployed on a VPS server of your choice.

You can get a 2GB RAM VPS from Linode for $10, but it’s unmanaged. If you want a Managed VPS, then use our new BlueHost Promotion Offer, you will get upto 40% OFF on hosting with one Free Domain for Life. If you get a Managed VPS, they will probably install Zammad for you.

In this article we will explain how to install and configure Zammad open source helpdesk/customer support ticketing system in CentOS/RHEL 7Ubuntu 16.04 and Debian 9 server.

Step 1: Configure System Locale on System

1. Zammad uses UTF-8 locale, otherwise, packages such as PostgreSQL will not install. Check your system locale using following command on your respective Linux distribution.

# locale

LANG=en_IN
LC_CTYPE="en_IN"
LC_NUMERIC="en_IN"
LC_TIME="en_IN"
LC_COLLATE="en_IN"
LC_MONETARY="en_IN"
LC_MESSAGES="en_IN"
LC_PAPER="en_IN"
LC_NAME="en_IN"
LC_ADDRESS="en_IN"
LC_TELEPHONE="en_IN"
LC_MEASUREMENT="en_IN"
LC_IDENTIFICATION="en_IN"
LC_ALL=

If there is nothing with UTF-8 in the above output, you have to set a new locale using following command.

# localectl set-locale LANG=en_US.UTF-8
# locale status

System Locale: LANG=en_US.UTF-8
       VC Keymap: us
      X11 Layout: us

Step 2: Install Elasticsearch on System

2. Now install Elasticsearch using following commands according to your Linux distribution you are using.

Install Elasticsearch on CentOS/RHEL 7

# rpm --import https://artifacts.elastic.co/GPG-KEY-elasticsearch
# echo "[elasticsearch-5.x]
name=Elasticsearch repository for 5.x packages
baseurl=https://artifacts.elastic.co/packages/5.x/yum
gpgcheck=1
gpgkey=https://artifacts.elastic.co/GPG-KEY-elasticsearch
enabled=1
autorefresh=1
type=rpm-md" | sudo tee /etc/yum.repos.d/elasticsearch.repo

# yum -y install java elasticsearch
# /usr/share/elasticsearch/bin/elasticsearch-plugin install ingest-attachment
# systemctl daemon-reload
# systemctl enable elasticsearch
# systemctl start elasticsearch
# systemctl status elasticsearch

Install Elasticsearch on Ubuntu 16.04

# echo "deb https://artifacts.elastic.co/packages/5.x/apt stable main" | sudo tee -a /etc/apt/sources.list.d/elastic-5.x.list
# wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add -
# apt-get update
# apt-get install openjdk-8-jre elasticsearch
# /usr/share/elasticsearch/bin/elasticsearch-plugin install ingest-attachment
# systemctl restart elasticsearch
# systemctl enable elasticsearch
# systemctl status elasticsearch

Install Elasticsearch on Debian 9

# apt-get install apt-transport-https sudo wget
# echo "deb http://ftp.debian.org/debian jessie-backports main" | sudo tee -a /etc/apt/sources.list.d/debian-backports.list
# echo "deb https://artifacts.elastic.co/packages/5.x/apt stable main" | sudo tee -a /etc/apt/sources.list.d/elastic-5.x.list
# wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add -
# apt-get update
# apt-get install -t jessie-backports openjdk-8-jre
# apt-get install elasticsearch
# /var/lib/dpkg/info/ca-certificates-java.postinst configure
# /usr/share/elasticsearch/bin/elasticsearch-plugin install ingest-attachment
# systemctl restart elasticsearch
# systemctl enable elasticsearch
# systemctl status elasticsearch

Step 3: Install Zammad Support Ticket System

3. Once Elasticsearch has been installed, now you can add Zammad official repository to install Zammad, this will also install required packages such as Nginx HTTP server and PostgreSQL from this repository using following commands according to your distribution.

Install Zammad on CentOS/RHEL 7

# yum -y install epel-release wget
# wget -O /etc/yum.repos.d/zammad.repo https://dl.packager.io/srv/zammad/zammad/stable/installer/el/7.repo
# yum -y install zammad

Install Zammad on Ubuntu 16.04

# wget -qO- https://dl.packager.io/srv/zammad/zammad/key | sudo apt-key add -
# wget -O /etc/apt/sources.list.d/zammad.list https://dl.packager.io/srv/zammad/zammad/stable/installer/ubuntu/16.04.repo
# apt-get update
# apt-get install zammad

Install Zammad on Debian 9

# wget -qO- https://dl.packager.io/srv/zammad/zammad/key | sudo apt-key add -
# wget -O /etc/apt/sources.list.d/zammad.list https://dl.packager.io/srv/zammad/zammad/stable/installer/debian/9.repo
# apt-get update
# apt-get install zammad

4. Once Zammad has been installed, you can find all its packages under /opt/zammad (default base directory) and all the Zammad services (zammadzammad-webzammad-worker and zammad-websocket) are started automatically, you can view their status using following commands.

#systemctl status zammad
#systemctl status zammad-web
#systemctl status zammad-worker
#systemctl status zammad-websocket

5. You can also manage (restart, stop, start, disable, enable, etc..) any of these services like other systemd services using following commands.

--------- Zammad Server --------- 
# systemctl status zammad
# systemctl stop zammad
# systemctl start zammad
# systemctl restart zammad
--------- Zammad Web Application Server ---------
# systemctl status zammad-web
# systemctl stop zammad-web
# systemctl start zammad-web
# systemctl restart zammad-web
--------- Zammad Worker Process ---------
# systemctl status zammad-worker
# systemctl stop zammad-worker
# systemctl start zammad-worker
# systemctl restart zammad-worker
--------- Zammad Websocket Server ---------
# systemctl status zammad-websocket
# systemctl stop zammad-websocket
# systemctl start zammad-websocket
# systemctl restart zammad-websocket

Step 4: Verify Nginx and PostgreSQL Services

6. The Nginx web server is started automatically, a server block for Zammad is created and auto-configured in /etc/nginx/conf.d/zammad.conf, that you confirm using following commands.

# cat /etc/nginx/conf.d/zammad.conf
# systemctl status nginx

7. The PostgreSQL database server is also auto-started and configured to work with Zammad that you can verify using following command.

# systemctl status postgresql

Step 5: Configure Nginx Server Block for Zammad

8. Now it’s time to configure nginx server block for Zammad, open the configuration file.

# vi /etc/nginx/conf.d/zammad.conf

Add your fully qualified domain name or Public IP to server name directive as shown.

server {
    listen 80;

    # replace 'localhost' with your fqdn if you want to use zammad from remote
    server_name domain.com;

Configure Nginx for Zammad

Configure Nginx for Zammad

Save the changes and exit the file. Then restart Nginx services for the recent changes to take effect.

# systemctl restart nginx

Important: On CentOS, SeLinux & Firewalld are possibly enabled. To get everything work you need to open the port 80 (HTTP) and 443 (HTTPS) to allow client requests to the Nginx web server, as follows:

# setsebool httpd_can_network_connect on -P
# firewall-cmd --zone=public --add-service=http --permanent
# firewall-cmd --zone=public --add-service=https --permanent
# firewall-cmd --reload

Step 6: Install Zammad via Web Installer

9. Once everything in place, you can access your Zammad installation from a web browser at the following URL’s.

http://example.com
OR
http://Public-IP

After the web interface loads, you will see the message Setup new system, click on it to continue.

Zammad Setup Web Installer

Zammad Setup Web Installer

10. Next, create the Zammad admin account, enter required details and click Create.

Create Zammad Admin Account

Create Zammad Admin Account

13. Then create your organization and upload logo, once you are done, click Next.

Create Organization in Zammad

Create Organization in Zammad

11. Next, configure Zammad email service. You can either use your local server setup or setup another outgoing STMP server. Then click Continue.

Set Zammad Email Notification

Set Zammad Email Notification

12. In the next interface, you can either configure Connect Channels or click Skip to configure it later on.

Setup Zammad Connect Channels

Setup Zammad Connect Channels

13. Once the setup is complete. You will be redirected to the Zammad helpdesk dashboard as shown in the following screenshot. From here, you can full setup you helpdesk or customer support system and manage it.

Zammad Helpdesk Dashboard

Zammad Helpdesk Dashboard

For more information, go to the Zammad Homepage: https://zammad.org/

That’s all! Zammad is a powerful web based ticketing system for helpdesk or customer support. If you encountered any issues while installing it, use the feedback form below to share you queries with us.

Source

How to Install Eclipse Photon IDE in Debian and Ubuntu

Eclipse is a free integrated development environment IDE which is used by programmers around to write software mostly in Java but also in other major programming languages via Eclipse plugins.

The latest release of Eclipse Photon IDE doesn’t come with pre-build binary packages specific for Debian based Linux distributions. Instead, you can install Eclipse IDE in Ubuntu or Debian based Linux distributions via the compressed tar archive file.

In this tutorial we will learn how to install the latest edition of Eclipse Photon IDE in Ubuntu or in Debian based Linux distributions.

Requirements:

  1. A Desktop machine with minimum 2GB of RAM.
  2. Java 9 SE SDK installed in Debian based distributions.

Install Eclipse IDE in Debian and Ubuntu

Java 8 or newer JRE/JDK is required to install Eclipse Photon IDE and the easiest way to install Oracle Java JDK using third party PPA as shown.

Install Java 8 on Ubuntu/Debian

$ sudo add-apt-repository ppa:webupd8team/java
$ sudo apt-get update
$ sudo apt-get install oracle-java8-installer

Install Java 9 on Ubuntu/Debian

$ sudo add-apt-repository ppa:webupd8team/java
$ sudo apt-get update
$ sudo apt-get install oracle-java9-installer

Install Java 10 on Ubuntu/Debian

$ sudo add-apt-repository ppa:linuxuprising/java
$ sudo apt update
$ sudo apt install oracle-java10-installer

For installing Eclipse IDE in your system, first open a browser and go to Eclipse official download page and download the latest version of the tar package specific to your installed Linux distribution architecture.

Installing Eclipse Photon IDE in Ubuntu/Debian

Alternatively, you can also download Eclipse IDE tarball file in your system via wget utility, by issuing the below command.

-------------- For 64-bit Architecture -------------- 
$ wget http://ftp.fau.de/eclipse/technology/epp/downloads/release/photon/R/eclipse-jee-photon-R-linux-gtk-x86_64.tar.gz

-------------- For 32-bit Architecture --------------
$ wget http://ftp.fau.de/eclipse/technology/epp/downloads/release/photon/R/eclipse-jee-photon-R-linux-gtk.tar.gz

Installing Eclipse Oxygen IDE in Ubuntu/Debian

-------------- For 64-bit Architecture -------------- 
$ wget http://ftp.fau.de/eclipse/technology/epp/downloads/release/oxygen/R/eclipse-jee-oxygen-R-linux-gtk-x86_64.tar.gz

-------------- For 32-bit Architecture --------------
$ wget http://ftp.fau.de/eclipse/technology/epp/downloads/release/oxygen/R/eclipse-jee-oxygen-R-linux-gtk.tar.gz

After the download completes, navigate to the directory where the archive package has been downloaded, usually Downloads directories from your home, and issue the below commands to start installing Eclipse Photon IDE.

The commands executed below will decompress the archive directly into /opt directory and create a symlink into an executable path for eclipse executable file.

$ cd Downloads/
$ sudo tar xfz eclipse-jee-photon-R-linux* -C /opt/  [For Photon]
$ sudo tar xfz eclipse-jee-oxygen-R-linux* -C /opt/  [For Oxygen]
$ ls /opt/eclipse/
$ sudo ln -s /opt/eclipse/eclipse /usr/local/sbin/eclipse
$ ls -l /usr/local/sbin/

Next, create Eclipse desktop launcher icon into system applications directory.

$ sudo nano /usr/share/applications/eclipse.desktop

Add the following configuration into the file eclipse.desktop.

[Desktop Entry]
Name=Eclipse IDE
Comment=Eclipse IDE
Type=Application
Encoding=UTF-8
Exec=/usr/local/sbin/eclipse
Icon=/opt/eclipse/icon.xpm
Categories=GNOME;Application;Development;
Terminal=false
StartupNotify=true

After you’ve created Eclipse launcher, use Ubuntu dash to search and open the application. On the first application launch, add Eclipse workspace directory and hit on Launch button to start the application.

Create Eclipse IDE Desktop Workspace

Create Eclipse IDE Desktop Workspace

Eclipse IDE on Ubuntu

Eclipse IDE on Ubuntu

Install Eclipse Photon via Snap on Ubuntu

Snap is software deployment and package management system to manage packages on Linux distribution, you can use snap to install Eclipse Photon edition on Ubuntu 18.04 or newer using the following commands.

$ sudo apt install snapd
$ sudo snap install --classic eclipse

After install Eclipse, navigate to the Activities Overview and search for Eclipse and launch it…

That’s all! The latest version of Eclipse IDE is now installed in your system. Enjoy programming with Eclipse Photon.

Source

Grafana – An Open Source Software for Analytics and Monitoring

Grafana is an open source, feature rich, powerful, elegant and highly-extensible analytics and monitoring software that runs on LinuxWindows and MacOS. It is a de facto software for data analytics, being used at Stack OverfloweBayPayPalUber and Digital Ocean – just to mention but a few.

It supports 30+ open source as well as commercial databases/data sources including MySQLPostgreSQLGraphiteElasticsearchOpenTSDBPrometheus and InfluxDB. It allows you to dig deeply into large volumes of real-time, operational data; visualize, query, set alerts and get insights from your metrics from different storage locations.

Read AlsoHow to Install Piwik (Google Analytics) Software in Linux

Importantly, Grafana allows for setting up multiple, independent organizations with each having their own usage environment (admins, data sources, dashboards and users).

Grafana Analytics Monitoring Software

Grafana Analytics Monitoring Software

Grafana Features:

  • Elegant graphics for data visualization.
  • Fast and flexible graphs with numerous options.
  • Dynamic and reusable dashboards.
  • It’s highly extensible using hundreds of dashboards and plugins in the official library.
  • Supports power user preferences.
  • Supports multi tenancy, setup multiple independent organizations.
  • Supports authentication via LDAP, Google Auth, Grafana.com, and Github.
  • Supports notifications via Slack, PagerDuty, and more.
  • Remarkably supports collaboration by allowing sharing of data and dashboards across teams and so much more.

An online demo is available for you to try before installing Grafana on your Linux distribution.

Demo URL: http://play.grafana.org/

In this article, we will explain how to install Grafana – Data Visualization & Monitoring software on CentOSDebian and Ubuntu distributions.

Install Grafana in Linux Systems

1. We will install Grafana from its official YUM or APT repositories, so that you can update it using your default package manager.

Install Grafana on Debian and Ubuntu

$ echo "deb https://packagecloud.io/grafana/stable/debian/ stretch main" | sudo tee -a /etc/apt/sources.list
$ curl https://packagecloud.io/gpg.key | sudo apt-key add -
$ sudo apt-get update
$ sudo apt-get install grafana

Install Grafana on CentOS, RHEL and Fedora

# echo "[grafana]
name=grafana
baseurl=https://packagecloud.io/grafana/stable/el/7/$basearch
repo_gpgcheck=1
enabled=1
gpgcheck=1
gpgkey=https://packagecloud.io/gpg.key https://grafanarel.s3.amazonaws.com/RPM-GPG-KEY-grafana
sslverify=1
sslcacert=/etc/pki/tls/certs/ca-bundle.crt" | sudo tee /etc/yum.repos.d/grafana.repo

# yum install grafana

2. After installing Grafana, you can find important files in the following locations:

  • Installs binary to /usr/sbin/grafana-server
  • Installs Init.d script to /etc/init.d/grafana-server
  • Creates default file (environment vars) to /etc/default/grafana-server
  • Installs configuration file to /etc/grafana/grafana.ini
  • Installs systemd service name grafana-server.service
  • The default configuration sets the log file at /var/log/grafana/grafana.log
  • The default configuration specifies an sqlite3 db at /var/lib/grafana/grafana.db
  • Installs HTML/JS/CSS and other Grafana files at /usr/share/grafana

3. Next, start the Grafana service, check if it is up and running, then enable it to auto-start at boot time as follows. By default, the process is run as the grafana user (created during the installation process), and listens on HTTP port 3000.

Start Grafana Server (via Systemd)

# systemctl daemon-reload
# systemctl start grafana-server
# systemctl status grafana-server
# systemctl enable grafana-server

Start Grafana Server (via init.d)

# service grafana-server start
# service grafana-server status
# sudo update-rc.d grafana-server defaults  [On Debian/Ubuntu]
# /sbin/chkconfig --add grafana-server      [On CentOS/RHEL/Fedora]

4. If your system has a firewall enabled by default, you need to open the port 3000 in the firewall to allow client requests to the grafana process.

-----------  [On Debian/Ubuntu] -----------
$ sudo ufw allow 3000/tcp
$ sudo ufw reload

-----------  [On CentOS/RHEL/Fedora] -----------  
# firewall-cmd --permanent --add-port=3000/tcp
# firewall-cmd --reload

5. Now use the following URL to access the Grafana, which will redirect to the login page, user credentials as username: admin and password: admin)

http://Your-Domain.com:3000
OR
http://IP-Address:3000

Grafana Admin Login

Grafana Admin Login

6. After login, you will access the home dashboard, as shown in the screenshot below.

Grafana Home Dashboard

Grafana Home Dashboard

7. Next, add a database or data source, click on “Add Data Source”. For example we will add a MySQL database; specify the data source name, type, and connection parameters. Then click on Save & Test.

Add Grafana Data Source

Add Grafana Data Source

You will be notified if the database connection is successful or it has failed, as shown in the screenshot. Then go back to the home dashboard to add a new dashboard.

Grafana Data Source Connection

Grafana Data Source Connection

8. From the Home dashboard, click on New dashboard to add a new panel for visualizing metrics from your data source.

Add Grafana New Dashboard

Add Grafana New Dashboard

From here, you can add more data sources, dashboards, invite your team members, install apps and plugins to extend the default functionalities, and do more.

You can find more information from the Grafana Homepage: https://grafana.com/

Grafana is an elegant software for real-time data analytics and monitoring. We hope that you successfully installed Grafana on your Linux system, otherwise, use the feedback form below to ask any questions or share your thoughts about it.

Source

Wkhtmltopdf – A Smart Tool to Convert Website HTML Page to PDF in Linux

Wkhtmltopdf is an open source simple and much effective command-line shell utility that enables user to convert any given HTML (Web Page) to PDF document or an image (jpgpng, etc).

Wkhtmltopdf is written in C++ programming language and distributed under GNU/GPL (General Public License). It uses WebKit rendering layout engine to convert HTML pages to PDF document without loosing the quality of the pages. Its is really very useful and trustworthy solution for creating and storing snapshots of web pages in real-time.

Wkhtmltopdf Features

  1. Open source and cross platform.
  2. Convert any HTML web pages to PDF files using WebKit engine.
  3. Options to add headers and footers
  4. Table of Content (TOC) generation option.
  5. Provides batch mode conversions.
  6. Support for PHP or Python via bindings to libwkhtmltox.

In this article we will show you how to install Wkhtmltopdf program under Linux systems using source tarball files.

Install Evince (PDF Viewer)

Let’s install evince (a PDF reader) program for viewing PDF files in Linux systems.

$ sudo yum install evince             [RHEL/CentOS and Fedora]
$ sudo dnf install evince             [On Fedora 22+ versions]
$ sudo apt-get install evince         [On Debian/Ubuntu systems]

Download Wkhtmltopdf Source File

Download wkhtmltopdf source files for your Linux architecture using Wget command, or you can also download latest versions (current stable series is 0.12.4) at wkhtmltopdf download page.

On 64-bit Linux OS
$ wget https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.4/wkhtmltox-0.12.4_linux-generic-amd64.tar.xz
On 32-bit Linux OS
$ wget https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.4/wkhtmltox-0.12.4_linux-generic-i386.tar.xz

Install Wkhtmltopdf in Linux

Extract the files to a current working directory using following tar command.

------ On 64-bit Linux OS ------
$ sudo tar -xvf wkhtmltox-0.12.4_linux-generic-amd64.tar.xz 

------ On 32-bit Linux OS ------
$ sudo tar -xvzf wkhtmltox-0.12.4_linux-generic-i386.tar.xz 

Install the wkhtmltopdf under /usr/bin directory for easy execution of program from any path.

$ sudo cp wkhtmltox/bin/wkhtmltopdf /usr/bin/

How to Use Wkhtmltopdf?

Here we will see how to covert remote HTML pages to PDF files, verify information, view created files using evince program from the GNOME Desktop.

Convert Website HTML Page to PDF File

To convert any website HTML web page to PDF, run the following example command. It will convert the given webpage to 10-Sudo-Configurations.pdf in current working directory.

# wkhtmltopdf https://www.tecmint.com/sudoers-configurations-for-setting-sudo-in-linux/ 10-Sudo-Configurations.pdf
Sample Output :
Loading pages (1/6)
Counting pages (2/6)
Resolving links (4/6)
Loading headers and footers (5/6)
Printing pages (6/6)
Done

View Generated PDF File

To verify that the file is created, use the following command.

$ file 10-Sudo-Configurations.pdf
Sample Output :
10-Sudo-Configurations.pdf: PDF document, version 1.4

View Information of Generated PDF File

To view the information of generated file, issue the following command.

$ pdfinfo 10-Sudo-Configurations.pdf
Sample Output :
Title:          10 Useful Sudoers Configurations for Setting 'sudo' in Linux
Creator:        wkhtmltopdf 0.12.4
Producer:       Qt 4.8.7
CreationDate:   Sat Jan 28 13:02:58 2017
Tagged:         no
UserProperties: no
Suspects:       no
Form:           none
JavaScript:     no
Pages:          13
Encrypted:      no
Page size:      595 x 842 pts (A4)
Page rot:       0
File size:      697827 bytes
Optimized:      no
PDF version:    1.4

View Created PDF File

Take a look at the newly created PDF file using evince program from the desktop.

$ evince 10-Sudo-Configurations.pdf
Sample Screenshot :

Looks pretty nice under my Linux Mint 17 box.

View Website Page in PDF

View Website Page in PDF

Create TOC (Table Of Content) of a Page to PDF

To create a table of content for a PDF file, use the option as toc.

$ wkhtmltopdf toc https://www.tecmint.com/sudoers-configurations-for-setting-sudo-in-linux/ 10-Sudo-Configurations.pdf
Sample Output :
Loading pages (1/6)
Counting pages (2/6)
Loading TOC (3/6)
Resolving links (4/6)
Loading headers and footers (5/6)
Printing pages (6/6)
Done

To check the TOC for the created file, again use evince program.

$ evince 10-Sudo-Configurations.pdf
Sample Screenshot :

Take a look at the picture below. it looks even more better than the above.

Create Website Page to Table of Contents in PDF

Create Website Page to Table of Contents in PDF

Wkhtmltopdf Options and Usage

For Wkhtmltopdf more usage and options, use the following help command. It will display list of all available options that you can use with it.

$ wkhtmltopdf --help

Source

WP2Social Auto Publish Powered By : XYZScripts.com