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.

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.

How to Connect Wi-Fi from Linux Terminal Using Nmcli Command

There are several command-line tools for managing a wireless network interface in Linux systems. A number of these can be used to simply view the wireless network interface status (whether it is up or down, or if it is connected to any network), such as iw, iwlist, ip, ifconfig and others.

And some are used to connect to a wireless network, and these include: nmcli, is a command-line tool used to create, show, edit, delete, enable, and disable network connections, as well as control and display network device status.

First start by checking the name of your network device using the following command. From the output of this command, the device name/interface is wlp1s0 as shown.

$ iw dev
phy#0
Interface wlp1s0
ifindex 3
wdev 0x1
addr 38:b1:db:7c:78:c7
type managed

Next, check the Wi-Fi device connection status using the following command.

iw wlp2s0 link
Not connected.


From the output above the device is not connected to any network, run the following command to scan available Wi-Fi networks.

sudo iw wlp2s0 scan
command failed: Network is down (-100)

Considering the output of the above command, the network device/interface is DOWN, you can turn it On (UP) with the ip command as shown.

$ sudo ip link set wlp1s0 up

If you get the following error, that means your Wifi is hard blocked on Laptop or Computer.

RTNETLINK answers: Operation not possible due to RF-kill

To remove or unblock you need to run the following command to solve the error.

$ echo "blacklist hp_wmi" | sudo tee /etc/modprobe.d/hp.conf
$ sudo rfkill unblock all

Then try to turn ON the network device once more, and it should work this time around.

$ sudo ip link set wlp1s0 up

If you know the ESSID of the Wi-Fi network you wish to connect to, move to the next step, otherwise issue the command below to scan available Wi-Fi networks again.

$ sudo iw wlp1s0 scan

And lastly, connect to the wi-fi network using following command, where Hackernet (Wi-Fi network SSID) and localhost22 (password/pre-shared key).

$ nmcli dev wifi connect Hackernet password localhost22

Once connected, verify your connectivity by doing a ping to an external machine and analyze the output of the ping as shown.

$ ping 8.8.8.8
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
64 bytes from 8.8.8.8: icmp_seq=1 ttl=48 time=61.7 ms
64 bytes from 8.8.8.8: icmp_seq=2 ttl=48 time=61.5 ms
64 bytes from 8.8.8.8: icmp_seq=3 ttl=48 time=61.6 ms
64 bytes from 8.8.8.8: icmp_seq=4 ttl=48 time=61.3 ms
64 bytes from 8.8.8.8: icmp_seq=5 ttl=48 time=63.9 ms
^C
--- 8.8.8.8 ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 4006ms
rtt min/avg/max/mdev = 61.338/62.047/63.928/0.950 ms

That’s It! I hope this article helped you to setup your Wi-Fi network from the Linux command line. As always, if you found this article useful, share your thoughts in the comment section below.

Tig – A Command Line Browser for Git Repositories

In a recent article, we’ve described how to install and use GRV tool for viewing Git repositories in Linux terminal. In this article, we would like to introduce to you another useful command-line based interface to git called Tig.

Tig is a free open source, cross platform ncurses-based text-mode interface for git. It is a straight-forward interface to git that can help in staging changes for commit at chunk level and works as a pager for output from different Git commands. It can run on Linux, MacOSX as well as Windows systems.

How to Install Tig in Linux Systems

To install Tig in Linux, you need to first clone the Tig repository to your system and install it as shown.

$ git clone git://github.com/jonas/tig.git
$ make
$ make install

By default, tig will be installed under $HOME/bin directory, but ff you wish to install it in another directory under in your PATH, set prefix to the desired path, as shown.

$ make prefix=/usr/local
$ sudo make install prefix=/usr/local


Once you have installed Tig on your system, using the cd command get into your any of your local git repositories and run tig without any arguments, which should show all commits for the repository.

$ cd ~/bin/shellscripts/
$ tig 
Show Git Repository Commits

Show Git Repository Commits

To quit Tig, press q to close it.

Display Repository Activity Log

To display a log activities of the above repository, use the log sub-command.

