macOS

copy paste json pretty print

in terminal
pbpaste | json_pp | pbcopy

Spotlight

problems with indexing , not indexing, stopped indexing.

1)

  • Enable Indexing – sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.metadata.mds.plist
  • Disable Indexing – sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.metadata.mds.plist

2)
Open Terminal
Type - not copy! - the following but wait a few second between them:

sudo mdutil -i off /
sudo mdutil -i on /
sudo mdutil -E /

If, after a few minutes, Spotlight is still not indexing, try running this command, followed by the three commands above:
sudo rm -rf /.Spotlight-V100

apps at startup

search for folders

Hard Drive/Library/LaunchAgents

Hard Drive/Library/LaunchDaemons

Tags: 

Crashreports turn on off

turn off crash reports

launchctl unload -w /System/Library/LaunchAgents/com.apple.ReportCrash.plist
sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.ReportCrash.Root.plist

turn on

launchctl load -w /System/Library/LaunchAgents/com.apple.ReportCrash.plist
sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.ReportCrash.Root.plist
Tags: 

versions & beyond compare

/Users/hjhubeek/Library/Application Support/Versions/Compare Scripts

on run argv
set original_path to (item 1 of argv)
set modified_path to (item 3 of argv)
do shell script "/usr/local/bin/bcomp \"" & original_path & "\" \"" & modified_path & "\""
end run

in contents/resources of the Versions.app

in compareTools.plist
add to array of applications

<dict>
<key>Name</key>
<string>Beyond Compare</string>
<key>Type</key>
<string>ApplicationBinary</string>
<key>Path</key>
<string>BCompare.sh</string>
<key>Application</key>
<string>Beyond Compare</string>
</dict>

create file Compare.sh
#!/bin/bash

export PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin

FILEMERGE=`/usr/local/bin/bcomp`
if [ ! -e "$FILEMERGE" ]; then
FILEMERGE=/usr/local/bin/bcomp
fi

if [ ! -e "$FILEMERGE" ]; then
FILEMERGE=/usr/local/bin/bcomp
fi

if [ ! -e "$FILEMERGE" ]; then
echo "The FileMerge tool opendiff could not be located. Please install Xcode Tools from the Apple Developer website." >&2
exit 1
fi

if [ -n "$3" ]; then
"$FILEMERGE" "$1" "$2" -merge "$3"
else
"$FILEMERGE" "$1" "$2"
fi

# on run argv
#   set original_path to (item 1 of argv)
#   set modified_path to (item 3 of argv)
#   do shell script "/usr/local/bin/bcomp "" & original_path & "" "" & modified_path & """
# end run

avoid errors
#!/bin/sh
IFS=
bcompare "$6" "$7" -title1="$3" -title2="$5" -readonly
case $? in
'0','1','2')
exit 0
;;
'11','13','14')
exit 1
;;
'12')
echo "Important error???"
exit $?
;;
'*')
exit $?
;;
esac

Tags: 
Subscribe to RSS - macOS