LibreOffice Calc: Graphs with Two y-axes with Different Scales

While a bit technical, it’s occasionally useful to plot multiple data series that have very different scales in the same chart. Let me give an example to illustrate. Let’s say I want to see whether the number of Mormon temples being built aligns with the number of Mormon stakes (akin to a Catholic diocese) that are organized over time. (I’m a sociologist who studies religion; you’ll just have to go with my examples.)

However, the number of Mormon temples is in the hundreds while the number of Mormon stakes is in the thousands. If I plot them both on the same chart with the same y-axis (that’s the vertical axis), the number of Mormon temples is going to look really small and I won’t be able to see the variation over time in the number of temples, like this:

The chart shows that stakes have increased, but it looks like the number of temples has barely moved. LibreOffice Calc automatically creates the scale used for the y-axis based on the scale of the larger of the two data series, in this case, the number of stakes. Thus, the maximum value is 4,000 and the minimum is 0. What I want to do in this tutorial is to illustrate how to add a second y-axis on the right side of the chart that uses a different scale that is more appropriate for the number of temples.

To begin with, go ahead and create your chart with at least two data series, as I have shown in other tutorials, like this one. Once you have your chart with two data series complete, now it’s time to add a second y-axis with a different scale.

First, click on your chart then double-click it to open chart editing. Then, select the chart area by clicking on one of the axes (left or right doesn’t matter) and then right-click it. You’ll get a context menu with the option “Insert/Delete axes…” Select that:

In the window that pops up, you’ll see a second column labeled “Secondary Axes.” You want to select “Y axis.”

Click “OK” and you’ll see that a second y-axis has been added to your chart on the right side using the same metric as the left side:

The next steps are pretty straightforward, but before you do them, you should pause and think for a second so you don’t have to go back and undo what you’re about to do. You’re going to change the scale of one of the two y-axes, but which axis do you want to change? There isn’t a right or wrong answer here. Generally speaking, I typically see charts like this with the smaller of the two ranges assigned to the left axis and the larger assigned to the right axis, but, again, it is entirely up to you which way you choose to go. At this point, though, you need to make a decision. Then you can move to the next step.

I’m going to follow my suggestion above and change the y-axis on the left to a scale that fits with the number of temples (so, a smaller range of values) and keep the y-axis on the right with the larger range for the number of stakes. But before I change the scales of the axes, I need to tell LibreOffice which data series is going to align with which axis. Here’s how. Click on one of your data series lines, then right-click it and select “Format Data Series.”

In the window that pops up, you’ll see on the “Options” tab right at the top an option that says, “Align Data Series to” and then “Primary Y axis” (this is the one on the left of the chart) or “Secondary Y axis” (this is the one on the right of the chart). Since I selected the number of temples first, I’m going to leave that one aligned to the Primary Y axis:

Hit OK. Then select the other line (in my case, the number of stakes), right-click it, and select “Format Data Series.” On the “Options” tab, I’m going to select to align this line with the “Secondary Y axis”:

Once you do that, you’ll see that LibreOffice automatically adjusts the scale of the other axis. Here’s how my chart now looks:

You can see that it changed the scale of the Primary Y-axis (the one on the left) to a maximum of 250 to reflect the smaller range of that data series. If you want to customize the scale used, you can always click on the axis you want to modify and then right-click it and select “Format Axis”:

In the window that pops up, you can modify the scale of the axis by clicking on the “Scale” tab. If you want to change the values, click on the box next to “Automatic” to unselect it so you can put in your own values, then customize the value you add, like this:

When you have modified the scale to your satisfaction, select “OK” and your graph will be updated with the scale you want, like this:

The resulting chart now has two axes with different scales. It would be a good idea at this point to label the axes to reflect the differences. Simply right-click on the chart and select “Insert Titles.” In that window, add appropriate titles. The left y-axis is simply the Axes while the right y-axis is considered the “Secondary Axes”:

And your final graph will look something like this:

That’s how you can create a chart with two axes in LibreOffice Calc.

NOTE: This example was done in LibreOffice Calc version: 6.4.2.2 on a Linux-based operating system (Kubuntu 19.10).

LibreOffice Calc: Interpolating Missing Values in Graphs

Here’s my situation. I have some data over time but I’m missing values in specific years. I want to graph that data but would rather not have to estimate all of the missing values. It turns out, LibreOffice Calc can do that for you in your chart. Here’s how…

