Tag Info

Hot answers tagged


Take a look at the 'sips' command: man sips It is much simpler than GUI-scripting Preview and it's part of OSX. So you don't have to install anything. Example: full_w=$(/usr/bin/sips -g pixelWidth image.jpg | /usr/bin/grep -Eo "[[:digit:]]+") full_h=$(/usr/bin/sips -g pixelHeight image.jpg | /usr/bin/grep -Eo "[[:digit:]]+") half_w=$(/bin/expr full_w / ...


The filesystem and metadata can change when preview has write access to the file. The precise why is probably complicated, but you can prevent it by removing write access (chmod a-w test.pdf) and then using preview on the file. Note, the chmod updates the ctime as well. My guess is that metadata fields like kMDItemUsedDates and kMDItemLastUsedDate are the ...


My first thought was that ImageMagick is bound to have something for this, and indeed it does. You could run something like this find . -name "*.JPG" -exec identify {} \; | grep Corrupt where you can replace . with your directory of choice (it will descend recursively) to check each file or image with ImageMagick's identify command. Grepping for 'Corrupt' ...


You can do it with imagemagick by typing the following: convert image.png -resize 50% -density 72 image.png In order to execute the previous command you need imagemagick installed on your computer. You can easy do it via homebrew: brew install imagemagick And, if you haven't homebrew, you can install with this: ruby -e "$(curl -fsSL ...


Simply issue ifconfig List all network interfaces and their status.


The scutil --dns command gives you all the network routing information you'll need to map hardware interface labels to network routes. A little awk and grep can pretty it up if you need to script the information or pare it down. Start with gripping for "if_index" if you're curious.


Yes! The latest version of homebrew stores the artifacts used to install the packages in /Library/Caches/Homebrew: > ls /Library/Caches/Homebrew Casks gnutls-3.3.15.yosemite.bottle.tar.gz libusb-1.0.19.yosemite.bottle.1.tar.gz ppl011-0.11_1.yosemite.bottle.tar.gz Formula ...


You will almost certainly be fine. Try pip install pip and it should tell you "Requirements already satisfied". You could also try pip show pip and it will tell you it is installed and requires no other packages.

Only top voted, non community-wiki answers of a minimum length are eligible