I’m wondering why Safari on my Mac always slower load on facebook.com, but fast in Google Chrome. I did set the DNS for my network to Google DNS 188.8.131.52 and 184.108.40.206 and it doesn’t help much.
facebook.com reverse the IP differently from different location, if your browser prefetching it, maybe slow down from the previous IP you get. So I tried to disable the DNS Prefetching using the Terminal.
defaults write com.apple.safari WebKitDNSPrefetchingEnabled -boolean false
If I want to re-enable again, I can run this in Terminal.
defaults delete com.apple.safari WebKitDNSPrefetchingEnabled
I feel that the loading speed is faster than before.
I need to find some string in all folders.
grep -rnw './folder/' -e "search-text"
- -r is recursive
- -n is line number
- -w stands match the whole word
You received error from the sed command in Mac, because the argument in mac is different.
If you type in Mac terminal, you may receive error like this
Justins-MacBook-Pro:2 juzhax$ sed -i 's/old_text/new_text/g' example.txt
sed: 1: "config.php": command c expects \ followed by text
The first argument should be the extension of the backup file. The correct way is
Justins-MacBook-Pro:2 juzhax$ sed -i '.bak' 's/old_text/new_text/g' example.txt
Justins-MacBook-Pro:2 juzhax$ sed -i '.original' 's/old_text/new_text/g' example.txt
If you don’t want any backup file, you can do like this.
Justins-MacBook-Pro:2 juzhax$ sed -i '' 's/old_text/new_text/g' example.txt
Error: invalid object in plist for destination format
When you convert the .plist file to json, you could see this problem
plutil -convert json -e json ./filename.plist
./filename.plist: invalid object in plist for destination format
Remove the key and date using any editor, then re convert again.