Imagine I’m plotting the number of congregations in the LDS Church over time (weird example, I’m sure you’re thinking, but I’m a sociologist who studies religion, so, yeah, that’s what I do). I have the number of congregations in 1841, 1849, 1901, etc. Basically, I have the number in certain years, but I’m missing the number of congregations in lots of other years. I could interpolate the missing values (Excel has this function built in; LibreOffice Calc does not, but you can do it following the approach I have detailed here). But, I don’t really need to do that for my project. I just need a chart that shows the growth of congregations over time.

My data are organized into two columns. Column A is years and ranges from 1841 through 2019. Column B is the number of congregations with the values I have and lots of blank cells:

Select the cells you want to plot (A1:B176 in my case) then click on “Insert Chart”:

You’ll get this window:

Since I want a Line chart, I’m going to select “Line” and because I want “points and lines,” I’m going to select that option as well. I also want “Smooth” lines rather than “Straight” lines, so I select that option, too:

Click “Next >” at the bottom. Since you already selected your Data range, you shouldn’t have to change that. However, we do want the “First column as label” for the x-axis of the chart. So, select that option:

Then select “Next >”. You shouldn’t have to change anything on the Data Series tab, so you can hit “Next >” again. On the Chart Elements tab, you’ll want to describe your chart elements. Add a Title and label your x-axis and y-axis. I also didn’t need a legend since I’m only plotting one data series, so I turned that off:

Then click “Finish.” You’ll have a chart, but it only has the points for the years when you have data, like this:

To add a line connecting the points and interpolating the missing data, click on the chart, then double-click it to modify the chart. Once you’re inside the chart, click on one of the points to select the data series, then right-click and select “Format data series”:

On the “Options” tab you’ll see “Plot Options” and just below that, “Plot missing values.” The default is “Leave gap.” Select “Continue line” and it will interpolate the missing values for you:

Select “Ok” and your line chart will now actually have a line, like this:

There you have it. A line chart with interpolated missing values in LibreOffice Calc without you having to calculate all of the missing values.

NOTE: This example was done in LibreOffice Calc version: 6.4.2.2 on a Linux-based operating system (Kubuntu 19.10).

Setting Up a New Windows Computer for Your Kids

I recently had a colleague contact me for some computer advice. He knows I’m a computer geek and was looking for some help setting up a new Windows laptop for his kids. He was wondering which antivirus software to buy.

If you’re at all familiar with my blog, you’ll know that I’m not a fan of Windows and run Linux almost exclusively in my house (I keep a Windows laptop around to use a book scanner). So, it may seem strange turning to a Linux user for advice for a Windows computer. But, it’s actually not that strange. Linux does so much right that it has taught me what you should do when setting up a computer, regardless of your operating system. So, here’s the advice I gave my colleague that I think would be good advice for anyone setting up a new computer for kids.

Antivirus Software

If what you want is just antivirus software, Microsoft Windows ships with antivirus protection now (Microsoft Security Essentials). If you don’t install any other software, you can make sure that you install that software. Plus, the price is hard to beat. It’s free. Also, from my perspective, it’s best for not slowing down your computer dramatically. Norton, Kaspersky, etc. all slow down your computer, which sucks. If all you want is virus/spyware protection, Microsoft Security Essentials is sufficient.

Additional Software

If you want additional software on the laptop to accomplish something else, that’s a different question. Since it’s for your kids, there are two types of software you could consider.

Home Internet Security

First, do you want to restrict where your kids can go online? I’m actually a proponent of simply teaching your kids good habits and not policing where they can go. That may not be your perspective. If you want to restrict where they can go, I’d suggest OpenDNS’s Family Shield (or Home). It restricts adult content and is free.

Ransomware

Second, there is also the concern of ransomware, which is basically if someone were to get a piece of software on your computer that then locks you out of your files. The easiest solution to this is just to install backup software like Dropbox and make sure your kids store any important files in the Dropbox folder. There is a free option that gives you 2 gigabytes. It’s generally good practice to back up all of your important files anyway (e.g., essays, homework, photos, etc.). So long as you have a backup, ransomware is basically not a problem. (See this guide for dealing with ransomware by Dropbox.)

Multiple Accounts and Administrator Accounts

