Skip to content

Instantly share code, notes, and snippets.

@dragonken
dragonken / ffmpeg-mkv-to-mp4.sh
Created August 11, 2017 17:04 — forked from pwenzel/ffmpeg-mkv-to-mp4.sh
MKV and AVI to MP4 Conversion for Apple TV
# See also https://trac.ffmpeg.org/wiki/Encode/AAC
# direct copy
ffmpeg -i input.mkv -c:v copy -c:a copy output.mp4
# direct copy video, but convert audio to AAC with default variable bit rate
ffmpeg -i input.mkv -c:v copy -c:a aac -strict experimental output.mp4
# direct copy video, but convert audio to AAC with constant bit rate
ffmpeg -i input.mkv -c:v copy -c:a aac -strict experimental -b:a 320k output.mp4
@dragonken
dragonken / ramdisk.sh
Created August 16, 2017 12:50 — forked from rxin/ramdisk.sh
ramdisk create/delete on Mac OS X.
#!/bin/bash
# From http://tech.serbinn.net/2010/shell-script-to-create-ramdisk-on-mac-os-x/
#
ARGS=2
E_BADARGS=99
if [ $# -ne $ARGS ] # correct number of arguments to the script;
then
@dragonken
dragonken / auto-remove-sublime-license-popup
Created August 17, 2017 20:17 — forked from egel/auto-remove-sublime-license-popup
Auto-remove Sublime's license popup
#!/usr/bin/python
# -*- coding: utf-8 -*-
import sublime_plugin
import subprocess
from time import sleep
import sys
cl = lambda line: subprocess.Popen(line, shell=True, stdout=subprocess.PIPE).communicate()[0].strip()
log = lambda message: sys.stderr.write("Log: %s\n" % message)
@dragonken
dragonken / ffmpeg-cheatsheet.md
Created August 18, 2017 17:37 — forked from nickkraakman/ffmpeg-cheatsheet.md
FFmpeg cheat sheet for 360 video

FFmpeg Cheat Sheet for 360º video

Brought to you by Headjack

 
FFmpeg is one of the most powerful tools for video transcoding and manipulation, but it's fairly complex and confusing to use. That's why I decided to create this cheat sheet which shows some of the most often used commands.

 
Let's start with some basics:

  • ffmpeg calls the FFmpeg application in the command line window, could also be the full path to the FFmpeg binary or .exe file
@dragonken
dragonken / uninstall-mono.sh
Created November 5, 2017 11:34 — forked from AgiosAndreas/uninstall-mono.sh
This script removes Mono from an OS X System. It must be run as root
#!/bin/sh -x
#This script removes Mono from an OS X System. It must be run as root
rm -r /Library/Frameworks/Mono.framework
rm -r /Library/Receipts/MonoFramework-*
for dir in /usr/bin /usr/share/man/man1 /usr/share/man/man3 /usr/share/man/man5; do
(cd ${dir};
@dragonken
dragonken / remove-mono.sh
Created November 5, 2017 11:34 — forked from powerumc/remove-mono.sh
Uninstalling Mono on Mac OS X
#!/bin/sh -x
#This script removes Mono from an OS X System. It must be run as root
rm -r /Library/Frameworks/Mono.framework
rm -r /Library/Receipts/MonoFramework-*
for dir in /usr/bin /usr/share/man/man1 /usr/share/man/man3 /usr/share/man/man5; do
(cd ${dir};
pair = 'BTCUSD'
csv = [['Date', 'Open', 'High', 'Low', 'Close', 'Volume']]
end_t = Time.now.to_i * 1000
loop do
body = HTTParty.get("https://api.bitfinex.com/v2/candles/trade:1h:t#{pair}/hist?_bfx=1&limit=1500&end="+end_t.to_s).body
body = Oj.load(body) rescue nil
break if body.nil?
break if body.size == 0
body.each do |e|
csv << [Time.at(e[0] / 1000).strftime('%Y-%m-%d %H:00:00'), e[1], e[3], e[4], e[2], e[5]]
@dragonken
dragonken / Instructions
Created November 4, 2018 21:27 — forked from halbtuerke/Instructions
Join multiple *.flv files with ffmpeg
To use this script just copy all flv files into a directory and call the script via:
"join-flvs.sh *.flv"
@dragonken
dragonken / npm-using-https-for-git.sh
Created November 17, 2018 08:47 — forked from taoyuan/npm-using-https-for-git.sh
Force git to use https:// instead of git://
git config --global url."https://github.com/".insteadOf [email protected]:
git config --global url."https://".insteadOf git://
@dragonken
dragonken / ch4_arp_poison.py
Created March 9, 2019 22:33 — forked from ismailakkila/ch4_arp_poison.py
ch4_arp_poison.py
from scapy.all import *
import os
import signal
import sys
import threading
import time
#ARP Poison parameters
gateway_ip = "10.0.0.1"
target_ip = "10.0.0.250"