Categories
News

How to Watch Netflix Natively on Linux

Netflix has been available natively on Linux for some time, but it hasn’t always been easy to watch.

Without the right setup, it’s not going to work. Fortunately, with the right software, Netflix will run on any current Linux distribution.

Follow the steps below to watch videos from your Netflix library on Linux.

The Evolution of Netflix on Linux

At one time, accessing Netflix on Linux was difficult. A specific version of Google Chrome was needed, complete with Encrypted Media Extension (EME) support. Chrome additionally required a specific version of Mozilla Network Security Services and a User Agent Switcher extension. (Changing the User Agent is a method of tricking a website that you’re using a different operating system or browser).

Watch Netflix on Linux

Today, all you need to do is open netflix.com in Google Chrome and log into your account. Within seconds you’ll be able to seamlessly watch Netflix content. Additionally, you have the option to turn Netflix into a Desktop Application via Google Chrome’s Web-App tools (see below).

Which Browsers Play Netflix on Linux?

For the best results playing Netflix in your browser on Linux, stick to Google Chrome or Mozilla Firefox.

While other browsers might boast Netflix support (such as Vivaldi or Opera) Chrome and Firefox are the most reliable.

Google Chrome

If Chrome isn’t already installed on your Linux distribution you can find it at www.google.com/chrome/.

No additional software or plugins are available for Chrome to stream Netflix videos. Simply visit the site as explained above and enjoy. Other Chromium-based browsers should also work, but your mileage may vary.

If Google Chrome isn’t to your taste, rely on it as a backup when your preferred browser won’t play Netflix. Usually this is only a short-term hiccup that can be fixed a day or so later with a new update.

Mozilla Firefox

Access your Netflix watchlist on Linux

If your distro has Mozilla Firefox preinstalled you can also watch Linux on Netflix. However, some tweaking is required.

  • First, ensure you have the latest version of Firefox installed.
  • Next, visit netflix.com and sign into your account.
  • You’ll spot a message at the top of the screen, advising you that additional software is required. Click Enable DRM.
  • Wait while the additional software is installed.
  • Refresh the page if necessary, then play your chosen video.

If Netflix won’t work on Firefox on Linux, check the following:

  • In your browser address bar, enter about:preferences#content.
  • On the General tab, look for Digital Rights Management (DRM) Content.
  • Ensure the box next to Play DRM-controlled Content is checked.
  • Open a new tab then enter about:addons.
  • Find Plugins then confirm that OpenH264 and Widevine are Enabled (set as Always Activate).

Configure Widevine to watch Netflix on Linux in Firefox

  • Finally, if necessary, restart Firefox.

You should now be able to play Netflix videos in Firefox.

Want to Watch US Netflix on Linux? You Need a VPN

With Netflix available through your browser, you’ll be able to access your library, view recommendations, and use the service exactly how you might through your TV, game console, or mobile app.

But if you need to access a Netflix library from another country (such as Netflix US), you will need a VPN. A virtual private network that supports Netflix lets you fool the website as to your whereabouts. So, if you’re in France, select a VPN server in the USA to access Netflix’s US library.

Not all VPNs support video streaming through Netflix. Check our list of the best VPN services to get started.

Is There a Netflix Desktop App for Linux?

At one point you could install an app for Netflix. This unofficial tool was in reality a Windows app and came bundled with Wine. This no longer works, but you can create a Desktop Application on Linux using Chrome’s “Add to desktop” feature.

  • Open Google Chrome
  • Go to netflix.com
  • Login to your account
  • Click the Chrome menu button (three dots in the top right of the Chrome browser)
  • Select More tools > Add to desktop.
  • In the dialog box click Add.
  • Check Open as window.
  • Click OK to confirm.

Now you should have a shortcut on your desktop. Double click to launch Netflix in its own Chrome window.

Watch Netflix on Linux With Kodi

Another way you can watch Netflix on your Linux PC is via the Kodi media center software. This comes with some limitations, however—there is currently no support for 4K streaming. You’ll be limited instead to a maximum of 1080p.

If you have Kodi installed you can use an unofficial Netflix add-on to access your account. Note that this requires providing your account credentials to a third-party app—another good reason to be using a VPN.

Start by installing Kodi in the terminal. Update and upgrade first:

sudo apt update && sudo apt upgrade

You’re ready to install Kodi:

sudo apt install kodi

Next, download the repository for the Netflix addon.

Download: CastagnaIT for Kodi (Free)

Save this to your Linux PC. In Kodi, open the Add-ons browser and select Install from zip file.

Browse in Kodi to the download location and install the repository file repository.castagnait-1.0.x.zip.

Click Back to find the add-ons browser again. Select Install from Repository and find the CastagnaIT repo. Browse this for the Netflix add-on and Install.

Ubuntu users should be done here. However, distros from other branches should install these tools:

sudo apt install build-essential python-dev python-pip python-setuptools

pip install --user pycryptodomex

You can now launch the Netflix add-on in Kodi, sign into your account, and access all the movies and shows.

Netflix Natively and Easily on Linux!

Thanks to all the efforts on various sides we now have Netflix natively on Linux without applying any workarounds. You just need a modern browser, or you can watch Netflix using a Kodi add-on.

Need to watch Netflix’s US library? In that case, you need a VPN. We recommend ExpressVPN, which offers a 49% discount to MakeUseOf readers.

Looking for something to watch? Use these tools to find movies and TV shows on Netflix.

Read the full article: How to Watch Netflix Natively on Linux

Categories
News

How to Upgrade or Switch Linux Distros Without Losing Data

When you switch Linux distributions, the default course of action is to wipe everything on your computer. The same is true if you perform a clean install of an upgrade to avoid potential complications.

Turns out, it’s actually quite easy to perform clean installs or change Linux distros without losing data. Here’s what to do so that you’re all set up no matter your current situation.

How Does It Work?

What’s the magic that lets you keep all your personal data? Simple: separate partitions.

Whenever you switch Linux distros, you have to tell the installer what partition setup you would like to have on your hard drive. If Linux is the only operating system on the hard drive, you will most likely have one or two partitions. This includes the main partition, usually formatted as ext4, which includes the operating system and all of your data.

Optionally, you can also have an additional partition called the swap partition. This is a portion of your hard drive that’s used as RAM overflow space, as well as the location where RAM data is stored during hibernation.

But you have the freedom to create as many partitions as you like, and you can tell the installer which partitions should be used for which folders.

Creating a Separate Home Partition

Partition hard drive on Linux

If you’re tired of wiping data when you change Linux distros, you want to create an additional ext4-formatted partition. The first one should have “/” (the root folder) mounted to it, and the other partition should have “/home” mounted to it. All of your personal data is stored in the “/home” folder, so that means all of your personal data will be stored in the second partition.

Once you’re ready to switch Linux distros or perform an upgrade, you’re free to wipe out the first partition that contains the operating system and your installed applications. However, the second partition that has all of your personal files and preferences can remain untouched.

Next, when you perform the new Linux installation, you can tell the installer to reformat the first partition (to start from scratch), but leave the second partition alone and just mount it to “/home”. Then, all you need to do is make sure that you set up the same username and password as before, and everything should be back to the way it was.

Separating your partitions does not stop you from encrypting your drive, either.

The only thing you would still have to do is reinstall your applications, but you won’t have to reconfigure many of them because their settings were stored along with your other personal files.

Precautions to Take When Switching Linux Distros

One potential downside is that keeping prior settings while switching between distributions may cause incompatibilities. For example, although Fedora and Ubuntu both use GNOME as the default desktop backend, Ubuntu’s implementation is quite different, and settings from Fedora could get messy. Be aware.

Make sure that when you are giving the two partitions space, you give each of them enough room. If your first, root partition is very small, you won’t be able to install very many applications. If the second partition is too small then you won’t have much room to save your personal files. The partition sizes are hard limits.

Create Linux root partition

I’d suggest giving your first partition at least 15 or 20GB of space if you don’t plan on installing a lot of applications.

If you plan on installing many applications or games (which take up substantial amounts of space), then you may want to go with 50GB. Gamers should look at the games they’re interested in installing and add up how much space each one takes up.

If you find that your partition sizes weren’t appropriate for your usage, you can resize them by booting into a Live environment and running a partitioning tool or using the command line.

Already Have Linux Installed?

If you already have a Linux installation in place and have everything (including your Home folder) on the same partition, don’t worry. It only takes a few steps to achieve the setup you need. The steps are as follows:

  1. Download the Live environment ISO of your favorite Linux distribution, and burn it to a CD/DVD or write it to a USB drive.
  2. Boot into your newly-created media. Use a partitioning tool such as GParted to resize your ext4 partition to the size you want it to be.
  3. Use the same tool to create a new ext4 partition in the empty space created by resizing the first partition. Make note of what partition it is. It should look like /dev/sdXY, where X is a letter designating the drive and Y is a number designating the partition. An example is /dev/sda2.
  4. Mount both partitions, and copy over the contents of the home folder to the new partition. Make sure that you’re copying over all of the contents of the home folder, and not the home folder itself. Otherwise, when everything is done, all of your stuff will be in “/home/home/user”, which won’t work.
  5. Now open a terminal and run the command gksudo gedit to open the Gedit text editor. Now use the menus to open the file located at /etc/fstab in the first partition.
  6. Add the following line to the end of the file: /dev/sdXY /home ext4 errors=remount-ro 0 1. Again, make sure to replace /dev/sdXY with the actual designation for the partition.
  7. Save it, and restart. Make sure to remove the Live environment media so that you boot back into your regular installation.

Switch Linux Distros Without Losing Data

The difference won’t be obvious, but your personal data will now be on a separate partition that stays out of the way when switching distros or performing upgrades!

Separating partitions isn’t only for distro hoppers or to reduce hassle when upgrading to a new release. A separate partition can come to the rescue if you download updates that leave your PC in a state where it doesn’t boot. Simply reinstall a version of Linux on the root partition and you’re back up and running without having to back up and restore a bunch of files.

If you’re now feeling more emboldened to try out other versions of Linux or take a few risks, here’s our list of five bleeding-edge Linux distros. Just make sure to keep regular backups of your personal data, even if it is now on a separate partition.

Read the full article: How to Upgrade or Switch Linux Distros Without Losing Data

Categories
News

21 Essential Tips for First-Time Chromebook Users

So, you’ve considered the Chromebook’s upsides and downsides, and now you have a shiny new Chromebook. Great choice—it’s a versatile laptop option with a brilliant array of customization options.

However, Chromebooks have a learning curve, and feel different to, say, a MacBook, or Surface Laptop. You might also wonder what you can do with a Chromebook, or how to set it up.

Well, here are the best tips and tricks for new Chromebook owners.

1. Create Multiple User Profiles

Chromebooks make good use of Chrome’s User Profiles feature, allowing you to divide your machine into separate profile logins. Each profile maintains its own apps, settings, and controls. Are you the only user on your device? You should still use multiple profiles.

But Chromebook user profiles are crucial if you have kids. Google did away with supervised profiles, replacing them with the Google Family Link, which is very similar. Follow Christian’s tutorial on installing Google Family Link on Android to create safe accounts for your kids. The process is the same for a Chromebook.

2. Use Guest Mode for Guests

Even if you don’t use the Profiles feature above, you should definitely be aware of Guest Mode. Guest Mode lets you hand your device to someone else and rest assured that they’ll never be able to see your data (e.g., browsing history, downloads, bookmarks, etc.) or access your apps.

And when the guest is done, all traces of their activity are wiped from your device—no need for manual housekeeping. While this may sound similar to Incognito Mode in Chrome, be aware that Guest Mode and Incognito Mode aren’t the same!

3. Open Apps in Separate Windows

chromebook open app new window

Since all Chromebook apps are actually web apps in disguise, first-time users tend to be put off by the fact that apps always open in Chrome. Fortunately, it’s possible to force any installed app to open in a separate window.

Find the desired app in the App Launcher or the Taskbar, right-click on it, and select Open as window. It’s that simple! Now your device will feel like a real laptop, not just a glorified Chrome browser.

4. Organize Apps Into Folders

chromebook create app folder

As you use your device more and more, you’ll soon amass too many installed apps to wrap your head around. While the App Launcher makes it easy to launch any app with a quick search, maybe you prefer to tap or click. In that case, you should take advantage of App Folders.

Open the App Launcher and click on All Apps, then drag any app icon onto any other app icon to group them into a folder. Keep dragging as many icons as needed. To name the folder, click on it and change “Unnamed Folder” at the top to whatever you want.

5. Turn Websites Into Apps

chromebook set website to launch as app

Remember, Chromebook apps are basically just websites disguised as apps. While this does come with a few downsides, there’s one truly nifty benefit: you can turn any website into an app and run it in its own separate window.

Open Chrome, navigate to the website you want to use as an app and click the three-dot button at the top right. Go down to More tools, then select Create shortcut. Give the app a name, make sure you check Open as window, and then click Add.

6. Preview Files Before Opening

chromebook file details spacebar

One of the coolest things about Finder on macOS is that you can highlight most any file and press Spacebar to get a preview of that file without actually launching it in its associated app. Did you know that Chrome OS also has a similar preview feature?

Open the Files app, select any file without actually opening it, and press Spacebar. You’ll see an overlay with some file details (e.g., size, type, last modified time, etc.) and some information specific to the file type (e.g., ID3 tags for MP3s). Some types, like images and audio, will also have a preview.

7. Snap Windows to the Left and Right

If you have a Chromebook that supports a 1920×1080 resolution or higher, you probably don’t want to maximize your apps. For better productivity, you can make better use of your screen estate by keeping two windows open side by side.

An easy way to do this is drag windows to the left or right edge, and Chrome OS will automatically snap them to the side and fill up half the screen. Or you can select a window and press Alt + [ for a left snap or Alt + ] for a right snap.

8. Force Quit for Frozen Apps

chromebook chrome os task manager

You probably won’t run into frozen apps as often on Chrome OS as on Windows or even Mac. But if you do, all you need to do is open the Task Manager using the Search button + Escape keyboard shortcut.

Once that’s open, just find the frozen process, select it, and click End Process. The Task Manager is one of the most important Chrome OS features, so be sure you start using this crucial system feature.

9. Force Reboot for a Frozen System

In the rare case that something goes wrong at the system level, you may find that the Task Manager won’t open or isn’t able to unfreeze your device. If that happens, you can always use the last resort option: Hard Reboot.

Every Chromebook comes with a special set of media keys above the number key row. One of them is the Refresh key (resembling a circular arrow); another is the Power key (looks like a circle with a vertical line). Press Power + Refresh to reboot immediately.

Note that this will lose any unsaved data in open apps. Also note that this isn’t the same thing as a Powerwash, which is covered in more detail below.

10. Master the Built-In Search Key

One thing unique about Chromebook keyboards is the lack of a Windows key or Command key. Instead, Google opted to replace the Caps Lock key with a Search key, which opens the App Launcher when pressed.

This key is useful in three core ways:

  1. Quickly launch any app by typing its name. In this sense, it’s very similar to the Windows 10 Start Menu and Mac Spotlight.
  2. Quickly launch any website URL or search engine query.
  3. Activate a voice search by clicking the microphone button.

It may feel weird to use the Caps Lock key in this way, but it’s one of those things where going back is impossible once you get into the groove.

11. Rebind the Special Keys

chromebook special key settings

Chrome OS treats five keys as special, allowing you to rebind them if you wish: Search, Ctrl, Alt, Backspace, and Escape. You can rebind these to any of the other five, plus Caps Lock, Google Assistant, and Disabled. Hate the Search key? Revert it to Caps Lock here. Or turn it off altogether.

Click your profile icon at the bottom right, then click the gear icon to open Settings. Head to Device > Keyboard. Just change the key bindings with the drop-down menus. You can also turn the top-row media keys into function keys by enabling the checkbox.

12. Learn the System’s Keyboard Shortcuts

chromebook keyboard shortcut glossary

In addition to having a different keyboard layout, Chromebooks have different keyboard shortcuts for system-level actions. Fortunately, Google made it extremely easy to learn these new shortcuts, using another shortcut in the process. Hit CTRL + ALT + ? (yes, the question mark key), and you’ll bring up the Chromebook shortcut glossary.

Type in a letter to find the shortcut you want. You can search the glossary using the letter or key you want to find out the shortcut for, or which Chromebook shortcuts use a specific combination. It lists every possible Chromebook shortcut, starting with the most popular options.

That said, you can get a jump start with our overview of the most important Chromebook shortcuts.

13. Right-Click and Middle-Click on Touchpad

I hated my first three days on my Chromebook because the touchpad doesn’t come with any mouse buttons. This made web browsing a nightmare because I didn’t have access to right-clicking or middle-clicking. As it turns out, both of these actions are simpler than I thought.

To right-click, you just need to tap the touchpad with two simultaneous fingers. To middle-click, you just need to tap the touchpad with three simultaneous fingers. This tip alone will make your Chromebook experience a million times better.

14. Swipe Gestures for the Touchpad

chromebook three finger gesture show all screens

All modern Chromebooks come with a gesture-enabled touchpad and these gestures will change your life. While many gestures are supported, there are four in particular that every Chromebook newbie should know:

  1. Swipe horizontally with two fingers to go Forward and Back in Chrome.
  2. Swipe vertically with two fingers to scroll up and down.
  3. Swipe horizontally with three fingers to slide between open tabs in Chrome. This is even faster than using Ctrl + Tab.
  4. Swipe down with three fingers to open the Task Switcher, which spreads out all open apps in a bird’s eye view.

15. Quickly Free Up Disk Space

chromebook storage space options

All Chromebooks come with some form of SSD for data storage. While this is great news for speed and performance, there is one downside: many Chromebooks come with very small SSDs. On the one hand, this is great because it keeps the cost of a new Chromebook low. On the other hand, you can run out of storage space quickly.

Which is why disk space management is so important. Click on your profile icon at the bottom right, then click the gear icon to open Settings. Under the Device section, click Storage management. Here you can see what’s taking up space on your system and one-click delete when necessary.

On some Chromebooks, you can swap out the SSD for one with a larger capacity. Switching out the SSD can void your warranty, so make sure to check before making any hardware upgrades. If you’d prefer not to tinker with the hardware, check out the cheapest cloud storage providers instead.

16. Disable Sleep Mode

chromebook idle power options

For a long time, Chrome OS didn’t offer users an effective method for managing screen idle time and power management. Thankfully, that is no longer the case.

Head to Settings > Power, and you can select what your Chromebook should do on idle. For reference, your Chromebook will begin to idle after around 10-minutes. You can opt for Sleep, Turn off the display, or Keep the display on.

The latter option is what many users require, finding it frustrating to return to a sleeping Chromebook. There’s also the option to switch off Sleep when cover is closed, stopping your device sleeping each time you close the lid.

Some users may find their access to such settings unavailable due to school or enterprise administration settings. If that sounds like you, check out this Chrome extension that disables Sleep Mode. Not only that, but the Keep Awake extension also lets you pick between modes for screen-only sleep and screen-and-system sleep.

17. Take Easy Screenshots

If your Chromebook doesn’t have a Print Screen button, how are you supposed to capture an image of your screen? Simply press Ctrl + Switch Window key. (Switch Window is a special top-row key that looks like a rectangle with two vertical lines beside it.)

Saved screenshots appear in your Downloads folder, which you can access using the Files app. Note that you can also use Ctrl + Shift + Switch Window to limit your screenshot to a specific region of the screen.

18. Enable Optional Features With Flags

chromebook flags options

Open Chrome and type chrome://flags in the URL bar to access a bunch of optional Chrome OS features.

Note that these optional features may not be completely stable. At best, they may not function as intended. At worst, they can be buggy enough to cause data loss. Most of them are close to stable and extreme bugs are rare, but this risk is always present with these optional features.

If you are new to Chromebooks and Chrome OS in general, you should research what these options do before fiddling.

19. Experimental Features on Beta and Dev Channels

chromebook switch development channel

If you’re feeling adventurous, but you don’t want to mess with the optional flags above, consider switching to the Beta channel or Dev channel.

The Beta channel grants a low-risk sneak peek at upcoming features, approximately one month ahead of the Stable channel. The Dev channel grants a high-risk, bug-prone sneak peek at experimental features well ahead of the Stable channel. To switch to Beta or Dev channels:

  1. Click your profile icon at the bottom right.
  2. Click the gear icon to open Settings.
  3. At the bottom of the left panel, click About Chrome OS.
  4. Click Additional Details.
  5. Click the Change channel button.
  6. Pick either Beta or Dev channel.

If you want to minimize system crashes and potential for data loss, stick to the Stable channel. Switching from an experimental channel to the Stable channel will delete everything from your Chromebook, including accounts!

20. Factory Reset Using Powerwash

If you ever want to start over with a blank slate, plan on selling your Chromebook, or if you ever run into a catastrophic error that causes your system to crash all the time, then you may need to Powerwash your device.

Powerwash is Google’s term for a “factory reset.” It deletes all of the data on your Chromebook and returns to its factory state. Despite losing local data, your Google accounts and profiles won’t be affected, nor will any of your data synced to Google’s cloud.

To learn more, check out our post on reformatting your Chromebook.

21. Switch on Google Assistant

chromebook google assistant

You can use the Google Assistant on your Chromebook to show notifications, use “OK Google,” and display other useful information. Google Assistant can help new Chromebook users work their way around the new device. It displays handy tooltips relating to your current activity, plus other information.

To switch Google Assistant on, click your profile icon at the bottom right, then the gear icon to open Settings. Head to Search and Assistant > Google Assistant. 

Other Chromebook Tips You Might Like

As with all computers, Chromebooks do slow down over time due to wear and tear and accumulation of junk. Fortunately, there are steps you can take to speed up your Chromebook and reclaim performance. If you’re looking for a change of Chromebook-scene, check out the best Chromebooks for every type of user.

One last thing: even though I sing their praises and think they’re the best device for casual home use, Chromebooks aren’t perfect. If you want to try something different, here’s how you install Linux on your Chromebook.

Read the full article: 21 Essential Tips for First-Time Chromebook Users

Categories
News

nano vs. Vim: The Best Terminal Text Editors, Compared

You may be surprised to learn that many aspects of your Linux desktop are not hidden behind complex code. Numerous programs and system settings are tucked away in text files.

You can open these with your default text editor such as Gedit or Kate, but the terminal is often faster, especially when you need administrator permissions.

For terminal-based text editing, two of the top choices are GNU nano and Vim. Which is better? I’m not going to wade into that question, but there are core differences that set these two text editors apart.

A Brief History of GNU nano and Vim

The GNU nano (more commonly referred to as “nano”) project was created in 1999 in order to emulate and improve upon the Pico text editor. Developers claimed GNU nano to be 2/3 to 1/8 the size of the Pico binary, which made it very lean and usable on even the weakest systems.

Vim, originally developed in 1991, is based on the original Vi text editor that was developed in 1976. Like GNU nano, Vim began as an effort to improve an earlier project.

GNU nano

Nano Linux terminal text editor

GNU nano has a reputation for being relatively user-friendly. If you’ve never used nano before, there’s a good chance you can fumble your way through without help.

To get started, you can open or create a file by typing:

nano /home/user/HelloWorld.txt

This will show you a recognizable user interface. The title of your text file appears at the top and the text contained within the file appears in the middle. The actions you can perform line the bottom. You complete these actions by pressing Ctrl plus the indicated key.

For example, you exit and save a file using Ctrl + X. Admittedly, I was very concerned about how to save my file the first time I used nano, as the text editor only lists this command as “Exit”. But when you try to edit, Nano asks if you want to save.

As the bottom of the screen shows, nano contains much of the functionality you would expect from a graphical application. You can cut and paste, find and replace words, and much more.

GNU nano’s features include:

  • Autoconf support
  • Goto-line# command w/o flag
  • Case sensitive search function
  • Interactive search and replace
  • Slang and ncurses support
  • Autoindent ability
  • Displayed tab width option
  • Regular expression search and replace
  • Toggles for cmdline flags via meta keys
  • Tab completion when reading/writing files
  • Soft text wrapping (text doesn’t wrap as in full-fledged document editors, with continuations indicated with $)

Overall, nano is a great option for newcomers to terminal text editing. You can get to try your hand at opening files from the command line and navigating using primarily a keyboard without having to throw out much of what you know about text editors.

On a DEB-based system such as Debian or Ubuntu, you can install GNU nano using:

sudo apt install nano

On Fedora, a RPM-based system, you can install using:

sudo dnf install nano

Since nano is a command-line program you likely won’t find it in GNOME Software or alternative Linux app stores. But you can install it using traditional package managers, such as Synaptic.

Vim

Vim Linux terminal text editor

Vim, by contrast, isn’t quite so welcoming to newcomers. When you open a text file you see just the contents of the file and no indication of how to use Vim itself.

Getting started is straightforward though. You open a file using the following command:

vim /home/user/HelloWorld.txt

At this point, you’re left having to read the documentation, search online, or mash buttons and hope for the best. If you do opt for the last option, there are some safeguards in place. You can’t do any real editing without pressing I to enter “Insert” mode. After you’ve made your edits, you then press Esc to exit the mode (at least you could probably guess that).

To perform other functions, when not in Insert mode, press the : (colon) key. Then type the key or keys that correspond with what you want to do and press Enter.

For example, to save the changes you’ve made to your text file, type :w and hit Enter. This will “write” changes to your file. See, the w is intuitive when you think in terms of read and write rather than open and save.

When you’re done, you can then type :q and hit Enter to quit the program. Again, rather intuitive.

Once you learn the behavior, there’s a certain beauty to Vim’s minimal aesthetic. You don’t have clutter floating inside your terminal window. All you see on screen is the text inside your text file. If you’re comfortable with typing (and you very well may be, considering you’re in the command line), Vim’s interface can feel rather natural.

There’s another reason to make the effort. Vim has the advantage of being more powerful than GNU nano. Not only does Vim contain more features from the get-go, you can also customize the program with plugins and scripts.

Vim’s features include:

  • Automatic commands
  • Completion commands
  • Digraph input
  • Higher memory limits than vanilla vi
  • Split screen
  • Session recovery
  • Tab expansion
  • Tag system
  • Syntax coloring

After you’ve taken the time to add in your desired plugins, Vim becomes a capable alternative to full-featured graphical text editors such as Sublime Text or Visual Studio Code. If you’re not into coding, that doesn’t mean it’s time to give Vim a pass. With a markdown plugin available, Vim is also a capable option for writers.

Is Vim harder to grasp than nano? For sure. But with the ability to add features from other text editors, you can really make Vim your own.

On Debian or Ubuntu, you can install Vim using:

sudo apt install vim

On Fedora, use:

sudo dnf install vim

GNU nano vs. Vim: Which Do You Prefer?

If you can live with with a steeper learning curve, then you may find yourself falling in love with Vim. It’s simple and rather attractive in its own way.

But if you want an option that’s straightforward and gets the job done, there’s little reason not to pick GNU nano. It doesn’t have the mystery that Vim has. You don’t have to read a manual to use the program, which in general is a hallmark of good design.

At the end of the day, both are equally capable of editing the same text files. And when you find yourself falling in love with either program, here are ways to integrate plain text files into how you use your computer.

Read the full article: nano vs. Vim: The Best Terminal Text Editors, Compared

Categories
News

How to Create and Boot From a Linux USB Drive on Mac

Linux has long been synonymous with bootable flash drives, whether it’s to fix some sort of problem with your primary operating system, or for trying various distros.

There are a few ways to create an Ubuntu (or other Linux) bootable USB drive for Mac. You can go the freeware route for an easy option, or put a little bit of time into creating the drive yourself using Terminal. Let’s look at both methods.

First: Prepare Your USB Drive

When you’re looking to create a bootable Linux USB drive on a Mac, the first step is to make sure you’ve got the right USB drive for the job, and that it’s formatted correctly to avoid any problems.

Some Linux variants may require larger volumes, so pay attention to the requirements when downloading. Generally speaking, anything above 4GB will do the job. Others don’t have any strict requirements, but formatting to FAT beforehand is a good idea regardless.

Warning: Everything on your drive will be erased when you do this!

  1. Insert your USB drive into your Mac and launch Disk Utility (under Applications > Utilities, or search for it using Spotlight with Cmd + Space).
  2. Select your USB device in the menu on the left, then click Erase.
  3. Give it a name and choose MS-DOS (FAT) under Format and GUID Partition Map under Scheme.
  4. Hit Erase to apply the changes. If it fails, try again—sometimes the system doesn’t unmount the volume in time and the process will be unable to complete.

Mac Disk Utility format

If you have persistent problems, try another USB drive. Now download a Linux distro to install on your USB stick, and you’re ready to get started.

Make a Bootable Linux USB Drive With Etcher

balenaEtcher is a free open source tool for burning disc images onto USB and SD drives. It makes creating bootable devices completely foolproof:

  1. Grab your desired Linux image, then download Etcher and install it.
  2. Insert your USB stick, then launch Etcher.
  3. Click Select image and find the Linux image you downloaded—Etcher supports IMG, ISO, and ZIP, among others.
  4. Ensure the correct USB device is selected—hit Change to see a list of connected devices.
  5. Finalize the process by clicking Flash and wait for the process to complete.

etcher bootable linux usb drive

You’ll likely see an error message warning that your USB drive isn’t compatible with your Mac. That’s normal—simply eject and go. Your bootable Linux USB drive is now ready; you can now skip to the Booting Your USB Drive section below.

Create a Live USB Using the Terminal

If for some reason you don’t want to use Etcher (maybe you’re on an incompatible version of macOS), you can accomplish this task using the command line. It’s possible using Terminal, your Mac’s built-in command line interface.

While this method requires a little more thought and patience, it’s actually pretty straightforward. You might even learn something new, plus you’ll feel smart afterwards. Assuming you’ve formatted your drive per the earlier instructions, here’s how it works:

1. Convert Your ISO

Launch Terminal and take note of where your Linux disc image is stored in Finder. Convert your image (usually an ISO) to an IMG file using the hdiutil convert command:

hdiutil convert [/path/to/downloaded.iso] -format UDRW -o [/path/to/newimage]

Replace [/path/to/downloaded.iso] with the location of your own ISO (you can drag and drop directly into the Terminal window if you want) and [/path/to/newimage] to wherever you want the new image file to be created.

convert iso to dmg

Note: Modern versions of macOS will automatically create a .DMG file. If your version doesn’t do this, try appending IMG to the end of your new image file name, such as [/path/to/newimage.img]

2. Write the Image to USB

Next, you’ll need to identify your drive’s mounted location so you can tell the Mac which drive to use. With Terminal open, use the following command to list all connected drives:

diskutil list

set up external drive

You’ll likely be able to identify the drive by its name, format, and size using a process of elimination. Take a note of the listing under the IDENTIFIER column, then unmount the drive using the following command:

diskutil unmountDisk /dev/[diskX]

You’ll need to replace [diskX] with the corresponding number, like disk3—if successful, Terminal will report that the disk was unmounted. If you’re having trouble unmounting a drive, you can launch Disk Utility, right-click on a drive, then choose Unmount (don’t eject the drive, though).

unmount drive mac

The final step is to write the image to your USB stick, using the dd command:

sudo dd if=[/path/to/newimage.dmg] of=/dev/[diskN] bs=1m

Replace [/path/to/newimage.dmg] with the path to the file created in the first step (again, drag and drop works best), and [diskN] with the location identified earlier. You’ll need to authorize with your administrator password immediately afterwards, since you used the sudo command.

install linux on usb drive mac

You’re now done, and your drive is ready for booting.

Booting Your USB Drive

Assuming all went well, you’ll now have a USB drive that will let you boot into Linux. Plug it into the Mac you want to use it on, then shut down the computer.

In order to access your Mac’s boot menu, you’ll need to hold the Option (Alt) key while it boots. The best way to do this is to shut down, hold the Option key, start your Mac, and wait. If you did it correctly, you’ll see a few options including your built-in hard drive and the USB device created earlier, titled EFI Boot.

Mac choose boot disk

To boot into Linux, select the USB device and click the arrow (or double-click it). Depending on what you’re using, you may get another menu which acts as a bootloader for your particular flavor of Linux.

Linux boot menu

If you have problems, or your USB drive won’t show up, try running the process again, using an alternative method above, running off a different USB stick or port, or consulting your respective distro’s help documentation.

The Best Way to Try Linux on Your Mac

Assuming all went well, you now have Linux running on your Mac and you can test it out or install it outright if you’re tired of macOS. You still have an Apple recovery partition which is accessible by holding Cmd + R while your machine boots. This can help you reinstall macOS (or apply other fixes) if you decide to go back.

Ubuntu running on a MacBook Air

There are other tools that claim to help you do this, but not all of them work, and some cost money. Unetbootin is still a popular choice for Linux and Windows users, but is not as good as Etcher on a Mac (and has some issues on newer versions of macOS).

There’s also our old favorite Mac Linux USB Loader, which is open source and actively maintained. It’ll cost you $5 for a pre-compiled binary, assuming you don’t want to download Xcode and compile it yourself. This low entry fee helps keep the project maintained, but it’s hard to justify paying for something when there are perfectly good free alternatives.

For more, check out how to install macOS from a USB flash drive. And if you’d prefer to install Linux on your internal drive, our guide on how to dual-boot Linux on your Mac is your essential next read.

Read the full article: How to Create and Boot From a Linux USB Drive on Mac

Categories
News

Kodi 18.7 Leia Is Now Available For Download

You can now download Kodi 18.7 IPA / APK for iOS 13, iPadOS 13, Android running on iPhone, iPad or Android device. Here are the details.


[ Continue reading this over at RedmondPie.com ]

Categories
News

How to Set Up SSH on Linux and Test Your Setup: A Beginner’s Guide

One of the most important ways of using Linux is via SSH. This remote access command line tool lets you do everything from installing software to configuring Linux as a web server. SSH can save time, make you more productive, and help you unlock the power of your Linux distro.

But how do you set up SSH, on both the client and server sides? Learn how to install and configure SSH software at both ends and remotely control your Linux computer.

What Is SSH?

SSH stands for Secure Shell and allows you to remotely control a Linux computer or server from another device. It works across local area networks and the internet, meaning that it can be used to manage a Linux-powered media server in your house, or a Linux web server on a different continent.

While SSH doesn’t give you access to the remote computer’s desktop environment, it lets you use the terminal. Once connected to the remote computer you can use it as if it was right in front of you. Just be sure to have root access.

Note that other remote access solutions are available for Linux. For example, Ubuntu users can rely on the VNC-compatible remote desktop tool Remmina.

To use SSH, you’ll need to ensure that the remote computer (server) has SSH set up. Additionally, your local device (the client) will need an SSH app installing.

Client-Side Installation

Installing and setting up SSH on a client is simple. In some cases you don’t even need any additional software:

  • Linux users should find a SSH client built into the terminal
  • macOS computers also have SSH preinstalled in the terminal
  • Windows PCs will need to use the PowerShell command line tool, or install PuTTY

Connect to a device using SSH in Windows PowerShell

  • To connect to Linux over SSH from iPhone and iPad try iTerminal ($4.99)
  • If you’re using Android for SSH, try JuiceSSH (Free)

SSH not installed on your Linux system? Add by updating packages and upgrading, then installing:

sudo apt update && sudo apt upgrade

sudo apt install openssh-client

Used to using SSH on Windows but have switched to a Linux desktop? You might miss the PuTTY desktop SSH app with its easy mouse interface. Fortunately, it can be installed on a Linux desktop:

sudo apt install putty

With your SSH client software installed, you’re ready to set up a connection to your remote computer or server.

As a general rule for all desktop and mobile clients, all you need is an IP address or host name, and appropriate login details. While the look of the apps may differ, and the port name may need entering manually, SSH clients are mostly indistinguishable.

Server-Side Installation and Configuration

Before establishing a connection, install the server-side software to host your SSH connection. This requires someone to be present to install or enable SSH. You might already be present to do this—otherwise, a colleague or support engineer at the server end will set up SSH.

Note that if you’re using a web hosting package, SSH should be enabled by default. Speak to your web host to set up SSH if not.

If SSH is not enabled on the remote computer or server, install it with

sudo apt install openssh-server

Check this worked with

sudo systemctl status ssh

The command should illicit a response of “active.”

Check the status to confirm SSH is set up correctly

In some cases the Ubuntu firewall ufw may block SSH. To ensure this doesn’t happen, use

sudo ufw allow ssh

In some cases you’ll need to also enable SSH on the remote device. This is a security precaution that can be tweaked using

sudo systemctl enable ssh

Other options are available (stop, start, and disable) for configuring the SSH service.

Determine IP Address

To connect to the remote device over SSH, you’ll need to know the IP address of the machine. You have two easy ways to find this:

  • Run a terminal command
  • Check the router

To display the IP address of the remote system, logon and run

ip address

This will return the device’s IP address, so take a note of it. On older Linux versions ifconfig may provide better results.

You can also check your router to see connected devices. The Linux PC or server will be listed, typically by operating system or device name. This should make it simple to identify.

To display the public IP address, login to the server and open whatsmyip.org.

The IP address you use should be the one suitable for the connection. So, if the device is on the same network as the client, use the local IP address. For connections across the internet, use the public IP address. If the computer is located on a different network, make sure that port 22 is forwarded to the computer.

Connecting to Linux via SSH

Along with the correct IP address you should also have a username and password to gain access to the remote machine.

For command line SSH tools, use

ssh username@REMOTE.IP.ADDRESS.HERE

Be sure to replace username with the actual username and REMOTE.IP.ADDRESS.HERE with the remote device’s IP address. Hit Enter, and you’ll be prompted for the password.

With a correct password, you’ll get a functioning terminal prompt—you’re now logged into the remote computer.

Using a desktop SSH client like PuTTY?

Configure SSH on Windows with PuTTY

Input the Host Name or IP address, select the SSH connection type, then Open. When prompted for your username and password, enter them in the command line window to complete the connection and gain remote access.

Can’t Connect? Troubleshoot Your SSH Set Up

If you are having SSH connection issues, these are the possible causes:

  • SSH software isn’t installed on either computer
  • Your username or password is incorrect
  • The IP address is wrong
  • A firewall is blocking the connection, or port 22 is not being forwarded

Double-check each point and you should be able to connect. If not, the problem might be more complex.

Using Linux Remotely With SSH

SSH is a useful tool for managing one or more Linux computers.

It lets you can work on any machine from just one system. You can input almost any Linux terminal command over SSH.

Key examples include:

  • Update: sudo apt update && sudo apt upgrade
  • Check status: uptime
  • Running processes: ps
  • Running processes by CPU: top

Setup SSH on a Linux server to run commands remotely

Check our list of SSH commands for managing a Linux server for more.

Setup SSH and Make Linux More Powerful

With SSH, Linux becomes considerably more flexible and powerful. You can literally remotely access a computer using a smartphone thanks to SSH.

If SSH is set up correctly, with client and server-side software enabled and configured, remote command line access is possible. Need something more? Here’s how to remotely control a Linux desktop from Windows.

Read the full article: How to Set Up SSH on Linux and Test Your Setup: A Beginner’s Guide

Categories
News

What Are Config Files? How to Edit Them Safely

Most of the computer programs we use—whether office suites, web browsers, even video games—are configured via menu interfaces. It has almost become the default way we use our machines.

But some programs require you to take a step beyond that. Instead of menus, you must edit a text file for the software to run as you wish.

These text files configure the software and are—unsurprisingly enough—called “config files”. If you want to enhance your computer knowledge you will need to know what a config file is and how to edit one.

What Are Config Files?

Before we get into the technical nitty-gritty, let’s first define what a configuration file is.

Config files are essentially editable text files that contain information required for the successful operation of a program. The files are structured in a particular way, formatted to be user configurable.

While some configuration is hard coded into software, settings that you can change are included in config files.

Surprisingly, there’s no defined standard on how config files should work, or what they should look like. It’s entirely up to the whim of the developer of the program.

Edit the Raspberry Pi's boot config file

Linux users will be particularly familiar with config files as many basic maintenance tasks require you to edit them. Tweaking the Raspberry Pi often relies on editing config files. This might be to specify a wireless network to connect to or set the amount of RAM for graphics.

However, config files are not exclusive to Linux. There are times when you may have to edit them in Windows or macOS.

How to Find and Edit Config Files

Some config files are structured in a format of the developer’s own design. Others use widely known standards used to structure data, like:

  • JSON (JavaScript Object Notation)
  • YAML (YAML Ain’t Markup Language)
  • XML (eXtensible Markup Language)

Some programs load the information stored in their config files when they start. Meanwhile others periodically check the config file to see if it has been changed.

Whatever config file you want to edit it’s smart to make a copy of it before you make any changes. This way, if something goes wrong, you can restore the copy and start again!

Now, let’s take a look at a real-world config file. As we mentioned earlier, they come in all different shapes and sizes. One config file you’re almost certainly familiar with is the hosts file. Windows, Mac, and Linux all use this to manually map IP addresses to hostnames.

Windows Config Files

Windows users will find the hosts file in c:windowssystem32driversetc.

You can open it by double-clicking the mouse and selecting Notepad from the list of suggested apps. This is all you need to view and edit config files like hosts. However, several alternatives are available—see below for details.

With the file open you will see that it uses whitespace (literally spaces and tab stops) to separate elements.

Edit the Windows hosts file with Notepad

Each hostname has its own line, followed by a tab stop and the IP address. Furthermore, the hosts file allows the user to add annotations and comments, which all begin with a hash symbol.

Linux Config Files

On Linux, you’ll find the hosts file in /etc/. This can be opened in Gedit, or a command line text editor such as nano or vim. In most cases your Linux distro will have one or all of these preinstalled.

Some programs store the config file in the home directory, with a period at the beginning of the filename. These config files sometimes have the file extension .rc and we refer to them as “dotfiles”.

Config Files in macOS

Like Linux, the hosts file can be found in /etc/ on macOS.

Mac users will know that BBEdit is the default, preinstalled text editor. This makes it ideal for editing config files in macOS. However, as with Linux, command line editors vim and nano are also available.

Apps for Safely Editing Config Files

So, now we know what config files are used for, let’s talk about how we can edit them.

To do this, you’re going to need a text editor. Avoid word processors; these can add formatting to the file which would prevent them from being read correctly.

Edit a Windows config file in Notepad++

Native text editors are available, as mentioned. However, for extra functions, third party text editors are also available:

Download: Notepad++ for Windows (Free)

Download: Atom for Windows, macOS, Linux (Free)

Download: Sublime Text Editor for Windows, macOS, Linux (Free evaluation)

So many text editing tools are available for every platform that it is hard to recommend a single app. Linux users can also check our list of Linux text editors. Meanwhile this round up of text editors for macOS should help Apple computer owners.

When you edit a config file, it’s important to ensure you follow the conventions of it. This can be worked out just by looking at it. Some config files, like the hosts file, will explain these conventions to you in commented out lines. Others will force you to read some documentation, or a couple of blog posts.

Finally, if the config file you edit has a JSON or XML format, consider a text editor with syntax highlighting. Notepad++ and Atom are both good options here. Syntax highlighting will improve your accuracy by showing you when you’ve made a mistake.

Other Places You Can Find Config Files to Edit

If you’re interested in exploring config files further, you’ll find them in all sorts of applications and platforms. There is more to config files than specifying which websites and IP addresses to block!

Beyond the hosts file, you’ll find config files in video games. These are often used to define and control things like keymappings.

Meanwhile, some config files can be used to cheat. This was the case in the original Deus Ex game on PC. These days, cheating is far more difficult and often not worth the effort unless enabling an official cheat mode.

Web applications also use configuration files for customization.

What If Your Config Edit Doesn’t Work?

Problems associated with editing config files tend to fall into two camps: permissions and user error.

Issues with config files caused by permissions issues are down to system integrity. You’re unable to save changes because you’re editing as an ordinary user. To prevent accidental misconfiguration, many config files are only editable by those with administrator-level privileges.

Edit a Linux hosts file

Fixing this is easy:

  • On Windows, right-click the text editor, and select Run as administrator
  • On macOS and Linux, try escalating your privileges with the sudo command. So, if you were editing your hosts file, run sudo nano /etc/hosts

(Note that if you specified a different filename or location, you would effectively create a config file in the terminal.)

When the problem is user error, it means it’s your fault. Check that you haven’t made any typos, and that you’ve followed the conventions of the config file.

While it may seem obvious, a simple spelling mistake can render your entire file useless. Before committing to your changes and saving the file remember to:

  • Check the change you made
  • Ensure you left a comment

Also be sure to close the config file before trying to run the software you’re attempting to configure.

Config Files Are Important

More than important, they’re an essential part of using Linux. Knowing how to properly edit them can help you considerably.

While you can edit many config files, be sure to make a copy of the file before making any changes. That way, you can revert to the original if something goes wonky.

Using Linux? Here’s more about modifying and managing the hosts file in Linux.

Read the full article: What Are Config Files? How to Edit Them Safely

Categories
News

What Is a Linux Swap Partition? Everything You Need to Know

Most Linux installations recommend that you include a swap partition. This may seem odd to Windows users used to having their entire operating system on a single partition.

What does a swap partition do, do you even need one, and how big should it be? These are all important questions that, with the right answers, can seriously improve your system’s performance.

What the Linux Swap Partition Does

Partitions in Ubuntu Linux

The swap partition serves as overflow space for your RAM. If your RAM fills up completely, any additional applications will run off the swap partition rather than RAM.

This may sound like an easy way to increase your computer’s amount of usable memory without actually getting more RAM, but that isn’t the case. RAM is the ideal hardware for memory because it’s extremely quick, unlike hard drives which are, relatively speaking, much slower.

Solid state drives may have made the performance hit less of an issue with their much-improved speeds, but even they can’t match RAM. This is also true of newer NVMe SSDs. In either case, you wouldn’t want to cause additional wear and tear on your solid state drive.

A close analogy of the swap partition is the Windows pagefile, although there are many technical differences between the two.

The Linux swap partition is not limited to being overflow storage space. It can assist your PC in other ways.

Prioritization

A swap partition can also help move some items from your memory to your hard drive in order to leave more room in memory for more important items. This implies that items that are rarely touched would get moved to the swap partition.

The threshold of what is considered “rare” depends on the “swappiness” (yes, that’s the actual term used), which is configurable. A higher swappiness means data is more likely to be moved to the swap partition. A lower swappiness means data is less likely to be moved to the swap partition.

Hibernation

A swap partition is used as the destination of your memory’s contents whenever you tell your system to hibernate. This means that without a swap partition, hibernation on Linux is impossible.

That said, it has become rather rare for people to use the hibernation feature, so this may not matter to you.

Do You Need a Swap Partition?

Create swap partition in Ubuntu Linux

Does this mean that a swap partition is necessary? Not at all! A Linux system can perform perfectly well without a swap partition. We’ve already discussed the benefits of a swap partition. Now, why might you not want to have one?

When Swap Partitions Don’t Help

Swap partitions have their downsides. They take up space on your hard drive that doesn’t resize dynamically when not in use. Heavy swap usage can also increase wear and tear on your main drive. In some cases, swap partitions don’t even help improve performance. Here’s an example where having a swap partition can actually be worse than not having one.

Say you’ve installed Linux on an old netbook with only 2GB of RAM and a 5400rpm hard drive. With just 2GB of memory, you can imagine that filling up pretty quickly with a few open browser tabs. The swap partition allows you to keep them all open as the memory overflows.

But then a bottleneck appears because of the hard drive’s 5400rpm speed. Since the hard drive is so slow and the system constantly wants to access the swap partition, the netbook becomes extremely sluggish. The machine is slow enough to be unusable unless you close everything to free up some memory.

The set swappiness doesn’t guarantee that everything in the swap partition will move back over once space becomes available in RAM. Instead, much may stay in the swap partition, causing the netbook to continue to be sluggish. So you’re left rebooting your computer to start from a clean slate, which takes a while because the system has to remove everything from the swap partition before shutting down.

What Happens When You Don’t Have Swap

If you do decide to forego a swap partition, know the risks. When your computer needs more RAM than is available, the interface can lock up. You risk having to force quit your computer and lose all the data you were working on.

In such cases, you may wish you had a swap partition around, even if it were only used that once. This depends on whether you find yourself running out of storage space often. Would you notice if you had 4GB less storage space available because you devoted that amount to swap?

Linux Swap Recommendations

Here are some recommendations for when you may want to have a swap partition and how large to make it.

  • If you would like to be able to hibernate your computer, then you should have a swap partition. The size of this partition should be the size of your installed memory, plus an additional 10-25% to leave room for any items that were already moved over into the swap partition.
  • Just want a small performance boost (and you have at least a 7200rpm hard drive)? Then you can add a swap partition if you want. The size of this can be whatever you’d like, but I wouldn’t make it any bigger than you would if you were creating a swap partition to enable hibernation.
  • If you occasionally use heavy applications that require extra RAM, a swap partition can serve as peace of mind. In this case, you don’t need your swap partition to be as large as your RAM.
  • If you have a 5400rpm hard drive, then you may not want to create a swap partition simply because the bottleneck can make your computer worse off. But if you absolutely want to have swap, then you can still create a partition using the same sizing guidelines outlined above. Just be sure to change the swappiness value to something much lower.

Changing Swappiness

Ubuntu Linux swappiness file

Like many aspects of the Linux desktop, your computer’s swappiness is stored in a text file. You can find this file by navigating to /proc/sys/vm.

When you open the file, you will see a single number indicating your current swappiness. You can edit this file using any text editor of your choice, as long as you have root permissions.

To do this with the default GNOME text editor found in Ubuntu and Fedora, you could try:

sudo gedit /proc/sys/vm/swappiness

There is also a command line option that works regardless of which text editor you have installed. Simply enter:

sudo sysctl vm.swappiness=20

You can enter any digit ranging from 0 to 100. The value indicates when you want Linux to start actively moving processes from the memory to the swap partition. So for example, a value of 20 indicates that processes will be moved when memory usage reaches 80%; the default swappiness value in Ubuntu of 60 indicates that processes will be moved when memory usage reaches 40%.

You can check whether the change was successful by reopening that text file. Unsurprisingly, the terminal offers a faster way to check your swappiness. Just enter this command:

cat /proc/sys/vm/swappiness

Does Your PC Feel Faster?

Swap partitions can make a major difference in your system’s performance—sometimes for better and sometimes for worse. Now that you know what the swap partition is for, hopefully you’re better equipped to make the decision appropriate for your situation.

But before you re-partition your drive, know that there’s more to memory management than the amount of RAM you have and the size of your Linux swap partition. Take a moment to learn how Linux manages RAM.

Read the full article: What Is a Linux Swap Partition? Everything You Need to Know

Categories
News

How to Tether Any Smartphone to Linux for Mobile Internet

Laptops are invariably limited to Wi-Fi only connections; desktop computers never have built-in mobile internet. But what if you need to get your Linux computer online but have no wireless or Ethernet network?

The answer is tethering. With a smartphone you can share your mobile internet with your computer.

As long as your carrier doesn’t limit how you use your data, internet connection sharing (also known as netshare) with a Linux computer is a good option. Wi-Fi tethering is one option—here’s how to use USB tethering on Linux with Android and iPhone.

What Is Tethering?

Tethering is the name given to connecting a mobile device to a computer such in order to share mobile internet.

While some carriers might restrict this activity, these days that is rare. Most smartphones have a data plan which allows tethering, making tethering an attractive way to get online.

Strictly speaking, tethering refers to using a USB cable to share mobile internet. This means that you will need to carry your phone’s USB data cable around if you plan to use tethering.

Wireless tethering is also possible, using Wi-Fi or Bluetooth; this is also known as “wireless hotspot”. In most cases wireless tethering is easier but there are good reasons to use USB tethering:

  • For a reliable network connection
  • To keep your phone charged
  • Avoid wireless interference
  • Prevent wireless sniffers intercepting data

If you don’t have a suitable USB cable, here’s how to use your phone as a wireless hotspot. Simply connect your Linux computer to your phone’s hotspot to get online.

Use the Right USB Cable for Tethering

Before proceeding, you need to be sure that you’re using a USB cable that is suitable for tethering. Not all cables will work for this, as some are designed purely for power. The best way to check that your USB cable is suitable for tethering is to plug it into your computer. Connect your phone and wait for either device to detect the other. If some sort of data transfer or file browsing is available, it is suitable for tethering.

If there is a problem with the cable, you should be able to buy a suitable data-ready alternative online.

The following methods all require you to connect the mobile device to your PC via USB cable before activating tethering.

How to Tether Android Phones to Linux

If you have an Android device, tethering is straightforward, thanks in part to both phone and PC being Linux-based.

If you want to tether Android to Linux via a USB cable:

  1. Connect the USB cable to your phone and Linux PC.
  2. Android will detect the connection—when prompted to Allow access, select Allow.
  3. In the Notifications find the USB message, and tap it.
  4. Under Use USB for, select USB tethering.

In most cases, the connection will be automatically established. Check the IP address for your device to confirm it has worked using ifconfig or ip address. Look for an option labeled usb0.

Set up internet connection tethering with Android and Linux

With some distros, you may need to select the USB connection.

  1. On Linux system, find the network tray applet
  2. Click to find the network option with a name like “auto usb0”.
  3. Select this to connect Linux to your phone via the USB cable.

Don’t have a data plan which allows tethering? Installing a custom Android ROM can help circumvent restrictions.

Want to Tether a BlackBerry Phone?

Depending on how old your BlackBerry is, there are several options for tethering it to a Linux system. If you have a BlackBerry, it is either running:

  • Android (since 2015)
  • BlackBerry 10 (2013-2018)
  • Blackberry OS 7.0 (2011-2013)

For BlackBerry devices running Android, refer to the section above. For BlackBerry 10 and BlackBerry OS 7.0, check below.

To tether phones over USB running BlackBerry 10, start by connecting the phone to your computer. Then:

  1. Open Settings > Network Connections > Internet Tethering.
  2. Tap Connect.
  3. Select USB.
  4. Enable Internet Tethering.

Want to tether a BlackBerry OS phone to Linux?

  1. Tap Manage Connections > Network and Connections.
  2. Find Mobile Hotspot Connections then
  3. Set up the network credentials.

Whichever method you use, select the usb0 network in your Linux panel if it doesn’t automatically connect.

How to Tether iPhones to Linux

If you have an iPhone with a data plan which allows tethering, you can set up USB tethering.

Unlike Android, however, this doesn’t connect automatically. Instead, you will need libimobiledevice, described as a “cross-platform software protocol library and tools to communicate with iOS devices natively.” Head to www.libimobiledevice.org to confirm current compatibility.

If you’re using Ubuntu, libimobiledevice should already installed. If not, before hooking up your iPhone to Linux, open a terminal and enter:

sudo apt install libimobiledevice6

To connect to the internet through your iPhone:

  1. Open Settings > Personal Hotspot.
  2. Enable Allow Others to Join.

All you need to do now is select the connection in Linux. Unlike Android, iPhone devices display as a new Ethernet device, rather than USB. So, look for eth0 or eth1—usually the latter, as eth0 should be assigned to your Ethernet port.

How to set up Linux USB tethering on iPhone

Tethering Linux Phones to Linux

Several Linux mobile operating systems are available. These include a mobile version of Pure OS on the Librem 5, PostmarketOS on the PinePhone, and UBPorts, the continuation of Ubuntu Touch.

Perhaps surprisingly, not all of these have reliable options for USB or wireless tethering. For specifics, check the documentation of whichever Linux mobile project you’re using.

Tethering Your Phone to Linux: Success!

While smartphones can be used as wireless hotspots for laptops and computers, USB tethering remains useful. Your computer may have a damaged network card, for example, or you may have equipment susceptible to wireless interference.

Ultimately, sharing your phone’s mobile internet is a great way to get your Linux PC or any other device online. And if you’re concerned about the phone losing charge, the USB cable will ensure it draws power from your PC. It’s win-win!

Want to share your phone’s internet connection with a different operating system? You can connect mobile internet from an Android phone to your PC or laptop, as well as use the hotspot feature on an iPhone.

Read the full article: How to Tether Any Smartphone to Linux for Mobile Internet