You should also probably set up multiple accounts on the laptop, though, again, this is up to you and how much control you want to give your kids. Setting up a local account for your kids means they won’t be able to install software without your administrative password. If they don’t know what they are doing, this is generally a good idea.

Reinstall Windows

Finally, I’m not sure how good you are with computers, but I’d also suggest making sure you have a way to revert to a completely fresh install in case your kids manage to get past the software and screw things up. Since I build my own computers and run Linux, reinstalling my operating system is something I do regularly. But for most users, the very thought of doing that is terrifying. Microsoft has made that much easier.

Conclusion

Do all of the above and your laptop should work fine for years. Plus, all of the above will cost you exactly $0, just some time.

Plex/tinyMediaManager and Doctor Who Specials

I’m a science fiction fan. And I want my science fiction at my fingertips. To that end, I have slowly been digitizing my favorite series (e.g., Star Trek, Stargate, and now Doctor Who) and putting them on my fileserver that uses Plex to serve the episodes to whatever device I want. I recently ran into an issue with how to organize Doctor Who episodes on my fileserver and, once I figured it out, I thought I’d share it here in case others run into the same situation.

First, props to Doctor Who for occasionally having specials. They are always well done and lots of fun. So, I’m certainly not complaining. BUT, the problem is that the specials are not technically part of a season. That causes some challenges when it comes to how to organize the files.

I use tinyMediaManager for organizing my movies and TV shows on my file server. Not only does tinyMediaManager pull down all the information for my movies and TV shows but it also has the ability to rename the files and organize them. I like how it does all of this and it plays nice with Plex as well, which is important.

Now enter the problem with Doctor Who. Like most TV shows, Doctor Who has seasons. The standard ways to indicate the season and episode of a show are to include something like the following in the name of the digital file: “S03E14.” This indicates the show is from Season (“S”) 03 and is the 14th Episode (“E”) from that season. This works great for most of Doctor Who since most of the content is episodes.

But, what about the specials? The creators of Doctor Who regularly release off-season or out-of-season specials. These don’t get a season episode number. When I tried to get tinyMediaManager to scrape the specials, it didn’t know what to do with them. Basically, it ignored them because it didn’t know what they were since I didn’t know what to name them.

After a little googling, I found out that “Specials” have a special Season designation: “00.” So, for the first Doctor Who (2005) special called “The Christmas Invasion,” that aired on December 25, 2005, how you can name that file is:

Doctor Who – S00E167 – The Christmas Invasion

The naming convention breaks down like this. “S00” tells both Plex and tinyMediaManager that it is a “special.” tinyMediaManager then moves it into a folder called “Specials.” The “E167” is the episode number for the entire series (from Wikipedia). Once I figured this out, tinyMediaManager knew where to put the special:

And Plex began to recognize what the episode was:

Success! Now I can include Specials with my favorite science fiction series. There is order again in the science fiction universe.

Change Doorbell Sound on Ring App and Amazon Echo

I’ve had a Ring doorbell (and security system) for quite a while. I never bought the chime that goes with the doorbell because it has always worked through my Amazon Echo devices. However, I only recently learned that you can change the notification sounds you get when someone rings your doorbell. However, how you do this requires clicking through almost a dozen screens in the Ring app and I can never remember it. So, here’s how to do it.

Change Doorbell Sound on Ring App

I’ll start with the notification sound you get on your phone through the Ring app when someone pushes the doorbell. First, open the Ring app and you’ll be on the Dashboard or Home screen:

The dashboard or home screen.

Click the three lines in the upper left corner to open that menu:

Menu options.

Select “Devices”:

The list of devices.

Now select your Video Doorbell (mine is called “Front Door”):

Options for your Video Doorbell.

You’ll have to scroll down (at least, I did), to see the settings icon (the gear). Click on that:

These are the settings for your video doorbell.

The settings you want are the Alert Settings. So, click on that:

The alert settings for your video doorbell.

The second option down in the screenshot above is for the chimes that you can use if you have a separate chime for your device. I don’t. So, what I want to change are the “App Alert Tones.” Click on that option and you’ll get this screen:

App Alert Tones screen

We’re almost there (I know, right!?!). Now click on “Ring Alerts” and you’ll get this screen:

Here’s where you can adjust all of the alerts for your phone (through the Ring app) when someone pushes your doorbell. You can silence it. You can turn on or off the notifications. You can set it to Pop on screen. What we want is at the very bottom in the “Advanced” section. Click on that and you’ll get more options:

This is the same screen, just after I scrolled down to the see the advanced options.

Now, finally, we can change the sound. Click on “Sound” (it will indicate which sound you are currently using below “Sound”) and you’ll get this screen:

These are your options for doorbell notifications on your phone through the Ring App.

You can pick any of the sounds or music available there. If you want to set it to a song or something like that, you can put that into a folder on your phone called “Ringtones” and they will show up there.

Change Doorbell Sound on Amazone Echo Devices for Ring

In addition to changing the sound on your phone, you can also change the sound on your Amazon Echo if you have it connected to the Ring app. I’m not going to go through how to connect it to the Ring app as that is pretty straightforward (download the Ring skill for your Echo), but here is how to change your doorbell sound on your Amazon Echo.

First, open the Amazon Echo app:

Amazon Echo home screen.

In the bottom right, click on “Devices”:

A list of my devices.

I have a lot of devices set up with my Amazon Echo, so I actually have to scroll over to see all the devices (just swipe the list at the top to the left – Tinder style!) to see the option for All Devices:

I swiped left!

Click on “All Devices” and you’ll get a list of all the devices you have set up on Amazon’s Echo/Alexa app. You need to find the app that has a camera icon and is whatever you named your Ring video doorbell. Mine is called “Front Door”:

You’re looking for your Ring video doorbell in the list of devices.

Click on that and you’ll see the settings screen for your video doorbell:

The selected sound is under “Doorbell Sound.”

As you can see in the screenshot above, I had set up a “Howl” for Halloween. I want to switch it to something different. Click on the Doorbell Sound option and you’ll see a list of additional sounds:

The list of doorbell sounds.

The list includes seasonal options. I went with Xmas Elves. Select it and click back and that will be the new sound that is played through your Amazon Echo devices when the Ring video doorbell is pressed:

It worked!

Now, the next time I want to change this option, I won’t have to click on 50 different options in the various apps. Hooray for me (and you)!

Linux/Kubuntu – Disable Network Printer Auto Discovery

I don’t know when Kubuntu started automatically discovering printers on networks and then adding them to my list of printers, but it is a problematic feature in certain environments – like universities (where I work).

I set up my home printer on my laptop easy enough. But, whenever I open my laptop and connect to my work network, this feature searches for printers on the network and then adds them to my list of printers. I now have hundreds of printers that show up in my printers dialogue:

I didn’t manually add any of those printers. They were added automatically and are causing problems. First, it’s a pain in the ass to find the printer I want. Second, when I shutdown my computer, the OS has to run through all of those printers and make sure they are disconnected, which makes the OS hang for a couple of minutes every time I want to close down.

This is obviously a great idea in principle, but problematic in this environment.

So, how to turn this off. I found a solution. In a terminal, edit the following file:

sudo nano /etc/cups/cups-browsed.conf

In that file, you should just have to uncomment the following line (remove the hashtag ‘#’):

BrowseProtocols none

So, from this:

To this:

Afterward, try running the commands:

service cups-browsed restart
service cups restart

After making this change, my computer no longer automatically adds shared printers on my network. Hooray!

Unfortunately, making this edit did not remove all the shared printers it had already installed. I still had to remove them all manually, which was annoying. But at least they won’t be reinstalled automatically.

Linux – Failing to Read Encrypted DVDs

Thanks to the fine folks at VLC and Ubuntu, watching DVDs on Linux is generally pretty straightforward. Install “libdvd-pkg” and follow the prompts and you’re generally good to go. That works for me almost all of the time.

However, I recently tried to watch a DVD and had no luck. I would insert the DVD and then wait. With most other DVDs, after about 30 seconds, I’d get a prompt that my Kubuntu 19.04 system had read the DVD and I had several options to proceed (view the files, watch it in VLC, etc.). But with this one, my OS couldn’t even detect that there was a disk in the drive. I tried multiple approaches.

Here’s what K3b indicated:

When I tried loading it in VLC:

And from the command line in VLC:

The problem is not my drive. I regularly load disks in the drive and they work fine, including many disks that have CSS encryption that the libdvd-pkg addresses. But, try as I might, I could not get my computer to even recognize that there was a disk in the drive.

I have a blu-ray player connected to my home entertainment center. Worried that the disk may just be bad, I put it in the blu-ray player and it opened fine. That convinced me that the disk was using some form of encryption that is still not addressed in the libdvd-pkg. I did one final check. I inserted the disk into an old laptop I keep around that has Windows installed on it just to see if this really is a Windows vs. Linux thing. Sure enough, Windows immediately detected it and opened it right up.

After spending a good 5 hours or so trying to find a solution (including installing lots of packages and reading through dozens of threads in Linux forums), I didn’t find a solution. I wrote this post basically just to inform other Linux users that there are some DVDs out there that have encryption that prevent them from being opened in Linux. I’m running the latest version of Kubuntu as of this writing (19.04 beta) with all the suggested packages installed to examine a DVD. But, regardless of what I tried, my OS could not read this disk.

Update 2/3/2020:

A friendly reader (Fabian Echevarria) sent the following:

Last week I came across a DVD similar to that described in your article.

I was able to read the data, first using ddrescue to read to ISO. The resulting ISO also failed but now with a common Title 3 IFO error, which usually isn’t a deal breaker, but in this case continued to prevent play. So I read the raw directory (I normally use 7z/isoinfo) and then pulled each individual chapter from streams that seemed viable, in this case 59 through 72. Running md5sum on the resulting files determined that only two chapters differed between all those stream. A manual review of those two determined which were the correct chapters, which I combined into the final file. The combined file plays fine.

For more information on Fabian’s workarounds, see here.

Plex – Syncing Media to Devices

I love my Plex server. It works pretty flawlessly with devices like my Roku or allowing me to listen or view my media collection online. However, there are occasionally instances when I know I either won’t have internet access (e.g., on a plane or on a hike) and I want to have access to my media. Plex still has me covered with the option of “syncing” media to my phone. However, the process isn’t all that intuitive. So, here’s my guide to syncing audio and video to a phone/tablet.

First, choosing what to sync is done, from what I can tell, almost exclusively from the device (with some minor exceptions). Basically, you have to install the Plex app on your device, open the Plex app, log into your account on your device, then find the media you want to sync. (I’m not going to cover install, opening, or logging in with this tutorial, just synching.)

Let’s say I want to synchronize my Simon & Garfunkel albums to my phone so I can play their music when I don’t have internet access. I first have to open the Plex app:

This is how the app looks once it’s open and connected to your Plex server.

Make sure it has detected my Plex server (which is called NewPlex):

I circled my server in this image.

Then I have to find my collection of Simon & Garfunkel music in the Music tab (at the bottom of the screen):

To move between different collections, you click the buttons at the bottom of the app. In this screenshot, I was looking at my Music collection.
I have now selected my Simon & Garfunkel songs.

Once I have done that, syncing is pretty easy. Look for the “down arrow” and touch it:

When you do, you’ll get this screen:

You set your synching options on this screen.

You’ll have the option of adjusting the audio quality (this makes a lot of sense if you’ve got your files stored in FLAC on your file server but want to save space on your phone; if so, convert them). You can also dictate how many songs you want to synchronize. If you put a limit, I’m assuming Plex will just randomly select which ones will syncronize (you can also just download specific songs or albums). When you’ve made your decisions, you click on Save and the transfer process will start.

Here’s where things get kind of interesting. You can now open your Plex dashboard and look for your sync progress. To illustrate, I picked an album I have stored in FLAC on my server and started the conversion process:

Your “Conversions” page in the Plex server settings shows you the files that are being prepared to be transferred to your device.

Once your server has converted everything, it will be sent to your device and you’ll see a little arrow in the corner of synchronized albums, like this:

All the white arrows in circles indicate that these albums have been synchronized with my device – so they are stored on my device.

The process is similar for movies. Click on the “Movies” tab at the bottom of the screen to look through your movies. Once you find the one you want to syncronize, click on it. That same “down arrow” will show up:

Click on the down arrow to synchronize the movie to your device.

Click on it and you’ll get one of the same options as before to choose the quality of the synchronized file.

Once you click Save, the conversion process will start on your Plex server:

Here’s the Conversion screen showing my movie converting before transfer to my phone.

Once the conversion is complete, the file will be sent to your device and you’ll see, similarly, an arrow on the movie indicating it is synchronized with your device.

Finally, there are a few secrets to accessing your synchronized content quickly and easily. If/When you find yourself without internet access, or if you just want to see what you have synchronized with your device, you can click on your icon at the top left of the app and select “Offline Browsing”:

Once you do that, only synchronized content will show up in your tabs, like you see below:

You can also click on the “Downloads & Sync” option in that same menu and see the content that is currently synchronized with your device:

And you can check in the settings dashboard in your Plex server to see what content is synchronized with which device (you can synchronize with multiple devices):

This makes it easy to see what content is synchronized to which device

One last bit of advice. If you want to remove content from a device, you can do so on your phone/tablet or on your Plex server. On your phone, go to your Downloads & Sync list, then select the sync you want to delete. When you do, in the upper right corner there will be a trashcan. Click on it and you can delete the sync.

On the Plex server, in the “Sync” tab, hover over the sync and you’ll see a red X. Click on it, and the synchronized files will be deleted from that device

And if you want to remove a device from your account altogether and get rid of all the synchronizations tied to that device, that is done on the Plex server web interface as well. In the Settings menu, click on Authorized Devices, find the device you want to remove and click on the red X.

That will remove all the synchronizations and prevent it from being able to access your Plex server.

This website was helpful in figuring all of this out.

Linux – Setting Up FTP/SFTP Restricted Access for User

I run a server (Ubuntu 18.04) that hosts about a dozen websites using Linode. Most of the sites are run using WordPress and are my own or sites I manage for friends or family. I do, however, host one for a colleague who actively develops online content for that site.

As WordPress has developed, the ability to upload various file types has slowly been removed for security reasons. As a result, for certain types of files, it is now required to upload them using a different approach. I can do so using SSH, but GUI FTP/SFTP software was going to be easier in this situation as the person responsible for managing that site doesn’t have a lot of knowledge managing a website. I explained to this person, we’ll call her Sharon, that it would be possible for her to upload these files herself using FTP/SFTP. She was worried as she doesn’t know what that is or how to use it. But I explained it and, hopefully, she’ll grow more comfortable with it.

However, I don’t want a novice to gain access to all the files on my server. So, I was faced with the question of how to set up an FTP/SFTP account for someone that is restricted to just one folder – a folder where she can upload stuff and delete files, but with no access to anything else.

Here’s how I did it.

First, you should create a new user group on your server. This can be done with the following command:

sudo addgroup --system GROUPNAME

This will add a new user group called GROUPNAME (I called mine “ftpusers”). If this individual isn’t currently a user on your server, add them as a user as well:

sudo adduser --shell /bin/false USER

Replace “USER” with whatever name you’re using for this individual, for me it was “sharon.” You’ll need to create a password for your USER and fill in some additional information. Then add your USER to your GROUPNAME with the following command:

sudo usermod -a -G GROUPNAME USER

Or my command:

sudo usermod -a -G ftpusers sharon

So, you have now created a new group and a new user and added the new user to the new group. Of course, the next step is to restrict what your new USER can do. In particular, we want the user to have access to just a single directory. Here’s how that is done.

You can create a directory the user can use:

sudo mkdir -p /var/sftp/NEWFOLDER

This folder can be anywhere on your server. I put mine in a subfolder on their wordpress installation:

sudo mkdir -p /var/web/DOMAIN/public/wp-content/uploads/NEWFOLDER

Now, we need to tell the server to restrict USER to this NEWFOLDER when they login. First, let’s give ownership of that folder to the user with the chown command:

sudo chown USER:GROUPNAME /var/sftp/NEWFOLDER

We should also make sure the permissions for the new folder are what we want them to be – read/write for the user and group:

sudo chmod 755 /var/sftp/NEWFOLDER

If you navigate to that folder and check the settings, you should see that the owner is now the USER and the GROUPNAME (you can check with “ls -l”). It’s not a bad idea to also check to make sure that the folder above it is owned by “root” or your primary user, which will prevent your new USER from being able to make changes to that folder.

So far, we have a new USER and GROUPNAME and the user has a folder they can access. However, we need to tell the server that the user needs SFTP access and then need to force them to go to just that one folder when they login with SFTP.

To grant them SFTP access, you need to change the SSH settings:

sudo nano /etc/ssh/sshd_config

This will open the file “sshd_config” with a text editor (nano) so you can make changes. At the end of the file, you want to add the following text:

Match User GROUPNAME
ForceCommand internal-sftp
PasswordAuthentication yes
ChrootDirectory /var/sftp/NEWFOLDER
PermitTunnel no
AllowAgentForwarding no
AllowTcpForwarding no
X11Forwarding no

This allows users in the group GROUPNAME SFTP access to the folder you created for them.

Before you close the nano session with “sshd_config”, you may have to change one other setting. Look for a line that says:

Subsystem sftp /usr/lib/openssh/sftp-server

Mine was not commented out, so that setting was active. However, given the settings we just added to the file, we need to change that. Comment out that line:

#Subsystem sftp /usr/lib/openssh/sftp-server

Below that line, add the following line:

Subsystem sftp internal-sftp

I’m guessing that the original line specified a location for the sftp-server to be used by the server but we want the server to determine the best location for the sftp-server it is going to use and that’s what the second line does. (Alternatively, in the text added to “sshd_config” the line “ForceCommand internal-sftp” could probably be left off, meaning you wouldn’t have to do the step I just described. I haven’t tried that, but it may work.)

Anyway, when you’re done editing the “sshd_config” file, save it and exit from nano.

Finally, to make sure that the new USER is forced into the specified folder when they login, you have to make one more change. This changes the home directory for the user so they are forced into that directory when they login. Here’s the command.

usermod -d /var/sftp/NEWFOLDER USER

This makes the folder you created (NEWFOLDER) the home directory for the USER so, when they log in using SFTP, they will be forced directly into that folder.

There you have it. You have a new user in a group with restricted SFTP access and the user will be forced directly into the folder you created where they can upload, modify, and delete content. They will not have access to anything else on the server, so the rest of your content will be safe.

Acknowledgments: I figured all of the above out with help from these sites: here, here, here, and here.

Plex – How To Create Smart (auto updating) Music Playlists

I love my Plex server. I stream my music basically around the world (I travel regularly). But it took me a while to figure out how to create playlists that automatically update (i.e., “smart playlists”) based on search filters. At home, I use a native music client (e.g., Strawberry or Clementine) to play my music. Clementine, in particular, has excellent smart playlist functionality, allowing me to create a playlist with all of my music in the “Folk” genre or published between 1970 and 1980. With how amazing Plex is, I figured the same functionality had to be possible. I knew I could simply add songs to a playlist manually, but that seemed cumbersome. I’d rather let the software do it for me. Once I figured it out, I thought I’d make the steps clear for others.

Counter-intuitively, the place to start is not in the “Playlists” option on the Plex dashboard, but in the Music panel.

Click on the Music pane, not the Playlists pane.

You’d think that you would create Playlists in the Playlists area, but you don’t. You create all the Playlists in the Music area.

Once you’re viewing your music, you need to look for a drop-down menu. It’s all the way to the left and says “All” with a little arrow next to it.

Click on the little arrow next to “All” to drop down the menu.

What you want to do is click on “Custom Filter.” That will open this option:

Here’s where you create custom filters.

Using that filter option, you can search for, say, all the music in the Genre “Alternative” or “Classic Rock.” Once you’ve entered your search criteria, click the “APPLY” button on the far right and it will apply your search criteria to your music:

Once you apply the search criteria, Plex will show you the music that fits the criteria.

Now, creating a “Smart Playlist” is just one more step. Look to the right of the window for an icon with four little lines and a plus sign. That is the icon for creating a playlist:

This is the icon you want for creating a playlist.

Clicking that button will open a prompt for you to name the new playlist. I typically name mine based on the search criteria, but you can call them whatever you want:

Now, with your Smart Playlist created, you’ll be able to see it in the Playlist area. Click on “Playlists” in the left menu and, assuming you’ve done everything correctly, you’ll see your newly created playlist there:

All of your playlists are in the Playlists area.

The little gear icon that appears in the top left corner of the playlist indicates that it is a “smart playlist” that will automatically update if you add new music to your library that meet your search criteria. Playing the playlist is as easy as hovering over it and then clicking on the play arrow that appears:

Hover over the playlist, then click on the play arrow to play it.

There you go. You can now create as many playlists as you’d like using filtering/search criteria. (This guide helped me figure this out.)