Sunday, 23 August 2020

Jellyfin, Pi-Hole, OpenVPN running on an MXQ are a few of my favourite things

For several years I had a WD MyCloud sitting under my telly serving content to Kodi and PCs via a Samba share. I had low demands and it did just what I wanted. It even had a USB3 port on the back so I could backup the single NAS disk to a portable disk. 

Eventually boredom set in and I wondered if I could do anything with an old MXQ box sitting in my cupboard for the past 4 years. If you don't know what a MXQ box is, it's a small Android computer that was popular for running Kodi and dabbling in IPTV.

In 2016 I paid the sum of £22.90. Now you can pick them up for around £10 on eBay, or even splash out on a MXQ Pro 4K for a costly £20. You'll also need a SD card (I've been using a Micro SD with an adaptor) and a portable hard disk if you want to clone my setup...

First you want to get Armbian running on the MXQ. There's a great video at http://mxqproject.com/tutorial-s805-how-to-run-armbian-linux-on-mxq-s805-box/. By the end of it you'll have a server similar to a Raspberry Pi.

There's no particular order what to install next. Besides having a fan-less, low power server on my network, I couldn't figure out what to do with it.

Then I found some software called Pi-Hole, which is a DNS sink hole. You leave it running on your home network and configure your devices to point at the MXQ box for DNS lookups. Any dodgy DNS lookups are binned. It can also help with stopping adverts. The software is really well written and the dashboard is ace. I just followed a guide for installing on a Raspberry Pi @ https://www.raspberrypi.org/blog/pi-hole-raspberry-pi/.

Then I toyed with the idea of installing OpenVPN. The reason for not using it was that my Internet Provider gives me a dynamic IP address so it can occasionally change and I won't know where my home network is. Dynamic DNS services exist so you can your register your dynamic IP address to a DNS name. While several of these services were free in the past, I could only find No-IP that meant I needed to confirm my details every month. No thanks. 

Fortunately https://ydns.io/ comes to the rescue and gives you a DNS entry with a dynamic IP for free. Better still there's a script that runs on the MXQ box that runs via a scheduled job that updates the IP address if it changes. You can find the script at https://github.com/ydns/bash-updater.

This opened the door for OpenVPN so I followed the guide at https://www.pcmag.com/how-to/how-to-create-a-vpn-server-with-raspberry-pi. Now I can access my home network where ever I am in the world. While a little concerned about security, I've read that OpenVPN is pretty secure. Don't forget to open the port on the router to allow incoming connections.

I also installed a Samba server on MXQ. However Kodi running on my Bravia TV couldn't access video files larger than 2GB. So I switch to vsftpd which was slightly better as it didn't have the limit. But it felt old fashioned using FTP for streaming videos.

Years ago I learnt about Plex, but got put off with the cost. My experience is soon as I spend money on software I find that it doesn't meet my requirements (just minor issues). More recently I found out about Emby, but that was also a purchase. Then I heard about Jellyfin which is a freebie fork of Emby. These pieces of software usually sit on a server in the home and you can access content via different devices in and out of the home.

Similar to other software above, I followed a Raspberry Pi guide from https://www.electromaker.io/tutorial/blog/how-to-install-jellyfin-on-the-raspberry-pi. The Android version was installed on my phone, tablet and Bravia TV. I created libraries for my 20+ years of photos, 100s of films and TV shows, music videos and music.

My music didn't scan properly at first. After reviewing the logs, it seems Jellyfin uses a couple of pieces of software - ffprobe (to examine media content) and ffmpeg (to convert media content). These versions supplied with the Jellyfin distribution didn't work on my MXQ. So I entered "apt install ffmpeg" which installed versions that did work. Then I just needed to update the paths of these utilities in the Jellyfin interface.

I also dabbled in IPTV. This usually a paid service and gives you access to lots of live TV stations. Jellyfin has the capability of setting scheduled recordings - either as a one off, or a series. I needed to supply Jellyfin with a couple of URLs, one ending with a m3u for the TV streams and another XML file for the EPG. I didn't want to pay for testing these out, so I found out about a free service called Pluto. You can get these two URLs from https://forums.whirlpool.net.au/archive/9nk7ly73.

