Posts

Apple Mail does not search

 Apple mail searches using "Envelope Index" database files. These are located in  ~/Library/Mail/V#/MailData where # is some number. 1. Quit mail 2. In the Terminal, just type: find ~/Library/Mail/V?/MailData -name "Envelope Index*" -delete 3. Re-open mail. It should re-index.

Force Mac OS X 10.13 to install

 These days when you download the 10.13 installer ( https://apps.apple.com/us/app/macos-high-sierra/id1246284741?mt=12 ) it complains that the installer is corrupted or broken and won't install. Really what has happened is Apple doesn't sign the installer anymore and so the certificate is invalid. However, certificates are date-sensitive. So, simply unplug your target machine from internet so that it doesn't automatically talk to Apple or reset its date/time, and set the time manually like so. Make sure the installer has quit first. 1. Open Terminal 2. Type:     date -s  0711141518 or any other date in 2018 or earlier.  3. Open the installer again. You should now be able to install 10.13.

Enabling apache

Mac OS X used to have a sharing function which turned apache (webserver) on so you could make websites on your machine. However, they turned that off, for whatever unknown reason. To enable apache now, do the following. First, let's find out your username. Open /Applications/Utilities/Terminal.app It will come up with a terminal screen Type: whoami The machine will answer with your login name. Note what it is. Let's say it's " bob " for now. Now type: sudo vi /etc/apache2/httpd.conf This will start you off editing the apache webserver configuration file ( https://www.youtube.com/watch?v=dFUlAQZB9Ng ). Yes, this is a unix machine. The way you edit it is not by mousing, contrary to what we see in Jurassic Park(tm), but by typing in and editing text files. To search for the necessary lines, type a forward-slash (/) Type what you want to search for, in this case, php . Press enter after typing php as the search. You will find a line like this: #LoadModule php7_modul

Dropbox never finishes spinning

If Dropbox never finishes spinning on your Mac, it means there are some files it can't transfer, or is repeatedly transferring.  Sometimes this is because your network is too slow and your files are too big. Maybe check that first. Generally, if you have files over 1 GB in size that you are trying to back up, you probably want to have over 50 Mbps network speed. If however it is not filesize that is the issue, in order of drasticness, try the following: 1. Rebuild privileges a. Click on the dropbox menu icon b. Click on your personal avatar/icon c. Click on Preferences d. Alt-click on Account e. It will bring up a bunch of buttons one of which is repair privileges. Click it. f. It will ask your admin password. Give it. Depending on how many files you have, this will take a few minutes. I have about 1m files (really) and it takes about 10 minutes. 2. Find and delete linkfiles a. Open a Terminal b. Type: cd ~/Dropbox ; find ./ -type l -delete where "l" is an ELL, not a One.

batch convert MOV files to mp4

 If like me you prefer to not have any MOV files due to their size, you want to convert them to mp4 video. #!/bin/sh # -r = frame rate # -f = output format # -i = input file name # -s = aspect ratio/frame size # -crf = constant rate factor # -pix_fmt yuv420p = quicktime compatible quality="" if [ "$1" == "-d" ] ; then echo "Downscaling quality to 480x360 at 15fps" quality="-r 20 -s 480x360" fi if [ "$1" == "-i" ] ; then echo "Downscaling for old iphone and similar" # for i in `/bin/ls` ; do ( echo $i ; ffmpeg -i $i -threads 0 -strict experimental -f mp4 -vcodec libx264 -vpre slow -vpre ipod640 -b 1200k -acodec aac -ab 160000 -ac 2 -s 480x320 iphone-$i ) ; done quality="-vpre slow -vpre ipod640 -b 1200k -acodec aac -ab 160000 -ac 2 -s 480x320" fi for i in `/bin/ls | grep .[mM][oO][vV]` ; do ( echo "Converting QuickTime file to MP4: "$i nn=`echo $i | sed -e s/\.[Mm][Oo][vV]/\

Remapping keys

Sometimes keys annoy you and you keep typing incorrectly, e.g. from being used to a Windows keyboard or similar. Plus CAPS LOCK is pointless. In my case I kept hitting right alt instead of right command. So I made right alt to also be a command key. hidutil property --set '{"UserKeyMapping":[{"HIDKeyboardModifierMappingSrc":0x7000000E6,"HIDKeyboardModifierMappingDst":0x7000000E7}]}' That's all it takes. List of keys here: https://developer.apple.com/library/archive/technotes/tn2450/_index.html#//apple_ref/doc/uid/DTS40017618-CH1-TNTAG8 Command syntax is here: https://developer.apple.com/library/archive/technotes/tn2450/_index.html

Erasing firmware password

Image
On some occasions, like myself, you may be forgetful, and forget what you set your bootup ("firmware") password to. Unfortunately for you, if you boot in recovery mode using Command-R, it still wants you to remember your original password to erase the old one.  The proper way to do this is to take the computer to Apple with proof of purchase and they will do it for you. However, if like me you only buy their much older machines due to their upgradability, you may find that you don't have proof that you bought it in an apple store, e.g. second hand, or you lost the proof years ago. So, how do you reset it? The answer unfortunately, is with great difficulty. This blog page tells you how. Please note that I disclaim responsibility for the below - if you blow up your Macbook it's your fault. Do not follow these instructions. I followed these: https://blog.wzhang.me/2017/10/29/removing-mac-firmware-password-without-going-to-apple.html However, they are not 100% clear on al