MacOS
Enable write support for NTFS on OS X Mavericks
Retrieve the UUID of the drive you want to write on
1 | $ diskutil info /Volumes/YourDriveName | grep UUID |
Edit the file /etc/fstab
1 | $ sudo vi /etc/fstab |
Add the following content
1 | UUID=22F1DF1C-AFDE-B507-A15B-FC9296BB2E2B none ntfs rw,auto,nobrowse |
Unmount the drive, and then remount. It should now writable.
Important NOTE
1 | It is also important that the HD has been safely removed, since NTFS contains a flag to notice if the disk was safely removed or not, not allowing to mount it in write mode with the native OSX driver (something similar happens under Linux). In case it happens you just need to plug it into a windows PC and safely remove the HD (so it cleans that flag). |
By neburim
Reference:
Enable write support for NTFS on macOS Sierra
Find your disk name
1 | $ ls -l /Volumes/ |
So in this case my external hard disk name is New Volume
Edit/Create the file /etc/fstab
1 | sudo vim /etc/fstab |
Add the following content
1 | LABEL=New\040Volume none ntfs rw,auto,nobrowse |
\040
is represent a
Now unmount it, and plug it back. It will appear in /Volume directory
Reference:
Missing Air Drop in Mountain Lion
Open up terminal
1 | $ defaults write com.apple.NetworkBrowser BrowseAllInterfaces 1 |
Reference:
Delete provisioning profile on XCode 5
Open up terminal
1 | $ cd ~/Library/MobileDevice/Provisioning\ Profiles |
See which one you want to delete (when you added the profile)
1 | $ rm 13C42BED-0555-4684-A905-5547B2293D46.mobileprovision |
Reference:
Install command line tools
in Xcode 5 & Mavericks
1 | $ xcode-select --install |
Reference:
Configure virtual host in XAMPP
1 | <VirtualHost web-local.mysite.com:80> // use <ServerName>:80 instead of *:80 |
Reference:
grep
with color
Add the following content to ~/.profile
1 | export GREP_OPTIONS='--color=always' |
Reference:
Terminal history not keeping
This is because of permission issue
1 | $ ls -l ~/.bash_history |
Simply change the owner
1 | $ sudo chown username ~/.bash_history |
Reference:
replace pattern with sed
I have already mention this in Linux section, but there is a small difference here. The command below will produce error
1 | $ sed -i "s/reload('#\(\w\+\)#&#\(\w\+\)#')/href='#\1#\&#\2#';/" /path/to/file |
Output
1 | sed: 1: "AbcFile.c": invalid command code A |
Here you have to add -e
option for OS X, e.g.
1 | $ sed -ie "s/reload('#\(\w\+\)#&#\(\w\+\)#')/href='#\1#\&#\2#';/" /path/to/file |
NOTE: You can either use -ie
or -i -e
Reference:
Batch resize image
1 | $ sips -Z 1024 *.png |
1024
is refer to width, the height will adjusted according to ratio
Reference:
Compress and split files
1 | $ tar -zcvf file.tar.gz file/* |
Reference:
Search and replace multiple files
1 | $ grep -R -l "special keyword" * | xargs sed -i "" 's/special keyword/new keyword/' |
grep -R -l "special keyword" *
- retrive all files that contains “special keyword”sed -i "" 's/special keyword/new keyword/'
- replace “special keyword” with “new keyword”
Reference:
Mission control not working
Restart it
1 | $ osascript -e 'quit application "Dock"' |
Reference:
Convert heic to jpg
1 | $ brew install imagemagick |
Reference:
Create Catalina iso file
1 | hdiutil create -o /tmp/Catalina -size 8500m -volname Catalina -layout SPUD -fs HFS+J |
Download create-catalina-iso.sh
Reference:
PhpStorm (ideavim) / VScode cursor not moving when holding on j
k
h
l
1 | $ defaults write com.jetbrains.PhpStorm ApplePressAndHoldEnabled -bool false |