This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
tech:macos:start [2019/06/15 16:33] rk4n3 |
tech:macos:start [2019/11/09 11:13] (current) rk4n3 |
||
---|---|---|---|
Line 28: | Line 28: | ||
brew install pkg-config | brew install pkg-config | ||
brew install gettext | brew install gettext | ||
+ | brew install glib | ||
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:/usr/X11/lib/pkgconfig | export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:/usr/X11/lib/pkgconfig | ||
</code> | </code> | ||
+ | |||
+ | <code> | ||
+ | ==> Caveats | ||
+ | ==> libffi | ||
+ | libffi is keg-only, which means it was not symlinked into /usr/local, | ||
+ | because some formulae require a newer version of libffi. | ||
+ | |||
+ | For compilers to find libffi you may need to set: | ||
+ | export LDFLAGS="-L/usr/local/opt/libffi/lib" | ||
+ | |||
+ | For pkg-config to find libffi you may need to set: | ||
+ | export PKG_CONFIG_PATH="/usr/local/opt/libffi/lib/pkgconfig" | ||
+ | </code> | ||
+ | |||
=== Portable alternative for getting current time === | === Portable alternative for getting current time === | ||
Line 39: | Line 54: | ||
#include <mach/mach.h> | #include <mach/mach.h> | ||
#endif | #endif | ||
- | </code> | + | |
struct timespec ts; | struct timespec ts; | ||
- | <code> | + | |
#ifdef __MACH__ // OS X does not have clock_gettime, use clock_get_time | #ifdef __MACH__ // OS X does not have clock_gettime, use clock_get_time | ||
clock_serv_t cclock; | clock_serv_t cclock; | ||
Line 63: | Line 78: | ||
<code> | <code> | ||
brew tap AdoptOpenJDK/openjdk | brew tap AdoptOpenJDK/openjdk | ||
- | brew install <version> | + | brew cask install <version> |
</code> | </code> | ||
Where version is: | Where version is: | ||
- | * ''adoptopenjdk-openjdk8'' | + | * ''adoptopenjdk8'' |
- | * ''adoptopenjdk-openjdk9'' | + | * ''adoptopenjdk9'' |
- | * ''adoptopenjdk-openjdk10'' | + | * ''adoptopenjdk10'' |
Line 87: | Line 101: | ||
''CELLAR_HOME'': should be ''/usr/local/Cellar'' | ''CELLAR_HOME'': should be ''/usr/local/Cellar'' | ||
+ | ===== Locust ===== | ||
+ | * ''curl -O https://bootstrap.pypa.io/git-pip.py'' | ||
+ | * ''chmod 755 get-pip.py'' | ||
+ | * ''sudo -H ./get-pip.py'' | ||
+ | * ''sudo -H pip install --ignore-installed six'' | ||
+ | * ''sudo -H pip install locustio'' | ||
+ | |||
+ | ====== Trivia ====== | ||
+ | |||
+ | ===== CLI Tips + Tricks ===== | ||
+ | |||
+ | ==== Pretty-Printing ==== | ||
+ | === Pretty-Print JSON from a file ... === | ||
+ | <code>cat unformatted.json | python -m json.tool</code> | ||
+ | === Pretty-Print JSON from the clipboard ... === | ||
+ | <code>pbpaste | python -m json.tool</code> | ||
+ | === Pretty-Print XML from the clipboard ... === | ||
+ | <code>pbpaste | xmllint --format -</code> | ||
+ | |||
+ | ===== Desktop/GUI Tips + Tricks ===== | ||
+ | ==== Resize a window to 1920x1080 ==== | ||
+ | Open ''Applications'' -> ''Utilities'' -> ''Script Editor'', paste this, and hit the play button: | ||
+ | <code> | ||
+ | tell application "Firefox" | ||
+ | activate | ||
+ | set the bounds of the first window to {100,100,2020,1180} | ||
+ | end tell | ||
+ | </code> | ||