One problem I experienced with IPTV streaming, is that while my phone and tablet could view the content, the Bravia TV kept freezing. Turns out the Jellyfin client on the TV couldn't handle the TV streams and Jellyfin was transcoding the video. The CPU in the MXQ box couldn't cope. I managed to get round this by... 

  1. Installing VLC on the TV.
  2. Configuring the Jellyfin Android app to use VLC.
  3. Switching off transcoding on the Jellyfin server.
Which worked. But after watching the content on Pluto (not stop Fear Factor, Star Trek TNG, Minecraft and Roblox), it wasn't worth it. So I removed the IPTV plugin. 

I've been using Trakt for several years. Once the Trakt plugin was configured, I synced it with my Jellyfin library so I know what TV shows I've already seen.

Jellyfin and OpenVPN combined are great. I wouldn't recommend opening a port on the router for Jellyfin, just use OpenVPN to access the home network first. 

That's quite a bit of typing, hope it's useful for someone if they want a mini project to do during the COVID lockdown, or even if they want a cheap (but not nasty) home media server. I may of hit a few issues along the line which I resolved and forgot about - if you have any issues add a comment below and I'll try to help.

Sunday, 28 December 2014

Caffeine, alcohol, 40s male menopause and brain fog

Maybe it's a half life crisis getting to the grand old age of 40 (50+ will say that 40 isn't old), or the male menopause (according to Wikipedia this sets in at 30), but for the last 2-3 years I've been suffering from brain fog.

If you've Googled for Brain Fog, you'll probably have stumbled across this page knowing what it is. If you don't, here's a brief intro... Brain Fog is not a currently recognised medical condition, people who suffer from it have it "all in their head". Brain Fog is frustrating experience when you know what your brain is potential of, yet it seems to be working in a go slow mode. My old car had a limp mode when it was about to pack it and it restricted the speed to 40mph. Brain fog is like a limp mode. Symptoms can last hours to months to years. I work in IT developing applications, I need my brain to function properly or my work suffers. After years of experiencing brain fog, I can predict when my work is going to suffer.

When I was 38 I started getting Brain Fog. Initial research on Google suggests that alcohol, chemical imbalance (vitamin or mineral deficiency), caffeine can contribute to the issue. Around the same time my eye lid developed a twitch, think it's called Myokymia (previous post). Maybe the two were related, but I managed to solve the twitch with a magnesium supplement. It's been 6 months since having this supplement and the twitch hasn't come back.

The brain fog still remained. I love my beer and I love a coffee. I don't gamble, smoke or do illegal drugs, but I like my two drinks. It was painful to give them up. I could whittle on about them for a while, but I found that caffeine was directly responsible for the brain fog. Grabbing a coffee at the local coffee shop (especially the bean to cup variety) would cause me to have a brain fog episode lasting 2-4 days afterwards. These days I'm mostly on red bush tea, decaf instant coffee and decaf tea. Even green tea is out of the picture.

Things have slightly changed on the alcohol front. Previously I could have 6-8 pints of beer (around 4.5 to 5.5% in strength) and my hangover would last a day. Having the same amount of beer now takes me 2-3 days to recover. I've tried to cut down on my beer intake. Beer is not related to my brain fog, so I can enjoy this substance abuse.

I do feel my brain has changed in the past 12 months. My memory isn't as good as it was. I can remember something in one room and know that when I go into another room to do it, I'll have forgotten what I've gone into the room to do. I've been reading a book on mindfulness, which terms "autopilot" being something we do without knowing we're doing it. Like going to make a decaf coffee and putting a tea bag in my cup. Maybe forgetfulness is the first stage of old age, Alzheimers, depression or having too much time to look up medical conditions on Google. I hope it's the latter.

Friday, 10 May 2013

Uploading to YouTube without a Google+ account

I've been a YouTube for sharing family videos for the past few years. I thought Google was the best thing since sliced bread and when Google+ came out I signed up immediately. Google+ is pants, so I deleted my Google+ account.

Whenever I try to upload a video to YouTube, I can't because I need to create my Google+ account again. There is a way to solve the problem...

  1. When prompted, create your Google+ account
  2. Go into YouTube settings and near the avatar there's a link "revert back to your YouTube username instead of the Google+"
  3. Once reverted back, you can safely delete your Google+ account and upload to YouTube!

Wednesday, 27 February 2013

My, my, my, Myokymia

At the start of December 2012 I started getting a twitch on my upper left eyelid. It bloody drives me mental. I visited the local doctors in January and they said it'll pass with time. Now it's the end of February and still no change.

I like a alcoholic drink and keep within my weekly allowance as advised by UK health authority. I also like to have 2-3 cups of coffee and a few cups of tea a day. I cut back on my alcoholic and caffeine for 2 weeks at the start of January, it didn't make a difference.

While on holiday last week I over indulged on beer and caffeine. My eyelid went into overdrive. So again, I'm stopping all beer and caffeine.

After doing a bit of Googling, it seems my the nerve going to my eyelid muscle has gone a bit mental. Stress (I'm not stressed, or I don't think I am), caffeine, alcohol and lack of sleep (plenty of sleep) can make the situation worse.

I've even tried alternating between hot and cold compresses as described on the Myokymia wiki page.

On a similar subject... My father in law (~70 years old) had a more serious condition where his eye would shut and not open a couple of years ago. He visited a neurologist and a opthamologist. The opthamologist gave him botox injections. This didn't work, so the neurologist insisted it was an early Parkinson's Disease. He was on anti depressants for months, then Parkinson medication for months. The issue got resolved when he had an operation to remove the offending muscles from his eyelids. His quality of life has greatly improved since.

My plan is to keep of the caffeine and alcohol for another week. If it's not gone, I'm visiting my doctors again. I'd prefer to have acupuncture first. If that fails, I'm going to have a botox injection to disable the muscle.

5th March 2013

Keeping off the caffeine and alcohol for another week didn't work.

Visited the doctor today. I said about my eyelid twitching and they gave me the usual vague look. Then I said about it being myokymia and the (rather honestly) said they had never heard of that term before. I got the impression it wouldn't be treated under NHS (UK's freebie health service) as it's not life threatening (WTF?), and I'd have to use my private health cover, which I prefer anyway. She didn't know if I should see a neurologist or a opthamologist. She also suggested that a opthamologist may give me "reassurance" that will make it go away (WTF?)  She's going to read up about the condition and check with another doctor before letting me know next week.

Hopefully I'll have something positive to report soon...

13th June 2013

It's been over three months since my last post! It's almost gone! After spending considerable time Googling for cures, I came to the conclusion it was a deficiency in potassium or magnesium or a vitamin. I had a 2 month course of multi vitamins with potassium. No change.

Then I read that magnesium deficiency is quite common in the world these days. Turns out the RDA for magnesium is really high and just eating a bowl of bran isn't going to do it. Magnesium apparently is used for brain and nerves. I visited my local chemist and picking up a course of magnesium. After a few weeks the twitching is still occurring, but not as often.

12th November 2013

