Kurly – An Alternative to Most Widely Used Curl Program

Kurly is a free open source, simple but effective, cross-platform alternative to the popular curl command-line tool. It is written in Go programming language and works in the same way as curl but only aims to offer common usage options and procedures, with emphasis on the HTTP(S) operations.

In this tutorial we will learn how to install and use kurly program – an alternative to most widely used curl command in Linux.

Requirements:

  1. GoLang (Go Programming Language) 1.7.4 or higher.

How to Install Kurly (Curl Alternative) in Linux

Once you have installed Golang on your Linux machine, you can proceed to install kurly by cloning its git repository as shown.

$ go get github.com/davidjpeacock/kurly

Alternatively, you can install it via snapd – a package manager for snaps, on a number of Linux distributions. To use snapd, you need to install it on your system as shown.

$ sudo apt update && sudo apt install snapd [On Debian/Ubuntu]
$ sudo dnf update && sudo dnf install snapd [On Fedora 22+]


Then install kurly snap using the following command.

$ sudo snap install kurly

On Arch Linux, you can install from AUR, as follows.

$ sudo pacaur -S kurly
OR
$ sudo yaourt -S kurly

On CentOS/RHEL, you can download and install its RPM package using package manager as shown.

# wget -c https://github.com/davidjpeacock/kurly/releases/download/v1.2.1/kurly-1.2.1-0.x86_64.rpm
# yum install kurly-1.2.1-0.x86_64.rpm

How to Use Kurly (Curl Alternative) in Linux

Kurly focuses on the HTTP(S) realm, we will use Httpbin, a HTTP request and response service to partly demonstrate how kurly operates.

The following command will return the user agent, as defined in the http://www.httpbin.org/user-agent endpoint.

$ kurly http://httpbin.org/user-agent
Check User Agent

Check User Agent

Next, you can use kurly to download a file (for example Tomb-2.5.tar.gz encryption tool source code), preserving remote filename while saving output using -O flag.

$ kurly -O https://files.dyne.org/tomb/Tomb-2.5.tar.gz

To preserve remote timestamp and follow 3xx redirects, use the -R and -L flags respectively, as follows.

$ kurly -R -O -L https://files.dyne.org/tomb/Tomb-2.5.tar.gz
Download File Using Kurly

Download File Using Kurly

You can set a new name for the downloaded file, using the -o flag as shown.

$ kurly -R -o tomb.tar.gz -L https://files.dyne.org/tomb/Tomb-2.5.tar.gz 
Rename File While Downloading

Rename File While Downloading

This example shows how to upload a file, where the -T flag is used to specify the location of a file to upload. Under the http://httpbin.org/put endpoint, this command will return the PUT data as shown in the screenshot.

$ kurly -T ~/Pictures/kali.jpg https://httpbin.org/put
Upload File Using Kurly

Upload File Using Kurly

To view headers only from a URL use the -I or --head flag.

$ kurly -I https://google.com
View Website Headers from Terminal

View Website Headers from Terminal

To run it quietly, use the -s switch, this way, kurly will not produce any output.

$ kurly -s -R -O -L https://files.dyne.org/tomb/Tomb-2.5.tar.gz

Last but not least, you can set the maximum time to wait for an operation to complete in seconds, with the -m flag.

$ kurly -s -m 20 -R -O -L https://files.dyne.org/tomb/Tomb-2.5.tar.gz

To get a list of all kurly usage flags, consult its command-line help message.

$ kurly -h

For more information visit Kurly Github Repository: https://github.com/davidjpeacock/kurly

Kurly is a curl-like tool, but with a few commonly used features under the HTTP(S) realm. Many of the curl-like features are yet to be added to it. Try it out and share your experience with us, via the comment form below.

3 Command Line Tools to Install Local Debian (.DEB) Packages

In this tutorial we will learn how to install local software packages (.DEB) in Debian and its derivatives such as Ubuntu and Linux Mint using three different command line tools and they are dpkg, apt and gdebi.

This is useful to those new users who have migrated from Windows to Ubuntu or Linux Mint. The very basic problem they face is installing local software on system.

However, Ubuntu and Linux Mint has its own Graphical Software Center for easy software installation, but we will be looking forward to installing packages through terminal way.

1. Install Software Using Dpkg Command

Dpkg is a package manager for Debian and its derivatives such as Ubuntu and Linux Mint. It is used to install, build, remove and manage .deb packages. but unlike other Linux package management systems, it cannot automatically download and install packages with their dependencies.


To install a local package, use the dpkg command with the -i flag along with package name as shown.

$ sudo dpkg -i teamviewer_amd64.deb
Install Local Package in Ubuntu

Install Local Package in Ubuntu

If you get any dependency errors while installing or after installing and launching a program, you can use the following apt command to resolve and install dependencies using the -f flag, which tells the program to fix broken dependencies.

$ sudo apt-get install -f

To remove a package use -r option or if you want to remove all its files including configuration files, you can purge it using the --purge option as shown.

$ sudo dpkg -r teamviewer [Remove Package]
$ sudo dpkg --purge teamviewer [Remove Package with Configuration Files]
Remove Package in Ubuntu

Remove Package in Ubuntu

To know more about installed packages, read our article that shows how to list all files installed from a .deb package.

2. Install Software Using Apt Command

The apt command is a advanced command-line tool, which offers new software package installation, existing software package upgradation, updating of the package list index, and even upgrading the whole Ubuntu or Linux Mint system.

It also offers apt-get and apt-cache command-line tools for managing packages more interactively on Debian and its derivatives such as Ubuntu and Linux Mint systems.

Essentially, apt-get or apt do not understand .deb files, they are designed to primarily handle package names (for example teamviewer, apache2, mariadb etc..) and they retrieve and install .deb archives associated with a package name, from a source specified in the /etc/apt/sources.list file.

The only trick to installing a local Debian package using apt-get or apt is by specifying a local relative or absolute path (./ if in current dir) to the package, otherwise it will try to retrieve the package from remote sources and the operation will fail.

$ sudo apt install ./teamviewer_amd64.deb
$ sudo apt-get install ./teamviewer_amd64.deb
Install Local Package Using apt in Ubuntu

Install Local Package Using apt in Ubuntu

Install Local Package Using apt-get in Ubuntu

Install Local Package Using apt-get in Ubuntu

To remove a package use remove option or if you want to remove all its files including configuration files, you can purge it using the purge option as shown.

$ sudo apt-get remove teamviewer
$ sudo apt-get purge teamviewer
OR
$ sudo apt remove teamviewer
$ sudo apt purge teamviewer

3. Install Software Using Gdebi Command

gdebi is a tiny command-line tool for installing local deb packages. It resolves and installs package dependencies on the fly. To install a package, use the following command.

$ sudo gdebi teamviewer_13.1.3026_amd64.deb
Install Local Packages Using Gdebi in Ubuntu

Install Local Packages Using Gdebi in Ubuntu

To remove a package installed from gdebi, you can use apt, apt-get or dpkg commands using purge option as shown.

$ sudo apt purge teamviewer
OR
$ sudo apt-get purge teamviewer
OR
$ sudo dpkg --purge teamviewer

That’s It! In this tutorial, we have explained three different command line tools for installing or removing local Debian packages in Ubuntu and Linux Mint.

If you know any other way of installing local packages, do share with us using our comment section below.

Linux Fun – How to Create ASCII Text Banners in Terminal

Recently, we have explained about how to randomly display predefined ASCII art on the Linux terminal, using a program called ASCII-Art-Splash-Screen. In this article, we will show how to create your own appealing ASCII text banners from plain text, using two command-line utilities called FIGlet and TOIlet.

Read Also: 20 Funny Linux Commands to Have Fun in Terminal

FIGlet is a simple command-line utility for creating ASCII text banners or large letters out of ordinary text, whereas TOIlet (a sub-command under figlet) is a command-line utility for creating colorful large characters from ordinary text.

How to Install and Use Figlet and Toilet Tools in Linux

To use FIGlet and TOIlet tools together, you first need to install them on your Linux system using default package manager as shown.

$ sudo apt install figlet toilet [On Debian/Ubuntu]
$ sudo yum install figlet toilet [On CentOS/RHEL]
$ sudo dnf install figlet toilet [On Fedora 22+]


Once installed, the basic way of using figlet is by providing as an argument, the text that you want to transform as a banner or large text, as shown.

$ figlet TecMint.com
 _____ __ __ _ _ |_ _|__ ___| \/ (_)_ __ | |_ ___ ___ _ __ ___ | |/ _ \/ __| |\/| | | '_ \| __| / __/ _ \| '_ ` _ \ | | __/ (__| | | | | | | | |_ | (_| (_) | | | | | |
|_|\___|\___|_| |_|_|_| |_|\__(_)___\___/|_| |_| |_|

Set Output Justification

If you want the output to be created at the center, use the -c flag as shown.

$ figlet -c TecMint.com
 _____ __ __ _ _ |_ _|__ ___| \/ (_)_ __ | |_ ___ ___ _ __ ___ | |/ _ \/ __| |\/| | | '_ \| __| / __/ _ \| '_ ` _ \ | | __/ (__| | | | | | | | |_ | (_| (_) | | | | | |
|_|\___|\___|_| |_|_|_| |_|\__(_)___\___/|_| |_| |_|

In addition, also use -l to set the output to the left or -r to print it to the right.

Define Output Width

You can also control the output width with the -w switch, the default width is 80 columns.

$ figlet -w 100 I Love TecMint.com
 ___ _ _____ __ __ _ _ |_ _| | | _____ _____ |_ _|__ ___| \/ (_)_ __ | |_ ___ ___ _ __ ___ | | | | / _ \ \ / / _ \ | |/ _ \/ __| |\/| | | '_ \| __| / __/ _ \| '_ ` _ \ | | | |__| (_) \ V / __/ | | __/ (__| | | | | | | | |_ | (_| (_) | | | | | |
|___| |_____\___/ \_/ \___| |_|\___|\___|_| |_|_|_| |_|\__(_)___\___/|_| |_| |_|

If you have a wider terminal, you can use the full width of your terminal with the -t switch.

$ figlet -t TecMint.com

Add Space Between Output Characters

For a more clear output, you can use the -k flag to add a little space between the printed characters: check out the different between the above and below output as shown.

$ figlet -t -k I Love TecMint.com
 ___ _ _____ __ __ _ _ |_ _| | | ___ __ __ ___ |_ _|___ ___ | \/ |(_) _ __ | |_ ___ ___ _ __ ___ | | | | / _ \\ \ / // _ \ | | / _ \ / __|| |\/| || || '_ \ | __| / __|/ _ \ | '_ ` _ \ | | | |___| (_) |\ V /| __/ | || __/| (__ | | | || || | | || |_ _| (__| (_) || | | | | |
|___| |_____|\___/ \_/ \___| |_| \___| \___||_| |_||_||_| |_| \__|(_)\___|\___/ |_| |_| |_|

Read Input From a File

Rather than type your text on the command-line, you can read text from a file, using the -p option as shown.

$ echo "I wish I could chmod 644 my Girlfriend" >girlfriend.txt
$ figlet -kp < girlfriend.txt
 ___ _ _ ___ _ _ |_ _| __ __(_) ___ | |__ |_ _| ___ ___ _ _ | | __| |
| | \ \ /\ / /| |/ __|| '_ \ | | / __|/ _ \ | | | || | / _` |
| | \ V V / | |\__ \| | | | | | | (__| (_) || |_| || || (_| |
|___| \_/\_/ |_||___/|_| |_| |___| \___|\___/ \__,_||_| \__,_|
_ _ __ _ _ _ _ ___ | |__ _ __ ___ ___ __| | / /_ | || | | || | / __|| '_ \ | '_ ` _ \ / _ \ / _` | | '_ \ | || |_ | || |_ | (__ | | | || | | | | || (_) || (_| | | (_) ||__ _||__ _|
\___||_| |_||_| |_| |_| \___/ \__,_| \___/ |_| |_| ____ _ _ __ _ _ _ __ ___ _ _ / ___|(_) _ __ | | / _| _ __ (_) ___ _ __ __| | | '_ ` _ \ | | | | | | _ | || '__|| || |_ | '__|| | / _ \| '_ \ / _` | | | | | | || |_| | | |_| || || | | || _|| | | || __/| | | || (_| | |_| |_| |_| \__, | \____||_||_| |_||_| |_| |_| \___||_| |_| \__,_|

Change Output Font

You can specify another font, using the -f flag, font is a .flf or .tlf file stored in /usr/share/figlet. You can check out available fonts like so.

$ ls /usr/share/figlet/
646-ca2.flc 646-es.flc 646-kr.flc 646-yu.flc 8859-9.flc 646-ca.flc 646-fr.flc 646-no2.flc 8859-2.flc ascii12.tlf 646-cn.flc 646-gb.flc 646-no.flc 8859-3.flc ascii9.tlf 646-cu.flc 646-hu.flc 646-pt2.flc 8859-4.flc banner.flf 646-de.flc 646-irv.flc 646-pt.flc 8859-5.flc bigascii12.tlf 646-dk.flc 646-it.flc 646-se2.flc 8859-7.flc bigascii9.tlf 646-es2.flc 646-jp.flc 646-se.flc 8859-8.flc big.flf 

Then use a particular font, for example, I use font slant.tlf as shown.

$ figlet -f slant "Sudo I Love You"
_____ __ ____ __ __ __ / ___/__ ______/ /___ / _/ / / ____ _ _____ \ \/ /___ __ __
\__ \/ / / / __ / __ \ / / / / / __ \ | / / _ \ \ / __ \/ / / /
___/ / /_/ / /_/ / /_/ / _/ / / /___/ /_/ / |/ / __/ / / /_/ / /_/ / /____/\__,_/\__,_/\____/ /___/ /_____/\____/|___/\___/ /_/\____/\__,_/

Use TOIlet to Create Colored ASCII Text Banners

The toilet command is also used to transform text to large ASCII characters. The simplest way of running it is as follows.

$ toilet TecMint.com
mmmmmmm m m " m # mmm mmm ## ## mmm m mm mm#mm mmm mmm mmmmm # #" # #" " # ## # # #" # # #" " #" "# # # # # #"""" # # "" # # # # # # # # # # # # "#mm" "#mm" # # mm#mm # # "mm # "#mm" "#m#" # # #  

To change to a particular font, use the -f option, it also reads fonts from the same source as figlet.

$ toilet -kf script TecMint.com
______ ,__ __ (_) | /| | | o | _ __ | | | _ _ _|_ __ __ _ _ _ _ ||/ / | | | | / |/ | | / / \_/ |/ |/ | (_/ |__/\___/| | |_/|_/ | |_/|_/o\___/\__/ | | |_/

A number of the options for figlet that we have looked at above also apply to toilet. For more information, refer to their man pages.

$ man figlet
$ man toilet

Read Also: Neofetch – Shows Linux System Information with Distribution Logo

Summary

In this article, we looked at two command-line utilities for transforming text to large ASCII text characters, useful for creating banners or messages. Share your thoughts about these commands via the feedback form below.

How to Synchronize Time with NTP in Linux

The Network Time Protocol (NTP) is a protocol used to synchronize computer system clock automatically over a networks. The machine can have the system clock use Coordinated Universal Time (UTC) rather than local time.

The most common method to sync system time over a network in Linux desktops or servers is by executing the ntpdate command which can set your system time from an NTP time server. In this case, the ntpd daemon must be stopped on the machine where the ntpdate command is issued.

In most Linux systems, the ntpdate command is not installed by default. To install it, execute the below command.

$ sudo apt-get install ntpdate [On Debian/Ubuntu]
$ sudo yum install ntpdate [On CentOS/RHEL]
$ sudo dnf install ntpdate [On Fedora 22+]

The example of ntpdate command as shown.

$ sudo ntpdate 1.ro.pool.ntp.org
Check Date and Time in Linux

Check Date and Time in Linux


In order to just query the server and not set the clock and use an unprivileged port to send the packets from, in order to bypass firewalls, issue ntpdate with the below flags.

$ sudo ntpdate -qu 1.ro.pool.ntp.org
Query NTP Server

Query NTP Server

Always try to query and sync the time with the closest NTP servers available for your zone. The list of the NTP server pools can be found at the following address:

http://www.pool.ntp.org/en/ 

In newer Linux distributions that ship with Systemd, you can also sync time via timesyncd.conf file. Just open the file for editing.

$ sudo nano /etc/systemd/timesyncd.conf

And add or uncomment the following lines after [Time] statement, as illustrated in the below excerpt:

[Time]
NTP=0.ro.pool.ntp.org 1.ro.pool.ntp.org
FallbackNTP=ntp.ubuntu.com 0.arch.pool.ntp.org
Sync Linux Time with NTP Server

Sync Linux Time with NTP Server

After editing the file, issue the timedatectl command to activate the NTP client build in systemd.

$ sudo timedatectl set-ntp true $ timedatectl status
Check Linux System Time

Check Linux System Time

Afterwards, issue date command in order to display your system clock.

Linux sdiff Command Examples for Linux Newbies

In one of our earlier article, we have explained about 9 best file comparison and difference (Diff) tools for Linux systems. We listed a mixture of command-line and GUI tools for comparing and finding differences between files, each with certain remarkable features. Another useful diff utility for Linux is called sdiff.

Read Also: How to Find Difference Between Two Directories Using Diff and Meld Tools

sdiff is a simple command line utility for showing the differences between two files and merge interactively. It is easy to use and comes with straightforward usage options as explained below.

The syntax for using sdiff is as follows.

$ sdiff option... file1 file2

Show Difference Between Two Files in Linux


1. The easiest way to run sdiff is to provide the two filenames you are trying to compare. It will show the merged difference side-by-side as shown in the following screenshot.

$ cal >cal.txt
$ df -h >du.txt
$ sdiff du.txt cal.txt
Check Difference Between Files in Linux

Check Difference Between Files in Linux

Treat all Files as Text Files

2. To treat all files as text and compare them line-by-line, whether they are text files or not, use the -a flag.

$ sdiff -a du.txt cal.txt
Filesystem Size Used Avail Use% Mounted on | April 2018 udev 3.9G 0 3.9G 0% /dev | Su Mo Tu We Th Fr Sa tmpfs 788M 9.7M 779M 2% /run | 1 2 3 4 5 6 7 /dev/sda10 324G 265G 43G 87% / | 8 9 10 11 12 13 14 tmpfs 3.9G 274M 3.6G 7% /dev/shm | 15 16 17 18 19 20 21 tmpfs 5.0M 4.0K 5.0M 1% /run/lock | 22 23 24 25 26 27 28 tmpfs 3.9G 0 3.9G 0% /sys/fs/cgroup | 29 30 /dev/loop2 82M 82M 0 100% /snap/core/4206 | /dev/loop4 181M 181M 0 100% /snap/vlc/190 <
/dev/loop1 87M 87M 0 100% /snap/core/4407 <
/dev/loop0 189M 189M 0 100% /snap/vlc/158 <
/dev/loop3 83M 83M 0 100% /snap/core/4327 <
cgmfs 100K 0 100K 0% /run/cgmanager/fs <
tmpfs 788M 40K 788M 1% /run/user/1000 <

Ignore Tabs and White Space

3. If you have files with too much whitespace, you can tell sdiff to ignore all white space while comparing using the -W switch.

$ sdiff -W du.txt cal.txt

4. You can also tell sdiff to ignore any white space at line end using the -z option.

$ sdiff -z du.txt cal.txt

5. In addition, you can instruct sdiff to ignore changes due to tab expansion with the -E flag.

$ sdiff -E du.txt cal.txt

Ignore Case While Comparing Difference

6. To ignore case (where sdiff treats upper- and lower-case as the same), use the -i option as shown.

$ sdiff -i du.txt cal.txt

Ignore Blank Lines While Comparing Difference

7. The -B option helps to ignore blank line in files.

$ sdiff -B du.txt cal.txt

Define Number of Columns to Output

8. sdiff allows you to set the number of columns to be printed (default is 130), by using the -w switch as follows.

$ sdiff -w 150 du.txt cal.txt

Expand Tabs to Spaces

9. To expand tabs to spaces in output, use the -t option.

$ sdiff -t du.txt cal.txt

Run sdiff Interactively

10. The -o flag enables it to run more interactively and send output to a file. In this command, the output will be sent to the sdiff.txt file, press Enter after seeing the % sign, to get the interactive menu.

$ sdiff du.txt cal.txt -o sdiff.txt
Filesystem Size Used Avail Use% Mounted on | April 2018 udev 3.9G 0 3.9G 0% /dev | Su Mo Tu We Th Fr Sa tmpfs 788M 9.7M 779M 2% /run | 1 2 3 4 5 6 7 /dev/sda10 324G 265G 43G 87% / | 8 9 10 11 12 13 14 tmpfs 3.9G 274M 3.6G 7% /dev/shm | 15 16 17 18 19 20 21 tmpfs 5.0M 4.0K 5.0M 1% /run/lock | 22 23 24 25 26 27 28 tmpfs 3.9G 0 3.9G 0% /sys/fs/cgroup | 29 30 /dev/loop2 82M 82M 0 100% /snap/core/4206 | /dev/loop4 181M 181M 0 100% /snap/vlc/190 <
/dev/loop1 87M 87M 0 100% /snap/core/4407 <
/dev/loop0 189M 189M 0 100% /snap/vlc/158 <
/dev/loop3 83M 83M 0 100% /snap/core/4327 <
cgmfs 100K 0 100K 0% /run/cgmanager/fs <
tmpfs 788M 40K 788M 1% /run/user/1000 <
% ed: Edit then use both versions, each decorated with a header.
eb: Edit then use both versions.
el or e1: Edit then use the left version.
er or e2: Edit then use the right version.
e: Discard both versions then edit a new one.
l or 1: Use the left version.
r or 2: Use the right version.
s: Silently include common lines.
v: Verbosely include common lines.
q: Quit.
%

Note that you need to have some of the editors such as ed installed on your system before using them, in this scenario.

Invoke Another Program To Compare Files

11. The --diff-program switch allows you to call another command-line tool, other than sdiff itself to compare files, for instance, you can call the diff program as shown.

$ sdiff --diff-program=diff du.txt cal.txt

For more information, consult the sdiff man page.

$ man sdiff

In this article, we looked at sdiff command-line tool examples for beginners. If you have any questions, use the comment form below to reach us.

How to Configure Network Bonding or Teaming in Ubuntu

Network Interface Bonding is a mechanism used in Linux servers which consists of binding more physical network interfaces in order to provide more bandwidth than a single interface can provide or provide link redundancy in case of a cable failure. This type of link redundancy has multiple names in Linux, such as Bonding, Teaming or Link Aggregation Groups (LAG).

Read Also: How to Setup Network Bonding or Teaming in RHEL/CentOS

To use network bonding mechanism in Ubuntu or Debian based Linux systems, first you need to install the bonding kernel module and test if the bonding driver is loaded via modprobe command.

$ sudo modprobe bonding
Check Network Bonding in Ubuntu

Check Network Bonding in Ubuntu

On older releases of Debian or Ubuntu you should install ifenslave package by issuing the below command.

$ sudo apt-get install ifenslave


To create a bond interface composed of the first two physical NCs in your system, issue the below command. However this method of creating bond interface is ephemeral and does not survive system reboot.

$ sudo ip link add bond0 type bond mode 802.3ad
$ sudo ip link set eth0 master bond0
$ sudo ip link set eth1 master bond0

To create a permanent bond interface in mode 0 type, use the method to manually edit interfaces configuration file, as shown in the below excerpt.

$ sudo nano /etc/network/interfaces
# The primary network interface
auto bond0
iface bond0 inet static
address 192.168.1.150
netmask 255.255.255.0 gateway 192.168.1.1
dns-nameservers 192.168.1.1 8.8.8.8
dns-search domain.local
slaves eth0 eth1
bond_mode 0
bond-miimon 100
bond_downdelay 200
bound_updelay 200
Configure Bonding in Ubuntu

Configure Bonding in Ubuntu

In order to activate the bond interface, either restart network service, bring down the physical interface and rise the bond interface or reboot the machine in order for the kernel to pick-up the new bond interface.

$ sudo systemctl restart networking.service
or
$ sudo ifdown eth0 && ifdown eth1 && ifup bond0

The bond interface settings can be inspected by issuing the below commands.

$ ifconfig or $ ip a
Verify Bond Interface in Ubuntu

Verify Bond Interface in Ubuntu

Details about the bond interface can be obtained by displaying the content of the below kernel file using cat command as shown.

$ cat /proc/net/bonding/bond0
Check Bonding Information in Ubuntu

Check Bonding Information in Ubuntu

To investigate other bond interface messages or to debug the state of the bond physical NICS, issue the below commands.

$ tail -f /var/log/messages
Check Bond Interface Messages

Check Bond Interface Messages

Next use mii-tool tool to check Network Interface Controller (NIC) parameters as shown.

$ mii-tool
Check Bond Interface Link

Check Bond Interface Link

The types of Network Bonding are listed below.

  • mode=0 (balance-rr)
  • mode=1 (active-backup)
  • mode=2 (balance-xor)
  • mode=3 (broadcast)
  • mode=4 (802.3ad)
  • mode=5 (balance-tlb)
  • mode=6 (balance-alb)

The full documentations regarding NIC bonding can be found at Linux kernel doc pages.

dutree – A CLI Tool to Analyze Disk Usage in Coloured Output

dutree is a free open-source, fast command-line tool for analyzing disk usage, written in Rust programming language. It is developed from durep (disk usage reporter) and tree (list directory content in tree-like format) command line tools. dutree therefore reports disk usage in a tree-like format.

Read Also: Agedu – A Useful Tool for Tracking Down Wasted Disk Space in Linux

It displays coloured output, depending on values configured in the GNU LS_COLORS environment variable. This env variable enables for setting the colours of files based on extension, permissions as well as file type.

dutree Features:

  • Show the file system tree.
  • Supports aggregating of small files.
  • Allows for comparing different directories.
  • Supports excluding of files or directories.

How to Install dutree in Linux Systems

To install dutree in Linux distributions, you must have rust programming language installed on your system as shown.

$ sudo curl https://sh.rustup.rs -sSf | sh


Once rust installed, you can run the following command to install strong>dutree in Linux distributions as shown.

$ cargo install --git https://github.com/nachoparker/dutree.git

After installing dutree, it uses environment colors according to the variable LS_COLORS, it has the same colors ls --color command that our distro has configured.

$ ls --color

The simplest way of running dutree is without arguments, this way it shows a filesystem tree.

$ dutree
Linux Filesystem Disk Usage

Linux Filesystem Disk Usage

To display real disk usage instead of file size, use the -u flag.

$ dutree -u 
Show Linux Disk Usage

Show Linux Disk Usage

Show Directories in Depth

You can show directories up to a given depth (default 1), using the -d flag. The command below will show directories up to a depth of 3, under the current working directory.

For example if the current working directory (~/), then display size of ~/*/*/* as shown in the following sample screenshot.

$ dutree -d 3
Show Directories in Depth Disk Usage

Show Directories in Depth Disk Usage

Exclude Files or Directories in Output

To exclude matching a file or directory name, use the -x flag.

$ dutree -x CentOS-7.0-1406-x86_64-DVD.iso 
Show Disk Usage with Exclude Filename

Show Disk Usage with Exclude Filename

You can also get a quick local overview by skipping directories, using the -f option, like so.

$ dutree -f
Quick Overview by Skipping Directories

Quick Overview by Skipping Directories

A full summary/overview can be generated using the -s flag as shown.

$ dutree -s
Linux Disk Usage Summary

Linux Disk Usage Summary

Aggregate Small Files

It is possible to aggregate files smaller than a certain size, default is 1M as shown.

$ dutree -a 
Aggregate Small Files

Aggregate Small Files

Exclude Hidden Files

The -H switch allows for excluding hidden files in the output.

$ dutree -H

The -b option is used to print sizes in bytes, instead of kilobytes (default).

$ dutree -b

To turn off colors, and only display ASCII characters, use the -A flag like so.

$ dutree -A

You can view the dutree help message using the -h option.

$ dutree -h
Usage: dutree [options] [..]
Options:
-d, --depth [DEPTH] show directories up to depth N (def 1)
-a, --aggr [N[KMG]] aggregate smaller than N B/KiB/MiB/GiB (def 1M)
-s, --summary equivalent to -da, or -d1 -a1M
-u, --usage report real disk usage instead of file size
-b, --bytes print sizes in bytes
-x, --exclude NAME exclude matching files or directories
-H, --no-hidden exclude hidden files
-A, --ascii ASCII characters only, no colors
-h, --help show help
-v, --version print version number

dutree Github Repository: https://github.com/nachoparker/dutree

dutree is a simple yet powerful command-line tool to show file size and analyze disk usage in tree-like format, on Linux systems. Use the comment form below to share your thoughts or queries about it, with us.

Linux video editing, open source ERP systems, Windows apps, password managers, and more

Our biggest hit last week was Don Watkins’ article on why System76 will start making its Linux computers in the U.S. Here’s more of what readers were talking about the week of April 9-15:

  1. Linux computer maker to move manufacturing to the U.S., by Don Watkins
  2. Top 9 open source ERP systems to consider, by Opensource.com
  3. The current state of Linux video editing 2018, by Seth Kenlon
  4. 3 password managers for the Linux command line, by Scott Nesbitt
  5. 3 open source apps for Windows, by Jeff Macharyas
  6. Getting started with Jenkins Pipelines, by Miguel Suarez
  7. Replicate your custom Linux settings with DistroTweaks, by David Spring
  8. How to create LaTeX documents with Emacs, by Sachin Patil
  9. Git turns 13, Linux and SSH commands to know, Python programming, and more, by Rikki Endsley
  10. Build your first Redis Hello World application in Python, by Tague Griffith

Win a year of AdaBox

AdaBox is a US$ 60 per quarter service that delivers hand-picked Adafruit products, unique collectibles, and exclusive discounts to your door. Enter our giveaway by Sunday, April 29 at 11:59 p.m. Eastern Time for a chance to win.

Free 2017 Open Source Yearbook download

Our third annual open source community yearbook rounds up the top projects, technologies, and stories from 2017.

Call for articles

We want to see your JavaScript story ideas. Send article proposals, along with brief outlines, to rikki@opensource.com.

Stay up on what’s going on with Opensource.com by subscribing to our highlights newsletter.

Check out the editorial calendar for a preview of what’s ahead. Got a story idea? Send us a proposal!

LISA18 CFP now open

The CFP for LISA18 is open, and Brendan Gregg (Netflix) and I will co-chair this year’s event, which will be held Oct 29-31 in downtown Nashville. Do you have something to say about the present and future of Ops? If so, send in your talk proposal by May 24th. Follow LISA on Twitter to stay updated on deadlines and announcements. If you have questions or feedback, contact us at lisa18chairs@usenix.org.

10 Best Media Server Software for Linux in 2018

A media server is simply a specialized file server or computer system for storing media (digital videos/movies, audio/music, and images) which can be accessed over a network.

In order to setup a media server, you need computer hardware (or perhaps a cloud server) as well as a software that enables you to organize your media files, and makes it easier to stream and/or share them with friends and family.

In this article, we will share with you a list of 10 best media server software for Linux systems. By the time you complete this article, you will be able to choose the most appropriate software to setup your home/office/cloud media server powered by a Linux system.

1. Kodi – Home Theater Software

Kodi (previously known as XBMC) is a free and open source, highly customizable media server software. It is cross-platform and runs on Linux, Windows, MacOS; iOS and Android. It is more than just a media server; it’s an ideal entertainment center software with a fabulous user interface and several other media server software appliances are based on it.

Kodi Home Theater Software

Kodi Home Theater Software


Kodi enables you to play movies/videos, music/audio, podcasts, view images and other digital media files from your local computer or a network server as well as the internet.

Kodi Features:

  • Runs on a wide variety of devices.
  • It is user friendly.
  • Supports a web interface.
  • Supports a variety of user created Add-ons.
  • Supports televisions and remote controls.
  • Has a highly configurable interface via skins.
  • Allows you to watch and record live TV.
  • Supports importing pictures into a library.
  • Allows you to browse, view, sort, filter or even start a slideshow of your pictures and much more.

How to Install Kodi in Linux

To install Kodi on Ubuntu-based distributions, use the following PPA to install latest version.

$ sudo apt-get install software-properties-common
$ sudo add-apt-repository ppa:team-xbmc/ppa
$ sudo apt-get update
$ sudo apt-get install kodi

To install Kodi on Debian 9 (Stretch), use the following command, as Kodi is available in the default “main” Debian repository.

$ sudo apt-get update
$ sudo apt-get install kodi

To install Kodi on Fedora use pre-built RPMFusion packages as shown.

$ sudo dnf install --nogpgcheck \ https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm
$ sudo dnf install kodi

2. PLEX – Media Server

Plex is a powerful, secure and fully-featured and easy-to-install media server software. It runs on Linux, Windows, MacOS, and many other platforms.

Plex Home Media Server

Plex Home Media Server

It supports almost all major file formats and allows you to organize your media in a central point for easy access. Plex has an easy-to-navigate interface, and a collection of useful apps for a variety of devices: phones, tablets, gaming consoles, streaming devices and smart TVs.

Plex Features:

  • Supports encrypted connections with multiple user accounts.
  • Allows you to easily pick and choose what to share.
  • Offers a parental control functionality.
  • Supports mobile sync which offers offline access to your media files.
  • Supports flinging of video from one device to another.
  • Also supports cloud sync.
  • Supports audio fingerprinting and automatic photo-tagging.
  • Has a media optimizer and much more.

How to Install Plex in Linux

To install Plex in Ubuntu, Fedora and CentOS distributions, go the Download section and choose your Linux distribution architecture (32-bit or 64-bit) to download .DEB or .RPM package and install it using your default package manager.

3. Subsonic – Personal Media Streamer

Subsonic is a secure, reliable and easy-to-use personal media server and streamer. It runs on Linux, Windows, MacOS and Synology NAS. It is very customizable and supports all major media formats. There are more than 25 supported apps that you can use to stream music directly on your mobile phone.

Subsonic Personal Media Streamer

Subsonic Personal Media Streamer

Subsonic can operate with multiple users and any number of players at the same time. And it allows you to play movies/videos or music/audio files on any compatible DLNA/UPnP devices.

Subsonic Features:

  • Has a highly configurable UI (user interface).
  • Supports secure connections over HTTPS/SSL.
  • Integrates with the best web services.
  • Supports up to 28 languages and comes with 30 different themes.
  • Offers a chat features.
  • Allows you to access your server using your own address i.e https://yourname.subsonic.org.
  • Supports authentication in LDAP and Active Directory.
  • Has an integrated podcast receiver.
  • Supports setting upload and download bandwidth limits and lots more.

How to Install Subsonic in Linux

To install Subsonic in Debian/Ubuntu and Fedora/CentOS distributions, you need to first install Java 8 or Java 9 using following commands on your respective distributions.

------------- Install Java in Debian and Ubuntu ------------- $ sudo apt-get install openjdk-8-jre [Install Java 8 in Debian/Ubuntu]
$ sudo apt-get install openjdk-9-jre [Install Java 9 in Debian/Ubuntu]
------------- Install Java in Fedora and CentOS ------------- $ sudo sudo yum install java-1.8.0-openjdk

Next go to the Subsonic Download section to grab the .deb or .rpm package and install it using your default package manager.

$ sudo dpkg -i subsonic-x.x.deb [On Debian/Ubuntu]
$ sudo yum install --nogpgcheck subsonic-x.x.rpm [On Fedora/CentOS]

4. Madsonic – Music Streamer

Madsonic is an open source, flexible and secure web-based media server and media streamer developed using Java. It runs Linux, MacOS, Windows, and other Unix-like systems. If you are a developer, there is a free REST API (Madsonic API) that you use to develop your own apps, addons or scripts.

Madsonic Music Streamer

Madsonic Music Streamer

Madsonic Features:

  • Easy to use and comes with jukebox functionality.
  • It is highly flexible and scalable with an intuitive web interface.
  • Offers search and index functionalities with Chromecast support.
  • Has built-in support for your dreambox receiver.
  • Supports authentication in LDAP and Active Directory.

How to Install Madsonic in Linux

To install Madsonic in Debian/Ubuntu and Fedora/CentOS distributions, you need to first install Java 8 or Java 9 using following commands on your respective distributions.

------------- Install Java in Debian and Ubuntu ------------- $ sudo apt-get install openjdk-8-jre [Install Java 8 in Debian/Ubuntu]
$ sudo apt-get install openjdk-9-jre [Install Java 9 in Debian/Ubuntu]
------------- Install Java in Fedora and CentOS ------------- $ sudo yum install java-1.8.0-openjdk

Next go to the Madsonic Download section to grab the .deb or .rpm package and install it using your default package manager.

$ sudo dpkg -i Madsonic-x.x.xxxx.deb [On Debian/Ubuntu]
$ sudo sudo yum install --nogpgcheck Madsonic-x.x.xxxx.rpm [On Fedora/CentOS]

5. Emby – Open Media Solution

Emby is a powerful, easy-to-use and cross-platform media server software. Simply install the emby server on your machine running Linux, FreeBSD, Windows, MacOS or on NAS. You can also grab the emby app on Andriod, iOS, Windows or run the web client from a browser or still use the emby TV app.

Emby Media Solution

Emby Media Solution

Once you have it, it will help you manage your personal media library, such as home videos, music, photos and many other media formats.

Emby Features:

  • A beautiful UI with supports for mobile sync and cloud sync.
  • Offers powerful web-based tools for managing your media files.
  • Supports parental control.
  • It automatically detects DLNA devices.
  • Enables easy sending of movies/videos, music, pictures, and live TV shows to Chromecast and much more.

How to Install Emby in Linux

To install Emby in Ubuntu, Fedora and CentOS distributions, go the Emby Download section and choose your Linux distribution to download .DEB or .RPM package and install it using your default package manager.

6. Gerbera – UPnP Media Server

Gerbera is a free open source, powerful, flexible and full-featured UPnP (Universal Plug and Play) media server. It comes with a simple and intuitive web user interface for easily configuring your web server.

Gerbera UPnP Media Server

Gerbera UPnP Media Server

Gerbera has a highly flexible configuration, allowing you to control the behavior of various features of the server. It allows you to browse and playback media via UpnP.

Gerbera Features:

  • It is easy to setup.
  • Supports metadata extraction from mp3, ogg, flac, jpeg, etc. files.
  • Supports user defined server layout based on extracted metadata.
  • Support for ContentDirectoryService container updates.
  • Comes with exif thumbnail support.
  • Supports automatic directory rescans (timed, inotify).
  • Offers a nice Web UI with a tree view of the database and the file system, allowing to add/remove/edit/browse media.
  • Support for external URLs (create links to internet content and serve them via UPnP to your renderer).
  • Supports flexible media format transcoding via plugins / scripts and much more.

How to Install Gerbera in Linux

To install Gerbera in Ubuntu, Fedora and CentOS distributions, follow our installation guide that explains installation of Gerbera – UPnP Media Server in Linux and also shows how to stream media files using Gerbera on your home network.

7. Tvmobili – Smart TV Media Server

Tvmobili is a lightweight, high performance, cross-platform media server software that runs on Linux, Windows and MacOS; NAS as well as embedded/ARM devices. It is easy to install and in addition, tvmobili is is fully integrated with iTunes and offers amazing support for full 1080p High Definition (HD) videos.

Tvmobili Media Server

Tvmobili Media Server

Tvmobili Features:

  • Easy to install, high performance media server.
  • Fully integrated with iTunes (and iPhoto on Macs).
  • Supports full 1080p High Definition (HD) video.
  • Lightweight media server.

How to Install Tvmobili in Linux

To install Tvmobili in Ubuntu, Fedora and CentOS distributions, go the Tvmobili Download section and choose your Linux distribution to download .DEB or .RPM package and install it using your default package manager.

8. OpenELEC – Open Embedded Linux Entertainment Center

OpenELEC is a lightweight Linux based operating system for setting up your machine as a media server using Kodi. It is built from scratch for the sole purpose of running Kodi media server software.

OpenELEC Open Embedded Linux

OpenELEC Open Embedded Linux

It allows you to organize your movie collections; offers you a picture browser, music and audiobook player, TV and personal video recorder, and a TV show management functionality. It is highly extensible through a great number of addons.

OpenELEC Features

  • Organize your movie collections and play your media with relevant info, subtitles and fanart.
  • Manually watch all your photos or use a handy slide show with zoom effect.
  • Browe, watch and record your favourite TV channels.
  • Manage your TV series and keep track of your favorite episodes.
  • Listent audo files in various formats with artists photos and album covers.
  • Easy expandable with Addons.

How to Install OpenELEC in Linux

As we said, OpenELEC is a small Linux based operating system built from scratch as a platform to turn your computer into a Kodi media center. To install it, go to the OpenELEC installation section,that shows you how to create the OpenELEC install stick on a Linux machine and install OpenELEC via the created install stick onto your HTPC.

9. OpenFlixr – Media Server

OpenFlixr is a virtual, flexible, energy efficient and fully-automated media server software. It uses several other applications to achieve its overall functions, including Plex as a media server (to organizes movies, series, music and pictures and streams them), Ubooquity for serving comics and ebooks and a web-based reader. It supports automated downloading and serving of media, encrypted connections, and smart auto-updating.

OpenFLIXR Media Server

OpenFLIXR Media Server

How to Install OpenFLIXR in Linux

To install OpenFLIXR, the only thing you need is a visualization software such as VirtualBox, KVM, Vmware, etc.

Once you have visualization software installed, Download OpenFLIXR and then import in hypervisor, power on and let it sit back for a couple of minutes till installation finishes, after that go to http://IP-Address/setup to setup OpenFLIXR.

10. OSMC – Open Source Media Center

OSMC is a free open source, simple, easy-to-use, full-featured media server software and media streamer for Linux. It is based on the Kodi media server software. It supports all well known media formats and a variety of sharing protocols. In addition, it comes with a remarkable interface. Once you have installed it, you get easy updates and apps to use.

OSMC - Open Source Media Center

OSMC – Open Source Media Center

How to Install OSMC in Linux

To install OSMC in Debian/Ubuntu, Fedora and RHEL/CentOS distributions, first go to the OSMC Download section, simply select your current Linux operating system and follow the installation instructions to install it using your package manager.

Conclusion

In this article, we shared with you some of the best media server software for Linux systems. If you know any media server software for Linux missing in the list above, just hit us up via the feedback form below.

Using less to view text files at the Linux command line

If there’s one thing you’re sure to find on a Linux system, it’s text files. A lot of them. Readme files, configuration files, documents, and more.

Most of the time, you probably open text files using a text editor. But there is a faster and, I think, better way of reading text files. That’s using a utility called less. Standard kit with all Linux distributions (at least the ones I’ve used), less is a command-line textfile viewer with some useful features.

Don’t let the fact that it’s a command-line tool scare you. less is very easy to use and has a very shallow learning curve.

Let’s take a look at some of the things that you can do with less.

Getting started

Crack open a terminal window and navigate to a directory containing one or more text files that you want to view. Then run the command less filename, where filename is the name of the file you want to view.

The file takes over your terminal window, and you’ll notice a colon (:) at the bottom of the window. The colon is where you can type any of the internal commands you use with less. More on these in a moment.

Moving around

Chances are that the text file you’re perusing is more than a couple of lines long; it’s probably a page or more. With less, you can move forward in the file in a few ways:

  • Move down a page by pressing the spacebar or the PgDn key
  • Move down one line at a time by pressing the Down arrow key

less also allows you to move backward in a file. To do that, press the PgUp key (to move up a page at a time) or the Up arrow key (to move up one line at a time).

Finding text

If you have a large text file or are trying to find a specific piece of text, you can do that easily in less. To find a word or phrase, press / on your keyboard and type what you want to find.

Note that the search function in less is case-sensitive. Typing “the silence” isn’t the same as typing “The Silence.”

less also highlights the words or phrases you search for. That’s a nice touch that makes it easier for you to scan the text.

You can press n on your keyboard to find the next instance of the word or phrase. Press p on your keyboard to find the previous instance.

Getting out of there

Once you get to the end of a text file and you’re done viewing it, how do you exit less? That’s easy. Just press q on your keyboard. (You can also press q at any time to leave the program.)

As I mentioned at the beginning of this post, less is easy to use. Once you use it, you’ll wonder how you ever did without it.