Skip to content

Instantly share code, notes, and snippets.

@mohanraj-r
Last active January 26, 2019 20:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mohanraj-r/047fd71d44f0e2bd28ff053938cfea4f to your computer and use it in GitHub Desktop.
Save mohanraj-r/047fd71d44f0e2bd28ff053938cfea4f to your computer and use it in GitHub Desktop.
[osx utils] osx related solutions #shell #reference #osx
# add self-signed cert to keychain (used by Chrome etc)
# Get the self-signed cert file by clicking on the lock icon in chrome and dragging it to desktop
# http://www.robpeck.com/2010/10/google-chrome-mac-os-x-and-self-signed-ssl-certificates/
sudo security add-trusted-cert -d -r trustRoot -k /Library/Keychains/System.keychain <self-signed cert>
# ldd equivalent
# https://discussions.apple.com/thread/309193?start=0&tstart=0
otool -L <bin>
# clipboard opy/paste
# http://blog.rogeriopvl.com/archives/copy-to-clipboard-from-terminal-in-os-x/
cat <foo.txt> | pbcopy
pbpaste > <bar.txt>
# concat PDFs
cd /usr/local/bin
sudo ln "/System/Library/Automator/Combine PDF Pages.action/Contents/Resources/join.py" pdfjoin
pdfjoin -o PATH/TO/YOUR/MERGED/FILE.pdf /PATH/TO/ORIGINAL/1.pdf /PATH/TO/ANOTHER/2.pdf /PATH/TO/A/WHOLE/DIR/*.pdf
## write iso files
## https://apple.stackexchange.com/a/100458
diskutil list
# then insert your usb stick and run diskutil list again to see the disk node (e.g. /dev/disk2).
diskutil unmountDisk /dev/diskN
sudo dd if=/path-to.iso of=/dev/rdiskN bs=1m (or bs=1M with homebrew)
# While dd is running, press Ctrl-T to see its progress
diskutil eject /dev/diskN
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment