Friday, March 27, 2015

Troubleshooting Connections

I spent a couple of hours yesterday trying to figure out why one of my computers (Windows7) suddenly could not see the rest of the local network or connect to the mapped drives I'd set up.  This was really aggravating, since the mapped drives were those on my Synology server, which makes copying files to/from the server a real pain if I can't see the server.

All of the sudden, two of the three drives I'd mapped on the server weren't there, and only some of the subfolders of the third drive were accessible. I could see the other folders on that drive, I just couldn't access them, nor the server, over the local network.

I hadn't made any hardware or software changes, so what happened?

  • Rebooting (a couple of times) didn't work.
  • I unmapped two of the drives that no longer worked. But couldn't unmap the third.
  • I checked the credential manager in Windows7 to see whether it had somehow been corrupted. No problems there.
  • I checked the network adapter to see that all of the network protocols were checked off. No problems there.
  • Checked the Network and Sharing Center settings to ensure Network Discovery was still enabled. Yup, no problems there.
  • Checked my firewall. Nope, That wasn't the problem. Scan the computer for viruses. Nope.
  • "Googled" the issue and read thru a number of suggestions. The ones that seemed relevant to me I checked and they didn't resolve the issue.
  • Checked the server from two other computers to see that the server's drive(s) were actually OK. That wasn't the problem.
  • Look through the Computer Services to see if some computer service has somehow been disabled. Nope.
  • Disabled the wireless connection. Hey, I'm guessing at this point.
  • Try using a Restore Point.  This looked like it was going to take a while, so I let it run overnight. Next morning, found the restore didn't work. Great..
  • Reboot in Safe Mode. Can't find anything there.
  • Wait a couple of hours....

  • Think (seriously) about chucking the computer.

  • Suddenly, everything's there. No idea why the problem took place or what I did (if anything) to fix it.
  • Remap the drives.


What a waste of a few hours.

SSH

Finally getting (remote) FTP connectivity back is great! Though I'm still following up to see what settings were changed, remote FTP access is nice to have back.

Opening up SSH access though, proved to be attractive. I must have received a couple of dozen attempts that were blocked (I think and hope). So after getting FTP access restored, I decided it was just too much to possibly leave exposed to keep SSH open. Maybe later after I finish reading up on SSH myself,  getting reacquainted with the CLI, and how I'd use SSH and secure it, I'll open things up again. Using Windows for too long and the GUI has dumbed me down from the days of DOS.


Thursday, March 26, 2015

Synology- Security

I'm still having issues with getting FTP to work outside my local network, so I gave up and opened a support ticket. After trying the obvious, TechSupport asked to be set up with SSH access. Almost as soon as I opened up SSH, I started getting notifications from my AutoBlock .  I've had AutoBlock enabled since the start, but the repeated efforts to gain access made me wonder what else I could do to (try) to secure my little server.

In DSM 5.x, Synology has a feature (under Control Panel->Security->Firewall), where you can set up Firewall rules which can be fairly granular in terms of applications, ports, IP addresses (or ranges) ,  and even on a country basis, and allow you to specify whether, if the rule is met, access is allowed or denied. And since I'd already done a little work to see which countries the (apparent) access attempts are coming from, I decided to set up a country specific block. Now, I know before I started this that IP addresses can be spoofed, so this is only one meager piece to trying to secure the server, but better than nothing. I found this guide as a starting point, though you'll need to modify for your own circumstances, and, as always, I'm not responsible for any bad things that might happen to your NAS if you follow this process.

I also changed my AutoBlock settings down to allow very few attempts before being blocked.

I'm starting out with very basic firewall settings to see how they work, in combination with the AutoBlock. Even as I write this, I had an attempt to SSH into the server that was AutoBlocked, but not because of the firewall rule.

I had been trying to connect to my site through a series of devices, some on a VPN, some not, so I thought I'd check just to make sure it wasn't me. It wasn't me, but it wasn't one coming from China either (blocked in my Firewall rule). Sigh...

For normal web access to my server, I have two factor authentication enabled, but for access thru SSH, adding the combination of the remote access key, AutoBlock and the Blocklist, will hopefully add more security. And, there is no anonymous FTP allowed.

Shortly after I initially set up my server, I was reviewing the connection logs (you do review yours, right?), and saw repeated anonymous ftp attempts. So I did a reverse IP lookup and found the provider's contact info and sent an 'abuse' report. Probably for the only time this will ever happen, I actually got a response from the user involved and found this site. After I exchanged some emails with the site owner, I was marginally more comforted by their explanation of the site's purpose, but not at all thrilled by it. I hope I'm getting a gradual education in security and not one by virtue of getting hacked. My naiveté is showing.  Shodan basically scans the Internet looking for vulnerabilities and open ports.


Now, my link to this site is not intended to bash them, but it's a bit of a scary reminder how easy it can be to find vulnerabilities. I searched, and at least for now, my server isn't listed.  Very interesting site. Worth a visit!









Sunday, March 15, 2015

Mobile Data Usage and Plex

One thing I've found since starting up my Plex project is that my monthly mobile data usage has skyrocketed. Now, I have a 4G 'phablet' type phone, so I probably chew up more than the typical smartphone user anyway.

One month, I used 46 gig of cellular data (not Wi-Fi), and probably 85% of that was from streaming Plex content.

This month, in the first two weeks of my billing cycle, it looks like I'm on track to beat that.<oops>. I've used almost 38 gig, and Plex accounts for 33 gig of that. I'm really just streaming music, so I'm surprised it's soaking up so much data.

Prior to Plex, I might have used 4-6 gig mobile data in a month, so streaming Plex is clearly driving the usage way up. I'll have to try Spotify and see if it's as hungry as Plex seems to be.

How much mobile data do you use per month? Mobile data usage is continuing to increase as we add bigger screened phones (and tablets with cellular data), with faster connections. It seems hard to find real information on average usage, but the rate of growth in usage seems destined for continued explosive growth.

New Setup for Mac

For the many years I worked remotely at home, my desk was overwhelmed with a docking station and monitors for my work computer. Now that I've been rid of that nuisance (i.e.' retired'), I have the chance to set up my Mac the way I've wanted to before, but didn't have the space.

In planning this, I thought I'd use the two existing monitors I had, plus a third on an adjacent desk that I was using thru an HDMI switch to connect to my Mac Mini (Plex server). I'd hoped I have three externals plus the laptop monitor.

What I found though, is that if you aren't using thunderbolt monitors (who can afford multiples of those?), is that the Macbook Pro can only support two external monitors, unless it's through Thunderbolt. Since I have both of my external connected through the digital to mini-dvi port (thunderbolt port), both of my existing Thunderbolt ports are in use. Without buying a Thunderbolt dock (as much as one of my monitors, though not as much as a Thunderbolt monitor), I cannot daisy chain another monitor. I have a usb to digital converter box, but I had some lag when I used it before on a Windows machine, so I'm not inclined to use it here.

To connect my monitors to the Mac, I ordered a couple of these cables from Monoprice. Hard to beat the price.

I have 20" and 19" Dell monitors. I don't have enough desk space for bigger monitors if I wanted to buy them, right now.

I found that when I tried connecting the third external monitor to my Mac's HDMI port, one of the other two went black. So, while not exactly what I had in mind, having two externals is a huge improvement! I set up a remote screen sharing session to the Mini in one of my workspaces to work on that computer when necessary (I'm lazy, it's three feet away). I'm enjoying the added workspace, but do occasionally find that I 'lose' the cursor in all that space, but I also got rid of the extra keyboard and mouse from the docking station.  

Since I have two Macs (Macbook Pro and the Mini), but only want one keyboard, I bought a Logitech K811, which actually allows you to connect to up to three devices through Bluetooth. Simply press the function key at the top of the keyboard to switch between devices. Since I have the remote screen sharing to the Mac, I don't need a second mouse for the Mini. That much less clutter on my limited space desktop.

I'm still considering whether to use Reflector to provide the ability to display my iPad (the smaller screen below the two displays) to display on one of the monitors, but I haven't really found a personal use case for this as yet.




Tuesday, March 03, 2015

Transitioning to Mac Mini for Plex


My decision to move from the Windows7 computer I was using to host my Plex server was driven by the instability of this particular computer (which has been an issue since I bought it, not of Plex). I wanted something that would be a smaller footprint, as the Win7 computer I was using was a laptop. Though it has a 1 tb drive, all of the media is stored on a Synology NAS, so the replacement didn't need to be anything with vast storage, but for purposes of transcoding (where necessary), did need to have a good processor and enough RAM.

I'd been waiting for Apple to announce their updating of the Mac Mini. I was really disappointed with their 2014 offering, as it seems they are really trying to show a clear differentiation between the Mini (as a low end product) and the iMacs. The new machines came only with an i5 and no upgradeable RAM. Apple RAM is expensive, so in the case of the new Minis, you have to order what you want when you buy, as the Mini has soldered RAM (no user upgrade). I decided to evaluate a reconditioned 2012 model, hoping there would be some availability with the launch of the new line.

I hadn't shopped for a reconditioned Mini, so I was surprised to learn when I went to look, there were none. Sigh. So, I set up a change detection search to look for me. I finally found some coming into the Apple store. I found a 2012 reconditioned i7 quad core Mini Server (2 x 1tb drives), with 4 gig RAM. I bought it (quickly, they seem to go fast), then later would evaluate the need to upgrade the RAM. I didn't really need the server version, as I already had the Synology. I may use the server app for some related purposes in the future, but right now, it primarily serves as my Plex server.

Apple setup is trivial, and I hoped that the Plex setup would be just as easy. Installing the Plex server itself was easy, and of course I had to change the port forwarding in the router to point to the new computer's IP address. Then I ran into my initial problem of mapping the drives on the Synology to the server on Plex and (since the Mini is so power efficient), finding a way not to have the Mini go to sleep (keeping my libraries accessible). In Windows, I had simply created mapped drives (M=Music, P=Photos, V=Video) and set up credentials for the Windows7 computer to be able to access the Synology. It always worked just fine once i got the credentials set up, but setting up drive mapping on the Mini and keeping it awake were something I hadn't thought about up until now.

I found people on the Plex Mac forum had similar concerns when it came to keeping the Mini awake. I settled on Caffeine. It seems to be working fine for me.

But not being all that familiar with users and mapping under OSX, mapping was a bigger unknown to me. I created users on the Mini for each of the drives and had them automatically login when the Mini started (using the Login items under System preferences). Once I figured that out,  everything seemed to work fine, though I have one intermittent problem, with one segment of my media library. Periodically, when playing something in my Music collection, Plex will seemingly start to play the song, but no music is played. This goes on for a few seconds, then it skips down to the next song, etc., but nothing is actually ever played.  Not particularly useful.

The first time this happened, I deleted the entry in Plex's library for Music (which was a mistake, as I'll explain). And re-added it. However, doing so means that Plex has to go out an reindex and match all of the media in the music library and add all of the album art. Oops. A reasonable number of my music tracks then had no artist or album art. Ok, manually go out and look for the album art and fix all of these.  Of course all of the music is then shown as "recently added", moving any of the other media types waaay down the list, since I had ~19,000 tracks in my collection at the time.

Then, it happened again.

I read through the forum and opened a post in the 'Ask a Ninja'  to look at the issue. Needed to upload a server log. This is way more help than I expected, since this is all volunteer work, helping others. The "Ninja" had a couple of suggestions, but I think the one I implemented that actually made the difference was to log back into the music folder on the Synology from the Mac Mini (on which the Plex server runs). Doing so suddenly fixes the issue with the music not playing. Don't even need to restart the Plex server! It's happened a couple of times since then, but since I haven't figured out why, the easy solution is just to log back into that remote folder (the Mini is connected to the network via ethernet, as is the Synology), and problem solved (for a while). The only other issue I've had is that even though the Plex port is forwarded to the (fixed IP) ethernet connection of the Mini, if WiFi is somehow turned off, Plex isn't accessible outside the house. This is still something to which I have not found a solution, and obviously I cannot forward the same port to two different IP addresses. So I just leave WiFi on.

I used the Activity Monitor to see how much RAM was being used with little more than the normal system processes and Plex, and was surprised to see it already using a swap file at this point, so I decided it was necessary to do a RAM upgrade. Prior to buying the Mini, I explored YouTube for a video on upgrading the Mini's memory (there are a couple of good videos). It seemed pretty simple. I bought the RAM from Crucial, upgrading from 4 gig to 16 gig (meaning that you have to replace the existing 4 gig RAM), after using their process (System Advisor or Scanner) to ensure I bought the correct RAM for my server. Cost was about $165.

The only problem I had was managing to get the bottom plate of the Mini to unscrew (twist off) so I could access the memory slots. It just didn't want to unscrew, but finally, did. There's nothing to upgrading the memory once you've done this, popping the existing RAM modules out and putting in the new. Fingers crossed, we'll hope there's no issue with rebooting...

All in, I spent about $1k on the Mac Mini and the memory upgrade. Add in the Synology (1513+) server and (baring any upgrades there), I've invested a total of about $3k in hardware.

No problems on reboot though, so now my little Mini is happily (and reliably) serving up my media. I only wish my Internet connection weren't so unreliable. But that's an issue I hope to address later this spring. But doing so, will mean reconfiguring the router. It's always something...