This file contains 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
# depends on wget and GNU Parallel (available via Homebrew) | |
wget -e robots=off -nd -r --spider -l1 -A pdf http://foo.net/bar 2>&1 | grep -Eio http.+pdf | parallel -L 1 wget -nc --no-verbose |
This file contains 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
% to enable continuous screen output in a parfor loop place a | |
% pause of 2-3 seconds before each fprintf or disp statement. | |
% it seems this flushes the stdout buffer of the worker nodes. | |
% tested with a local parpool in Matlab R2014b on OS X 10.9.5. | |
fprintf('pre\n') | |
parfor n = 1:5 | |
pause(2) | |
fprintf('start %i\n',n) | |
pause(10) | |
fprintf('end %i\n',n) |
This file contains 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
# qpdf converts the PDF into a readable text file | |
# depends on GNU sed and GNU grep (available via Homebrew) | |
# GNU sed because BSD grep throws an "illegal byte sequence" error | |
# GNU grep because BSD grep omits lines | |
# iconv to properly display non-UTF8 encodings | |
# doesn't find hyphenated words or words with ligatures | |
qpdf --qdf doc.pdf - | iconv -f ISO-8859-1 -t UTF-8 | gsed -E 's/\)-?[0-9]+(\.[0-9]+)?\(//g' | ggrep -ian foobar | |
# usage example | |
# |
This file contains 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
# depends on Imagemagick (available via Homebrew) | |
# horizontal concatenation | |
convert +append img1.png img2.png img3.png out.png | |
# vertical concatenation | |
convert -append img1.png img2.png img3.png out.png |
This file contains 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
# depends on Ghostscript (available via Homebrew) | |
# copied from: http://superuser.com/questions/360216 | |
gs \ | |
-o output.pdf \ | |
-sDEVICE=pdfwrite \ | |
-dColorConversionStrategy=/LeaveColorUnchanged \ | |
-dDownsampleMonoImages=false \ | |
-dDownsampleGrayImages=false \ | |
-dDownsampleColorImages=false \ | |
-dAutoFilterColorImages=false \ |
This file contains 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
# to avoid errors concerning libraries linked against former versions of libgfortran.3.dylib | |
brew remove --force suite-sparse-julia arpack-julia openblas-julia arpack64-julia openblas64-julia | |
brew update && brew install python3 | |
pip3 install --upgrade pip setuptools | |
# the @ operator is available starting from Python 3.5 / NumPy 1.10 | |
# https://docs.python.org/3.5/whatsnew/3.5.html#whatsnew-pep-465 | |
pip3 install http://sourceforge.net/projects/numpy/files/NumPy/1.10.0b1/numpy-1.10.0b1.tar.gz/download |
This file contains 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
% see also: http://undocumentedmatlab.com/blog/setting-the-matlab-desktop-layout-programmatically | |
if not(isdeployed) && usejava('jvm') && feature('ShowFigureWindows') | |
desktop = com.mathworks.mde.desk.MLDesktop.getInstance; | |
pause(0.7) % wait for gui to load | |
desktop.restoreLayout('foobar'); | |
clear desktop | |
end |
This file contains 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
#!/bin/sh | |
# | |
# Vimeo Downloader | |
# | |
# Copyright (C) 2008, 2010 Denver Gingerich | |
# Copyright (C) 2009 Jori Hamalainen | |
# | |
# Permission to use, copy, modify, and/or distribute this software for any | |
# purpose with or without fee is hereby granted, provided that the above | |
# copyright notice and this permission notice appear in all copies. |
This file contains 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
// available at https://github.com/sindresorhus/speed-test | |
function render() { | |
logUpdate([ | |
'↻ ' + stats.ping + getSpinner('ping'), | |
'↓ ' + stats.download + getSpinner('download'), | |
'↑ ' + stats.upload + getSpinner('upload') | |
].join('\n')); | |
} | |
// to select a specific server for testing get a server id |
This file contains 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
# Configure Remote Management | |
kickstart -configure -allowAccessFor -allUsers -privs -all | |
# Enable Remote Management | |
kickstart -activate -restart -agent | |
# Disable Remote Management | |
kickstart -deactivate -stop |