How to sync your files using lsyncd on Linux

Lsync is a lightweight syncing alternative to Rsync. It works roughly in the same way in that it scans a set directory for changes and syncs it to any place that the user wants. The application works as a background service and is readily available for installation on many mainstream Linux distributions. To get Lsyncd on Linux, open up a terminal window and follow the instructions that correspond to your operating system.

Note: be sure to install the app on all of the computers you wish to sync to.

Ubuntu

sudo apt install lsyncd

Debian

sudo apt-get install lsyncd

Arch Linux

Lsyncd is available for Arch Linux, though it’s not in the primary software sources, so installing it with the Pacman package management tool isn’t possible. Instead, those looking to use the Live Sync Daemon on Arch must download, build and set it up from the AUR.

To get the application working on Arch Linux, launch a terminal and follow the instructions below.

Step 1: Using Pacman, install both Base-devel and Git. These packages are essential, and you will not be able to interact with the Lsyncd AUR package without them.

sudo pacman -S git base-devel

Step 2: Clone the latest Lysncd AUR snapshot from the official Arch Linux User Repository website.

git clone https://aur.archlinux.org/lsyncd.git

Step 3: Change the terminal’s starting directory from the home folder to the newly cloned “lsyncd” directory using the CD command.

cd lsycnd

Step 4: Compile and generate an installable package for your Arch Linux PC by executing the makepkg command. Please note that when you’re using makepkg, the package may fail to build. If this happens, refer to the Lsyncd AUR page and read the user comments for guidance.

makepkg -sri

Fedora

sudo pacman -S lsyncd

OpenSUSE

sudo zypper install lsyncd

Generic Linux

Can’t find Lsycnd for your Linux operating system? If so, you may need to download the program and build it from source. Open up a terminal and follow the step-by-step instructions to learn how to get Lsycnd built and running.

Step 1: The app has a lot of dependencies that must be installed. Check the list below and grab each of these packages.

  • Cmake
  • Lua (5.2 or later)
  • Liblua (5.2 or later)
  •  GCC compiler
  • Lua compiler
  • Make
  • Binutils
  • Git

More information on needed dependencies can be found on GitHub.

Step 2: Use Git and clone the source code to your Linux PC.

git clone https://github.com/axkibe/lsyncd.git

Step 3:Move into the Lsyncd code folder with the CD command.

cd lsyncd

Step 4: Make a new build directory in the code folder.

mkdir build

Step 5: Move the terminal session into the new build directory.

cd build

Step 6: Run cmake to start the code compilation process.

cmake ..

Step 7: Finish up the compilation process with the make command.

make

Step 8: Install the app to your Linux computer with make install.

sudo make install

Configure Lsyncd

The Lsyncd service runs in the background. Unfortunately, the service doesn’t start up and enable itself manually. As a result, before we can interact with Lsyc, we must start the background service using the systemctl command.

sudo service lsyncd start

With the service started, we can make a new configuration file using the touch command.

sudo touch /etc/lsyncd.conf

Please note that on some operating systems, creating a file at /etc/lsynd.conf may not work. It may be necessary to create a configuration file in /etc/lsyncd/ instead.

sudo mkdir -p /etc/lsyncd/
sudo touch /etc/lsyncd/lsyncd.conf.lua

Open up the configuration file with the Nano text editor.

sudo nano /etc/lsyncd.conf

Or, if you set the configuration in /etc/lsyncd/, do:

sudo nano /etc/lsyncd/lsyncd.conf.lua

Paste the code below into the configuration file:

settings {
logfile = "/var/log/lsyncd/lsyncd.log",
statusFile = "/var/log/lsyncd/lsyncd.stat",
statusIntervall = 1,
nodaemon = false
}

After the code is in the Nano text editor, save it by pressing the Ctrl + O keyboard combination. Then, exit it with Ctrl + X.

Set up shared folder

Now that the core of the configuration folder is set up, we need to set up a syncing system. To set up a syncing system, go back to Nano and paste the code in lsyncd.conf, directly below what was added earlier.

Note: be sure to go through the sync code and change it so that it suits your needs.

sync {
default.rsyncssh,
source = "/source/folder/location",
host = "remote-pc-or-server-ip",
targetdir = "/remote/directory"
}

Once again, save the edits to the lsyncd.conf folder in Nano with Ctrl  + O.

Start the sync

Lsync is all set and ready to go. Now it’s time to start the synchronization process. In a terminal, use the service command to restart it.

sudo service restart lsyncd

By rebooting Lsync with the service command, it’ll read the new configuration file and instantly start syncing data.

Read How to sync your files using lsyncd on Linux by Derrik Diener on AddictiveTips – Tech tips to make you smarter

How to manage audio devices on Linux with Pavucontrol

On Linux, sound is delivered through Pulse Audio. It’s a revolutionary sound system that allows users to do many things, including swapping inputs on the fly, and even transmit sound over a network.

Pulse is a fantastic technology, that’s for sure, but it’s confusing to understand for the average user. For this reason, apps like Pavucontrol have popped up. They take the Pulse audio system, simplify it, and make it easier to understand.

In this article, we’ll go over how to manage your audio devices on Linux with the Pavucontrol sound manager. We’ll cover how to manage applications using the sound server, how to disable and enable microphones, and much more!

Install Pavucontrol

Pavucontrol is the gold-standard for managing the Pulse Audio sound server on Linux. Despite this, it’s not the default sound manager tool on mainstream Linux distributions. As a result, before we can continue with this tutorial, we’ll need to go over how to install the Pavucontrol audio manager.

To install Pavucontrol, launch a terminal window and follow the instructions that correspond with your Linux operating system.

Ubuntu

Ubuntu users can quickly install the Pavucontrol application using the Apt package manager.

sudo apt install pavucontrol

Alternatively, if you use Kbuntu or another Ubuntu Linux distribution that makes use of Qt, rather than GTK, install Pavucontrol-Qt.

sudo apt install pavucontrol-qt

Debian

Both Pavucontrol GTK and QT are available on all versions of Debian. To install either of these programs use the Apt-get package tool.

sudo apt-get install pavucontrol

or

sudo apt-get install pavucontrol-qt

Arch Linux

Need to get Pavucontrol or Pavucontrol Qt on your Arch Linux PC? Open up a terminal and use the Pacman packaging app to install it.

sudo pacman -S pavucontrol

or

sudo pacman -S pavucontrol-qt

Fedora

Fedora Linux has both versions of the Pavucontrol audio management program in its software repositories. To get the app working, launch a terminal and use the DNF package manager.

sudo dnf install pavucontrol

or

sudo dnf install pavucontrol-qt

OpenSUSE

OpenSUSE has Pavucontrol and Pavucontrol Qt for all versions of the operating system, and it can be installed using the Zypper command.

sudo zypper install pavucontrol

or

sudo zypper install pavucontrol-qt

Generic Linux

Pavucontrol is one of the most well-known audio managers for Pulse Audio on Linux, so you should be able to find it by searching for “pavucontrol.” Alternatively, feel free to download and build the source code for the program.

Manage audio playback

To manage the audio output of any application using the Pulse sound server on Linux, you’ll need to open up the Pavucontrol app and click on the “playback” tab.

Inside the “Playback” tab of Pavucontrol, you’ll be able to see what applications are using your sound system in a neat list. At the top of the list, you’ll see “system sounds.” To silence all system sounds on your Linux desktop, click the speaker icon. Alternatively, drag the audio slider to adjust its volume.

Note: the Playback tab only shows applications currently using audio. If a program isn’t actively playing sound, it will not be manageable in Pavucontrol.

Managing audio playback for individual applications in the Pavucontrol playback tab works the same as the “system sounds” entry. Press the speaker icon on the right to mute, or drag the slider to adjust the volume.

Manage recording levels

Need to change how apps on your Linux desktop are recording? Open up Pavucontrol, and click the “Recording” tab. In the recording area, you’ll see every program currently recording sound through the Pulse sound system.

To lower the input volume for an app, drag the slider to the left. To increase volume drag the slider to the right. It’s also possible to mute the recording entirely by clicking the speaker icon.

Control output devices (speakers)

Pavucontrol allows for excellent control over the output of audio devices. To manage them, open up the Pavucontrol app and find “Output devices.”

In “Output devices,” you’ll see a list of all sound playback devices on your Linux PC. Scan through the list of playback devices and find the one you want to modify. Then, use the slider to adjust its volume.

Want to make a new playback device the default? Click the icon to the right of the lock button.

Control input devices (microphones)

Pavucontrol lets users manipulate an input device, as well as outputs. To find your audio input devices in the app, click the “Input devices” tab.

In the “Input devices” tab, you’ll see all microphones and sound recording devices in a neat list. From there, you can manipulate the audio input level by dragging the volume level left or right. Additionally, it’s possible to mute any input device by clicking the speaker icon and set a microphone as default by clicking the “Set as fallback” button.

Disabling audio devices

Have an audio device you want to disable permanently? Open up Pavucontrol and Click the “Configuration” button. Then, look through the list of sound devices on screen and find the one you want to turn off.

Once you’ve located the device you want to shut off, click the drop-down menu next to it. Look through the menu, find “disable” and click on it. From this point on, Pulse Audio will not have access to the sound device.

To re-enable your audio device, go back to “Configuration”, click on the menu next to the device and change it from “disabled” to one of the available sound configurations listed.

If you need to manage audio files on Linux, check out our detailed post on the best audio tools for Linux.

Read How to manage audio devices on Linux with Pavucontrol by Derrik Diener on AddictiveTips – Tech tips to make you smarter

How to switch from Bash to Korn Shell on Linux

Korn Shell is a popular alternative to the Bash Shell that is commonly used as the default command-line system on Linux. The shell is backward compatible with Bash and borrows a lot of useful features found in C Shell.  Korn goes by Ksh for short and is very popular in the community. With a little know-how, it’s easy to get it working as the default shell on Linux! Follow along with our tutorial below and learn how!

Note: to use Ksh on Linux, you must be running Ubuntu, Debian, Arch Linux, Fedora or OpenSUSE. If not, building Ksh from its source code may be required.

Installi Ksh

Korn Shell is readily available for installation on all major Linux distributions. In this guide, we’ll focus on the MirBSD version of Ksh on Linux. The reason we’re talking about this version of Ksh is that the AT&T version of Korn Shell doesn’t enjoy support on all Linux distros (operating systems like Arch Linux and others). If you must use the AT&T release of Korn Shell, download it here.

To install the Korn Shell alternative to Bash on Linux, open up a terminal window and follow the instructions that correspond to your operating system.

Ubuntu

sudo apt install mksh

Debian

sudo apt-get install mksh

Arch Linux

sudo pacman -S mksh

Fedora

sudo dnf install mksh

OpenSUSE

sudo zypper install mksh

Generic Linux

Need to get the MirBSD release of Korn Shell on your Linux PC? If you’re having issues finding it in your OS’s package manager, you’ll need to download the shell’s source code and compile it manually. For information regarding the MirBSD Korn Shell, visit the official website’s download page.

Not sure how to build the source code? Information on making MirBSD’s Ksh from source can be found here.

Access Korn Shell

Did you know that you can access the Korn Shell on your Linux PC without making it the default command system? It’s true! By running the ksh command in a terminal window, it’s possible to jump from the default Bash shell instantly.

ksh

Want to use MirBSD’s Korn Shell as the root user? Here’s how! First, go to the terminal and access the root account. The best way to access the root account (for this case) is to use the su command. However, if you cannot run susudo -s also works.

su -

or

sudo -s

Once you’ve logged into the root user, it’s safe to switch from Bash to the Korn Shell.  Run the run the ksh command to access the shell.

ksh

List available shells

Before it’s possible to set Korn Shell as the default command-line system on Linux, you’ll need to figure out the location of it. The easiest way to determine the exact location of the Korn Shell binary is to take a look at the /etc/shells file.

To view the /etc/shells file, open up a terminal window and use the cat command.

cat /etc/shells

Look through the output of /etc/shells, find the location of Korn Shell and highlight it. Alternatively, pipe the output to a text file for easy access with the command below.

Note: there are many different entries for Korn Shell in the shells file. Ignore all entries with “static” in them.

cat /etc/shells  >> /home/username/Documents/location-of-ksh.txt

Alternatively, if you’d like to pipe only the Korn Shell entries to a text file, skip the command above and run this one instead:

cat /etc/shells | grep mksh >> /home/username/Documents/location-of-ksh.txt

Set Korn Shell as default

Want the Korn Shell to open up when you launch a terminal instead of Bash? Launch a command-line window on the Linux desktop, then run the chsh command.

Note: please understand that chsh is meant to swap the default command shell for the current user. Do not run it as root! You could accidentally switch your Linux PC’s root shell!

chsh

Running chsh will print an output that says “Enter the new value or press ENTER for the default.” Take a look at the location-of-ksh.txt text file in your favorite text editor and copy the location of Korn Shell to your clipboard. You can also view the text file in the terminal with:

cat /home/username/Documents/location-of-ksh.txt

Once the Korn Shell location is written into the chsh prompt window, press the Enter key on the keyboard to confirm your choice. Then, enter your user’s password to apply the change.

After running the chsh command, close the terminal session and restart your Linux PC. When it finishes rebooting, log back in and launch a terminal. Korn Shell should now be the default command-line interface.

Read How to switch from Bash to Korn Shell on Linux by Derrik Diener on AddictiveTips – Tech tips to make you smarter

How to access your Linux PC remotely with NoMachine

NoMachine is a “hands-off” remote access tool for Mac, Windows, and Linux. It offers a few different types of connection protocols like SSH, and NM’s NX protocol.

In this guide, we’ll go over how to set up the NoMachine remote system on Linux, as well as how to connect to computers with the software.

Install NoMachine

NoMachine has support for Ubuntu, Debian, Fedora, OpenSUSE and many other Linux distributions via a downloadable TarGZ archive. To install the software on your Linux operating system, launch a terminal window and follow the instructions below.

Note: along with installing NoMachine on the computer sending out a remote connection, please remember to install the app on the computer you intend to access through the app. NoMachine will not work unless it is set up on both the host and remote PC.

Ubuntu/Debian

NoMachine officially supports Debian-based Linux distributions, so it’s quite easy to get the client/server working on Ubuntu, Debian and operating systems that base themselves off the two operating systems. To start the installation, go to the download page. On the download page, click on either “NoMachine for Linux DEB i386” or “NoMachine for Linux DEB amd64 .”

Once it’s done downloading, open up the file manager and double-click on the DEB package file to open it up in Ubuntu Software Center, or GDebi (if you’re a Debian user.) Then, click the “install” button, type in your password and install the software to your computer.

Alternatively, launch a terminal and use the dpkg tool to install it via the command-line.

cd ~/Downloads 

sudo dpkg -i nomachine*.deb
sudo apt install -f

Or, for Debian users:

sudo apt-get install -f

Arch Linux

NoMachine is on Arch Linux thanks to the AUR. To install it, launch a terminal window and follow the step-by-step instructions below.

Step 1: Using the Pacman tool, install the dependencies required to install AUR packages. (Base-devel and Git).

sudo pacman -S base-devel git

Step 2: Grab the NoMachine AUR snapshot from the web using the git clone command.

git clone https://aur.archlinux.org/nomachine.git

Step 3: Using the CD command, change the terminal’s working directory from ~/home to the new “nomachine” folder.

cd nomachine

Step 4: Build an installable package for Arch Linux using the makepkg command. Keep in mind that when generating a package, problems can happen. Be sure to check the comments on the AUR page for guidance from other users.

makepkg -sri

Fedora/OpenSUSE

Redhat-based Linux distributions such as Fedora and OpenSUSE can easily install the NoMachine client/server system thanks an RPM package being available. To start the installation, head over to the download page and grab either the 32-bit or 64-bit version of the RPM package.

When the RPM package is done downloading, open up the file manager on your Fedora or OpenSUSE PC, click on “Downloads.” Once in downloads, double-click on the RPM to launch the default package installer.

Enter your password and use the RPM package installation tool to set up RPM on your Fedora or OpenSUSE PC. Alternatively, launch a terminal window and follow the instructions to set it up via the command-line.

Fedora

cd ~/Downloads
sudo dnf install nomachine*.rpm

OpenSUSE

cd ~/Downloads
sudo zypper install nomachine*.rpm

Generic Linux

Are you using a lesser-known Linux distribution? Don’t worry! You can still run the NoMachine client/server system on your PC! Follow the steps below to get it working on your computer.

Step 1: Go to the download page and grab the 32-bit or 64-bit version of the TarGZ NoMachine release.

Step 2: Launch a terminal window and use the tar command to extract the TarGZ archive.

sudo cp -p nomachine_6.3.6_1_x86_64.tar.gz /usr

cd /usr

sudo tar zxf nomachine_6.3.6_1_x86_64.tar.gz

Step 3: Execute the setup script and get the software installed on your PC.

sudo /usr/NX/nxserver --install

Using NoMachine

Open up the application menu on your Linux desktop. As it opens, you’ll notice a “welcome to NoMachine” message that goes over all of the program’s features. It also outlines the different protocols it supports (SSH and NX,) and gives out your Linux PC’s IP addresses.

After reading the welcome message, check “don’t show this again,” and click the continue button to move on to the next page.

To connect a remote computer, wait for the app to scan for it. Then, double-click on the computer to go to the connection page.

On the connection page, you’ll be presented with information related to the remote computer. It displays the hostname and LAN IP address. Confirm everything looks as it should, then select “OK” to continue to the next page.

Once you’ve reviewed the connection settings for the remote computer, it’s time to access the PC remotely. Highlight it with the mouse and click “Connect,” and enter your password to access the remote computer.

Disconnecting

Exiting a remote connection is refreshingly quick. There’s no need to click “quit” or “exit.” Instead, if you’d like to close an existing session, click the close button. It’s also possible to leave a connection by pressing Alt + F4 on the keyboard.

Read How to access your Linux PC remotely with NoMachine by Derrik Diener on AddictiveTips – Tech tips to make you smarter