Skip to content

Instantly share code, notes, and snippets.

View jamesmacwhite's full-sized avatar

James #FFFFFF jamesmacwhite

View GitHub Profile
@jamesmacwhite
jamesmacwhite / ffmpeg_mkv_mp4_conversion.md
Last active April 11, 2024 22:29
Easy way to convert MKV to MP4 with ffmpeg

Converting mkv to mp4 with ffmpeg

Essentially just copy the existing video and audio stream as is into a new container, no funny business!

The easiest way to "convert" MKV to MP4, is to copy the existing video and audio streams and place them into a new container. This avoids any encoding task and hence no quality will be lost, it is also a fairly quick process and requires very little CPU power. The main factor is disk read/write speed.

With ffmpeg this can be achieved with -c copy. Older examples may use -vcodec copy -acodec copy which does the same thing.

These examples assume ffmpeg is in your PATH. If not just substitute with the full path to your ffmpeg binary.

Single file conversion example

@jamesmacwhite
jamesmacwhite / Workarounds for Netflix and the blocking of IPv6 tunnels.md
Last active March 25, 2024 20:26
Prevent proxy/VPN streaming error messages from Netflix when using a Hurricane Electric IPv6 tunnel.

Workarounds for Netflix and the blocking of Hurricane Electric IPv6 tunnels

The dreaded "You seem to be using an unblocker or proxy." error message. Cool story bro.

This gist was essentially created out of my own rant about Netflix being hostile to IPv6 tunnel services since June 2016. You are welcome to read my opinion on the matter, this is the more technical side to the issue and how to combat it within your own network.

Since I wrote this, various GitHub users have contributed their thoughts and ideas which has been incorporated into this gist. Thank you to everyone who have contributed their own methods and implementations.

The problem

Netflix now treats IPv6 tunnel brokers (such as Hurricane Electric) as proxy servers. A while ago it became apparent to users and Netflix that somewhat by accident, IPv6 tunnel users were being served content outside of their geolocation because of the way Netflix was identifyi

@jamesmacwhite
jamesmacwhite / Netflix WPAD bypass rules.md
Last active August 9, 2023 13:24
Bypass rules for Netflix when using a WPAD based proxy deployment

Netflix and direct bypass rules using WPAD

If your like me you might already use a VPN to route your traffic through. The problem is some sites just don't like VPN services and will actively block you from using them without disabling or bypassing it.

Netflix is a prime example of a website that does not like VPN services, because they are seen as a way to circumvent the geo-restrictions imposed on the content library offered.

Below are WPAD rules I use to essentially send Netflix traffic directly and avoid any VPN errors/dreaded unknown error network messages. Error messages that Netflix throws back at you related to VPN usage when streaming might include:

  • "You seem to be using an unblocker or proxy"
  • VPN/proxy error M7111-1331-5059

Removing metadata from MP4 files

Often MP4 files will have metadata such as titles, comments and other data stored behind the media file. In some cases you'll never notice it, but some media players such as VLC, will use the information like titles and display them. In addition to media players, media organisers like Plex, may also use the metadata information, depending on if "local file information" is treated with a higher priority than indexers like The Movie DB or The TV DB.

Using mp4box (part of GPAC) provides a way to remove standard metadata information from an MP4 file, essentially rewriting the MP4 container, without modifying the original stream.

In place metadata removal

This will remove the metadata from the file in place, a file with out_ is created temporarily for the new ISO data to be written, once completed it will overwrite the original source file.

@jamesmacwhite
jamesmacwhite / dd-wrt-inadyn-entware.md
Last active May 21, 2018 18:52
Using the newer version of inadyn on DD-WRT

Using the Entware inadyn package on DD-WRT

Dynamic DNS is a great tool for being able to keep one or more services that rely on a specific DNS name record being accurate. In most cases, DDNS is useful for something like your home ISP IP address which is often dynamic or "sticky". Unless provided (or you pay for the priviledge), residenital ISP broadbrand plans don't usually offer static IP.

DD-WRT includes DDNS (inadyn), but there is one problem. It's very old. DD-WRT includes the version 1.96-ADV. While having older software isn't ideal there is one key area that is a potential security issue. SSL support. The standard DDNS implementation in DD-WRT means you are sending your DNS update request over plaintext. This is bad. Being able to sniff credentials for your chosen DNS provider over the wire means you are wide open to someone being able to intercept and modify the request. In addition, the crendentials used may also be tied to a service multiple services. While it would require some effort and en

@jamesmacwhite
jamesmacwhite / m190411_125323_craft2_focal_point_fields.php
Last active April 11, 2019 21:26
Migrate Craft 2 focal point field data
<?php
namespace craft\contentmigrations;
use Craft;
use craft\db\Migration;
use craft\db\Query;
/**
* m190411_125323_craft2_focal_point_fields migration.
@jamesmacwhite
jamesmacwhite / m190412_182837_tablemaker_update_fieldtype.php
Created April 12, 2019 18:36
Field type migration for Table Maker for Craft 2 to Craft 3 migrations
<?php
namespace craft\contentmigrations;
use Craft;
use craft\db\Migration;
use supercool\tablemaker\fields\TableMakerField;
/**
* m190412_182837_tablemaker_update_fieldtype migration.
@jamesmacwhite
jamesmacwhite / m190416_110112_update_retour_widget_type.php
Created April 16, 2019 11:13
Migration for updating Retour widget from Craft 2
<?php
namespace craft\contentmigrations;
use Craft;
use craft\db\Migration;
use nystudio107\retour\widgets\RetourWidget;
/**
* m190416_110112_update_retour_widget_type migration.

Keybase proof

I hereby claim:

  • I am jamesmacwhite on github.
  • I am jamesmacwhite (https://keybase.io/jamesmacwhite) on keybase.
  • I have a public key whose fingerprint is 7E6F 9A74 C332 D284 8B14 80CA BCB2 5A84 0CFB 1C8E

To claim this, I am signing this object:

@jamesmacwhite
jamesmacwhite / nanobox-net-share-manual.md
Last active January 29, 2020 23:54
Nanobox and manually fixing failed mounting on Windows

Nanobox manual mounting of codebase folder

Sometimes Nanobox will fail to mount the codebase of an app through the usual nanobox run command. This will lead to a constant loop of attempting to mount the codebase folder before Nanobox gives up after a few tries, despite entering the correct password. If you look at the logs, this will often be due to a host is down error.

This can often because the mount has not been correctly set. You can do this manually, by running net share as per:

https://github.com/nanobox-io/nanobox/blob/a512a85c181cab4ca454456a915bee5147796a8b/util/provider/share/share_windows.go#L81

The syntax is: