Skip to content

Instantly share code, notes, and snippets.

View NTICompass's full-sized avatar

Eric Siegel NTICompass

View GitHub Profile
@famousgarkin
famousgarkin / fix.sh
Created March 18, 2017 18:10
ffmpeg fix "Video uses a non-standard and wasteful way to store B-frames ('packed B-frames'). Consider using the mpeg4_unpack_bframes bitstream filter without encoding but stream copy to fix it."
ffmpeg -i "in.avi" -bsf:v mpeg4_unpack_bframes -vcodec copy "out.avi"
@Changaco
Changaco / btrfs-undelete
Last active April 11, 2024 12:17
btrfs-undelete
#!/bin/bash
# btrfs-undelete
# Copyright (C) 2013 Jörg Walter <info@syntax-k.de>
# This program is free software; you can redistribute it and/or modify it under
# the term of the GNU General Public License as published by the Free Software
# Foundation; either version 2 of the License, or any later version.
if [ ! -b "$1" -o -z "$2" -o -z "$3" ]; then
echo "Usage: $0 <dev> <file/dir> <dest>" 1>&2
echo
# Mount drive here
dd if=/dev/zero of=/path/to/mount/zero
# Unmount drive here
sudo dd if=/dev/whatever bs=4k | pv | 7za a -si -t7z -m0=lzma -mx=9 -mfb=64 -md=32m -ms=on archive.7z -bd
@umidjons
umidjons / dos2unix.md
Created July 18, 2014 04:55
Execute dos2unix for directory recursively.

Will recursively find all files inside current directory and call for these files dos2unix command. Would break if you had spaces in file name.

find . -type f -exec dos2unix {} \;

Wouldn't break if you had spaces in file names.

find . -type f -print0 | xargs -0 dos2unix
@MadaraUchiha
MadaraUchiha / mysql_comment.markdown
Last active May 9, 2019 23:07
Don't use MySQL functions in PHP - Comment for Stack Overflow
[**Please, don't use `mysql_*` functions in new code**](http://bit.ly/phpmsql). They are no longer maintained [and are officially deprecated](http://j.mp/XqV7Lp). See the [**red box**](http://j.mp/Te9zIL)? Learn about [*prepared statements*](http://j.mp/T9hLWi) instead, and use [PDO](http://php.net/pdo) or [MySQLi](http://php.net/mysqli) - [this article](http://j.mp/QEx8IB) will help you decide which. If you choose PDO, [here is a good tutorial](http://j.mp/PoWehJ).

Please, don't use mysql_* functions in new code. They are no longer maintained and are officially deprecated. See the red box? Learn about prepared statements instead, and use PDO or MySQLi - this article will help you decide which. If you choose PDO, here is a good tutorial.

@jasny
jasny / mysql_splitdump.sh
Last active February 15, 2024 16:13
Split MySQL dump SQL file into one file per table or extract a single table
#!/bin/bash
####
# Split MySQL dump SQL file into one file per table
# based on http://blog.tty.nl/2011/12/28/splitting-a-database-dump
####
if [ $# -lt 1 ] ; then
echo "USAGE $0 DUMP_FILE [TABLE]"
exit
@pixelhandler
pixelhandler / jquery-1.6.4-promises.js
Created October 9, 2011 01:09
Deferred / Promise extracted from jQuery v1.6.4 for use with older version of jQuery 1.4.2
(function($){
var // Promise methods
promiseMethods = "done fail isResolved isRejected promise then always pipe".split( " " ),
// Static reference to slice
sliceDeferred = [].slice;
if (typeof $ !== 'function') {
return false;
} else {