$ tig log
View Git Repository Log

View Git Repository Log

Show Repository Objects

The show sub-command allows you to display one or more objects such as commits and many more, in a more detailed way, as shown.

$ tig show commits
Show Git Repository Objects

Show Git Repository Objects

Search A Pattern/Word in Git Files

You can also search for a particular pattern (for example the word check) in your git files with the grep sub-command, as shown.

$ tig grep check 
Search a Work in Git Repository

Search a Work in Git Repository

Display Git Repository Status

To display status of your git repository use status sub-command as shown.

$ tig status
Show Git Repository Status

Show Git Repository Status

For more Tig usage, please refer to help section or visit the Tig Github repository at https://github.com/jonas/tig.

$ tig -h

Tig is a simple ncurses-based interface to git repositories and mainly act as a Git repository browser. Give us your feedback or ask any questions via the comment form below.

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

Assume you are running short on disk space and you wanted to free up, by searching something that’s a waste of space and removing it or moving it to an archive medium. How do you track down right stuff to delete, that saves maximum space?

Linux provides a standard du command, which scans entire disk and shows you which directories hold the huge amount of data. That can assist you narrow your search to the things most useful deleting.

However, that only shows you what’s huge. What you actually want to know is what’s too huge. By default, du command will not let you differentiate between data that’s huge because you are doing something that needs it to be huge, and data that’s huge because you unpacked it once and ignored about it.

Most Linux file systems, by default only shows when a file was last accessed, but not shown when it was written, modified or even read. So if you created a huge amount of data years ago, forgot to delete it and have never used it since, then it is important to use those last-access time stamps to know the difference between used and unused data.


Agedu pronounced as (age dee you) is an open source and free utility (much like du command) that helps system administrators to track down wasted disk space used by old files and delete them to free up some space.

Agedu does a complete scan and produces reports that shows how much disk space is utilized by each directory and sub directory along with the last-access times of files. In simple words, it simply helps you to free up disk space.

Agedu Features

  1. Creates graphical reports.
  2. Produces data output in HTML format.
  3. Generates HTML reports with hyperlinks to other directories for easy navigation to gather reports.
  4. Provides more configurable options.

How Does Agedu Works?

From the man page:

agedu is a program which does this. It does basically the same sort of disk scan as du, but it also records the last-access times of everything it scans. Then it builds an index that lets it efficiently generate reports giving a summary of the results for each subdirectory, and then it produces those reports on demand.

How to Install Agedu in Linux Systems

On Debian/Ubuntu, agedu is available to install from the default system repositories using following apt-get command as shown.

$ sudo apt-get install agedu

On RHEL/CentOS, you need to turn on EPEL repository to install Agedu using following yum command as shown.

# yum install epel-release
# yum install agedu

Fedora and Arch Linux users, simply type the following command to install Agedu.

$ sudo dnf install agedu [On Fedora]
$ sudo yaourt -S agedu [On Arch Linux]

On other Linux distributions, you can compile Agedu from source as shown.

$ wget https://www.chiark.greenend.org.uk/~sgtatham/agedu/agedu-20180329.af641e6.tar.gz
$ tar -xvf agedu-20180329.af641e6.tar.gz
$ cd agedu-20180329.af641e6
$ ./configure
$ make
$ sudo make install

How to Track Wasted Disk Space Using Agedu

The following command will do a complete scan of /home/tecmint directory and its sub-directories and creates a special index file containing its data structure.

# agedu -s /home/tecmint/

Scan Linux System for Disk Space

Built pathname index, 232578 entries, 22842517 bytes of index Faking directory atimes
Building index
Final index file size = 97485984 bytes

Next, type the following command to query newly created index file.

# agedu -w
Sample Output :
Using Linux /proc/net magic authentication
URL: http://localhost:34895/

Now, type the following command to open the URL using any web browser.

# http://localhost:34895/
Graphical Output :

The below screen shows the graphical representation of disk usage of /home/tecmint along with its sub directories using various colors to show the difference between disused and recently accessed data.

Click on any sub directory to see the reports of its sub-directories. To terminate this mode, just press [CTRL+D] on command line.

Linux Disk Space Usage

Linux Disk Space Usage

To create and set custom port number for agedu, type the following command.

# agedu -w --address 127.0.0.1:8081
Sample Output :
Using Linux /proc/net magic authentication
URL: http://127.0.0.1:8081/

Enable password protection for Agedu using the following command.

# agedu -w --address 127.0.0.1:8081 --auth basic

Agedu Password Protect Reports

Username: agedu
Password: n2tx16jejnbzmuur
URL: http://127.0.0.1:8081/
Password Protect Agedu

Password Protect Agedu

Linux Directory Disk Space Usage

Linux Directory Disk Space Usage

Access Agedu reports using terminal mode.

# agedu -t /home/tecmint

Show Disk Space Usage in Terminal

8612 /home/tecmint/.AndroidStudio3.1
3684 /home/tecmint/.PlayOnLinux
604 /home/tecmint/.ScreamingFrogSEOSpider
2416 /home/tecmint/.TelegramDesktop
61960 /home/tecmint/.Write
1508 /home/tecmint/.adobe
20 /home/tecmint/.aptitude
48 /home/tecmint/.byobu
1215948 /home/tecmint/.cache
3096 /home/tecmint/.cinnamon
1421828 /home/tecmint/.config
12 /home/tecmint/.dbus
8 /home/tecmint/.emacs.d
780 /home/tecmint/.fonts
...

You see the output similar to du command. Let’s see the old files which are not accessed for long time. For example, to see only old files that are not accessed in last 12 months or more.

# agedu -t /home/tecmint -a 12m

Show Files Not Accessed in Last 12 Months

2416 /home/tecmint/.TelegramDesktop
1500 /home/tecmint/.adobe
46776 /home/tecmint/.cache
1840 /home/tecmint/.cinnamon
142796 /home/tecmint/.config
636 /home/tecmint/.gconf
88 /home/tecmint/.gimp-2.8
12 /home/tecmint/.gnome
112 /home/tecmint/.java
108 /home/tecmint/.kde
8 /home/tecmint/.links2
16 /home/tecmint/.linuxmint
6804 /home/tecmint/.local
12 /home/tecmint/.mindterm
40920 /home/tecmint/.mozilla
4 /home/tecmint/.oracle_jre_usage
12 /home/tecmint/.parallel
24 /home/tecmint/.shutter
6840 /home/tecmint/.softmaker
336 /home/tecmint/.themes
....

Let’s find out how much disk space taken by MP3 files by using following command.

# agedu -s . --exclude '*' --include '*.mp3'

Again to see reports run the following command.

# agedu -w

To deleted files and free up disk space, use the following command.

# rm -rf /downloads/*.mp3

How to remove agedu index file? First see the size of the index file with the following command.

# ls agedu.dat -lh
Sample output :
-rw------- 1 tecmint tecmint 35M Apr 10 12:05 agedu.dat

To remove index file, just enter.

# agedu -R

For more information on agedu command options and usage, please read the man pages or visit agedu home page.

# man agedu

If you know any tool that we haven’t mentioned in this site. Please let us know about it via comment box below.

5 ‘stat’ Command Examples for Linux Newbies

stat command is a useful utility for viewing file or file system status. It retrieves information such as file type; access rights in octal and human-readable; SELinux security context string; time of file birth, last access, last data modification, last status change in both human-readable and in seconds since Epoch, and much more.

It has an option to specify a custom format instead of the default, for displaying information. In this guide, we will look at five stat command examples for Linux newbies.

Check Linux File Status

1. The easiest way to use stat is to provide it a file as an argument. The following command will display the size, blocks, IO blocks, file type, inode value, number of links and much more information about the file /var/log/syslog, as shown in the screenshot:

$ stat /var/log/syslog
File: '/var/log/syslog'
Size: 26572 Blocks: 56 IO Block: 4096 regular file
Device: 80ah/2058d Inode: 8129076 Links: 1
Access: (0640/-rw-r-----) Uid: ( 104/ syslog) Gid: ( 4/ adm)
Access: 2018-04-06 09:42:10.987615337 +0530
Modify: 2018-04-06 11:09:29.756650149 +0530
Change: 2018-04-06 11:09:29.756650149 +0530
Birth: -

Check File System Status

2. In the previous example, stat command treated the input file as a normal file, however, to display file system status instead of file status, use the -f option.

$ stat -f /var/log/syslog
File: "/var/log/syslog"
ID: ce97e63d2201c974 Namelen: 255 Type: ext2/ext3
Block size: 4096 Fundamental block size: 4096
Blocks: Total: 84769790 Free: 16012830 Available: 11700997
Inodes: Total: 21544960 Free: 20995459


You can also provide a directory/filesystem as an argument as shown.

$ stat -f /
File: "/"
ID: ce97e63d2201c974 Namelen: 255 Type: ext2/ext3
Block size: 4096 Fundamental block size: 4096
Blocks: Total: 84769790 Free: 16056471 Available: 11744638
Inodes: Total: 21544960 Free: 21005263

Enable Following of Symbolic Links

3. Since Linux supports links (symbolic and hard links), certain files may have one or more links, or they could even exist in a filesystem.

To enable stat to follow links, use the -f flag as shown.

$ stat -L /
File: '/'
Size: 4096 Blocks: 8 IO Block: 4096 directory
Device: 80ah/2058d Inode: 2 Links: 25
Access: (0755/drwxr-xr-x) Uid: ( 0/ root) Gid: ( 0/ root)
Access: 2018-04-09 10:55:55.119150525 +0530
Modify: 2018-02-20 11:15:54.462893167 +0530
Change: 2018-02-20 11:15:54.462893167 +0530
Birth: -

Use a Custom Format To Display Information

4. stat also allows you to use a particular or custom format instead of the default. The -c flag is used to specify the format used, it prints a newline after each use of format sequence.

Alternatively, you can use the --printf option which enables interpreting of backslash escapes sequences and turns off printing of a trailing newline. You need to use \n in the format to print a new line, for example.

# stat --printf='%U\n%G\n%C\n%z\n' /var/log/secure

Meaning of the format sequences for files used in above example:

  • %U – user name of owner
  • %G – group name of owner
  • %C – SELinux security context string
  • %z – time of last status change, human-readable

5. Here is an example which shows using of accepted format sequences for file systems.

$ stat --printf='%n\n%a\n%b\n' /

Meaning of the format sequences used in the above command.

  • %n – shows the file name
  • %a – print free blocks available to non-superuser
  • %b – outputs total data blocks in file system

Print Information in Terse Form

6. The -t option can be used to print the information in terse form.

$ stat -t /var/log/syslog
/var/log/syslog 12760 32 81a0 104 4 80a 8129076 1 0 0 1523251873 1523256421 1523256421 0 4096

As a last note, your shell may have its own version of stat, please refer to your shell’s documentation for details about the options it supports. To see all accepted output format sequences, refer to the stat man page.

$ man stat 

In this article, we have explained five stat command examples for Linux newbies. Use the feedback form below to ask any questions.

Newsboat – An RSS/Atom Feed Reader for Linux Terminals

Newsboat is a free, open source RSS/Atom feed reader for Linux terminals. It is originally created from Newsbeuter, a text based RSS/Atom feed reader, however, Newsbeuter is not actively maintained.

RSS/Atom are a number of widely-used XML formats to communicate, publish and syndicate articles, for instance news or blog articles. Newsboat is created to be used on text terminals such as GNU/Linux, FreeBSD or macOS.

Read Also: Newsroom – A Modern CLI to Get Your Favorite News in Linux

In this article, we will show how to install and use Newsboat – a command-line feed reader to read your favorite news or articles from the Linux terminal.

Requirements:

  • GCC 4.9 or later, or Clang 3.6 or later
  • STFL (version 0.21 or later)
  • pkg-config
  • GNU gettext (only for systems that do not offer gettext in the libc)
  • libcurl (version 7.18.0 or later)
  • libxml2, xmllint, and xsltproc
  • json-c (version 0.11 or later)
  • SQLite3 (version 3.5 or later)
  • DocBook XML
  • DocBook SML
  • asciidoc

