Bulk Convert MP4 to MKV Without Reencoding

Posted March 21st, 2015 in Uncategorized

If you have a bunch of MP4 files and want to convert to MKV without needing to reencode each file, this can be done with a super handy little tool called avconv.

Install avtools

You’ll need homebrew for this step.

1
brew install avtools

 

Do the conversion

I have a folder of MP4 files. To bulk convert them:

1
for f in *.mp4; do avconv -i "$f" -codec copy -map 0 "${f%.mp4}.mkv"; done

The above will create identically named MKVs next to your MP4s. Once you’re happy, just delete all your MP4s.

 

Bonus: Bulk merge ASS subtitles

If you have identically named ASS subtitle files next to your shiny new MKVs, you can bulk merge them using mkvmerge from mkvtoolnix with:

1
2
brew install mkvtoolnix
for f in *.mkv; do mkvmerge -o "./muxed/$f" "$f" "${f%.mkv}.ass"; done

Thanks to user MestreLion for his answer on AskUbuntu.

Read More »

Creating a Basic ToDo Application in Laravel 5 – Part 4

Posted February 5th, 2015 (Updated 28 Mar 2015) in PHP

Welcome back to my simple to-do application tutorial for Laravel 5. This tutorial is relatively long so I’ve broken it up into multiple posts.

  1. Part 1 – Installation, Database and Routes
  2. Part 2 – Listing Projects and Tasks
  3. Part 3 – Create/Edit/Delete
  4. Part 4 – Validation

The source for each part can also be found on GitHub.

So far we’ve learned how to install and set up Laravel, set up some project and task nested resources and display them to the user. Create, edit and delete functionality has also been implemented. In this chapter we’ll finish things off by adding form validation.

Read More »

Creating a Basic ToDo Application in Laravel 5 – Part 3

Posted February 5th, 2015 (Updated 12 Mar 2015) in PHP

Welcome back to my simple to-do application tutorial for Laravel 5. This tutorial is relatively long so I’ve broken it up into multiple posts.

  1. Part 1 – Installation, Database and Routes
  2. Part 2 – Listing Projects and Tasks
  3. Part 3 – Create/Edit/Delete
  4. Part 4 – Validation

The source for each part can also be found on GitHub.

So far we’ve learned how to install and set up Laravel, set up some project and task resources and displayed them to the user. In this chapter we’ll learn how to set up create, edit and delete pages/actions.

Read More »

Creating a Basic ToDo Application in Laravel 5 – Part 2

Posted February 5th, 2015 (Updated 9 Feb 2015) in PHP

Welcome back to my simple to-do application tutorial for Laravel 5. This tutorial is relatively long so I’ve broken it up into multiple posts.

  1. Part 1 – Installation, Database and Routes
  2. Part 2 – Listing Projects and Tasks
  3. Part 3 – Create/Edit/Delete
  4. Part 4 – Validation

The source for each part can also be found on GitHub.

So far we have a working database complete with seed data and a bunch of routes for displaying, editing and deleting our projects and tasks. In this second chapter I’ll cover controllers, models (with relationships), views (including the blade templating language and layouts) and route model binding.

Read More »

Creating a Basic ToDo Application in Laravel 5 – Part 1

Posted February 5th, 2015 (Updated 22 Feb 2015) in PHP

With the release of Laravel 5, there have been a bunch of backwards incompatible changes, new features added as well as the usual influx of new users so I thought I’d take the time to redo my basic to-do application with Laravel 5. The app covers a wide range of concepts, links to relevant learning material where possible and should make for a great introduction to the framework.

This tutorial is relatively long so I’ve broken it up into multiple posts.

  1. Part 1 – Installation, Database and Routes
  2. Part 2 – Listing Projects and Tasks
  3. Part 3 – Create/Edit/Delete
  4. Part 4 – Validation

The source for each part can also be found on GitHub.

Today will cover installation, configuration, artisan, migration, seeding and routes.

Read More »

How to Install Illuminate/HTML In Laravel 5

Posted February 5th, 2015 in PHP

Laravel 4 contained a Form helpers package called HTML but it was removed from 5 to cut down on cruft. HTML is still available as a first party package though so below are instructions on getting it back.

First require it in:

1
composer require "illuminate/html":"5.0.*"

Next up add the service provider and aliases. Open /config/app.php and update as follows:

1
2
3
4
5
6
7
8
9
10
11
12
13
'providers' => [
	...
 
	'Illuminate\Html\HtmlServiceProvider',
],
 
'aliases' => [
 
	...
 
	'Form'=> 'Illuminate\Html\FormFacade', 
	'HTML'=> 'Illuminate\Html\HtmlFacade',
],

That’s it. To confirm it’s working use the following:

1
2
3
php artisan tinker
> Form::text('foo')
"<input name=\"foo\" type=\"text\">"

Read More »

How to Bulk Merge MKV and ASS Subtitle Files

Posted January 25th, 2015 in Linux

Today I had a folder of files like so:

1
2
3
4
5
6
7
My Video - 01.ass
My Video - 01.mkv
My Video - 02.ass
My Video - 02.mkv
My Video - 03.ass
My Video - 03.mkv
...

I wanted to add the .ass subtitle files to my .mkv containers but I had about 100 videos and didn’t want to do each one manually.

Using mkvtoolnix you can combine the video and subtitles like so (courtesy of Super User):

1
mkvmerge -o output.mkv input.mkv subs.srt

Because our files are all nicely named we can use a for loop to iterate this command over them all simply replacing the .mkv extension with .ass in the third argument (See How can I rename all my *.foo files to *.bar, or convert spaces to underscores, or convert upper-case file names to lower case?):

1
for f in *.mkv; do mkvmerge -o "./muxed/$f" "$f" "${f%.mkv}.ass"; done

and that’s it! The fixed up files will be in your muxed subdirectory.

Read More »

How to Par2 Repair More Effectively

Posted January 23rd, 2015 in Linux

One of the most annoying things about SABnzbd is it’s failure to correctly repair broken downloads – especially when you download multiple repairable files in a single combined NZB. This often stems from SABnzbd not including all relevant par2 and part files during its repair – so the par2 command assumes far more missing files than there actually are. Below I’ll explain a method for easily including all relevant files for a (hopefully) more successful repair.

 

The Par2 Command

First let’s look at the par2 command:

1
2
3
4
5
6
7
8
$ par2
...
Usage:
 
  par2 c(reate) [options] <par2 file> [files] : Create PAR2 files
  par2 v(erify) [options] <par2 file> [files] : Verify files using PAR2 file
  par2 r(epair) [options] <par2 file> [files] : Repair files using PAR2 files
...

Based on the above we need to call

1
par2 r <list of par2 files> <list of mkv parts>

But how do we get those lists?

 

Your Download

Let’s say I’ve (legally) downloaded of episodes 8 and 9 of MyShow!. My failed download folder might include the following files:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
MyShow! - 08 [720p].mkv.001
MyShow! - 08 [720p].mkv.002
MyShow! - 08 [720p].mkv.003
MyShow! - 08 [720p].mkv.par2
MyShow! - 08 [720p].mkv.vol000+01.par2
MyShow! - 08 [720p].mkv.vol001+02.par2
MyShow! - 09 [720p].mkv.001
MyShow! - 09 [720p].mkv.002
MyShow! - 09 [720p].mkv.003
MyShow! - 09 [720p].mkv.004
MyShow! - 09 [720p].mkv.par2
MyShow! - 09 [720p].mkv.vol000+01.par2
MyShow! - 09 [720p].mkv.vol001+02.par2
MyShow! - 09 [720p].mkv.vol003+04.par2

We want to repair one episode at a time starting with episode 8. Here’s how I’d retrieve lists of just par2 then just the part files:

1
2
3
4
5
6
7
# Episode 8
ls *"- 08"*.par2 # Par2 files
ls *"- 08"*.[0-9][0-9][0-9] # Part files
 
# Episode 9
ls *"- 09"*.par2 # Par2 files
ls *"- 09"*.[0-9][0-9][0-9] # Part files

 

Putting it All Together

Combining par2 with my above lists results in:

1
2
par2 r *"- 08"*.par2 *"- 08"*.[0-9][0-9][0-9] # Ep 8
par2 r *"- 09"*.par2 *"- 09"*.[0-9][0-9][0-9] # Ep 9

You may also need to include *.mkv if that file exists but more often than not I’ve found it doesn’t.

Hope your repairs go a little smoother with this quick tip!

Read More »

How to get Artisan Tinker Working in OSX 10 MAMP

Posted January 8th, 2015 in PHP

Those of you with MAMP who work with laravel will be very familiar with this dreaded message when attempting to php artisan tinker:

Boris REPL not supported. Needs readline, posix, and pcnt extensions.

Inside where I explain how to install these tools.

Read More »

Making PS3 Controller Work on OSX Yosemite

Posted December 14th, 2014 in Uncategorized

Spent an hour grappling with this last night. Here’s how to get the PS3 controller working on Yosemite.

Pair the PS3 controller with your mac:

It seems Yosemite’s bluetooth device list is a little buggy and devices can show in the top bar bluetooth drop down but not in the system configuration bluetooth page for some devices. The PS3 controller is one of these devices.

After a while digging around the net I found some working instructions thanks to user DillingerEscapeHam on Reddit:

  • Plug PS3 controller into laptop
  • See Bluetooth device in status bar menu (though just a bt address, not named “Playstation Controller”)
  • Click to Connect device in status bar menu
  • Open System Preferences
  • No device listed
  • Unplug controller
  • Attempt to turn controller on without cable (no response, no flashing lights)
  • Controller was now listed correctly as Playstation controller in status bar menu and was listed as Connected
  • Disconnect controller via menu.
  • Unplug and start controller with PS button. It connects correctly.

After you get the controller paired you’ll need either a game that supports the controller or an app like Joystick Mapper (paid) or Enjoy2 (free) which allows binding of keyboard keys or mouse buttons/swipes to controller events. I recommend forking out the $6 for Joystick Mapper, as I’ve had issues with sensitivity on Enjoy2.

That should be all there is to it. I’m currently playing Hearthstone with a PS3 controller on Yosemite just fine!

Read More »

Page 1 of 1512345...10...Last »