Skip to content

Instantly share code, notes, and snippets.

@keithshep
Last active September 5, 2015 04:54
Show Gist options
  • Save keithshep/438303 to your computer and use it in GitHub Desktop.
Save keithshep/438303 to your computer and use it in GitHub Desktop.
OS X Specific Commands
To get rid of shadows in screen captures:
defaults write com.apple.screencapture disable-shadow -bool true
To manipulate file attributes use xattr:
usage: xattr [-l] file [file ...]
xattr -p [-l] attr_name file [file ...]
xattr -w attr_name attr_value file [file ...]
xattr -d attr_name file [file ...]
The first form lists the names of all xattrs on the given file(s).
The second form (-p) prints the value of the xattr attr_name.
The third form (-w) sets the value of the xattr attr_name to attr_value.
The fourth form (-d) deletes the xattr attr_name.
options:
-h: print this help
-l: print long format (attr_name: attr_value)
Build 64bit GSL on OS X:
CPPFLAGS="-arch x86_64" LDFLAGS="-arch x86_64" ./configure --prefix=/Users/kss/local && make && make install
http://stackoverflow.com/questions/3377147/on-os-x-how-do-i-find-out-what-architecture-a-shared-lib-is-compiled-for
To start python in 64-bit mode
arch -x86_64 python3
GUI diff on mac:
* use "filemerge" from spotlight
* use "opendiff" from terminal
* to use with git do something like `git difftool -t opendiff #hash filename`
== When "locate" I get the following error message: ==
WARNING: The locate database (/var/db/locate.database) does not exist.
To create the database, run the following command:
sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.locate.plist
Please be aware that the database can take some time to generate; once
the database has been created, this message will no longer appear.
== To Install homebrew in ~/bin ==
cd ~/bin
mkdir homebrew && curl -L https://github.com/mxcl/homebrew/tarball/master | tar xz --strip 1 -C homebrew
ln -s homebrew/bin/brew
== To uninstall homebrew ==
follow http://superuser.com/questions/203707/how-to-uninstall-homebrew-osx-package-manager
== finding arch of library file ==
you could use `file`, `otool`, or `lipo`
lipo -info /usr/lib/libiodbc.a
== building/installing/compiling with opencv ==
cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/Users/keith/bin/opencv-2.4.5-bin -D BUILD_PYTHON_SUPPORT=ON ..
make
make install
# then from the examples dir
PKG_CONFIG_PATH=/Users/keith/bin/opencv-2.4.5-bin/lib/pkgconfig ./build_all.sh
DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:/Users/keith/bin/opencv-2.4.5-bin/lib/ ./morphology
== for building emgu ==
# NOTE: so far this fails because I can't get a 32bit ffmpeg
# mostly based on http://www.emgu.com/wiki/index.php/Download_And_Installation#OSX with minor mod:
cmake \
-DCMAKE_OSX_ARCHITECTURES=i386 \
-DBUILD_NEW_PYTHON_SUPPORT:BOOL=FALSE \
-DBUILD_PERF_TESTS=FALSE \
-DBUILD_TESTS:BOOL=FALSE \
-DBUILD_DOCS:BOOL=FALSE \
-DBUILD_JPEG=TRUE \
-DBUILD_PNG=TRUE \
-DBUILD_TIFF=TRUE \
-DFFMPEG_INCLUDE_DIR=/Users/keith/bin/homebrew/Cellar/ffmpeg/1.1/include/ \
.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment