Skip to content

Instantly share code, notes, and snippets.

@zymr-keshav
Created September 15, 2017 04:27
Show Gist options
  • Save zymr-keshav/ab1b869f2dca16c9958fe717dcec6501 to your computer and use it in GitHub Desktop.
Save zymr-keshav/ab1b869f2dca16c9958fe717dcec6501 to your computer and use it in GitHub Desktop.
useful tweaks and tip while switching from ubuntu to macOS x

MacOS Sierra 10.12.5 Macbook Pro ( Ratina )

Ubuntu to Mac os.

  1. You can not create new file from context menu but can create new folder only. alternative: use touch filename
  2. No utility to lock the monitor alternative: a. Navigate to  icon --> System Prefrences --> Security & Privacy --> General --> Check Require Password immediately after sleep or screen saver starts b. hit Shift-Control-Power hold them down for two seconds, revoke by Spacebar
  3. No way to see hidden files in a folder. alternative: open terminal and run defaults write com.apple.Finder AppleShowAllFiles true and than killall Finder
  4. No way to see file system. alternative: go to Finder hit Command + Shift + H => open Home folder ( in Finder ) hit Shift + command + G ==> write location name
  5. Open in Terminal directly within folder utility missing alternative:  icon --> System Preferences --> Keyboard --> Shortcuts --> Services --> Enable "New Terminal at Folder" to check this ; suppose we have to open /opt/alpha/beta folder in terminal then Go back to the parent folder(alpha), select the relevant folder (beta), right click (context menu) --> Services --> Open Folder in Terminal
  6. brew instead of apt-get Install brew using below command in terminal /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"// Refrence http://brew.sh
  7. Unable to keep project open in Sublime-text-3 while we close all the files. alternative : use Shift +Q to close sublime completely. or install
  8. No shortcut to open terminal. alternative: command + spacebar and write Terminal ( minimize and right click on icon from dock and check Options > Keep in Dock)
  9. Title of Tab in terminal ( shortcut command + I and write tab Title ; but no way to close that panel using keyboard)
  10. no window maximize, if you click on maximize, it will span over the screen and hide the menu ( double tab on window will adjust according to screen width)
  11. window top bar can not adjusted within open window
  12. git installed but no autocomplete feature. alternative: install curl https://raw.githubusercontent.com/git/git/master/contrib/completion/git-completion.bash -o ~/.git-completion.bash added in ~/.bash_profile
     if [ -f ~/.git-completion.bash ]; then
      . ~/.git-completion.bash
     fi
  1. mouse scroll reverse Navigate to System Prefrences ( Apple icon) > Mouse > Uncheck Scoll Direction : Natural

  2. set function keys ( F1 F2 ) as normal  icon > System Prefrences ( Apple icon) > Keyboards > (last option) check F1.F2, etc.. keys as standard keys

  3. remove Siri Navigate to System Prefrences ( Apple icon) > Siri > Uncheck Enable Siri on right side panel

  4. backspace ( fn + delete )

  5. remove Notification of stocks Navigate to System Prefrences ( Apple icon) > Extensions > Today > uncheck Stock

  6. rename a file select File and Press Enter (return)

  7. make link for sublime so that it can be opened from terminal by hit subl sudo ln -s "/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl" /usr/local/bin/subl

  8. colorful terminal and git branch in terminal

# Git branch in prompt
parse_git_branch() {
    git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}

RED="\[\033[0;31m\]"
YELLOW="\[\033[1;33m\]"
GREEN="\[\033[0;32m\]"
BLUE="\[\033[1;34m\]"
LIGHT_RED="\[\033[1;31m\]"
LIGHT_GREEN="\[\033[1;32m\]"
WHITE="\[\033[1;37m\]"
LIGHT_GRAY="\[\033[0;37m\]"
COLOR_NONE="\[\e[0m\]"

export PS1="${GREEN}\u@${LIGHT_GRAY}\h:${LIGHT_RED}\w${LIGHT_GREEN}\$(parse_git_branch)${BLUE} $ "

if [ -f ~/.git-completion.bash ]; then
  . ~/.git-completion.bash
fi

export CLICOLOR=1
export LSCOLORS=ExFxBxDxCxegedabagacad
alias ls='ls -GFh'
  1. keybaord symbol list  icon --> System Preferences --> Keyboard > Modifier Keys ⌘ = Command ⇧ = Shift ⌥ = Option (a.k.a. Alt) ⌃ = Ctrl ⎋ = Esc ↩︎ = Return ⌫ = Delete (a.k.a. Backspace)

  2. Keyboard shortcuts

Command + Option + I => chrome developer tools

Command + Option + J => chrome developer tools console

  • Command + Shift + H = Home

  • Command + Shift + D = Desktop

  • Command + Shift + A = Application

  • Command + Shift + U = Utilities

  • Command + Shift + . = Toggle Hidden files

  • Command + , = Open Settings of any item/ panel

  • control + command + T => Add folder to sidebar (bookmark)

  • control + command + F => Maximize current active window

write subl . in terminal from the location of peoject folder to open project in sublime.

Version 10.10 Yosemite 10.11 EI Captian 10.12 Sierra

  1. when you click on a zip file and select Open; it will extract the zip into same folder.

  2. Remove entry from context menu

 icon --> System Preferences --> Keyboard --> Shortcuts --> Services > text > uncheck the un necesray item from context menu such as "Add to iTunes as a Spken Track"

  1. install XtraFinder for adding copy move and other feature in folder/file context menu

  2. brew install coreutils so that you can use linux command such as shuf, date but with prefix g ; so date is gdate and shuf -is gshuf

  3. mysql installation download and install ; it will set default password which will be displayed after succesfull installtion completion; note down now first make symbolic link for mysql to run from terminal

echo 'export PATH="$PATH:/usr/local/mysql/bin"' >> ~/.profile
source ~/.profile

$: mysql -u root -p

change default password

mysql>

SET PASSWORD FOR 'root'@'localhost' = PASSWORD('new_password'); Query OK, 0 rows affected, 1 warning

exit;

now you can access with your password

. mysql start stop restart

sudo /usr/local/mysql/support-files/mysql.server start/stop/restart

Or you can set alias to mysql alias mysql=/usr/local/mysql/bin/mysql and then run below query $: mysql -u root -p Enter Password:

@zymr-keshav
Copy link
Author

zymr-keshav commented Dec 6, 2017

write in .bash_profile

pman () {
    man -t "${1}" | open -f -a /Applications/Preview.app
}

and

now see man page in Preview App
for eg:

~: pman date

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment