sips
macOS has long included a command line tool called sips. It’s a comprehensive image manipulation tool
macOS image manipulation with sips
$ sips --help
Get dpi
$ sips --getProperty dpiHeight --getProperty dpiWidth image-20210910165854169.png
/Users/matejkafr/Documents/Htl/Doc/Documentation/pandoc/MDtoPDF/tmp/image-20210910165854169.png
dpiHeight: 300.000
dpiWidth: 300.000
Set the dpi:
$ sips <file> -s dpiHeight <dpi> -s dpiWidth <dpi>
$ sips image-20210910165854169.png -s dpiHeight 600 -s dpiWidth 600 -o image_600.png
Hinweis:
- DPI haben keine Auswirkungen in HTML Browsern
- Bei LaTeX wird das Bild kleiner wenn die DPI erhöht werden.
Image Crop
--cropToHeightWidth pixelsH pixelsW
Crop image to fit specified size.
--cropOffset offsetY offsetH
Crop offset from top left corner.
sips --getProperty pixelWidth --getProperty pixelHeight Mairboeck_Fabian.jpg
cp Mairboeck_Fabian.jpg Mairboeck_Fabian_.jpg;sips --cropOffset 25 40 --cropToHeightWidth 250 170 Mairboeck_Fabian_.jpg
cp *.jpg build;find ./build -type f -name '*.jpg' -maxdepth 1 \
-exec sips --cropOffset 25 40 --cropToHeightWidth 250 170 {} ';'
wakeonlan
brew install wakeonlan
.zshenv
# ~/.zshenv
PATH=$PATH:~/Documents/Htl/lib/bin
CDPATH=.:~/Documents/Htl
- What should/shouldn’t go in .zshenv, .zshrc, .zlogin, .zprofile, .zlogout?
- Quick directory navigation in the bash shell](https://unix.stackexchange.com/a/31179)
Homebrew
macOS installs Homebrew GNU tools
How to replace Mac OS X utilities with GNU core utilities?
$ brew install coreutils findutils gnu-tar gnu-sed gawk gnu grep
# Die GNU Utilities beginnen alle mit einem g (ggrep, gawk, gsed, ...)
$ brew install pandoc
$ brew install node
Python
$ brew install python
Pandas für M1 [*]:
$ pip3 install cython
$ pip3 install numpy --no-use-pep517
$ pip3 install pandas --no-use-pep517
$ pip3 install matplotlib