Skip to content

Instantly share code, notes, and snippets.

@htpc-helper
htpc-helper / convert.mkv.sh
Last active September 5, 2023 16:07
Bash script for converting mkv to mp4 without transcoding video
#!/bin/bash
# Configure inputs
INPUT_FOLDER='/media'
DELETE_ORIGINALS=false #set to true to delete original files
# Set $IFS variable to handle files whitespace in name
SAVEIFS=$IFS
IFS=$(echo -en "\n\b")
@jamesmacwhite
jamesmacwhite / ffmpeg_mkv_mp4_conversion.md
Last active May 5, 2024 15:42
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

@agentrickard
agentrickard / gist:27b83d78109565ae1a16
Created August 16, 2014 18:29
Sampe Drupal 8 build script
#!/bin/bash
# be in the right directory
# edit this line as appropriate
cd /Applications/MAMP/htdocs
# assign the path to drush.
# if drush is not in your path, or if you use multiple versions.
drush='/Applications/MAMP/drush/drush'
@skwashd
skwashd / pre-commit
Last active January 4, 2016 04:59
Git pre-commit hook for checking files with coder-review and php lint. This prevents developers committing broken PHP or code that doesn't comply with the Drupal coding standards.Add this file to .git/hooks/pre-commit in the root of your doc repo and make it executable (chmod +x .git/hooks/pre-commit).You must have the coder module in ~/.drush/T…
#!/bin/bash
#
# Git pre-commit hook for Drupal projects.
# Created by Dave Hall - http://davehall.com.au
# Distributed under the terms of the WTFPL - http://www.wtfpl.net/
#
set -e
@julionc
julionc / 00.howto_install_phantomjs.md
Last active April 26, 2024 09:13
How to install PhantomJS on Debian/Ubuntu

How to install PhantomJS on Ubuntu

Version: 1.9.8

Platform: x86_64

First, install or update to the latest system software.

sudo apt-get update
sudo apt-get install build-essential chrpath libssl-dev libxft-dev
@becw
becw / example.install.php
Last active March 26, 2019 06:53
Enable/revert a feature in a Drupal update hook #drupal7
/**
* EXAMPLE FEATURE UPDATE
* Enable and revert the my_new_feature_name feature.
*/
function example_update_7001() {
// An array of new or changed features; the array keys are feature names,
// values are an array of exportable types as seen in a feature's .info file:
// features[field][] = node-page-body
$features = array(
'my_new_feature_name' => array('field', 'variable'),
@huangzhichong
huangzhichong / selenium-webdriver-cheatsheet.md
Created August 7, 2012 12:38
Selenium Webdriver CheatSheet

API workthough

  1. Open a browser

    # start an instance of firefox with selenium-webdriver
    driver = Selenium::WebDriver.for :firefox
    # :chrome -> chrome
    # :ie     -> iexplore
    
  • Go to a specified URL