https://appleid.apple.com mlubinsky@hotmail.com
https://monosnap.com/en/page/download/mac
http://sourabhbajaj.com/mac-setup/
https://github.com/adamisntdead/CleanMacSetup/blob/master/setup.sh
https://github.com/sosedoff/lunchy-go
https://en.wikipedia.org/wiki/Launchd
http://osxdaily.com/2017/02/06/list-all-terminal-commands-mac/
http://www.mitchchn.me/2014/os-x-terminal/
disk space
brew install Caskroom/cask/disk-inventory-x
https://www.omnigroup.com/more
http://grandperspectiv.sourceforge.net/
clang++ --version or clang --version
Apple LLVM version 6.0 (clang-600.0.56) (based on LLVM 3.5svn)
Target: x86_64-apple-darwin14.1.0
Thread model: posix
mlubinsky$ gcc --version or g++ --version
Configured with: --prefix=/Library/Developer/CommandLineTools/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 6.0 (clang-600.0.56) (based on LLVM 3.5svn)
Target: x86_64-apple-darwin14.1.0
Thread model: posix
cat hello.c
#include <stdio.h>
int main()
{
printf("Hello, World!\n");
return 0;
}
make hello
./hello
Oracle client: http://www.macsequel.com/
C++ on Mac
http://www.xoltar.org/posts/2016-04-21-mac-os-x-native/index.html
http://www.xoltar.org/posts/2016-05-03-mac-os-x-native-2/index.html
https://johnwickerson.wordpress.com/2013/10/31/some-useful-and-free-mac-apps/
To save screenshot to the Clipboard : Command-Shift-Control-4
http://osxdaily.com/2016/04/29/best-disk-storage-analyzers-mac/
diff tool for mac: meld
https://github.com/yousseb/meld/releases/
http://www.alexkras.com/how-to-run-meld-on-mac-os-x-yosemite-without-homebrew-macports-or-think/
https://habrahabr.ru/post/277189/ compile XBoost under Mac
http://zipzapmac.com/go2shell
http://geoff.greer.fm/2015/12/25/fsevents-tools-watch-a-directory-for-changes/ monitoring file change ( inotify)
http://osxdaily.com/2016/01/17/empty-cache-safari-mac-os-x/
Automator
https://news.ycombinator.com/item?id=11859980
https://gist.github.com/eirikb/c189a7d8406b2897dad0e86086be1b23
SMS
http://computer.howstuffworks.com/e-mail-messaging/how-to-send-text-messages-computer.htm
Sure, you can edit your `.profile` or `.bashrc` or `.zhsrc`, but those settings do not carry over to your GUI applications, like the IDEs I am used to.
Applications are spawned by launchd, which is why changing shell environments doesn't get propagated to GUI apps. Use:
launchctl setenv MYVAR myval
to change the launchd environment and those of the launched apps
https://news.ycombinator.com/item?id=10143143
http://www.mitchchn.me/2014/os-x-terminal/
http://lenta.ru/articles/2015/09/30/elcapitan/ El Capitan
Homebrew
http://blog.jpalardy.com/posts/untangling-your-homebrew-dependencies/
https://news.ycombinator.com/item?id=10309576
Homebrew installs in /usr/local
http://octavore.com/posts/2016/02/15/distributing-go-apps-os-x
brew list
gdbm git libevent mongodb node openssl pkg-config python readline sqlite tmux tree
ls /usr/local/Cellar/
gdbm git libevent mongodb openssl pkg-config python readline sqlite tmux tree
http://robots.thoughtbot.com/starting-and-stopping-background-services-with-homebrew
https://webmailnew.apple.com Apple mail
https://idmsa.apple.com/IDMSWebAuth/authenticate Apple ID
http://developingandmac.blogspot.com/2015/05/mac-setup-for-web-development.html
http://carlosbecker.com/posts/first-steps-with-mac-os-x-as-a-developer/
>>> import sys
>>> print sys.path
['', '/usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pip-1.5.4-py2.7.egg',
'/Library/Python/2.7/site-packages/pip-1.5.1-py2.7.egg',
'/usr/local/lib/python2.7/site-packages/pip-1.5.4-py2.7.egg', '/usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python27.zip', '/usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7', '/usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-darwin', '/usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac', '/usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac/lib-scriptpackages', '/usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-tk', '/usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-old', '/usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload',
'/Library/Python/2.7/site-packages',
'/usr/local/lib/python2.7/site-packages']
pip install bokeh
Successfully installed bokeh pytz six pygments pystache markdown pyzmq tornado colorama websocket numpy pandas certifi backports.ssl-match-hostname
http://www.alexeberts.com/efficient-text-editing-macos/
http://www.sequelpro.com/ DB GUI
http://nano.sapegin.ru/all/show-gui-dialog-from-shell
https://news.ycombinator.com/item?id=9213256
http://arhipov.blogspot.com/2015/03/packaging-java-application-for-mac-os.html
Export from MS Excel to csv
http://developmentality.wordpress.com/2010/12/06/excel-2008-for-macs-csv-bug/
tr '\15' '\n' < Workbook1.csv > fixed_wokbook1.csv
How to share folders between Mac and Windows
http://www.7tutorials.com/how-share-os-x-folders-windows-7
you can get Save As… back if you hold down the Option key.
you can have Save As back: System Preferences -> Keyboards -> Shortcuts -> App Shortcuts. Add a shortcut called "Save As..." with Command-Shift-S.
https://news.ycombinator.com/item?id=8402079
http://lapwinglabs.com/blog/hacker-guide-to-setting-up-your-mac
http://blog.no-panic.at/2014/10/17/modern-mac-development-setup-part-1/
Objective-C
http://www.mactech.com/articles/mactech/Vol.25/25.07/2507RoadtoCode-BradCoxInterview/index.html
Small utilities
http://inconsolation.wordpress.com/
Redis
http://redis.io/topics/quickstart
http://habrahabr.ru/post/240787/
https://github.com/yahoo/redislite
https://github.com/no13bus/redispapa
brew install redis
To have launchd start redis at login:
ln -sfv /usr/local/opt/redis/*.plist ~/Library/LaunchAgents
Then to load redis now:
launchctl load ~/Library/LaunchAgents/homebrew.mxcl.redis.plist
Or, if you don't want/need launchctl, you can just run:
redis-server /usr/local/etc/redis.conf
SWIFT
https://developer.apple.com/swift/blog/
http://thechangelog.com/all-the-swift-things/
http://gizmodo.com/5952938/everything-you-need-to-know-about-batteries
http://habrahabr.ru/company/yotadevices/blog/228159/ translation
PRINT from iPad
http://www.computerra.ru/103716/5-sposobov-raspechatat-dokumentyi-i-fotografii-s-iphone-i-ipad/
MacVim
http://blog.pangyanhan.com/posts/2013-12-13-vim-install-solarized-on-mac-os-x.html
http://www.derlien.com/ disk space viewer
Window Managers
https://usepanda.com/blog/slate-review/ SLATE
http://apple.stackexchange.com/questions/9659/what-window-management-options-exist-for-os-x
https://news.ycombinator.com/item?id=7982514
https://news.ycombinator.com/item?id=8768022
Command line
http://mattgemmell.com/mac-keyboard-shortcuts/
http://www.mitchchn.me/2014/os-x-terminal/
https://news.ycombinator.com/item?id=7747982
https://github.com/mathiasbynens/dotfiles/blob/master/.osx
http://fonnesbeck.github.io/ScipySuperpack/
http://www.pyrosoft.co.uk/blog/2013/01/09/creating-a-bootable-usb-stick-from-osx/
Right-click (or control-click) the application in question and choose "Open"
CoRD- remote desktop client for Windows:
http://cord.sourceforge.net
https://github.com/Homebrew/homebrew/wiki/Homebrew-and-Python
ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go)"
export PATH=/usr/local/bin:/usr/local/sbin:$PATH
brew install python
export PATH=/usr/local/share/python:$PATH
brew install pyenv
pyenv lets you easily switch between multiple versions of Python
/usr/local/Cellar/python/2.7.6/bin/python
https://github.com/jimbojsb/launchrocket/releases
http://hackercodex.com/guide/python-development-environment-on-mac-osx/
http://jakevdp.github.io/blog/2013/02/02/setting-up-a-mac-for-python-development/
brew info python
python: stable 2.7.6 (bottled), HEAD
http://www.python.org
/usr/local/Cellar/python/2.7.6 (5225 files, 80M)
Built from source
/usr/local/Cellar/python/2.7.6_1 (4907 files, 80M)
Poured from bottle
From: https://github.com/Homebrew/homebrew/commits/master/Library/Formula/python.rb
==> Dependencies
Build: pkg-config ✔
Required: openssl ✔
Recommended: readline ✔, sqlite ✔, gdbm ✔
==> Options
--quicktest
Run `make quicktest` after the build (for devs; may fail)
--universal
Build a universal binary
--with-brewed-tk
Use Homebrew's Tk (has optional Cocoa and threads support)
--with-dtrace
Experimental DTrace support (http://bugs.python.org/issue13405)
--with-poll
Enable select.poll, which is not fully implemented on OS X (http://bugs.python.org/issue5154)
--without-gdbm
Build without gdbm support
--without-readline
Build without readline support
--without-sqlite
Build without sqlite support
--HEAD
install HEAD version
==> Caveats
Setuptools and Pip have been installed. To update them
pip install --upgrade setuptools
pip install --upgrade pip
You can install Python packages with
pip install <package>
They will install into the site-package directory
/usr/local/lib/python2.7/site-packages
See: https://github.com/Homebrew/homebrew/wiki/Homebrew-and-Python
.app bundles were installed.
Run `brew linkapps` to symlink these to /Applications.
brew install mysql
We've installed your MySQL database without a root password. To secure it run:
mysql_secure_installation
mysql_upgrade -u root -p
mysql.server restart
To connect run:
mysql -uroot
To have launchd start mysql now and restart at login:
brew services start mysql
Or, if you don't want/need a background service you can just run:
mysql.server start
alias mysql.start="sudo /usr/local/mysql/support-files/mysql.server start"
alias mysql.stop="sudo /usr/local/mysql/support-files/mysql.server stop"
alias mysql.restart="sudo /usr/local/mysql/support-files/mysql.server restart"
alias mysql.status="sudo /usr/local/mysql/support-files/mysql.server status"
mlubinsky$ ls /usr/local/lib/python2.7/site-packages
Crypto ansible itsdangerous.py requests-2.0.1-py2.7.egg-info
Flask-0.10.1-py2.7.egg-info ansible-1.4.4-py2.7.egg-info itsdangerous.pyc setuptools-3.4.1-py2.7.egg
Flask_Restless-0.12.0-py2.7.egg-info bson jinja2 setuptools.pth
Flask_SQLAlchemy-1.0-py2.7.egg-info dateutil markupsafe sitecustomize.py
Glances-1.7.4-py2.7.egg-info easy-install.pth mysql sitecustomize.pyc
Jinja2-2.7.1-py2.7.egg-info ecdsa mysql_connector_python-1.1.6-py2.7.egg-info six-1.4.1-py2.7.egg-info
MarkupSafe-0.18-py2.7.egg-info ecdsa-0.10-py2.7.egg-info paramiko six.py
MySQL_python-1.2.5-py2.7.egg-info flask paramiko-1.12.1-py2.7.egg-info six.pyc
MySQLdb flask_restless pip-1.4.1-py2.7.egg sqlalchemy
PyYAML-3.10-py2.7.egg-info flask_sqlalchemy pip-1.5.4-py2.7.egg virtualenv-1.11.2-py2.7.egg-info
SQLAlchemy-0.8.3-py2.7.egg-info glances psutil virtualenv.py
Werkzeug-0.9.4-py2.7.egg-info gridfs psutil-1.2.1-py2.7.egg-info virtualenv.pyc
_mysql.so gunicorn pycrypto-2.6.1-py2.7.egg-info virtualenv_support
_mysql_exceptions.py gunicorn-18.0-py2.7.egg-info pymongo werkzeug
_mysql_exceptions.pyc httplib2 pymongo-2.6.3-py2.7.egg-info yaml
_psutil_osx.so httplib2-0.8-py2.7.egg-info python_dateutil-2.2-py2.7.egg-info
_psutil_posix.so itsdangerous-0.23-py2.7.egg-info requests
Find Files
http://apps.tempel.org/FindAnyFile/
https://github.com/paulirish/dotfiles
http://barryclark.co/creating-bashstrap/
http://habrahabr.ru/hub/macosx/
http://www.keyxl.com/aaa1f76/48/Apple-Mac-OS-X-OSX-keyboard-shortcuts.htm
To turn off or stop services from starting up every time your machine starts look in the following folders:
/Library/LaunchAgents
/Library/LaunchDaemons
/Library/StartupItems
C++
http://solarianprogrammer.com/2013/06/11/compiling-gcc-mac-os-x/
MySQL
http://stackoverflow.com/questions/25954230/mysql-does-not-start-in-osx-yosemite-10-10
2. Homebrew will download MySQL and install it on your machine automatically.
3. To auto start MySQL upon booting your Mac, type in the commands below.
$ brew install mysql
$ sudo chmod -R 755 /usr/local/var/mysql
$ rm -Rf /usr/local/var/mysql/Your-Machine-Name.local.err
$ mkdir -p ~/Library/LaunchAgents
$ ln -sfv /usr/local/opt/mysql/*.plist ~/Library/LaunchAgents
$ launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist
$ mysql.server start
4. Start your MySQL Server by typing the following command:
You now have MySQL installed and running on your machine. In case you get any error when starting your MySQL Server i.e. ERROR! The server quit without updating PID file, you may refer to the steps below.
sudo /usr/local/mysql/support-files/mysql.server start
sudo /usr/local/mysql/support-files/mysql.server stop
sudo /usr/local/mysql/support-files/mysql.server restart
Fixing Errors
If you get any error when starting MySQL, you should open Finder and go to (Command + Shift + G) /usr/local/var/mysql and open the file name ending in .err (e.g. Your-Machine-Name.local.err) in your preferred text editor. It will contain the details about the error encountered by MySQL when starting. As for me, I encountered an error saying, “ERROR! The server quit without updating PID file”. I have found out that this is a permission error on the folder /usr/local/var/mysql. Here is how to fix it:
1. Open the Terminal again and type the commands below:
2. After doing this, you can type “mysql.server start” again to start MySQL again.
Securing your MySQL installation
It is always recommended to secure your MySQL installation. To do this, type the following on your Terminal:
$ mysql_secure_installation
Set root password? [Y/n] Y
Remove anonymous users? [Y/n] Y
Disallow root login remotely? [Y/n] Y
Remove test database and access to it? [Y/n] Y
Reload privilege tables now? [Y/n] Y
$ brew remove mysql
$ brew cleanup
$ launchctl unload -w ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist
$ rm -Rf ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist
brew install mysql
==> Caveats
A "/etc/my.cnf" from another install may interfere with a Homebrew-built
server starting up correctly.
To connect:
mysql -uroot
To have launchd start mysql at login:
ln -sfv /usr/local/opt/mysql/*.plist ~/Library/LaunchAgents
Then to load mysql now:
launchctl load ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist
Or, if you don't want/need launchctl, you can just run:
mysql.server start
==> /usr/local/Cellar/mysql/5.6.17_1/bin/mysql_install_db --verbose --user=mlubinsky --basedir=/usr/local/Cellar/mysql/5.6.17_1 --datadir=/usr/local/var/mysql --tmpdir=/tmp
MySql + Apache + PHP
http://habrahabr.ru/post/217245/
http://www.journaldev.com/1456/how-to-install-apache-php-and-mysql-on-mac-os-x
MAMP
http://documentation.mamp.info/en/mamp/preferences/apache
iTerm2
http://chris-schmitz.com/develop-faster-with-iterm-profiles-and-window-arrangements/
https://news.ycombinator.com/item?id=8035022
The killer feature for me is split panes. Using a large screen like the iMac 27"s we have it's great to have iTerm2 fullscreened and then split the screen into vertical CMD-D and horizontal CMD-SHIFT-D splits. I like to use one pane for vim, one for rails console, one for bash, etc. Use CMD-W to close a pane. Right-clicking will give you an option to move a pane around which is actually fun #iamnerd.
One press of CMD-Enter and just that pane gets fullscreened (especially useful when iTerm2 itself is not running as fullscreen). Press CMD-Enter again to return to the previous state.
Unfortunately, iTerm2 to my liking isn't set up properly when you first install it. You have to customize a few things. My first customization is setting up CMD-ALT-ENTER to always bring up or hide the terminal. No more ALT-TABbing around just press it and it's there. Seems pointless but will save you a ton of time in the long run.
I also set up keys for moving from window to window. I use CMD-[arrows] for switching from window to window. You can still use CMD-SHIFT [|] (left and right brackets) but it's pretty weird because it tracks which windows were opened first and not the order on the screen which is not intuitive.
Mostly importantly, you need to set up new windows to open in the folder of the previous window. Not sure why that's not the default but whatever... Then you can open a new split it's already in the correct folder. This makes it really quick to be in the middle of a command, make a new pane, run a new command (or queue a new command for later) and then close it when it's done.
We have different apps that we run, so I use multiple tabs for that. One project, one tab. Then I split panes for a rails console, an rspec screen, etc. CMD-1, CMD-2 to switch between projects.
In iTerm2 preferences, click on the "Keys" tab. In the bottom left, under "Hotkey", check "Show/hide iTerm2 with a system-wide hotkey" and assign the hotkey you'd like to use.
Check the "Hotkey toggles a dedicated window with profile:" option and choose "Hotkey Window" in the popup menu below (should be selected by default).
With default settings, the Hotkey Profile window will stretch across the top of the screen, and the hotkey will drop the window down from the top, complete with animation.
You can customize the settings for the "Hotkey Window" profile under the "Profiles" tab.
Git for Mac
http://git-scm.com/download/mac
http://sourceforge.net/projects/git-osx-installer/files/latest/download
https://code.google.com/p/git-osx-installer/
$ls /usr/local/
bin git lib share
$which git
/usr/bin/git # this is not good - this is XCode's git!
Below we are using blue for files and green for directories. When Mac OS starts up it loads the following in order:
/etc/paths
/etc/paths.d
~/.MacOSX/environment.plist
When you open a new terminal session/window on a mac it loads bash by default, which in turn reads the following in order (adding to whatever was loaded at start up – the aforementioned):
/etc/profile
~/.bash_profile
~/.bash_login (if the previous does not exist)
~/.profile (if the previous does not exist)
What goes in “~/.bash_profile” actually sets the environmental variables (including paths) for whatever user invoked bash, which is handy if you want to set paths specific for users; however, if you ever modified/added to your paths then you probably did so intending it to be system wide. In which case you’d want to add it to this file “/etc/paths” …whose contents typically look like:
/usr/bin
/bin
/usr/sbin
/sbin
/usr/local/bin
Don’t get me wrong, you can modify/add to anything along the “hierarchy of loading environmental variables/paths” like in the “/etc/paths.d” but to keep things simple I’d opt to just edit “/etc/paths.”
http://stackoverflow.com/questions/9832770/where-is-the-default-terminal-path-located-on-mac
edit your ~/.profile or ~/.bash_profile with the following
$ cat /etc/paths
/usr/bin
/bin
/usr/sbin
/sbin
/usr/local/bin
$ cat ~/.profile
$ cat /etc/profile
# System-wide .profile for sh(1)
if [ -x /usr/libexec/path_helper ]; then
eval `/usr/libexec/path_helper -s`
fi
if [ "${BASH-no}" != "no" ]; then
[ -r /etc/bashrc ] && . /etc/bashrc
fi
/etc/paths and /etc/paths.d - it become part of your PATH variable
vi
export PATH=$PATH:/new/dir/location1
PATH=/usr/local/git/bin:$PATH
export PATH
http://superuser.com/questions/666086/install-git-under-osx-mavericks
http://stackoverflow.com/questions/19887445/cannot-use-git-from-terminal
http://mac.github.com/ GitHub for Mac
SSHPASS
Web Development
http://mallinson.ca/post/osx-web-development/
http://mallinson.ca/post/web-development-with-mavericks/
http://danielkoskinen.com/setup-part-2-web-development/
Terminal
https://news.ycombinator.com/item?id=7051091
http://apple.stackexchange.com/questions/5435/got-any-tips-or-tricks-for-terminal-in-mac-os-x
Keyboard short cuts
The spacebar to page down, shift spacebar to page up
Use two fingers on your trackpad.
fn+up = page up
fn+down = page-down
fn+left = top
fb+right = bottom
fn+shift+up = page up
fn+shift+down = page down
fn+up = scroll up } These will be the same in
fn+down = scroll down } some programs, but not all
Google Chrome shortcuts
Tabs and windows
⌘+T opens a new tab
⌘+W closes the current tab
⌘+shift+T opens the last tab you closed (Chrome remembers the last ten tabs you had open)
⌘+alt+left and ⌘+alt+right move left and right along your open tabs
⌘+H hides Chrome
Navigation
⌘+L jumps to the address bar
⌘+alt+F jumps to the address bar and prefixes a ‘?’ so that whatever text you enter will be interpreted as a Google search (on Windows you can do this by pressing ⌘-K – I wonder why it’s more complicated on a Mac?)
⌘+D bookmarks the current page
Webpage shortcuts
⌘+ and ⌘- change the zoom level of the page; use ⌘+0 (zero) to return to default zoom
⌘+F find text within the current page
⌘+E use the current highlight to find text within the page
Text editing
alt+left and alt+right move the cursor left and right by words
⌘+left and ⌘+right move the cursor to the beginning or end of the line
Hold down shift to highlight the characters that the cursor passes through.
3-rd party utils
https://news.ycombinator.com/item?id=7052311
http://brickftp.com/post/1970045-21-mac-apps-we-use-every-day?utm_source=hn
http://lifehacker.com/lifehacker-pack-for-mac-2013-our-list-of-the-best-mac-635303836
http://danielkoskinen.com/my-dev-setup-part-1-utilities/
http://www.smashingapps.com/2013/08/26/13-awesome-and-useful-mac-apps-for-developer.html
http://www.rockettheme.com/blog/75-mac/1693-essential-mac-apps-for-development-and-productivity
http://osxdaily.com/2013/10/31/use-network-utility-mac-os-x/
http://osxdaily.com/2013/11/01/install-java-os-x-mavericks/
http://osxdaily.com/2013/10/24/simple-tips-os-x-mavericks/
http://osxdaily.com/2013/10/30/connect-smb-nas-network-shares-os-x-mavericks/
http://osxdaily.com/2013/10/28/show-user-library-folder-os-x-mavericks/
http://apple.stackexchange.com/questions/12161/os-x-terminal-must-have-utilities
http://www.techendo.co/posts/how-to-learn-to-program-in-10-easy-steps