Roughly 2 months ago I started getting the odd twitch again. :(. As I don't believe in taking artificial food supplements, I stopped the magnesium 3-4 months ago. Looks like I can't go cold turkey on the magnesium.

I bought another course of cheapish tablets from my local store, which almost stopped the twitching. Then I read about cheap magnesium not being fully absorbed into the body. Turns out most of the magnesium was getting pooped out (which can be used to relief constipation). I bought some chelated magnesium from Amazon as this has good reviews and is supposed to have a 100% absorption rate. So far it's working really well - one week into the course and I think the twitch has fully gone.

Rather than go cold turkey and stop magnesium supplements completely, I'm going to eat foods rich in magnesium and only pop the pills if the twitching returns. Must admit, I used to hate eating spinach, but now my taste buds quite like the taste.

Monday, 30 July 2012

Dislocated Shoulder (or how not to Ski)

In February 2012, I had a trip to Mayrhofen, Austria to take the 4 years of dust accumulating on my ski boots. Come to think of it, a duster would have been a quicker and cheaper option than wiping them in the fresh snow of the Austrian Alps.

The first 4 days of the holiday went amazing sweet. Perfect flight (Innsbruck airport is one of the nicest airports to land) and the ski resort had a good dollop of snow the week before.

[Update... I couldn't be bothered typing this blog post in, as I was starting to bore myself, I'll get down to the nitty gritty...]


I made the mistake of looking up a mountain while skiing down. This cause me to land shoulder first from a 10 foot drop, resulting in a dislocated shoulder. The right picture is after the accident, the left is after they slotted my shoulder back.


Unfortunately, I was about 30 miles away from the ski resort when it happened. Top tip, no matter what a "friend" says about you'll okay be skiing back, don't believe them. Skiing back to the resort meant skiing down numerous red and blue runs and the occasional chair and button lift. Using a button lift with a dislocated shoulder is painful.

When I finally got back to the resort, I couldn't find a doctors. I found plenty of trees (remembering Lethal Weapon, a swift hit to the tree can relocate it), I decided to find visit our hotel and talk to the guest services. They pointed me in the direction of a local medical centre.

After about 6 hours since dislocating my shoulder the kind medics finally popped it back into place. It took about 15 minutes and cost £700. They advised on having a MRI scan when I got back home. I also got a fancy looking sling, pain killers and ice bag. For the next few days I had to be careful taking off my t-shirt and washing my back in the shower.

When I got back home, it was proving impossible to get an appointment at my local doctors. To get an appointment you need to call between 8am and 8:05am, if you miss, all the slots will be booked up. I missed my slot for 2 days. On the third day I got an appointment with the doctor. They said skiing was a dangerous sport and could I call back in a week or so when my usual doctor is back from holiday. WTF!

After several weeks I got a physiotherapist. The doctors said a MRI scan isn't needed on someone my age (37), as I should make a full recovery. The physio gave me a few exercises to do. No exercises should be done within 4 weeks of dislocating a shoulder.

It's been 5 months since dislocating my shoulder. Most of the time it feels fine, but I get the odd twinge every now and again. It's not a painful one, just "odd". It mostly occurs when I'm cycling.

Tuesday, 26 July 2011

Cornea Abrasion Recovery

A couple of weeks ago I suffered from a large corneal abrasion. Being a pessimist I assumed I wouldn’t be able to see again. It was one of the scariest experiences of my life.

While I don’t recommend having a “Google” for medical self diagnosis (there’s a lot of duff forum posts), I couldn’t find that many posts on how people have recovered from an abrasion. Here’s one post to address that imbalance…

On Tuesday 12th July my son accidently kicked me in the right eye during a nappy change. For the first 30 minutes I couldn’t feel any pain, but my vision had a disturbing tint of white. It was like looking through a steamed up windows.

The pain kicked in after about 1 hour, but I didn’t want to visit the hospital as I assumed it’s one of those things that will be okay after an hour or two.

Three hours later my Mrs drove us all to accident and emergency at the hospital. During the ride to the hospital and walking to A&E, the pain we so immense that I couldn’t open either eye,
The doctor squirted a few drops of some pain killer into my eye and I could open both eyes without any pain. It was amazing stuff. Following that he examined my eye for any internal damage (thankfully not finding anything) then put a few drops of some orange substance (fluorescein) in it. The fluorescein makes any corneal abrasions turn green.

The doctor rather worryingly said my abrasion was the size of Africa (meaning it was quite large). It was a round abrasion 3mm in diameter. With permission, I managed to take a picture of his notes…

Chloramphenicol which had to be applied 4 times a day for 5 days. I was asked to return on Thursday (2 days later) for a check up.

Just before leaving the hospital, my wife took this picture. The green is caused by the fluorescein. The dark green is my iris and the light green is the area with the abrasion.


The doctor had lead me to believe the pain would be unbearable that night, but I was more worried about losing my vision. Don't get me wrong, it was painful - I was doped up on Paracetamol and Ibuprofen most of the time. I found Ibuprofen gave the most relief. Made a mistake on the first evening by not applying the medicine.

During the next 48 hours my vision was very blurred and tear ducts where working overtime. I spent most of the time with my eye shut, as it felt better.

The drive to hospital on Thursday was painful, thankfully my wife drove the car. The sunlight was hurting my eye. Bloody typical – British summers aren’t usually that sunny unless your recovering from a cornea abrasion!

The doctor applied some more fluorescein, and said that the abrasion had mostly recovered. Only three small pin pick holes remained. My vision was still blurred.

The following Tuesday (1 week after the accident), I still had blurred vision. Being a IT professional in front of a monitor for 8 hours a day was unbearable. I arranged a visit to my local General Practitioner.
He performed another fluorescein test, and said my cornea didn’t have any abrasions. Quite worrying considering my (long and short sighted) vision was still blurred.

It’s 2 weeks since the accident. I think my vision is getting better in my eye. But it’s difficult to say. I’m booked into see the ophthalmologist this Thursday (16 days after the accident).

I’ll update this blog when I’ve got more news.
  • Update 27/07/2011 - I could resist searching the Internet for my blurred vision. Came  across this page, which describes Cornea Endema (swelling of the Cornea). The cornea is made of 5 layers, if fluid gets between these layers, it can cause blurred vision. Muro 128 ointment can be used to draw out this fluid (here's a bit more info). Wonder if the opthamologist says the same thing tomorrow...
  • Update 30/07/2011 - Visited the ophthalmologist a couple of days ago. While there's no serious issues with my eye, he said that the top layers of the cornea typically repair themselves after 2-3 days, but the lower layers can take several weeks. Not totally sure why, but he recommended a use Viscotears (typically used to treat dry syndrome) for 6 weeks, even though I've no history of dry eye or pain. 
I must admit that my vision is getting better in my eye. Based on my experience of a large cornea abrasion...
  • Days 1-2: Experienced the most pain. Had to keep my eye shut due to the pain. Found Ibuprofen helped better than paracetamol.
  • Days 3: Top layer of cornea about 97% repaired. No pain unless exposed to bright sunlight.
  • Week 1: No pain, just blurred vision.
  • Weeks 2-3: Blurred vision improving.  

Sunday, 30 January 2011

Tough call - switch to Ubuntu or stick with Windows 7?

In the last few months, I've been trying out Ubuntu 10.10. It stemmed from wanting to buy a MacBook, but not wanting to cough up the money for Apple hardware. In addition, I keep hearing about Apple hardware breaking down. Knowing my luck it'd break within a couple of months after the warranty has expires.

Back to the original post... Being a simple sole, I'd like to stick to one platform - either Windows 7 or Ubuntu. I've tried my best to switch, but have come to the conclusions...

Windows 7 runs the software I like - Sony Vegas, extensive DVD backup software, Keepass (with KeepassSync), iTunes.

Ubuntu beats Windows 7 hands down for surfing the net on my netbook. Almost everything that I do these days is through a web browser, so missing out on the Windows 7 applications isn't a major issue. I've tried switching to LastPass instead of Keypass, but LastPass gives me (unnecessary?) concerns about my security on the web.

I thought if I switched to Ubuntu, I wouldn't need to download as many software updates as Windows 7. Surprisingly, my Ubuntu system requires more updates. Which includes clogging up my grub loader with loads of dead kernels (which can be removed, but I shouldn't need to manually remove them).

So I'm going to stick to Ubuntu on my netbook. My desktop PC will keep Windows 7, hosting my video and music collection.