Author: Rob

I’m a keen technology and computing enthusiast and work as an IT consultant. My hobbies include PC gaming, electronic projects and tinkering with anything computer-related.

Renaming video files from get_iplayer for easy import into Sonarr

There may become a time where someone wants to obtain some media from the popular get_iplayer application to add to their Sonarr library.

Sonarr doesn’t like importing such files by default because the season and episode numbers aren’t in a common format.

I couldn’t find any easily automated method to rename the files into a supported format online, so I’ve pieced together a small script to help achieve this quickly and easily.

I’m not a programmer, but do have enough experience to know roughly what a piece of code is doing so please bear this in mind with my script, it may not be perfect or perform all necessary functions but it should help you enough to get Sonarr to correctly recognise them and it can then rename appropriately upon import if your installation is set to do so.

This is made mostly by code samples found online with some minor modifications, your mileage may vary. This script is designed to run on media files for a single TV show at a time, not one large folder with multiple shows downloaded into it (mostly due to my future hopes/plans for the script).

Open up a new plaintext editor such as Notepad on Windows, then paste the following:

Set objFso = CreateObject("Scripting.FileSystemObject")
Set Folder = objFSO.GetFolder("X:\path-to-files")

For Each File In Folder.Files
    sNewFile = File.Name
    sNewFile = Replace(sNewFile,"_Series_"," - S0")
    if (sNewFile<>File.Name) then 
        File.Move(File.ParentFolder+"\"+sNewFile)
    end if

Next

For Each File In Folder.Files
    sNewFile = File.Name
    sNewFile = Replace(sNewFile,"_-_","E")
    if (sNewFile<>File.Name) then 
        File.Move(File.ParentFolder+"\"+sNewFile)
    end if

Next

For Each File In Folder.Files
    sNewFile = File.Name
    sNewFile = Replace(sNewFile,"._"," - ")
    if (sNewFile<>File.Name) then 
        File.Move(File.ParentFolder+"\"+sNewFile)
    end if

Next

For Each File In Folder.Files
    sNewFile = File.Name
    sNewFile = Replace(sNewFile,"_"," ")
    if (sNewFile<>File.Name) then 
        File.Move(File.ParentFolder+"\"+sNewFile)
    end if

Next

You should edit line two, to insert the path to your downloaded video files, you’ll need to do this for each new folder of media that you wish to rename, then save it as a vbscript file, for example “rename.vbs”.

Double-click it and accept any security warning to allow it to run and you should then see your media names with the common SxxExx naming format.

This script works by searching for and replacing certain values. It doesn’t account for all types of files downloaded through get_iplayer, for example it doesn’t recognise special episodes because their file name doesn’t include the word “Series”.

I may improve this over time, I would like to add the following:

  • Recognise special episodes and move them to a subfolder for manual renaming
  • Organise files into subfolders by season for easier copy/paste into your media library
  • Scan recursive media folders with multiple shows

For now though, I just wanted to get it working well enough for my needs which it does, and share it with anyone else who may find it useful.

MPs Awarded £10,000 Expenses to ‘Work from Home’

I’m not a writer, but I like to moan.

Today my moaning is directed at IPSA, the regulatory body for MP’s pay in the UK. They have now announced that they’re allowing MPs to claim £10,000 to set themselves up for working from home. I’ll cite references where possible but make no guarantees to the accuracy of my content.

With the world being on Pandemic lockdown right now, the majority of the population have converted fine to working from home. Everyone has a table to sit at, their employers provide laptops in most cases to use for work, most people have an internet connection of some sort. It boggles me that anyone is “not set up” for working remotely.

Presumably, some of the things one may need to work remotely could be, a table to sit at, a laptop, a printer, electricity, heating (as stated in other articles) and some stationary. Most of these items many people would already have such as a company laptop but lets say you need to kit-out someone with everything they *need*, not want, need.

  • Laptop plus software licenses, a generous £800 and should be provided by the employer, not the employee.
  • A printer, basic inkjet models can be found for £20, but lets assume they need something a bit heavier duty but still suitable for home use and assume a £150 laser printer.
  • Electricity, remember as HMRC rules on expenses state, you can only claim for any *extra* usage as a result of working from home, not the full amount. So let’s say you run the laptop 24 hours a day as an extreme example. According to the calculations here this would cost only around 15p per day. Add to that the costs of your laser printer which has a very low standby current, at a rough generous guess allow 10p per day. That’s less than £8 per month assuming you worked 7 days a week,
  • Another point mentioned is heating. But remember HMRC states that only the *additional* costs as a result of home-working can be claimed. If your family is in lockdown as they’re supposed and in the home, chances are it’s already heated acceptably and so will not cost any extra. Plus, we’re well into the Spring season seeing warmer temperatures anyway so they don’t need heating at all. No claim justifiable for this.
  • Stationary. Headed paper would/should be provided by the employer, so that’s free. Maybe you need a couple of note pads, box of pens, some plain paper and post-its. I think £20 a month should easily cover this.
  • Furniture? Who hasn’t got a table and chair in their home already? No need for a new one certainly not at the tax-payers expense.
  • Internet, for those living in the dark ages without internet, Vodafone offer a 76Meg fibre internet including line rental for just £23 a month. It includes a £70 Amazon voucher you can spend on your stationary too!
  • Telephones. A mobile is no doubt already provided and used most often. But say you want a landline too. I’d assume this would be a VoIP phone to tie in with the Gov security systems so lets assume a generous £200 for a fancy handset and £15/month for an unlimited cal subscription. If they can’t do it for that price they’re doing something wrong.
  • Transport expenses should be banned during the period because they’re supposed to be working from home and isolating, setting an example for the nation.

So all in all, assuming the highest amounts I have quoted here which are very generous, that adds up to £1236, that includes one-off costs as well so the monthly figure will be a lot less.

MPs need to be given the same expense allowances as everyday people like you and me. IPSA, as an ‘independent’ regulator who were setup to prevent abuse of the system, need to stop allowing and encouraging MPs to abuse the system.

How to reset UniFi controller admin password, without email, including 32bit

I was recently in a situation where I needed to reset a forgotten Ubiquiti UniFi controller password.

There is some forum posts on the Ubiquiti forums, but the procedure is not supported or officially documented in any way, the posts on the forums are also missing some required details I found. The two methods below are adapted from forum posts by Taotech and Apak on the Ubiquiti forums.

The easy method:

If your controller is installed on a 64bit operating system (default for recent versions), you should have no trouble following this method.

  • Download Robo 3T from this link
  • Install and create a profile for your local server, and port number 27117
  • Connect to it, and in the left pane expand “ace” and then “collections”
  • Right-click on “admin” and click “View documents”
  • Open up this link to QuickHash.com
  • In the “Input data” field, type the new password you would like to set, and in the “Salt” field type 9Ter1EZ9$lSt6 and click Generate and your new password hash will be shown in the output field.
  • Copy the output value from QuickHash, and head back to Robo 3T to paste it in the “x_shadow” field.
  • Head back to your UniFi login screen, unter your username and your new password and you should be straight in!

Method for an older server with a 32 bit OS and probably a very old version of UniFi Controller:

The difficulty here is most MongoDB tools are 64-bit only, so this took me a while to figure out.

  • Download mongodb-win32-i386-2.4.14.zip and unzip it somewhere like the desktop
  • Open command prompt and cd to the extracted files
  • Type “mongo.exe –port 27117” and hit enter, you should then be at a mongo prompt.
  • Type “use ace
  • Type “db.admin.find()” to show the current admin record, make a note of the _id field value
  • Open up this link to QuickHash.com
  • In the “Input data” field, type the new password you would like to set, and in the “Salt” field type 9Ter1EZ9$lSt6 and click Generate, and your new password hash will be shown in the output field.
  • Copy the output value from QuickHash.
  • Take the following command and paste it into Notepad or a text editor (pasting to the command prompt and substituting values can be tricky, I prefer to edit the line in Notepad first). Then substitute your _id noted from the earlier step, and your output password hash from QuickHash into the command below.
    db.admin.update({_id:ObjectId("585d16243d093c03b21a800a")}, {$set: {"x_shadow":"$6$9Ter1EZ9$lSt6/tkoPguHqsDK0mXmUsZ1WE2qCM4m9AQ.x9/eVNJxws.hAxt2Pe8oA9TFB7LPBgzaHBcAfKFoLpRQlpBiX1"}})
  • Make sure it is shown on one line, then copy/paste it into your command window and press enter.
  • That should have updated the password, you can confirm if it was successful by running db.admin.find() and comparing the x_shadow value to the new one you have just put in.
  • Head back to the UniFi login page and login with your new password!

Alpine IXA-W404R Head Unit Optional Modules / Accessories

I recently picked up one of these head units very cheap from Facebook Marketplace. It appears to be a very modular unit with many accessories available for it. In fact I’d go as far as to say that many of the functions that it is designed for require optional modules to be purchased…not great from a consumer perspective but it seems to work for Alpine.

When researching this unit, I was unable to find a definitive list of all the compatible modules, so I have put together the following from various sources and I hope it is useful to someone. I have linked to the appropriate page on the Alpine or other suitable websites where possible.

 

Input Sources

 

Adapters & Cables

 

Audio Processing & Amplifiers

 

Others…

The user manual mentions the following but offers no part numbers or further information, I will update the details here if I find anything out.

  • “Vehicle Display Interface Box” – Interface box to output media information to dashboard MFDs, in some cases it can connect to and control in-car systems such as climate control and parking sensors. Also allows steering wheel controls in many cases. Vehicle support includes select BMW, Porsche, VW, Opel, Seat, Skoda and Renault from year approximately 2008 onwards. No mention of any other brands.
  • “Steering Controls Interface” – Same as above.

FIX: Windows 7, 8 & 10 Support & Drivers for Sony ICD-PX720 Voice Recorder / Dictaphone

For those of you who are looking to get your Sony ICD-PX720 voice recorder working under Windows 7 or above, no doubt you have probably stumbled upon this post.

I’m glad to report that I have found success when faced with this issue myself.

The problem: Sony have replaced the original software that came with these devices with an newer software program, however, the new software neither works with the recorder, nor does it contain the drivers necessary to use the device on Window 7, 8 or 10.

The solution: After several hours of searching, I came across this post on the Microsoft forums from another frustrated owner. A responder to that post links to a installer for the original software which both supports the device AND includes the all-important drivers. As the download is still hosted on the Sony servers, there’s a good chance that the link may not work forever, and will eventually be taken down given that Sony do not want to support the older software any more. For this reason, I have mirrored the download here. Just download and install as you would any other program, and then plug in your device. If you find that it does not automatically install the driver, you can manually browse to it’s location in the folder:

C:\Program Files (x86)\Sony\ICD-PX Series Driver\

Feel free to comment if you need any further guidance getting this working. I have successfully tested it on Windows 7 Pro x64 and Windows 10 Pro x64.

FIX: Peugeot Planet 2000 WINCAD Error on a Virtual Machine

Hi all, another quick fix. Credit goes to crazycarl over at Peugeot Forums and I am reposting here just to ensure it remains available for the forseeable future.

When running PP2000 inside a virtual machine, as many users do nowadays, you may see the following error on certain computers, depending on the processor that they use:

WINCAD caused a general protection fault in module WIN87EM.DLL at 0001:02C9

In my case, I am using VirtualBox to run my VM, I don’t know if this fix applies to VMWare, or even whether this error occurs on VMWare.

The fix that seems to work for me is:

1. Download “Winfloat.exe” to your VM.
2. Double-click on “Winfloat.exe” to extract files to C: drive.
3. Copy “HIDE87.com” to the c:\windows\system32 directory.
4. Open the “autoexec.nt” file (c:\windows\system32\autoexec.nt) with a text editor like Wordpad.
5. Add “lh c:\windows\system32\HIDE87.com” to the “autoexec.nt” file.
6. Save the file, and exit.
7. Reboot the Virtual Machine.
8. Done!

 

WordPress Help – How to display WP-Toolset Multiple Image Field in a Lightbox Gallery

Here’s a quick one. On recently needing to design a website for a client which utilises custom post types and fields from the WP-Toolset plugin, I needed a way to display multiple images with lightbox functionality.

Here is how I achieved this:

First install the Foobox Image Lightbox plugin from the WordPress directory. I chose this one because it is fast, responsive, simple, and the free version offered all the features I needed.

Then go to your Content Templates section within Toolset and open the template that you need. We will now make use of the following code to take each image from a multiple image field and display it with a clickable lightbox link.

[wpv-for-each field="wpcf-photo"]
<a href="[types field='photo' output="raw"][/types]" class="foobox" rel="gallery">
<img class="object-fit" src="[types field='photo' output="raw"][/types]"></a>
[/wpv-for-each]

To explain the above code a little, if you need it. The class="foobox" is required to invoke the lightbox plugin and tell it to act upon the following image. The rel="gallery" value tells Foobox to group all of the images into a gallery wwith previous/next buttons rather than requiring you to click each photo in turn. The output="raw" tells Toolset to output the URL to the image, rather than the image itself, obviously we require the URL to make this work. In this case, I have applied a simple style using class="object-fit" to output the image in a fixed-size square with the image centered and cropped to fit. If it is of any use or interest, the CSS for this property is:

img.object-fit {
margin: 5px;
width: 300px;
height: 300px;
border-radius: 15px;
object-fit: cover;
border: 1px solid;
}

Hopefully this will help someone who was in the same boat as me, me not being a professional designer it did take me a while to figure it out and piece together code from various sources. If you need further help, hit me up in the comments and I’ll see what I can do.

Warning: eBay Listing Work From Home Job Scam info.globaltrex@gmail.com Helen at Globaltrex Wayne Johnson Facebook

I recently noticed a job opportunity making the rounds on social media. See below:

Being in need of work myself, I thought I would respond and see where it went. I emailed the address as advised and told them about my previous eBay history:

I then shortly received the following response:

Initially I only noticed the one spelling mistake “spear” instead of “spare” and the occasional lack of capital letters so it’s not as bad as most scam emails. Notice that for such a successful company, they don’t say who they are. Alarm bells also rang when the income example they gave included a item valued at £500, and that how it worked involved receiving money myself and passing it on to them upon sale. Whilst I haven’t heard of a scam like this, it didn’t take me long to piece together a scenario which would leave me out of pocket so I then went on to ask a few more questions. A Google search on their email address and “Globaltrex” name also revealed absolutely nothing. Had no one fallen for it so far? And why would such a “successful company” not be listed anywhere? I checked out the email headers to see where the message was sent from and it turned out to be a iPhone on the O2 UK network which added a little hope, at least it was in the UK and not Nigeria for once!

She duly responded to my questions:

Notice how it starts off with a defensive statement “Hun I assure you”. If it was legitimate, a person would offer up some proof straight away not just say “I assure you”. A large successful business would also have a website and a registered business, and as it’s a eBay business they would presumably have a store with a proven feedback record as well. She avoided the topic and did not provide any proof at all and simply offered to move on and find someone else. I then did some searching and eventually found a useful combination of search terms which revealed hundreds of results relating to this scam, even some which had made it onto the UK JobCenter website! See for yourself here. I let her know about my findings and that I was not happy to proceed. She was of course quick to brush it off and find another victim.

Stay safe people! Hopefully this post will end up in a Google search and prevent at least one other person from falling victim to this scam. Let me know in the comments if you found this post useful.

[Update] Gmail Account Suspended After Adding POP3 Imported Account

Just a quick update on my previous post with this problem.

I eventually managed to get all of the accounts setup fine, however, every damn one of them got suspended in the process. I found a way around that though.

As long as you setup the POP3 import and leave the box UNCHECKED for “leave a copy of retrieved messages on the server”, you will then receive a email on your previous email system indicating that the account is suspended, and most importantly, some directions to appeal this decision.

After having a human at Gmail manually unsuspend the first two problem accounts for me (roughly 8 hours after submitting the appeal), the other 4 accounts were automatically unsuspended as soon as I submitted the appeal request which allowed me to continue setting up the accounts.

So from what I have learned here, the reason for suspension is completely unknown but is NOT for breach of terms and conditions (which I have thoroughly read every single word to make sure), And if this is happening to several different accounts, once the first couple are reviewed by staff at Google, I guess they whitelist your IP address or similar to have the others automatically resolved when you appeal it.

[ONGOING] Gmail Account Suspended After Adding POP3 Imported Account

I was recently tasked with setting up a handful of Gmail accounts for a company, creating the accounts worked fine as expected, but when trying to add their business email address as a POP3 import/send as address I have been facing some issues where the accounts are becoming suspended and at risk of deletion. Gmail’s reasoning for this? Apparently “Terms of Service Violation”. I have thoroughly read through the several pages of their Terms of Service, and there is not one rule within that, that we are breaking here.

To make matters even worse, I chose not to leave a copy of imported messages on the server (to free up mailbox space on the POP3 server) which means that all emails from the company address have been sucked up into Gmail and are being held at ransom, if I can’t get Gmail to unsuspend those accounts, the thousands of business emails will be gone for good.

My findings so far:

  • I am able to setup a account import from a POP3 account easily, it imports the messages fine, no problems at all there.
  • However, when setting up “send mail as” for this address, as soon as Gmail sends out the verification email to the address it is causing the Gmail account to immediately logout and state that it has been suspended. This is reflected by a email from Google sent to the recovery email address for the account stating that one can appeal the decision and wait for a response from their staff.

Of course this is very inconvenient and nerve wracking to think that crucial business emails are at risk of deletion, not to mention the downtime that it is causing for the users in question who are unable to deal with their emails in the meantime. I’m unsure what could be triggering this but presumably this is some sort of anti-spam measure. However, this is not a suitable way for Gmail to deal with the problem. Ideally, they should show a captcha or similar instead in a situation like this.

The Gmail accounts have been phone verified already, but for the first two accounts I was able to successfully appeal to Google, thankfully were reinstated after waiting about 10 hours for them to review the issue. I was then prompted to re-verify the phone number again when logging into the account again.

I have reached out to @gmail on Twitter to find out more, I won’t hold my breath but hopefully they will come back with some suitable answers and maybe even a change in their procedures to prevent this from happening again.