Skip to content

Instantly share code, notes, and snippets.

@j796160836
j796160836 / ffmpeg_mkv_mp4_conversion.md
Last active January 31, 2022 01:03 — forked from jamesmacwhite/ffmpeg_mkv_mp4_conversion.md
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

@j796160836
j796160836 / update-jenkins.sh
Last active February 10, 2019 21:37 — forked from lacek/update-jenkins.sh
Update Jenkins on Mac OS X
#!/bin/bash
DEFAULT_URL=http://updates.jenkins-ci.org/current/latest/jenkins.war
TMP_PATH=/tmp/jenkins.war
APP_PATH=/Applications/Jenkins/jenkins.war
PLIST_PATH=/Library/LaunchDaemons/org.jenkins-ci.plist
url=${1-$DEFAULT_URL}
echo 'Downloading WAR package...'
@j796160836
j796160836 / namecheap-synology-ddns.php
Last active November 12, 2023 10:49
Add custom DDNS provider for Namecheap on Synology NAS
#!/usr/bin/php -d open_basedir=/usr/syno/bin/ddns
<?php
/*
Usage Instructions ( Obviously your domain has to be hosted on Namecheap )
1) Copy this file to /usr/syno/bin/ddns/namecheap.php
2) Add the following entry in /etc.defaults/ddns_provider.conf
[Custom - Namecheap]
modulepath=/usr/syno/bin/ddns/namecheap.php
@j796160836
j796160836 / dummy-web-server.py
Created September 26, 2017 12:56 — forked from bradmontgomery/dummy-web-server.py
a minimal http server in python. Responds to GET, HEAD, POST requests, but will fail on anything else.
#!/usr/bin/env python
"""
Very simple HTTP server in python.
Usage::
./dummy-web-server.py [<port>]
Send a GET request::
curl http://localhost
@j796160836
j796160836 / getudid.sh
Created December 17, 2016 13:36 — forked from tehnoir/getudid.sh
getudid
#!/bin/bash
function getUDID {
udid=($(system_profiler SPUSBDataType | grep -A 11 -w "iPad\|iPhone\|iPad" | grep "Serial Number" | awk '{ print $3 }'))
if [ -z $udid ]; then
echo "No device detected. Please ensure an iOS device is plugged in."
exit 1
else
for i in "${udid[@]}"; do
echo -n $i | pbcopy
@j796160836
j796160836 / set_project_profiles.sh
Created December 17, 2016 13:35 — forked from tehnoir/set_project_profiles.sh
Update Xcode project's build settings to point to current provisioning profiles.
#!/bin/bash
##############################################################################################################
### 1. Name your profiles with the convention of ProjectName_TargetName_ConfigurationName.mobileprovision ###
### 2. Create a directory called CodeSign in your project directory ###
### 3. Move all your project's provisioning profiles into the CodeSign directory ###
### ###
### Running this script will update your project file to point to the correct UUIDs of each corresponding ###
### profile in your CodeSign directory. ###
##############################################################################################################
@j796160836
j796160836 / DummyAndroidTextUtilsMockTest.java
Created August 14, 2016 07:58 — forked from daddykotex/DummyAndroidTextUtilsMockTest.java
Mock Android TextUtils static method
import android.text.TextUtils;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.invocation.InvocationOnMock;
import org.mockito.stubbing.Answer;
import org.powermock.core.classloader.annotations.PrepareForTest;
import org.powermock.modules.junit4.PowerMockRunner;
請將下列語法 "取代" <body>
<body ONDRAGSTART="window.event.returnValue=false" onSelectStart="event.returnValue=false" ONCONTEXTMENU="window.event.returnValue=false" >
=================================
鎖滑鼠右鍵及防highlight
<body onselectstart="return false;" ondragstart="return false;" oncontextmenu="return false;">
======================
@j796160836
j796160836 / genymotionwithplay.txt
Created May 18, 2016 06:58 — forked from wbroek/genymotionwithplay.txt
Genymotion with Google Play Services
Download the following ZIPs:
ARM Translation Installer v1.1 (http://www.mirrorcreator.com/files/0ZIO8PME/Genymotion-ARM-Translation_v1.1.zip_links)
Download the correct GApps for your Android version:
Google Apps for Android 6.0 (https://www.androidfilehost.com/?fid=24052804347835438 - benzo-gapps-M-20151011-signed-chroma-r3.zip)
Google Apps for Android 5.1 (https://www.androidfilehost.com/?fid=96042739161891406 - gapps-L-4-21-15.zip)
Google Apps for Android 5.0 (https://www.androidfilehost.com/?fid=95784891001614559 - gapps-lp-20141109-signed.zip)
Google Apps for Android 4.4.4 (https://www.androidfilehost.com/?fid=23501681358544845 - gapps-kk-20140606-signed.zip)
Google Apps for Android 4.3 (https://www.androidfilehost.com/?fid=23060877490000124 - gapps-jb-20130813-signed.zip)
@j796160836
j796160836 / default.reg
Created December 22, 2015 15:50 — forked from P4/default.reg
Color schemes for Windows Command Prompt
Windows Registry Editor Version 5.00
; Default color scheme
; for Windows command prompt.
; Values stored as 00-BB-GG-RR
[HKEY_CURRENT_USER\Console]
; BLACK DGRAY
"ColorTable00"=dword:00000000
"ColorTable08"=dword:00808080
; BLUE LBLUE