ClearOS DNS and local websites

Thank you Comcast, I just started my vacation and you killed my internet. On a Saturday. Right in the middle of cartoons with the kids at 9:33am and you kill my internet. On a Saturday…until 2pm. I hate you Comcast.

So back to web development I guess, oh wait no internet. I host my sites locally here at home so no internet should not hit me too hard (except for all the offsite javascript and fonts – bad idea). But it did. My domains would not resolve, so I edited the servers DNS. Problem solved.

Network > DNS Server > (edit your existing entry)

You should already have a main DNS entry when you installed your system. From here all you need to do is add the domain you host locally. Dump it in an alias box (ex: Alias #3 = mypersonalsite.com). Now your domain should resolve and load with or without internet.

Party on Wayne.

ClearOS/Apache and Mod_Rewrite

Installing WordPress on your ClearOS box? Want to use permalinks? Enable them and find out that you are getting a 403 Forbidden? If you are getting a 403, like I was, then here is the quick fix for you.

In your .htaccess file, add this line to the top:

Options +SymLinksIfOwnerMatch

That should clear up the 403 for you.

Plex (on ClearOS) and Subscene.com Subtitles

(These directions should work on most linux installs of Plex)

I have kids, three of them. This makes actually hearing a movie or TV show damn near impossible, so I usually have the subtitles on – you get used to it after a while.

Since I have been using Plex (before on Zentyal and now on ClearOS) I have been manually downloading subtitles from Subscene.com and adding them to specific Plex movies as I watch them. A tedious process. I already have my system set to automatically download my torrents directly to the media folders, then Plex auto refreshes and the movies are good to go (works for the most part, I need to work out some permission issues). Now I have found a way to automate the subtitle process. I just got it working so I have not tested it fully yet. But so far it appears to be working.

Go here for the Plex plugin
https://github.com/kronenthaler/plex-subscene

On ClearOS 6.5 the plexmediaserver folder is located at
(this seems to be the location for most Linux based Plex installs)

  1.  

    Just add it to your plugin folder (may need to change permissions).

  2. Then open Plex in a browser.
  3. Go to your Plex SERVER SETTINGS > AGENTS.
  4. From there click on Movies or TV Shows and your new plugin should appear under Freebase or TheTVDB.
  5. Configure how you like from there.
  6. When done with settings, go into Tv and Movies and force a library refresh, this should update your existing movies/shows with subtitles.

Oh, and it’s not my fault if you break something…

UPDATED 2-11-2017: It seems the original Plex Subscene plugin I was using and mentioned in this post is no longer available at Github. The page has also been removed. I found this https://github.com/pannal/Sub-Zero.bundle/releases in my searches while looking for a replacement. It is a different plugin called Sub-Zero. It does much more than the plugin mentioned in this post. Download that one and give it a shot. If you get stuck check out this blog for help https://blog.rylander.io/2016/02/26/install-sub-zero-a-plex-plug-in-based-on-subliminal-to-download-subtitles/.

 

ClearOS HTTPD & Reverse Proxy

I already host a few domains on my ClearOS box with no problems, but they are all hosted on the Clear box itself. I recently had the need to point a subdomain to another machine on my network. In Apache2 this is reverse proxy (pointing a domain/subdomain to an internal IP address). A few Googles here and there and all I could find was a few 3-4 year old posts regarding the topic. It mentions installing and building Pound, and a few other options. None of those seemed to be right. A bit more Googling and I finally found it. Its super easy.

All I had to do was modify my existing /etc/httpd/conf.d/flex-80.conf file, nothing to install.

Heres where I found the solution
http://www.clearfoundation.com/component/option,com_kunena/Itemid,232/catid,17/func,view/id,32097/#32108

The forum support for ClearOS sucks, and everything I find is years old. Hopefully this helps someone, this solution worked for me using ClearOS 6.5 (as of 12/2014).

😀

Raspberry Pi High CPU Utilization

So if you are coding in python for your Raspberry Pi and your script runs a loop you may have noticed the high cpu utilization, or not. I have not had an issue (yet) with the Pi running in the 90%, I have had a test Pi on my bench running for a few days with no problems so far. Least to say that it still is an issue.

Now I cannot claim to be the author of this fix, I found it while digging through the RPi forums one day. If your Pi is having this issue, simply add this line of code here and there during your loop:

time.sleep(0.1)

TA-DA! It really is that simple. I added one time.sleep(0.1) call between each of my IF/THENs and I watched (via top) my cpu go from 90-98% to under 5%!!