This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gs -dNOPAUSE -dBATCH -sDEVICE=jpeg -dJPEGQ=100 -dGraphicsAlphaBits=4 -dTextAlphaBits=4 -r96 -sOutputFile='page-%00d.jpg' <input.pdf> | |
# r = resolution, here 96 = width 960px. properties with "AlphaBits" in them control smoothness of images and text |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var jq = document.createElement('script'); | |
jq.src = "https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"; | |
document.getElementsByTagName('head')[0].appendChild(jq); | |
jQuery.noConflict(); | |
let main = () => { | |
let next = $($('a:contains("Next 25 results")').toArray().pop()).attr('href') | |
let process = data => { | |
$('body dl').append($(data).find('dl').html()) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sysctl -n machdep.cpu.brand_string | |
# run the following command to directly open a link to Intel's page on that processor for detailed specs: | |
# open http://ark.intel.com/search?q=$(sysctl -n machdep.cpu.brand_string | awk '{print $3}') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ffmpeg -i <input.mkv> -q:a 0 -map a output.mp3 | |
# -q:a flag sets VBR encoding. 0 is hightest quality 320kbps. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#bsf filter is needed sometimes to take care of file format compatibility bullshit | |
ffmpeg -i video.mp4 -i audio.mp3 -bsf:a aac_adtstoasc -c copy -map 0:0 -map 1:0 output.mp4 | |
#if audio is webm | |
ffmpeg -i video.mp4 -i audio.webm -c:v copy -c:a libvorbis -strict experimental -map 0:0 -map 1:0 output.mp4 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ffmpeg -f concat -safe 0 -i files.txt -c copy output.mp4 | |
# Note that files.txt must have the filenames of videos to be merged in the following format | |
# file 'path/filename.mp4' | |
# file 'path/filename.mp4' | |
# file 'path/filename.mp4' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
find . -maxdepth 1 -iname '*.mp4' -exec ffprobe -v quiet -of csv=p=0 -show_entries format=duration {} \; | paste -sd+ -| bc |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// put this inside a Run Javascript block in Automator | |
app.doJavaScript("var script = document.createElement('script'); script.src = 'https://ajax.googleapis.com/ajax/libs/jquery/1.6.3/jquery.min.js'; document.getElementsByTagName('head')[0].appendChild(script);", { | |
in: app.windows[0].currentTab | |
}) | |
delay(1); // wait for jQuery to load | |
//... jQuery is now loaded, now add the rest of the script |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ffmpeg -i input.mkv -ss <start seconds (integer)> -to <end seconds (integer)> -c copy output.mkv |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
youtube-dl -ciw --restrict-filenames -o "/media/Scrape/youtube/mp3/%(upload_date)s-%(title)s.%(ext)s" --audio-format mp3 --audio-quality 0 --exec "ffmpeg -i {} -codec:a libmp3lame -qscale:a 0 {}.mp3 && rm {} " "<youtube URL>" |