Categories
computing linux

Fear and go seek

The common refrain for people advancing the cause that says that encryption should have government back-doors is that only people with something to hide need to encrypt their work. If you have nothing to hide, then you have nothing to fear.

Quite apart from that not being true in the general case, in the specific case it’s bad too, and this is why:

The following things use the same kinds of encryption that the government wants to put back doors into:

* Every website you put your credit card number in to.
* Your online bank access
* The communication between the website you put your credit card number in to and your credit card company.
* Your connection to your email
* The ability for home-workers to log in to their company’s network (VPN)

Companies are legally obliged to keep their company secrets secured, workers are contractually obliged (and in some cases also legally) to keep those secrets to the best of their ability.

These measures would grant the government the ability to read – as they flow through the wire – the items above, and even if you believe the government should be allowed to do this, there’s a wider issue.

Governments have, so far, not demonstrated the ability to keep their own documents secure, which would include the details of back-doors into secure systems, and once widely-used standards to encrypt communication are blown open. Even if somehow governments managed to perfect their own security, the known existence of a back-door would encourage the high number of highly intelligent people that have the required technical skills to try and find it, either for intellectual curiosity, or in order to read your data. Basically, it means that the encryption we rely on every day to make our lives easier and be able to do things over the internet, advancements that make things like personal banking and shopping possible for disabled, busy or just lazy people; suddenly become a lot more risky.

Computer security’s taken a bashing in the last year. Several deep investigations into the publically developed libraries that underpin a lot of internet security have resulted in a number of very public and news-friendly panics, and undermined confidence in them in general (To which the response is: Bugs being found – and fixed – is good. I’m happy that smarter people than me can see the code I rely on, and will publicly say if there’s a problem with it, rather than hope nobody notices), but the fact that ISIS, Apple, Google and other reprobates can encrypt their data so that it can’t be recovered in sub-decade timescales means that your credit card data can be stored safely, that your bank is able to offer your balance to your phone, and that companies – maybe yours – can let you VPN in and work from home once in a while; and crippling it is a very high price to pay.

Categories
Apple computing linux tv windows

Ripping TV Yarns

I’m in the process of ripping some boxsets of DVDs to Plex, and I thought I should probably document the process. The most obvious thing I’m not using here is Handbrake, which works really well for some people, but I am not one of them.

Physical to Digital

MakeMKV turns any DVD or Bluray I’ve thrown at it into an MKV file. The one thing it could do to make my life better would be custom tags on filenames, but the default {Directory}\{DVD Identifier}\title{nn}.mkv  is good enough. {DVD Identifier} is annoyingly unspecific most of the time, and sometimes within disks of the same box set (The thing I’m currently ripping has both WW_S4_T5_D3 and WESTWING_S4_D6 in it, as discs 1 and 6 respectively), so the next stage is to make those directory names consistent. It doesn’t matter what they are, so long as when I “ls” the directory, they are in the right order. Then, I run this:

export COUNT=1; # Start at 1
find . -name \*mkv \ # Find all files ending MKV
	| while read fle;\ # For each of those (as variable $fle)
		do mv $fle $(printf "The_West_Wing-S04E%0.2d.mkv" $COUNT);\ # Increment the filename
		COUNT=$(($COUNT + 1));\ # Add one to the filename count
	done

Note: You’ll need to collapse that back into a single line without the comments for it to work:

export COUNT=1; find . -name \*mkv \| while read fle; do echo mv $fle $(printf "The_West_Wing-S04E%0.2d.mkv" $COUNT);COUNT=$(($COUNT + 1)); done

This gives me a directory of well-named MKV files.

Digital to MP4

Plex is happier with mp4 encoded videos than with MKV files, though, plus they’re smaller without a noticable (to me) drop in quality, so when I’ve got a few series of these built up, I’ll run this overnight:

for fle in mkv/*.mkv; do encode.sh $fle; done

Where encode.sh looks like this:

#!/bin/bash
file=$1
ffmpeg -i $file -codec:v libx264 -profile:v high -preset ultrafast -crf 16 -minrate 30M -maxrate 30M -bufsize 15M -metadata:s:a:0 language=eng -c:a ac3 -b:a 384k -threads 2 ${file%.*}.mp4

Which is a standard ffmpeg encode line, the only real weirdness being the ${file%.*}.mp4 bashism, which basically turns the $file variable from “Foobar.mkv” into “Foobar.mp4” (It will also turn “Foo.bar.mkv” into “Foo.mp4” though, so be careful)

MP4 to Mediacentre

Once that’s finished, I’ll get rid of the mkv files, and send them into Plex. To ensure consistency of my filenames and also get any subtitle files I need, this is done using filebot, like this:

filebot -script fn:amc --output "/media/mediashare" --log-file amc.log --action move --conflict skip -non-strict --def music=y subtitles=en artwork=y --def "seriesFormat=TV Boxsets/{n}/{'S'+s}/{s00e00} - {t}" "animeFormat=Anime/{n}/{fn}" "movieFormat=Movies/{n} {y}/{fn}" "musicFormat=Music/{n}/{fn}" --def plex=localhost .

(Filebot, rename using the (included) automediacentre script. Output to directories below my media drive mount, log to amc.log, move (don’t copy) the files, if it already exists skip it. Don’t do strict checking, download music, search for subtitles, get series artwork, send TV shows to the “TV Boxsets” directory in {Series Name}/S{Series Number}/s{Series number}e{Episode Number} – {Episode Title} format. Anime should go somewhere else, Movies somewhere else, Music somewhere else, then notify plex on the local machine. Do this on the current directory)

Operating System Notes

None of this is OS specific. Filebot, FFMPEG Plex & MakeMKV are available – and work identically – on Windows, Mac & Linux. The various bash scripts could be adapted to powershell, but I’d instead recommend Babun, which is a repackaging of cygwin with a far nicer interface and package management system that’ll give you the basic *nix commandline tools on your windows machine (all of the above up to MP4 to Mediacentre runs on my beast-sized windows gaming rig, to avoid making the puny media centre CPU cry too much)