vim ~/.bash_profile
alias rn=’react-native’
Category: Mac
Capturing screenshots on macOS is very slow
Need to do both things below to fix it.
Disable Finder Extensions
1. Go into System Preferences > Extensions
2. In the left sidebar, choose “Finder”
3 Disable everything there include Google Drive Extension
Disable Show Floating Thumbnail
1. Press CMD + SHIFT + 5
2. Click Options
3. Uncheck Show Floating Thumbnail
Capturing screenshot is slow in Mac OS
Solution:
1. Go to System Preferences
2. Open Extensions
3. Choose Finder in the left sidebar
4. Disable Google Drive extension
Set shortcut to create new file in finder
1. Open Automator and create a Service;
2. Set the input to no input, and the application to Finder.app;
3. Drag and Drop the Run AppleScript workflow element onto the grey space;
4. Put the contents of this AppleScript in the textbox;
5. Save the workflow with a reasonable name (like New File);
6. Go to Settings -> Keyboard -> Shortcuts -> Services and assign a shortcut to it.
set file_name to "untitled" set file_ext to ".txt" set is_desktop to false -- get folder path and if we are in desktop (no folder opened) try tell application "Finder" set this_folder to (folder of the front Finder window) as alias end tell on error -- no open folder windows set this_folder to path to desktop folder as alias set is_desktop to true end try -- get the new file name (do not override an already existing file) tell application "System Events" set file_list to get the name of every disk item of this_folder end tell set new_file to file_name & file_ext set x to 1 repeat if new_file is in file_list then set new_file to file_name & " " & x & file_ext set x to x + 1 else exit repeat end if end repeat -- create and select the new file tell application "Finder" activate set the_file to make new file at folder this_folder with properties {name:new_file} if is_desktop is false then reveal the_file else select window of desktop set selection to the_file delay 0.1 end if end tell -- press enter (rename) tell application "System Events" tell process "Finder" keystroke return end tell end tell
Reference: https://apple.stackexchange.com/questions/129699/create-a-new-txt-file-in-finder-keyboard-shortcut
Disable Auto Start for Android File Transfer
1. Close Android File Transfer
2. Open Activity Monitor and kill “Android File Transfer Agent”
3. Go to /Applications/Android File Transfer.app
4. Click and select “Show package contents”
5. Go to Contents/Resources
6. Rename “Android File Transfer Agent” to “Android File Transfer Agent_DISABLED”
7. Open terminal and rename“/Users/username/Library/Application Support/Google/Android File Transfer” to Android File Transfer Agent_DISABLED.
Reference: https://gist.github.com/zeroseis/ce66d4c6b776577442a6
Unable to run mysql in terminal using ampps
Solution:
vim ~/.bash_profile
export PATH=$PATH:/Applications/AMPPS/mysql/bin
Reference:
http://stackoverflow.com/questions/13892904/how-do-i-access-mysql-from-mac-terminal-using-xampp
Puttygen on MAC
puttygen privatekey.ppk -O private-openssh -o privatekey.pem
Useful MAC Applications
- Tuxera Disk Manager
- Ampps
- XtraFinder
- TinkerTool
- BetterTouchTool / MagicPrefs
- HyperDock
- ubar
You don’t have permission to access / on this server.
Problem: Received the error “You don’t have permission to access / on this server.” when you try to setup Apache virtual host on Mac OS.
Solution: Add the below line to httpd-vhosts.conf
<Directory “/Users/uiroshan/development/php”>Options Indexes FollowSymLinks MultiViewsAllowOverride AllOrder allow,denyAllow from all</Directory><Directory “…”>
Options Indexes FollowSymLinks MultiViews
</Directory>
chkconfig Equivalent on Mac OS X
On Linux: chkconfig httpd on
On Mac: sudo launchctl load -w /System/Library/LaunchDaemons/org.apache.httpd.plist
On Linux: chkconfig httpd off
On Mac: sudo launchctl unload -w /System/Library/LaunchDaemons/org.apache.httpd.plist