How to Install Newsboat in Linux Systems


Newsboat is available to install from the snap package management system, but first you have to install snapd on your system to install Newsboat as shown.

------------- On Debian/Ubuntu/Linux Mint ------------- $ sudo apt install snapd $ sudo snap install newsboat ------------- On Fedora 22+ -------------
$ sudo dnf install snapd
$ sudo snap install newsboat

Alternatively, you can install Newsboat from source code to use some of the latest features, but before that you need to fully install dependencies with the command that follows.

------------- On Debian/Ubuntu/Linux Mint ------------- $ sudo apt update
$ sudo apt install libncursesw5-dev ncurses-term debhelper libjson0 libjson0-dev libxml2-dev libstfl-dev libsqlite3-dev perl pkg-config libcurl4-gnutls-dev librtmp-dev libjson-c-dev asciidoc libxml2-utils xsltproc docbook-xml docbook-xsl bc
$ wget http://www.clifford.at/stfl/stfl-0.24.tar.gz
$ tar -xvf stfl-0.24.tar.gz
$ cd stfl-0.24
$ make
$ sudo make install
------------- On RHEL and CentOS -------------
# yum install libncursesw5-devel ncurses-term libjson0-devel libxml2-devel libstfl-devel libsqlite3-devel perl pkgconfig libcurl4-gnutls-devel librtmp-devel libjson-c-devel asciidoc libxml2-devel libxslt-devel debhelper docbook-style-xsl docbook-style-xml bc
# wget http://www.clifford.at/stfl/stfl-0.24.tar.gz
# tar -xvf stfl-0.24.tar.gz
# cd stfl-0.24
# make
# make install 

Then clone the Newsboat repository from Github to your system, and install it as shown.

$ git clone git://github.com/newsboat/newsboat.git
$ cd newsboat $ make
$ sudo make install

How to Use Newsboat Feed Reader in Linux Terminal

In this section, we will explain how to use Newsboat to read RSS feed from a site, for example tecmint.com First of all, we will need to get the rss-feed link for tecmint.com from a browser and copy it (you can use any website feed url).

https://www.tecmint.com/feed/

Afterwards, save it in a file for later usage.

$ echo "https://www.tecmint.com/feed/" >rss_links.txt

Now you can read RSS feed from Tecmint.com using following command with the switches -u (specifies file containing RSS feed URLs) and -r (refresh feeds on start) as follows.

$ newsboat -ru rss_links.txt
Read RSS Feed in Linux Terminal

Read RSS Feed in Linux Terminal

To select a topic, use the Up and Down arrows to navigate, then press Enter on the topic you want. This examples shows that we have selected topic number 5 from the list.

Select Feed Topic in Linux Terminal

Select Feed Topic in Linux Terminal

To open a topic in the browser, you can press o, and to quit the program, hit q.

You can see all the options and usages by running the following command.

$ newsboat -h

For more information, visit Newsboat Github Repository: https://github.com/newsboat/newsboat.

Read Also: Cricket-CLI – Watch Live Cricket Scores in Linux Terminal

Newsboat is a simple and intuitive RSS/Atom feed reader for Linux terminals. Try it out and give us your feedback via the comment form below.

LG re-open sources WebOS, a look at the AI behind the Pixel 2's camera, and more news

In this edition of our open source news roundup, we take a look LG making WebOS open source (again), Google’s camera AI tools, a 3D printed stethoscope, and more.

Open source news roundup for March 18-31, 2018

LG makes WebOS open source… again

What was once open source is open source again. After Korean electronics giant LG bought WebOS from HP, it made the mobile operating system proprietary. The company has done an about-face and has released WebOS Open Source Edition. The goal: to convince developers to adopt WebOS for tablets, set-top boxes, and more.

WebOS, which was originally designed for Palm’s failed line of smartphones, has been powering LG’s televisions since 2013. Since then, “LG has refined the platform significantly, and hopes that the new release will help others exploit it.” To try to get developers on the WebOS bandwagon, the company has made a software development kit and build instructions available.

Google open sources its camera AI tools

Ever wonder how Google’s Pixel 2 smartphones take such impressive portrait-mode photos? Wonder no more. Google has open sourced the artificial intelligence technology behind it.

Called DeepLab 3+, the technology “uses a neural network to detect the outlines of objects in your camera’s field of view.” That enables a camera to gain a greater depth of field and to more accurately identify objects it sees. You can grab the code for DeepLab 3+ from GitHub and learn more about how the technology works.

Researchers create clinically-validated 3D printed stethoscope

Something as simple as a stethoscope can make a huge difference to medical professionals, especially ones in developing countries and in conflict zones. High-quality stethoscopes can be a difficult-to-obtain commodity in those situations, though. Thanks to the work of Dr. Tarek Loubani of the University of Western Ontario, anyone with access to a 3D printer and ABS plastic can 3D print a high-quality stethoscope for less than $3.

Loubani’s stethoscope design, called the Gila, “was made using free open source software to keep costs low and allow others to easily access the code.” Loubani said that the Gila “is the first open source medical device that has been clinically validated and is widely available,” and that “the acoustic quality was the same in our stethoscope as in a premium brand stethoscope.” You can learn more at the Gila Free Medical Hardware GitHub repository.

New open source file indexing software

The laboratory that gave the world the atomic bomb has made its search and retrieval software open source. Los Alamos National Laboratory boasts that its Grand Unified File Index (GUFI for short), released under a BSD license, can perform within seconds queries “that would previously have taken hours or days.”

Gary Grider, who heads the High Performance Computing division at Los Alamos, said that GUFI “will have a big impact on the ability for many levels of users to search data and get a fast response.” That includes making “calculations that support national security, as well as basic scientific research in fields such as engineered materials, biological processes, and earth systems modeling.”

In other news

Thanks, as always, to Opensource.com staff members and moderators for their help this week. Make sure to check out our event calendar to see what’s happening next week in open source.

How to build a plotter with Arduino

Back in school, there was an HP plotter well hidden in a closet in the science department. I got to play with it for a while and always wanted to have one of my own. Fast forward many, many years. Stepper motors are easily available, I am back into doing stuff with electronics and micro-controllers, and I recently saw someone creating displays with engraved acrylic. This triggered me to finally build my own plotter.

As an old-school 5V guy, I really like the original Arduino Uno. Here’s a list of the other components I used (fyi, I am not affiliated with any of these companies):

  • FabScan shield: Physically hosts the stepper motor drivers.
  • SilentStepSticks: Motor drivers, as the Arduino on its own can’t handle the voltage and current that a stepper motor needs. I am using ones with a Trinamic TMC2130 chip, but in standalone mode for now. Those are replacements for the Pololu 4988, but allow for much quieter operation.
  • SilentStepStick protectors: Diodes that prevent the turning motor from frying your motor drivers (you want them, believe me).
  • Stepper motors: I selected NEMA 17 motors with 12V (e.g., models from Watterott and SparkFun).
  • Linear guide rails
  • Wooden base plate
  • Wood screws
  • GT2 belt  
  • GT2 timing pulley

This is a work in progress that I created as a personal project. If you are looking for a ready-made kit, then check out the MaXYposi from German Make magazine.

Hardware setup

As you can see here, I started out much too large. This plotter can’t comfortably sit on my desk, but it’s okay, as I did it for learning purposes (and, as I have to re-do some things, next time I’ll use smaller beams).

The belt is mounted on both sides of the rail and then slung around the motor with some helper wheels:

I’ve stacked several components on top of the Arduino. The Arduino is on the bottom, above that is the FabScan shield, next is a StepStick protector on motor slots 1+2, and the SilentStepStick is on top. Note that the SCK and SDI pins are not connected.

Be careful to correctly attach the wires to the motor. When in doubt, look at the data sheet or an ohmmeter to figure out which wires belong together.

Software setup

While software like grbl can interpret so-called G-codes for tool movement and other things, and I could have just flashed it to the Arduino, I am curious and wanted to better understand things. (My X-Y plotter software is available at GitHub and comes without any warranty.)

The basics

To drive a stepper motor with the StepStick (or compatible) driver, you basically need to send a high and then a low signal to the respective pin. Or in Arduino terms:


digitalWrite(stepPin, HIGH);
delayMicroseconds(30);
digitalWrite(stepPin, LOW);

Where stepPin is the pin number for the stepper: 3 for motor 1 and 6 for motor 2.

Before the stepper does any work, it must be enabled.

digitalWrite(enPin, LOW);

Actually, the StepStick knows three states for the pin:

  • Low: Motor is enabled
  • High: Motor is disabled
  • Pin not connected: Motor is enabled but goes into an energy-saving mode after a while

When a motor is enabled, its coils are powered and it keeps its position. It is almost impossible to manually turn its axis. This is good for precision purposes, but it also means that both motors and driver chips are “flooded” with power and will warm up.

And last, but not least, we need a way to determine the plotter’s direction:

digitalWrite(dirPin, direction);

The following table lists the functions and the pins

Function Motor1 Motor2
Enable 2 5
Direction 4 7
Step 3 6

Before we can use the pins, we need to set them to OUTPUT mode in the setup() section of the code


pinMode(enPin1, OUTPUT);
pinMode(stepPin1, OUTPUT);
pinMode(dirPin1, OUTPUT);
digitalWrite(enPin1, LOW);

With this knowledge, we can easily get the stepper to move around:


    totalRounds = …
    for (int rounds =0 ; rounds < 2*totalRounds; rounds++) {
       if (dir==0){ // set direction
         digitalWrite(dirPin2, LOW);
       } else {
         digitalWrite(dirPin2, HIGH);
       }
       delay(1); // give motors some breathing time
       dir = 1-dir; // reverse direction
       for (int i=0; i < 6400; i++) {
         int t = abs(3200-i) / 200;
         digitalWrite(stepPin2, HIGH);
         delayMicroseconds(70 + t);
         digitalWrite(stepPin2, LOW);
         delayMicroseconds(70 + t);
       }
    }

This will make the slider move left and right. This code deals with one stepper, but for an X-Y plotter, we have two axes to consider.

Command interpreter

I started to implement a simple command interpreter to use path specifications, such as:

"X30|Y30|X-30 Y-30|X-20|Y-20|X20|Y20|X-40|Y-25|X40 Y25

to describe relative movements in millimeters (1mm equals 80 steps).

The plotter software implements a continuous mode, which allows a PC to feed large paths (in chunks) to the plotter. (This how I plotted the Hilbert curve in this video.)

Building a better pen holder

In the first image above, the pen was tied to the Y-axis with some metal string. This was not precise and also did not enable the software to raise and lower the hand (this explains the big black dots).

I have since created a better, more precise pen holder that uses a servo to raise and lower the pen. This new, improved holder can be seen in this picture and in the Hilbert curve video linked above.

The pen is attached with a little clamp (the one shown is a size 8 clamp typically used to attach cables to walls). The servo arm can raise the pen; when the arm goes down, gravity will lower the pen.

Driving the servo

Driving the servo is relatively straightforward: Just provide the position and the servo does all the work.


#include

// Servo pin
#define servoData PIN_A1

// Positions
#define PEN_UP 10
#define PEN_DOWN 50

Servo penServo;

void setup() {
  // Attach to servo and raise pen
  penServo.attach(servoData);
  penServo.write(PEN_UP);
}

I am using the servo headers on the Motor 4 place of the FabScan shield, so I’ve used analog pin 1.

Lowering the pen is as easy as:

 penServo.write(PEN_DOWN);

Next steps

One of my next steps will be to add some end detectors, but I may skip them and use the StallGuard mode of the TMC2130 instead. Those detectors can also be used to implement a home command.

And perhaps in the future I’ll add a real Z-axis that can hold an engraver to do wood milling, or PCB drilling, or acrylic engraving, or … (a laser comes to mind as well).

This was originally published on the Some Things to Remember blog and is reprinted with permission.

System Tar and Restore – A Versatile System Backup Script for Linux

System Tar and Restore is a versatile system backup script for Linux systems. It comes with two bash scripts, the main script star.sh and a GUI wrapper script star-gui.sh, which perform in three modes: backup, restore and transfer.

Read Also: 14 Outstanding Backup Utilities for Linux Systems

Features

  1. Full or partial system backup
  2. Restore or transfer to the same or different disk/partition layout.
  3. Restore or transfer backup to an external drive such as USB, SD card etc.
  4. Restore a BIOS-based system to UEFI and vice versa.
  5. Arrange a system in a virtual machine (such as virtualbox), back it up and restore it in a normal system.

Requirements:

  1. gtkdialog 0.8.3 or later (for the gui).
  2. tar 1.27 or later (acls and xattrs support).
  3. rsync (for Transfer Mode).
  4. wget (for downloading backup archives).
  5. gptfdisk/gdisk (for GPT and Syslinux).
  6. openssl/gpg (for encryption).

How to Install System Tar and Restore Tool in Linux

To install System Tar and Restore program, you need to first install all the required software packages as listed below.

$ sudo apt install git tar rsync wget gptfdisk openssl [On Debian/Ubuntu]
# yum install git tar rsync wget gptfdisk openssl [On CentOS/RHEL]
# dnf install git tar rsync wget gptfdisk openssl [On Fedora]

Once all the required packages installed, now it’s time to download these scripts by cloning the system tar and restore repository to your system and run these scripts with root user privileges, otherwise, use the sudo command.

$ cd Download
$ git clone https://github.com/tritonas00/system-tar-and-restore.git
$ cd system-tar-and-restore/
$ ls
Install System Tar and Restore

Install System Tar and Restore

Linux System Backup


First create a directory where your system backup files will be stored (you can actually use any other directory of your choice).

$ sudo mkdir /backups

Now run the following command to create a system backup file in /backups directory, the archive file will be compressed using the xz utility, where the flags are.

  • -i – specifies the operation mode(0 meaning backup mode).
  • -d – specifies destination directory, where the backup file will be stored.
  • -c – defines the compression utility.
  • -u – allows for reading additional tar/rsync options.
$ sudo ./star.sh -i 0 -d /backups -c xz -u "--warning=none"
Perform Linux System Backup

Perform Linux System Backup

To exclude the /home in the backup, add the -H flag, and use gzip compression utility as shown.

$ sudo ./star.sh -i 0 -d /backups -c gzip -H -u "--warning=none"

Restore Linux System Backup

You can also restore a backup as in the following command.

$ sudo ./star.sh -i 1 -r /dev/sdb1 -G /dev/sdb -f /backups/backup.tar.xz

where the option are:

  • -i – specifies operation mode (1 meaning restore mode).
  • -r – defines targeted root (/) partition.
  • -G – defines the grub partition.
  • -f – specified the backup file path.

The final example show how to run it in transfer mode (2). The new option here is -b, which sets the boot partition.

$ sudo ./star.sh -i 2 -r /dev/sdb2 -b /dev/sdb1 -G /dev/sdb

In addition, if you have mounted /usr and /var on separate partitions, considering the previous command, you can specify them using the -t switch, as shown.

$ sudo ./star.sh -i 2 -r /dev/sdb2 -b /dev/sdb1 -t "/var=/dev/sdb4 /usr=/dev/sdb3" -G /dev/sdb

We have just looked a few basic options of System Tar and Restore script, you can view all available options using the following command.

$ star.sh --help 

If you are accustomed to graphical user interfaces, you can use the GUI wrapper star-gui.sh instead. But you need to install gtkdialog – used to create graphical (GTK+) interfaces and dialog boxes using shell scripts in Linux.

System Tar and Restore Gui

System Tar and Restore Gui

You can find more command-line usage examples from the System Tar and Restore Github repository: https://github.com/tritonas00/system-tar-and-restore.

Summary

System Tar and Restore is a simple yet powerful, and versatile system backup script for Linux systems. Try it out comprehensively and share your thoughts about it via the feedback form below.