Did you try Diskwarrior to repair the disk directory? It turned out to be a life saver many times for me.


Why is emptying the trash so much slower than rm?

This is a case of "destructive" vs "non-destructive" editing of files.
Like in old days of cutting and gluing together audio tape or film, editing then was destructive like RM command is. You type in the command, hit ENTER and RM is immediately executed.

On the other hand, moving files to the TRASH folder is just that, and the system responds, "wait while I figure out how much stuff I need to move". You pay in time for the ability to UNDO a possible accidental erase. In the old days we were usually not so lucky in computers or with film or tape. :-)


Knowing which program runs a process at macos startup

It is most likely started by launchd.  But you can see it’s Parent Process ID (PPID) with ps -ef and follow the PID/PPID back.


is the keyboard layout for all macbook pro the same?

Apple provides a list of available keyboards here:

https://support.apple.com/en-us/HT201794

Which ones are available depends on where you are located.


I usually sync my iPhone with my Mac at home so testing it on my work PC does not give the option to mount the phone to sync music, pictures, etc. That said...

If I recall correctly you have to download and set up iTunes to sync with the PC in question. Then iTunes will mount (at least) the Pictures folder and allow you to copy things off of it manually if you so choose. (again going from memory, I may have a detail or two incorrect)

If your goal is to use your iPhone as an external storage device or to explore the contents of the phone then you will need a 3rd-party application like iPhone Explorer installed on your PC to have access to the iPhone's file system and to be able to copy files back and forth at will.

I have always wanted to be able to just plug an iPhone in and use some of the available storage as you would a thumb drive. But Apple has chosen to not implement that functionality out of the box for some reason.


There is a process called SH using 100% of my CPU

sh is a shell, a program that provides a command-line interface to your computer. It can be used either interactively, or as an interpreter for script files, such as the famous periodic maintenance scripts. Some such script is likely running in this case, and may be stuck for some reason.

You should be able to find out what script that is by using Inspect on the sh processes in Activity Monitor and looking at the Open Files and Ports tab. A file listed there with the .sh extension is a shell script. Its name will hopefully give you a clue as to its purpose; you can also open it as text and inspect it.


Mark message as already read from iPhone lock screen

It is possible to do this.

When receiving a message, swipe left on the notification, you will be presented with the screen below:

Then click view, this will open the message on the lock screen. Then click anywhere on the screen to close the box. This marks the message as read.


Bash: Elegant ways to use multiple variables for shortening long strings?

Storing parts of commands in variables and/or using eval is a good way to get weird parsing problems. I'd use a shell function instead:

addDockApp() {
    defaults write com.apple.dock persistent-apps -array-add \
        "<dict><key>tile-data</key><dict><key>file-data</key<dict><key>_CFURLString</key><string>/Applications/$1</string><key>_CFURLStringType</key><integer>0</integer></dict></dict></dict>"
}

addDockApp "Google Chrome.app"
addDockApp "Safari.app"
...etc

Alternately, you could write it as a loop, and iterate over the list of apps to add:

for app in "Google Chrome.app" "Safari.app" "Firefox.app" "Messages.app" \
    "Slack.app" "Microsoft Outlook.app" "Microsoft Word.app" "Microsoft Excel.app" \
    "App Store.app" "System Preferences.app" "zoom.us.app"
do
    defaults write com.apple.dock persistent-apps -array-add \
        "<dict><key>tile-data</key><dict><key>file-data</key<dict><key>_CFURLString</key><string>/Applications/$app</string><key>_CFURLStringType</key><integer>0</integer></dict></dict></dict>"
done


Error-"Unable to write to the last block of the device."

Testing cabling is more of an empirical exercise. First you disconnect and reseat both ends of the cable. Next, you put in the new cable and if the problem goes away it was the cable. If you suspect the cable on an intermittent problem you replace the cable and leave it in after reseating doesn't reduce the frequency of the issue.

I'd start with reseating things and re-testing. Since you have a good test you'll know pretty quickly if it's the drive, the cable or the driver board / software that's causing the write failure.

Also, check that the drive has updated firmware / appropriate firmware for your version of OS.


Safari on iPad can't resolve local network names

It's likely that the computers are using NetBIOS name resolution (aka WINS or occasionally SMB). This is used commonly for Windows file sharing, and is typically set when you enter a hostname for a computer. On Macs and Linux, it's not always broadcast, unless Windows file sharing is enabled/installed, but it typically is, so it's usually a workable option for small networks without a lot of fuss.

However, iOS devices don't use NetBIOS (since they don't do Windows file sharing, there's not a lot of point, and there may be licensing issues, I'm not sure). So unless you've explicitly set up DNS hostnames on your network, this is most likely why you can't address your machines by name from your iPad.

The best solution here is to assign hostnames using static DHCP on your router — because your machines most likely already use your router for DNS, you should be able to change your settings on the router without needing any changes on any of the machines. Most home routers have some way of doing this, but it varies from model to model. The basic process is to assign a DHCP reservation for each machine and add the host name (some routers might allow for a hostname based on MAC address, without a static reservation). Those host names should then be resolvable from all machines, including the iPad via DNS.

If you need further help with this, add some information about your router (although searching for an answer on Superuser might yield the information you need).


Is it possible to have GPL software in the Mac App Store?

If you mean taking software that you do not hold copyright to, and which you are only allowed to use and copy because it was licensed under the GNU GPL, then no.

The FSF spells it out here: section 6 of the GPL says "You may not impose any further restrictions on the recipients' exercise of the rights granted herein", and the Mac App Store Terms of Service explicitly add other restrictions.

The Software Freedom Law Center's legal representative confirmed this: the App Store agreements, on all platforms, are incompatible with the GNU GPL.

Apple seems to be disallowing GPL programs in the App Store as a matter of policy, but if you managed to sneak one through, then the author of the program could go after you for violating their copyright.

A completely different case is where you hold the copyright to a piece of software.  In that case, you are welcome to distribute it under more than one license.  (For example, Firefox was for a while licensed under the MPL, GPL, and LGPL.  MySQL is licensed under the GPL and also a proprietary license.)  So if you sell a program through the Mac App Store, you can also release it under the GPL -- assuming you are allowed to do each of these things independently.

(If you wanted to use somebody else's GNU GPL-licensed code in one of the App Stores, you could write to the copyright holder and see if they're willing to sell you an alternative license to their software.  They're under absolutely no obligation to do this, of course.)

VLC ran into trouble (I think) because copyright for the software was held by many different people, and the whole program was only allowed to be distributed under the GPL.  Some programs sidestep such issues by requiring contributors to assign copyright to them, but most don't.


how do i uninstall an app in mountain lion?

MAMP has a specific uninstaller in the disk image you installed with. Mount that disk image and you should see the uninstaller. Go here for more information.

For the rest of your apps that don't have specific uninstallers, use AppZapper, which is a nice utility. There are a few alternatives (CleanMyMac has a built in function for this) http://www.appzapper.com/


How can I configure my keyboard to be backlit at the login screen?

It appears that the problem is related to FileVault.  When I turned FileVault off and rebooted in safe mode the problem went away.  I could change the brightness of the screen and the keyboard at the login screen.  Volume controls worked too.  Now that I've turned FileVault back on the problem is back.


To prevent Finder from showing .noindex files

There are a variety of ways to hide things in Mac OS X. Note: if you do any of these you most likely do not need to use the .noindex extensions since files hidden from the finder will not be typically be shown in Finder Spotlight searches.

chflags hidden fileToHide (as already mentioned) does this by setting OS X file attributes.
use the Unix style period at the start of a file name .fileToHide, of course this will hide the file from the Finder and the command line.
create a .hidden at the file system root and list the filenames of files to hide from the Finder. This was the way to do it in the first several versions of Mac OS X prior to the chflags method.
There is also a classic Mac OS 9 file attribute that can hide files, but this should be considered highly depreciated

Note that the various hiding methods and .noindex should all work on Folders too.


The answer to this very much depends on what you are trying to achieve.

Window on top, not full screen

If you want to keep a window on top, but not fullscreen that is only possible if the application developer has implemented it, usually in macOS applications this is called something like 'stay on top'.

The recent few releases of macOS have really locked down the ability of each application to control others for security reasons, which means it's not possible to get a third party app to do this.

Full screen

One solution would simply be to make it fullscreen on the display, as the main display will remain usable. Some applications use a legacy fullscreen mode in macOS but that is pretty rare in 2020 as this was deprecated years ago.

If you want more than one application on the display is is partially possible by switching into Mission Control and making one applciation full screen, then dragging a second onto that full screen application creating a split screen view which adjustable widths.

Picture in picture feature

Some web browsers such as Firefox and Safari now have an integrated picture in picture mode for video play back, if you are specifically trying to keep a video running and visible while working you can do this and this window can be set to stay afloat.


Configure Finder dock icon to open another directory

With Finder open, press Cmd+` to open the Finder Preferences window.

In this window you'll see a drop down list that lets you select where new Finder window open to when you open them.

There are some suggestions made when you click on the drop down list or you can choose Other... and pick any folder you like.


Run Macbook inside of Windows application

You won't get closed clamshell mode unless you connect a display and power, but that's how I run many portable Mac so they do work well in that mode even if it's not what you look for specifically.

The Mac supports two log in users - so if you have one user logged in locally - you could VNC in with a second account and it will ask if you want to share the screen or have your own session.

One nice trick if you don't want to connect an actual display in closed clamshell mode, you can connect an adapter like this:

https://www.amazon.com/CompuLab-fit-Headless-Display-Emulator/dp/B00FLZXGJ6

Should be pretty straightforward for you to do either of these - it just takes connected items and/or two accounts.


How do I show all hidden & invisible files on the command line (both .files and invisible flagged files)?

If the files are indexed by Spotlight and files in subdirectories can be included, you could use mdfind:

mdfind kMDItemFSInvisible=1 -onlyin .

Or test for both GetFileInfo -av (attribute invisible) and if the name starts with a period:

shopt -s dotglob nullglob
for f in *; do [[ $(GetFileInfo -av "$f") = 1 || $f = .* ]] && echo "$f"; done

GetFileInfo is part of the command line tools package that can be downloaded from Xcode's preferences or from developer.apple.com/downloads.

Different ways to list only files that start with a period:

shopt -s nullglob; printf %s\\n .[^.]* ..?*
shopt -s dotglob nullglob; GLOBIGNORE='. ..'; printf %s\\n *
ls -a | grep -E '^(\.[^.]|\.\.[^$])'


How do I remove Cisco Anyconnect from the Dock?

Typically you quit a program and then drag the dock icon out of the dock if it remains. The dragging needs to be a few inches outside the dock and pause until you see the cloud animation arrive around the icon before releasing the mouse.


How to import tasks from OmniFocus into 2Do?

2Do currently has no import menu command, but you can use its URL schemes to create new tasks very flexibly. See 2Do URL Schemes. You can use the ofexport package to get your tasks out of OmniFocus, and then use some Applscript magic to generate the URL schemes and send them to 2Do. I haven't done this yet myself but am considering it were I to move to 2Do. An example AppleScript that might help can be found here.


Make Mac OS X "Option-Arrow" work like Windows "Ctrl-Arrow"

Here's how you can get ⌃ Control+arrow keys to work like you describe. Copy the following property list into ~/Library/KeyBindings/DefaultKeyBinding.dict (you can create the directory if it doesn't already exist):

{
    "^\UF703" = ("moveWordForward:", "moveWordForward:", "moveWordBackward:");
    "^$\UF703" = ("moveWordForwardAndModifySelection:", "moveWordForwardAndModifySelection:", "moveWordBackwardAndModifySelection:");
}

This will set up ⌃ Control+arrow to navigate to the beginning of the next word (by using OS X's normal navigation three times: to the end of the current word, end of the next word, then back to the beginning of the next word). I also included a version that works with ⇧ Shift so you can select text as you go.

Caveat: this will only work in Cocoa apps, but I think the normal ⌥ Option+arrow navigation does too. Also, make sure to relaunch your apps!


Why is an un-deletable Springboard app on my screen after the iOS 6 upgrade?

Before going through a hard reset, it might be worth doing a soft reset.

To do that, press the Power & Home buttons simultaneously until the iPod shuts down by itself. Release the buttons and power it back on.

This might take care of the issue. Otherwise, just restore it using iTunes and if you have no valuable data to lose, choose the "Setup Up As New Phone" option.


What's the minimum partition size for osx mavericks when dual booting with windows 8?

OS X Mavericks requires at least 8 GB of free space to install to. At least 15% of free space is recommended for updates and other such things.

Therefore, the minimum space for OS X is 9.2 GB, or to be safe, 10 GB.

So yes, using Disk Utility to partition before you installed Boot Camp would have meant that you could have made the OS X partition smaller.

You can repartition now with software such as iPartition, which specifically works with Boot Camp partitions.


How can I disable the Apple ID warning about not being signed into iCloud?

You could also issue this command in the Terminal:

defaults write com.apple.systempreferences AttentionPrefBundleIDs 0; killall Dock

This has worked for me so far (I'm on 10.15.2). Before that I created an alias for System Preferences, and put that in the dock instead. You get a small arrow at the bottom of the icon, but it's less eye-catching than the nasty red blob.


Messages font size can't be changed in Yosemite

Under 10.10.2 when you're typing inside a message to be sent those menu options function and increase/decrease the size of messages that appear above the text input. The text input itself doesn't actually change text size though.

In Messages > Preferences there's a slider that does the same thing.


Notes from iCloud account don't sync with devices when added as secondary account

I have the same problem syncing with my wife's notes. I found an obscure note in a marginally related Apple article about this: https://support.apple.com/en-us/HT205015. At the very end, under "Learn More" it says

"If you’re signed in to more than one iCloud Mail account on your iOS device or Mac and have notes syncing turned on, you can only use the new Notes features with your primary iCloud account. You can see your primary account in Settings > iCloud, or System Preferences > iCloud."

This really sucks since there is no workaround once you've upgraded.


How can I connect my Mac to my iPhone hotspot via USB from the command line?

If you’ve already erased your hard drive then there’s no “command line” to use to begin with.  You need a minimal operating system in which to boot into and it sounds like you don’t have that.
Here are a few options for you to move forward:

Get a USB Ethernet or USB WiFi dongle (I suggest Ethernet) to connect your Mac directly into your router/modem so you can do the Internet Recovery.

Obtain a USB installer from a trusted source (friend/colleague)

Put your Mac in Target Disk Mode and using another the other Mac, install macOS onto that machine. Alternatively, if the drive in your Mac is removable and you have the correct USB enclosure/adapter connect it to another Mac and install macOS onto it.

Regarding your WiFi....
Reinstalling an OS, regardless if it’s macOS, Windows, Linux, etc. is the absolutely last thing you should try.  It’s a “Hail Mary pass” type of move because the person diagnosing the problem is out of ideas.  It rarely solves the problem because if it does start working again, you haven’t identified what caused the issue to begin with to prevent it in the future.
In your case, resintalling won’t fix it because you’re not in macOS anywhere and you still cannot connect to WiFi for recovery.  If it doesn’t work in this “bare minimum mode“ it’s not going to work when the full OS is loaded.  The thing is, you didn’t have to erase the drive to find this out.  All you had to do was boot into Recovery to test it out.
I wrote this not as an admonishment, but as a cautionary tale to you and future readers.  If you’re being told, especially initially that “the fix is to resinstall” stop and look elsewhere; seek better guidance.  I’m not saying that it’s never the answer; I’m saying it shouldn’t be the first go to.
This is the equivalent to having a plumbing or electrical issue in your house and the contractor tells you that you need to demolish and rebuild the whole house  to fix it.  In this case, normally it would be ridiculous  to do that, but if the entire house had sub-standard or dangerous wiring (like wrapped in asbestos), demolishing might make sense.  It should be your last option after everything else is attempted/evaluated.


WhatsApp web interface in Safari reloads because it is using "significant energy" how to fix?

I believe the easiest way to fix this is to use a different browser. Both Firefox and Chrome shouldn't reload web.whatsapp.com or any other website without asking.
I do not have the latest Safari, but I dug through the latest Safari user guide and it seems there are no options in Safari's preferences to disable reloads due to significant energy consumption.
If you still really want to use Safari you might be able to find an extension that will stop these reload events, or you might be able to file a bug with WhatsApp and hopefully they will fix it soon. I do not recommend manually finding and blocking the guilty scripts from web.whatsapp.com. From my web development experience I can assure you that this will not be an easy task.


Natural Scroll Direction: On with trackpad, Off with mouse

Hi just found a great app that totally fixed this and so simple! You can set the scroll direction for each device separately.

SCROLL REVERSER
http://pilotmoon.com/scrollreverser/


How to bind Alt-p to up arrow instead of π

Normally we use ~/Library/KeyBindings/DefaultKeyBinding.dict file to customize some keys.

{
    "~p" = "moveUp:";
    "~n" = "moveDown:"; /* not really works */
}

However I found it does not work for alt-n.

Would you consider to use ctrl-p and ctrl-n instead? It is of standard emacs/readline key combination.


Time Machine hasn't been backing up the full system since before 10.8.3

You aren't supposed to browse the Time Machine directory tree directly. Try entering Time Machine from the Finder and just look for those folders from there.

If you're sure that those folders aren't in the backup, check System Preferences -> Spotlight -> Privacy.
To check all the excluded items, you can execute this command from Terminal:

sudo mdfind "com_apple_backup_excludeItem = 'com.apple.backupd'"

It will display a list of excluded paths.
If you can't identify the source of the issue, I suggest to wipe the backup drive and to make a new backup.


How to replace internal HDD with SSD in Mac Mini?

Boot holding the option key and select the SSD to boot. You can also use system preferences to set it as the default boot drive.

Once the machine will restart (or power on from off) and boot to the SSD, use Disk Utility to erase the HDD and enjoy your new Mac.


Is there a way to replace Finder altogether?

There's an Apple-documented general overview of the technologies that specifically support kiosk on OS X —

Technical Note TN2062: Creating Kiosks

— with a section Replacing the Finder.

  … Is it possible to remove it from the OS,

I recommend not attempting to remove Finder.

  including thing like file open dialogs etc? …

Of possible interest, in Apple Support Communities:

preferring to not show the sidebar in expanded save dialogues


Make OS X Server a wireless bridge without DHCP

I'm assuming you have another device handing out the DHCP leases. If so, try modifying the DHCP settings on the Ethernet Interface directly, and then turn on Internet Sharing. To do this:

System Preferences > Network, click the "Location" menu, and click "Edit Locations," name your new location, and click "Done". For Ethernet, click the "Configure IPv4 menu and select "Using BootP," click "Apply". In the left field, select "Wi-Fi," click the "Advanced" button, go to the "TCP/IP" tab and change "Configure IPv4 to "Using BootP" as well. Click "Apply," then go back to System Preferences and click "Sharing," and enable "Internet Sharing" in the left field. Set "Share your connection from:" to "Ethernet," and click the "Wi-Fi" box in the "To computers using:" field.


I've got one iPod touch, but two iTunes accounts on two separate computers

The issue isn't really iTunes accounts, but rather the syncing — you can only sync an iPod or iOS device with one library at a time.

The easiest solution now that iTunes songs are DRM-free is to copy your songs to her library, and then sync her device to her own library. To locate the actual files, select what you want in iTunes, right click and choose Reveal in Finder.


Will barometric data from my iPhone be used for a workout created on an Apple Watch without a barometer?

Yes, it already works with watchOS 3 and iPhones with built-in barometers (iPhone 6, 6 Plus, 6s, 6s Plus, 7, 7 Plus, 8, 8 Plus, X) running iOS 10.x or newer.

Start an outdoor walk workout and walk uphill. Once you stop the workout you will see the elevation gain on the Apple Watch and in your iPhone's Activity.app.

Example:


This type of things happen when you try to download something from chrome, and close it before finish downloading. If it so, you can try the following steps.

Went to Chrome -> Downloads and clicked Clear all
Restart Chrome
Removed the Download folder from the dock (by dragging it from dock to desktop) and dropped it back on there from your Macintosh
Check your app store, Is there any pending download available or not. If so take care of it.
Restart you machine.

Hope it will help you.


mycingular.net did not encrypt this message, message sent as email

I've had this happen a few times, and it's always been a problem with the carrier (not the phones or Apple's services). His carrier (Cingular) is sending the text message as if it were an email; this clear from the address @mms.att.net.

Thus, I suspect it has nothing to do with data in contacts apps on the phones. Similarly, the encryption warning is irrelevant.

Whenever I've experienced this before, it has fixed itself. That is, suddenly texts begin working properly.

Your friends should make sure he has run the latest updates on his iPhone. If that doesn't fix it, resetting network settings might force some carrier updates. (See Settings > General > Reset.)


How do I delete material in 'Video' in the imovie app

The videos in the "Video" section can be deleted from the "Photos" application.  iMovie can include those videos when making a project, but, it cannot delete them directly.


How do I access workspaces by number on macOS Sierra?

You can access different spaces in Sierra with control + number keys. But first, you must enable it in the Keyboard shortcut settings:

Go to Keyboard Settings (System Preferences > Keyboard > Shortcuts)
Select Mission Control from the left column of choices.
Check these boxes: Switch to Desktop 1, Switch to Desktop 1

You can now use switch between spaces using short keys.


XCode 6 on Yosemite crashing in fullscreen mode when build & running app on device

It's not that it's crashing but it's executing the red close button when you hit the play button.  I have also seen it exit full screen when you press the stop button.

But Yes I have been seeing the same thing.


You should be able to run

emacs -nw

(„no window“) to prevent it from opening a new window.


Latest max spec MBP15" idle temperatures

If you're not satisfied with the computer, and you can return it for a full refund - that seems like a good choice while you figure out what you want to do instead. This is no indication in itself however, that there's anything wrong with the computer hardware.

Besides that your question and the accompanying forum threads seems to be incoherent:

1) You experience high CPU load when using Lightroom. This is shown with screenshots of Activity Monitor showing high CPU load for Lightroom.

This is due to the programming of Lightroom. It is not a hardware error (!).

The posters on the forum saying that this is a cooling error are wrong. If the system was sensing a cooling problem and artifically making the CPU load higher due to this, it would have been attributed to kernel_task and not Lightroom.

2) You write that you were using the same setup in '93. This doesn't ring true as services such as Slack and Spotify did not exist in 93, nor was tabbed browsing a thing... heck you would have been using Mosaic or similar at that time.

3) As far as I know, chain stores get the exact same products as any other Apple vendor. There's no such thing as low-quality Apple batches being sold at chain stores at discount - at least nothing official. It might be that specific demo units or defective units can be sold as one-offs by a chain store, but they would have to advertise it as such. Advertising them as the real thing would be false advertising.

4) It is unclear, but it seems your problem is that your hear fan noise when you think you're not really doing anything with the computer. Try starting the computer up in Recovery mode (hold down Cmd and R while booting the Mac). If you hear excessive fan noise here while the computer is running known good software and not doing anything, that would be an indication of hardware failure.


How to Rebuild Launchpad Database in OS X Yosemite (10.10) and Later

Go to Library folder, which is hidden. To access it, click anywhere on desktop and make sure you see word 'Finder' in the top menu near Apple logo.
Press and hold alt/option key and in the top menu bar select Go and finally Library.
In the Library folder, locate and open the Application Support folder.
In the Application Support folder, locate and open the Dock folder.
You'll find a number of files in the Dock folder, including one named desktoppicture.db, and one or more files starting with a dashed set of capital letters and numbers and ending in .db. An example file name is FE0131A-54E1-2A8E-B0A0A77CFCA4.db. Grab all the files in the Dock folder with the dashed set of letters and numbers that end in .db and drag them to the trash or press ⌘/command + delete keys.
Launch Terminal, located in the /Applications/Utilities folder.
In the Terminal window, enter the following:

defaults write com.apple.dock ResetLaunchPad -bool true; killall Dock

Launchpad has now been reset. The next time you open Launchpad, the app will rebuild the databases it needs. Launchpad may take a bit longer than usual to launch the first time, and the Launchpad display will now be in its default organization, with Apple apps shown first, and third-party apps next.


What are some good .mbox viewers / editors for OS X?

Apple Mail allows importing from .mbox files (see the import option in the File menu). I don't know how well it supports the other requirements you've listed but it might be worth a try.


Problem solved.

  Keyboard

The Right Shift button is stuck as there is dust.

  Error code

Basically, there is an issue when my Mac is starting up -- one of the CPUs (in this case, CPU 1) is not working correctly.


Extend an Apple wireless network with non-Apple gear

Unfortunately Apple based networks cannot be extended using non-Apple devices. Even though in theory it should work without any problems, Apple has restricted using 3rd party routers to extended wireless network, and vice versa, non-Apple based wireless networks cannot be extended using Apple routers.

The workaround is to connect both, your Airport Express and your Netgear using Ethernet cable and enabling bridge mode in your Netgear settings page. Bridge mode disables creating second sub-network in your LAN, making Airport Express your default DHCP server.


Can I move Time Machine files from an external disk, reformat it, then restore the TM files?

You can make an efficient copy of the Time Machine volume by using Disk Utility and making a disk image of the original volume. Store that image on the temporary storage / other drive as a single file. Once you've erased the original drive and partitioned it as you wish, then use Disk Utility to reverse the operation and restore the image to the new partition. That will erase anything on the new partition so do the restore first then add extra files as needed.

Time Machine will pick up and use the new destination and carry on with backups and cleanup operations assuming no corruption happens during the two copy events.

I would just get a cheap drive and do the first step. Once I've verified that the backup img file mounts and I can restore a sample file to my desktop from Time Machine, I'd just erase the intended drive and start over with backups.

Much easier that way and why spend the second half of the work - just archive that Time Machine data offline in case you need it down the road.


How to automatically apply permissions to files added to a shared folder

I believe the way to resolve this is to set up ACL inheritance permissions on the parent folder. More about this here.

Firstly enable ACL permissions for SMB shares with the following command.

sudo defaults write /Library/Preferences/SystemConfiguration/com.apple.smb.server AclsEnabled -bool YES

Then set up inheritance permissions on the parent holder with the following command. This should recursively go through your share and apply the relevant permissions.

sudo chmod -R +a "group:REPLACE_WITH_YOURGROUP_NAME:allow readattr,writeattr,readextattr,writeextattr,readsecurity,list,search,add_file,add_subdirectory,delete_child,file_inherit,directory_inherit" REPLACE_WITH_PATH_TO_PARENT_SHARED_FOLDER

To be safe I'd recommend creating a test share to try the chmod command before applying it to your company's share. Then once you are sure you get the right results apply it to the live/production share.


Normally there is a default smart playlist with recently added items. If there is no such playlist you can easily recreate one with the following steps:

Creata a new smart playlist Shift+command+n
name it “recently added“
select match all rules
select date added is in the last 2 weeks
select media kind is not podcast
limit the result to 50 items

This should be it. Of course you can adjust the playlist to your likings (e.g. not last 2 weeks but last two month).


You can use one USB drive to back up multiple OS X Macs. Just connect the drive sequentially to each.

You could cycle the drive daily, weekly, monthly or hourly.

Each backup is kept separate and yes, anyone can read the backup files from either computer if they are an administrator of either Mac.

You could also make use of Crash Plan software to back up each Mac to the other over the network. That way you could have Time Machine on one Mac cover both of the computers - one directly and the other backing up the crash plan data.


Macbook pro late 2016 USB-C Stop working after sleep

The first things I'd try is resetting both the NVRAM and SMC.

Before following the steps below, ensure you have no external hardware connected and that you're using the built-in keyboard.

Resetting the NVRAM on Late-2016 MacBook Pro models

Older Macs had what's called Parameter RAM (PRAM), newer Macs use Non-Volatile Random-Access Memory (NVRAM). To reset the NVRAM on all Late-2016 MacBook Pro models (with and without Touch Bar) follow these steps:

Shut down your machine. Yes, a full shut down, not just logging out.
Press the power button and then immediately press the commandoptionpr keys.
Keep these keys pressed down for at least 20 seconds!
Let go of the keys and let your Mac reboot normally.

Note 1: When you log back in you may need to readjust some of your system preferences (e.g. speaker volume, screen resolution, startup disk selection, time zone information, etc).

Note 2: These steps will also work to reset the NVRAM (or PRAM) for all Macs. However, the late-2016 and 2017 MBP models actually required the commandoptionpr keys to be held down for 20 seconds, while earlier Macs did not require this, but doing so does not cause any problems either.

Reset the SMC

There's a couple of ways you can reset the SMC on your MBP, however I prefer the following steps:

Shut down your MBP
Keep the power cable plugged in
Press at the same time shiftoptioncontrol (on the left side of the keyboard) and the power button
Let go
Turn your computer back on with the power button

After resetting both the NVRAM and SMC, use your MBP to determine if the problem still occurs. Let me know how you go.


What do I need to provide a wired guest isolated access to my home network?

No - you need a specific switch that would create a wired VLAN (virtual LAN) to segment the guest network from the rest of the house's network. VLAN are how the wireless system works as well but the software doesn't have a way to identify or switch one or more than one of the wired ethernet ports to anything but the main VLAN.

If you add a switch (or router) to handle the VLAN - it will need to either have physical ports to differ from the AirPort so you might be better just letting it run your entire network. Cisco makes many of these - mostly for the enterprise / medium business - but there are other options if you don't like the Cisco brand.

Heading onto 2020 there are lots of options and for someone that likes Apple ecosystem and somewhat wants privacy controls, start with Plume and check out other packaged router / management / isolation tools.

https://www.plume.com/

If you want to be a network engineer, The ubiquity line is amazing and their new DreamMachine is the gateway  drug of choice for prosumer networks.

https://www.ui.com/


iPhone contacts bar with letters doesn't work for letters D-Y?

I finally fixed this by removing/renaming all the contacts in the misplaced '#' section.

No idea why it happened in the first place...


I'm not aware of a jailbreak that forces only a VPN and the core OS has no provision to only route traffic through a VPN.

The OS needs to contact an insecure network and send traffic in order to establish a VPN connection. For the time the device is connected to the network and not having built a secure tunnel - you are vulnerable to network sniffing. Even once you have a VPN - the traffic can still be sniffed and recorded for later analysis, but the encryption/obfuscation makes it harder to tell what data is being transmitted and to what servers you are communicating since all traffic goes to the VPN server.

In short, you need to be vigilant to ensure the VPN reconnects. If you make sure that your iOS device does not auto-join these untrusted WiFi hotspots, you will have to manually re-join if it drops so that you can manually fire up the VPN again and the device will not inadvertently re-join and put your traffic and data at risk.


Display's native resolution not registering properly

Tried doing an SMC reset, followed by a PRAM reset; neither worked.  Tried switching ports on the mini using an HDMI-Mini DVI dongle and starting up as the only connected monitor on this new setup; no change.

In the end what did work was switching to the monitor's DVI port and using a DVI-HDMI cable that came with a new monitor I'd picked up recently.  Screen now registers at the appropriate size and without scaling.


Which version of gcc is on Mountain Lion?

Mountain Lion doesn't ship with any GCC, but you can install GCC 4.7 . I have done this on my machine.


Can OneNote display all notes sequentially in one window for quick browsing (like Evernote)?

Unfortunately, no.  One Note is setup much like a spiral bound notebook where you can categorize your notes, make note groups, etc.  That's is one of the differntiating features of One Note over Evernote

  User interface: OneNote looks and feels like a digital version of a
  paper notebook, complete with tags and notebook sections. Evernote is
  more like a filing cabinet, with a simpler notes interface yet
  powerful tagging capabilities.

Lifehacker - Note-Taking Showdown: Evernote vs. OneNote (2016 Edition)


Recover Notes from El Capitan in High Sierra

Move old Notes (from your external drive) to iCloud

Drag and Drop

Allow it to sync (wait 5-10 minutes)

You should now see a duplicate Notes folders names (on your Mac (but not with exactly same content)

Those are the 2 Notes databases on iCloud

Now Select all Notes you want to keep and drag them over to new notes


Boot Camp script broke after El Capitan update

You can't set the bootable disk with bless if System Integrity Protection is enabled. This is because bless writes to NVRAM, which is prohibited by SIP. This is why System Preferences → Startup Disk is able to set the startup disk, but other binaries are not.

  To disable System Integrity Protection, you can do the following:

  Boot into the Recovery HD by restarting whilst holding ⌘R.
  Open Terminal (from the Utilities menu).
  Run the following command in Terminal:

csrutil disable

  Restart.

Source: Disable OS X El Capitan Rootless and permit write actions to System Integrity Protection locations


Startup disk only shows: Mac OS X Base System

/dev/disk0 (the USB installer disk) is the only physical disk visible here. The rest are all virtual disks of one sort or another -- /dev/disk1 ("Mac OS Base System") is a disk image mounted from the USB disk, and the rest are RAM disks used by the Recovery system.

Since I don't see any sign of your internal drive, even at the /dev entry level, I'm pretty sure you have a hardware problem that nothing like DiskWarrior will be able to help with. The disk itself may be dead, or a cable torn, or a connector knocked loose. In any of these cases, the only chance you have to get data off is will involve opening up the computer, checking cables and connections, and maybe removing the HD. Recent Apple laptops are not very easy to work on, so you may not want to risk doing this yourself. If you want to try, there are guides at iFixit.com; if not, find a repair shop to do it for you.

If it's just a cable/connector problem, repairing it and getting your data back is pretty straightforward. If the drive itself is dead, you may have to send it to someone like DriveSavers for recovery (which is expensive).


It's a tag without an assigned colour, and the contents is hidden due to the view options. Change the view options (⌘J) to Sort By and Arrange By Name.


Google Assistant Notification Settings for iOS

I had a similar issue.. I resolved it by uninstalling and reinstalling the assistant app. After installation when you open the app, it asks your permission for allowing notifications and accessing microphone.


Apple Watch Heart Rate Glance Shows Same Number Every Time, Or Series Of Random Numbers, Also On Replacement Watch

If the watches are different, and the phones are different, then the only thing that appears to remain the same is you.

You don't mention, but have you ruled out the possibility of there being anything about you? For instance, I remember reading that tattoos could prevent the heart monitor obtaining a clear reading, and there was some talk about people with very black skin also having difficulties. Example article here http://www.bbc.co.uk/news/technology-32537030

The other possibility is whether there is something with the tightness with which you wear it?


Run AppleScript as login item but only if it meets specific time criterion

You can wrap your code in an if statement block that checks the seconds since midnight:
Example AppleScript code:
set secondsSinceMidnight to time of (current date)

if secondsSinceMidnight ≥ 18000 and secondsSinceMidnight ≤ 82800 then

    --  # Your code goes here.

end if

Notes:
I assume the code you show in your question is either just part of it, as keystroke with System Events is sent to the front most window,  or you are manually bring the target window front most before the code is run.
If you place your code within the example if statement block, as coded, only the code within it will be run if it's between 5:00 AM and 11:00 PM.
Have a look at current date and the date class in the AppleScript Language Guide .


How to copy line without trailing whitespaces in terminal?

When a line in Terminal contains whitespace there is no method, that I know of, which involves just clicking to highlight the line sans the newline character.

You can single-click at the start of the line (or any inception point) you want to copy then press and hold the shift key and single-click the last word, or character, of the line you want copied. This will then not include the newline character when you press commandC to copy it to the Clipboard.
You can also double-click the first word, which highlights it, and then press and hold the shift key and single-click the last word, or character, of the line you want copied. This will then not include the newline character when you press commandC to copy it to the Clipboard.
Or you can single-click and hold at the start of the line (or any inception point) you want to copy while dragging the cursor to the last character in the line you want to copy. This will then not include the newline character when you press commandC to copy it to the Clipboard. Obviously this last one is probably not exactly what you're looking for but was included for completeness.


dd cloned NTFS partition will not boot from flash drive

You cannot boot windows off a USB flash drive.  You need a special type of flash drive then windows ultimate which comes with a USB bootable creation tool and a specialized USBkey.  There are other methods with which to install USB bootable windows onto and I have tried them and they do not work.


Why does my mac drop connection to my network regularly

Have you changed your network settings at any point? If so you may need to set the network to automatic and renew DHCP. Please see the instructions here: http://www.technobezz.com/mac-wont-connect-to-wifi/


Export iTunes music library information (album, artist, track names) to CSV or spreadsheet format?

Make sure all the columns you want metadata for are visible in the playlist or library you're looking at. Then, select the tunes you want with shift-click or ⌘-click or whatever:

Then, hit ⌘+C to copy. This will allow you to paste what's visible in the iTunes playlist into any sort of spreadsheet you like:

It won't label the columns for you, but it'll do the trick quickly.


How to force open TCP 443 on my machine?

To force open any port you can use nc (netcat).

The command sudo nc -l 443 will open port 443. Of course this will not serve any web pages. But it will be listed in your namp output as open port.

By specifying an interface with -b <if> you can bind it exclusively to it - other interfaces (e.g. en1) shouldn't show an open port 443 then:

sudo nc -b en0 -l 443

Check for more options by executing man nc.


Basically, what worked is booting to Windows natively and shutting it down several times to clear the hibernation flag. Also, disabled hibernation via power-management and via powercfg /h off.


Although your device may show you that you have 1,5GB space available, it is possible that the free space notification is popping up due to application updates requiring a bit more space than that. Try resetting your settings (don't worry, you won't lose any data!) to see if that helps.

Open the "Settings" app.
Tap "General".
Scroll to the bottom and tap "Reset"
Tap "Reset All Settings". This will only reset settings to their factory defaults and can often clean out any corrupt preferences that may cause undesirable behaviour. Your data such as contacts, photos, apps etc will not be touched.
Enter your passcode (if you have one set)
Confirm that you wish to reset your settings.

When your device has restarted, check your free space again. It might have increased a little and you should no longer get the notification that you are running out of storage space.


Change Copy and Paste behaviour system-wide

You can use applications like Keyboard Maestro (my preference), FastScripts, Spark to run a script which displays notification every time you press Cmd+C, or Cmd+V. Below is the Copy script which posts notification in Growl. Though you could also post these to OS X notification centre too.

tell application "System Events"
    set foremostApplication to name of first process where it is frontmost
end tell
tell application "Growl"
    register as application "Pasteboard Notifier" all notifications {"Copied", "Pasted"} default notifications {"Copied"}
    notify with name "Copied" title "Copied!" description "New Clipboard Item" application name "Pasteboard Notifier" icon of application foremostApplication
end tell

I tried creating a service through Automator, and binding that to Cmd+C; it didn't seem to work. You'd be better of using a app made to do this kind of work.

Edit: 05/11/15

I noticed that service created via the method above did work in Steam, while not in other Applications. I think because it doesn't have the Edit menu hence no Cut, Copy, and Paste items either. The application shortcuts probably get precedence over services linked to same shortcuts.


I just solved this problem by quitting safari and reopening it again. Once it's open, i just go into fullscreen mode again and it responded nicely.


In macOS settings, what is the difference between apps accessing to iCloud vs iCloud Drive

There's really not much difference, but the way to generally look at is:

iCloud is all the behind the scenes things like settings, scripts, messages, etc.

iCloud Drive is the user "usable" front end where you can directly access files and such as you normally would on a computer.

Let's use Photos as an example... You don't really access Photos either via the actual photo files nor do you really need access to the Library (database) file.  All of this happens behind the scenes and you access your Photos via the Photos app whether it be on your Mac or your iDevice.  A third party app (Lightroom for example) would want access to your Photos so it might ask for permission to use "iCloud."
Looking at a different (random) app, maybe you get a "Journaling" app that lets you chronicle the day's events.  It saves it in a Rich Text format and can use any number of online services like iCloud Drive, OneDrive, DropBox, et al.  That may ask you for access to "iCloud Drive" because it's saving a file in the more traditional sense - to a common location where you save documents.
Going back to Mail, it may need access to both.  It will utilize the mail back end of "iCloud" to synchronize mail across the devices or access contacts, but will also utilize "iCloud Drive" as a place to save and get attachments.
I applaud your diligence in questioning what Apps are asking for and this is an excellent line of questioning.  What you should also be looking for is what the app in question is accessing when it accesses iCloud or iCloud Drive - i.e. Contacts, location, mail etc.  I was recently looking for an IP subnet calculator (a networking thing) and it wanted access to my Photos and Location.  Needless to say, it didn't get downloaded.


No, there isn't a way to do this with the stock iOS (any version).

The only way you can do this, and I've never tried it but I've read about it, is by jailbreaking the device first.

You've already discovered the workaround which is to create a shortcut to an app that's within a folder.

Until Apple allows this level of customization, you will not be able to change the looks of folders.


Possible to generate html/text/web version of calendar for sharing?

PDF
You can easily create a PDF of your calendar and attach that PDF file:

Open Calendar.app and go to the right date on your calendar
'File' -> 'Print' (or CommandP)
Select your settings and press 'Continue'
Press the button in the lower left corner that says 'PDF'
Now you can 'Save as PDF' or 'Email PDF'

PNG
You can also make a quick and dirty screenshot of your calendar:

Open Calendar.app and go to the right date on your calendar
Press CommandShift4, now release the keys and press Spacebar. Now a camera icon appears.
Click on your calendar once using the camera icon. A screenshot will be saved on your Desktop which you can attach to your email.


iPhone 4S iMessaging to a iPad and iPhone - compilation of message threads

I have seen people set up iMessage in two ways:

The default manner where you accept messages from all email, phone that you have attached to your Apple ID (and this implies that people can send you message to more than one "address" and that conversations will not be threaded).
By restricting the receiving addressed so that people can only send you messages to either one phone number or one email address so that threading of all messages is forced.

You can change your settings on each device - just go to iMessage and disable all but one email and/or phone number for receiving messages. On iOS 6, open the settings app, tap on Messages, tap on Send & Receive, and ensure that only one address for being reached at is selected.

The downside of the second method, is you have to get everyone to only send messages to one account. The default settings were probably designed to ensure that all messages get to you even if it means they don't get threaded and assembled into a unified view.


In iPhone and iPad use, where does the space usage come from?

My 64GB iPhone has several hundred apps on it, mostly games, about 9GB of photos/personal videos, 3GB of music, and ~5GB of free space right now. I do have to prune from time to time but it's not too bad.

My 32GB iPad on the other hand...I really wish I had bought the 64GB (the largest at the time). I am constantly having to juggle what games/apps are on there, and that's really what's taking the majority of the space. iPad-specific apps can get huge...even universal apps can. I've seen several 1GB+ games, and have a bunch that are in the 250MB to 500MB range. I have only a fraction of my photo library on there, and no music or videos to speak of.

I am excited by the idea of a 128GB iPhone possibly being introduced Tuesday, and when I have saved for a new iPad I will get at least the 64GB model.


Is there a shortcut for → (U+2192, Rightwards Arrow) in iOS?

You can define a text replacement under Settings → General → Keyboard → Text Replacement.

Keep in mind that text replacements work very reliably in iOS, but once they get synced to macOS via iCloud Drive, issues may arise depending on the characters you use in your “shortcuts.”

Refer to Text replacement problem in Calendar for more details.


Why are there so many copies of my Downloads directory in ~/Library?

The purpose of ~/Library/Containers is to provide what amount to virtualized home directories for sandboxed applications. When a sandboxed application "asks for" the user's home directory (via NSHomeDirectory), it is given the path to its container directory. These features do not allow sandboxed apps to access the data in these directories, nor do they occupy (more than a trivial amount of) additional storage. (In fact, to the former point, this feature is designed to restrict apps' access to your data; to the latter, the "duplicate folders" are just symbolic links, which function as references back to the actual directories they represent.)

An application that is sandboxed may only read from and write to locations that are subdirectories of its own container. The symlinked folders in each Container (e.g., Downloads and Documents) are not accessible by default to sandboxed apps. Sandboxed apps can only access external file system locations if explicitly granted access to them through an NSOpenPanel or NSSavePanel (one of the pop-up dialogs that asks you to select a file to open or a location to which to save a file) via the Powerbox API (this is the model used by document-based applications—for instance, this lets you save and open documents that you edit with a sandboxed text editor in your Documents folder). In fact, apps that don't use App Sandbox (and thus don't have a container directory) can access virtually any file within your home directory (although there will be some further restrictions implemented in macOS Mojave), whereas those that do use App Sandbox (i.e., those that are given a container) cannot. Also, it's worth noting that all apps on the Mac App Store are required to use App Sandbox.

In summary: yes, those "replicated home folders" are supposed to be there—that is intended behavior; no, they are not consuming any meaningfully significant amount of extra disk space; and the feature that causes these folders to appear is actually preventing these apps from accessing your personal data, not enabling them to.

Further reading:

Another Ask Different thread about ~/Library/Containers
Apple's developer documentation about app sandboxing and pseudo-home directories


Delete many network configurations at once

You can use the Terminal to delete them out:

Usage: networksetup -removenetworkservice <networkservice>
    Remove the service named <networkservice>. Will fail if this is the only service on the hardware port that <networkservice> is on.

To get it to list then remove all the ones with MT65XX you'd need to do something like:

$ services=("${(@f)$(networksetup -listallnetworkservices | grep MT65XX | sed s/\*//)}")
$ for service in $services[@]; do networksetup -removenetworkservice $service; done

That this does is builds a list of services by running:

networksetup -listallnetworkservices | grep MT65XX | sed s/\*//

The @f splits the list on newlines, ignoring spaces. The grep finds just the MT65XX lines, and the sed removes any *, which denote disabled services in the output.

Then, for each of those, it runs the networksetup -removenetworkservice step.


Can Apple Remote app wake up an Apple TV 2?

Yes, as soon as you start the Remote app and tap the 'Menu' button, the Apple TV will wake up.


Google Maps app is no longer in the Background App Refresh list

GPS apps such as Google Maps do not rely on Background App Refresh to perform their tasks. They use CoreLocation, and declare Location Updates as one of their capabilities. This allows them to run continuously in the background (with caveats).

Background App Refresh allows an app that declares Background Fetch as one its capabilities to periodically (but infrequently) download small amounts of data in the background. The scheduling for background data fetch is left at the discretion of the operating system, and may actually get cut off after the app is not accessed for a number of days.

Background App Refresh is useful eg. for news apps, allowing them to have fresh content ready to display before you launch the app (as per Craig Federighi’s keynote presentation at WWDC 2013). This functionality is non-critical, and apps should be able to live with it disabled.

For further details, refer to Apple’s App Programming Guide for iOS.

If-This-Then-That also has a layman’s explanation of how some background operations work in iOS under the heading About iOS Background Syncing.


iMessage, FaceTime, Back to my Mac not working (Mountain Lion clean install)

The serial number may be an issue. When MacOSX thinks it is running on dodgy (i.e. non-Apple) hardware it usually has far more severe problems. There's no lockdown of an installation of MacOSX to a particular Mac, i.e. no DRM with keys and mandated validation with the vendor as with Windows. Apple cares most about people buying hardware, so the only "piracy" of MacOSX that they interfere with in code is running it on non-Apple hardware. But since my first version of this, I have been pointed at http://www.apple.com/support/icloud/contact/ by someone too polite to call m stupid in public, and that has strong sign of iCloud/SN linkage.

There's nowhere near enough info in the question to provide a sure answer to your problem, but there are clues pointing to possible issues. To figure it out, you should start by shutting off Little Snitch and the built-in firewall. You probably will want them back on eventually, but they should be off while you are trying to get complex services working to assure that they are not able to cause secondary blockage. And because you mentioned it, you get a rant: NEVER add entries to /private/etc/hosts on a modern MacOSX except for the 4 that the system needs for proper loopback initialization at boot time: IPv4 localhost and broadcasthost plus 2 forms of IPv6 localhost. if you have anything else in there, you should remove it. Once you've eliminated the possibility that your system config is explicitly blocking communication, you can look to the outside. All of those services include mechanisms to set up direct connections between 2 machines that may have IP addresses which are temporary and/or may be behind a NAT gateway that translates their traffic between a public and private (unroutable) address. Unfortunately, it is also possible for external network devices like routers and firewalls anywhere between the two ends to thwart those mechanisms. If you are behind a tight firewall, you will have trouble. If you are behind 2 layers of NAT, you will have trouble. Knowing what trouble you have isn't going to be discernible with toys like the Little Snitch network monitor, since the error you're getting probably involves just a handful of packets rather than any ongoing flow. To know what's happening you'd need to use a tool like tcpdump or wireshark and have an understanding of what you're looking at and looking for.


How do I avoid inadvertently switching workspaces?

There's a hidden preference for adjusting the delay in seconds:

defaults write com.apple.dock workspaces-edge-delay -float 0.5
osascript -e 'quit app "Dock"'

It can be set to an arbitrarily high value to disable dragging windows to other spaces.


My Apple Watch is getting notifications but my phone is not alerting with any notifications

Nope. AFAIK, at least as an Apple Watch owner, if you have an Apple Watch paired then you will receive all notifications on it. I don't believe that there is a way to change so that you receive notifications on the Watch and in Notification Center on your iPhone at the same time.


How to install iTunes 10.7 on OS X 10.5.8

iTunes 10.7 requires OS X 10.6.8 or later:

http://support.apple.com/kb/DL1576?viewlocale=en_US&locale=en_US


Finding iPhone 3G firmware version after full reset

Latest iOS [firmware is same as the OS in that respect] you can use on an iPhone 3G is 4.2.1 (8C148)


How do I force my Mac to log in to an account remotely?

I created something like this for Remote Desktop to signing a xServe. We had more than 1 account, and we had to sign un with both username and password. I ran this remotely through the terminal to prior to pulling up the screen.
`osascript -e 'tell application "System Events"' -e 'keystroke "USERNAME"' -e 'keystroke tab' -e 'delay 0.5' -e 'keystroke "PASSWORD"' -e 'delay 3.5' -e 'keystroke return' -e 'keystroke return' -e 'end tell'`

Just replace the USERNAME and PASSWORD and that should work.  I have not tested this on a more recent OS, but I hope this helps.


Reset the SMC:

1) Power down the system
2) Unplug all cables except Magsafe
3) Hold down left Shift + Control + Option + Power button for ~5 seconds
4) Boot machine up

This usually solves issues when certain hardware devices on the device itself aren't responding, especially when multiple do not work.


How to eliminate Internet lapses on my MacBook Air 13?

I now believe that these lapses/freezes can be blamed on the network setup that I was using.  My brother visited and with his Dell laptop running a version of Microsoft Windows the same thing happened.  I've since switched to a different Internet provider and haven't had the problem again.  The first Internet provider is in the process of discontinuing its service.


Using zgrep on a remote drive eats space on my local Mac

Once the command is running, I can see my free space on my local MacBook...disappear swiftly...
Could someone please tell me why is this happening or how to prevent it?

Operating Locally while connected remotely
The command is acting upon those files as if they were local, even when they are not.  *nix systems have this wonderful feature where you can mount almost anything as if it were a local file/directory.  This "feature" is where you're running into this problem.
To operate on the file, it has to "download" it from the remote, hold it in memory and if necessary, resort to swap space.  If it needs to unzip it (bzip, gzip, compress, etc.) it will likely utilize a temporary file (i.e. mktemp).  Since your command is operating locally, all the resources it will utilize will be local as well - it doesn't know to use your remote for temp space.
You can do a simple experiment to show how this works - move a file from one remote directory to another. Using a simple mount on a NAS (/Volumes/NAS/) if you try to move /Volumes/NAS/folder1/* to /Volumes/NAS/folder2/, this simple operation will need to "download" the files to local machine, then upload them to the destination folder.  However, if you login directly to the server and issue the move command there - for example, mv /home/username/folder1/* /home/username/folder2, it will happen almost instantly.
In your case, it has to extract a number of files from each of those .tar.gz files, download them, store them in a temp location, then load it to memory for as the ASCII text is searched for.
Cleaning up Temp files...
An important consideration to keep in mind is that temp files are not cleaned up until the process has completed or terminated abnormally; if the developer was good about it.  If not, those temp files will be cleared out upon reboot.
If you have 200GB of files to search and a MacBook Air with 128GB or 256GB of storage, you will run out of space very quickly filling it up with nothing but temp files.
How to prevent it
Do you operation on the server (remote machine) itself.  Instead of mounting the remote file/directory locally and operating on it locally, connect via SSH (for example) and issue your command on the remote itself.
Can you specify a different location for the temp directory like the remote?
Technically yes.  For example, gzip uses /tmp and you can set your environment variable to a remote temporary directory (i.e. /Volumes/NAS/tmp).  The problem is, you're still operating on the file locally, so it would "download" the file, and then while extracting them, "upload" all the extracted bits to the remote.


What mail clients are compatible with Microsoft Exchange 2003?

You can look at davmail. It is an Exchange gateway and will allow you to read-write the Exchange calendar from iCal, or to use any email application with Exchange.

Note that if your administrator allows IMAP access to your Exchange account, you do not need client support specifically for Exchange.


Gmail "On Behalf Of" Feature in Mail.app

Under Accounts in Preferences, there's a field there called "Email Address:".  You can put a comma-separated list of addresses in there, like this:

Now your "Compose" window will have a "From" popup menu that lets you choose your sending address:

AFAIK, this works for pretty much any mail account type, as long as your mail provider allows you to muck around with the From: header.


The command you probably are looking for is uuidgen.

man uuid shows the manpage for the UUID library (uuid.h).


How to get fn + left key working on macOS after changing to zsh from bash?

To get fn-left (Home) and fn-right (End) working, add these two lines to ~/.zshrc (for your user only), or /etc/zshrc (for everybody)
bindkey "^[[H" beginning-of-line
bindkey "^[[F" end-of-line


Go to the Finder and type command+shift+a. That will get you to your applications (hence the "a"). QuickTime and iMovie should both be there.


Beats1 on Mac doesn’t start unless I logout

I know this situation. Even if you use the correct Apple ID to authorize music playback, you may still see a repeat request for authorization. This can happen if you're logged in to your Mac using a simple user account, which doesn't have the correct privileges to allow iTunes to update its internal files with the authorization information.
    The solution is to log out and then log back in using an administrator account. Once you're logged in with an administrator account, launch iTunes, select "Authorize This Computer" from the Store menu, and provide the appropriate Apple ID and password.
    Log out, then log back in with your basic user account. iTunes should now be able to play the song.


Is the performance of Lion + SSD + Filevault2 good enough for a system primarily used for application developemnt?

As you will buy one of the latest Macs, you should be fine.

The used Intel processors support Intel® Advanced Encryption Standard (AES) which is also used in Filevault 2.

Ars Technica, published an extended review on Filvault 2 in Lion. They say:

  Apple also leverages the special-purpose AES instructions and hardware on Intel's newest CPUs, further reducing the CPU overhead. The end result is that regular users will be hard-pressed to notice any reduction in performance with encryption enabled.

Edit:

These are real world numbers from my MBP with an Intel 2635QM processor which supports AES encryption. My hard drive is a Crucial M4 128GB.

Filevault 2 disabled: max. read 510MB/s, write: I forgot to write this down :(
Filevault 2 enabled: max. read 490MB/s, write: 190MB/s

I mention only the max. numbers as these figures depend on different factors for file operations. The difference for maximum read here is 20MB/s abosolutely which is 4% relatively.


This is an attempt to write a canonical answer for drive error/faults and the importance of backing up data.

The Symptoms

  My iMac doesn’t start up. The loading bar doesn’t fill up and then,
  after 10 minutes or so, it shuts down.

This is just one of the symptoms of a possible hard drive crash.  It could be that it boots but is horribly slow.  It could also boot and perform well, then suddenly crash (kernel panic).  It could make horrible noise, or it could be as quiet as the day you bought it (SSD's of course).

In this particular case, it attempts to repair the volume, fails, then shuts down.  This definitely points to a failed drive.

What to do...

Stop using your device and remove your drive.  If you ever hope to have a chance at recovering your data you need to stop attempting to boot from it.  Most of all, don't try to "stress" it in the hopes of making things better.

A Word on Backing up Your Data

Ironically, the last item mentioned is the most important:

  (I haven‘t saved my files on a external hard drive and I don‘t want to
  lose it)

Whether you are using an iMac, a MacBook Pro, a PC or even working on an IBM mainframe, the very first thing you need to consider is backing up your data.  Everything fails. Period. Whatever it is, at some point in time, it will fail. What we cannot predict with any certainty is when it will fail

Your operating system can be easily reinstalled.  It may take a few weeks to tweak your settings just so, but that doctoral dissertation, picture of your family from last holiday, or file with the original recipe Coca-Cola will be gone - forever (generally speaking).

Backup is a very inexpensive insurance policy.  You can recover your data, but at a very high cost.  Would you rather pay $100USD for an external USB drive or thousands to a data recovery service?

Is it practical to backup your data now?  Probably and personally, I would avoid using the drive until I could get set up with a fully functioning machine before I begin my data recovery attempts.

Replacing a Failed Drive

The specific iMac model wasn't referenced, but it really doesn't matter in the context of this answer. It could be a spinning hard drive or an SSD inside an iMac, Mac Pro, or MacBook.  The drive has failed and it must be replaced.

iMac - must remove the glass to access the internal hard drive.  All Intel iMacs (at the time of this writing) have user serviceable drives - they can be replaced.  SSDs are normally proprietary, however.

Pre-2012 iMacs used magnets to hold the glass and screws to hold the LCD.  The removal is fairly straight forward.
2012 and later iMacs have the glass and LCD fused together with the assembly fastened to the body with adhesive.  This must be cut to access the internals

MacBook Pros

2012 and earlier MacBook Pro's used off-the-shelf standard 2.5" HDDs.  Removal of the bottom cover allows access to drive and memory.
2013-2015 MBP's used a "proprietary" PCIe SSD that was also accessible after removing the rear cover
2015 and later MBP's have the SSD soldered to the PCB.  It is no longer a user serviceable part.

"Rebuild" your Mac

To begin the process of rebuilding your Mac, you need to start with a clean slate and a fully functioning machine.  You can't rebuild you car's engine or transmission while you're still driving it and you can't rebuild your data while operating on a faulty system.

Here's what you need to do:

Buy a USB drive for Backup
Install a new drive
Re-install macOS and your Applications.
Make a backup

The Recovery Process

Get a USB to SATA enclosure/adapter to connect to your failed drive
Obtain recovery software and attempt the recovery process
After you have recovered all that you can, make another backup
Set up a backup strategy and schedule

Each one of these items has been address separately on this site and at many times linked back to Apple's own site (i.e. Using Time Machine).

One very important thing to note is that iCloud is not backup; it's file synchronization.  Meaning if you delete it on one device, it's deleted everywhere.


Logging into apps using Facebook credentials always uses a browser - Is this avoidable?

This is by design. Separation of applications and processes on iOS is deliberate.

Interprocess Communication (IPC) on iOS

Interprocess-communication between iOS apps is particularly limited. Apple would argue this is a net benefit, as their customers are better protected from malicious behaviours that are difficult to detect during the review process.

Shared Credentials Between Apps

Apps created by the same developer, digitally signed by the same organisation, can share credentials on iOS. This is how the Facebook and Messenger apps can both know you are logged into the Facebook service. But other Facebook connected apps, created by different developers, can not.


The usb icon you see in your 'desktop' is a finder's option, it has nothing to do with your actual desktop directory.

You can link the usb to your desktop directory :

ln -s /Volumes/"usb" ~/Desktop/"usb"

this way you'll have the usb folder on your finder's desktop and you desktop directory


How do I get the Shortcuts app in iOS 12?

Shortcuts app is available for all the devices running iOS 12. You can use this App Store link to access the app.

Open this answer directly on your iPhone/iPad and tap on the link above to directly open the App Store page of the Shortcuts app and download it. Alternatively, open the link in Safari for macOS and AirDrop it to your iPhone/iPad. This will directly open the App Store page for the app where can download it.

Your devices aren't too old to run the app. There is no special device capabilities required for running the app. The app is supported on all the devices capable of running iOS 12. (For iPhones that goes as far back as iPhone 5s.)

Shortcuts used to be a 3rd party app called Workflow before Apple acquired the app and hired the development team. You can learn more about the app here.

Apple has shared a pretty in-depth user guide explaining how to use this big step forward for iOS - the features are baked deeply into iOS and 3rd party developers can write extensions that let shortcuts and Siri reach into those apps and do work and automation.

Shortcuts User Guide


How do I stop VoiceOver on iPhone from being interrupted by notifications?

I use Voice Over all the time and if I understand it correctly the setting for Speak notifications in the VO settings is just to speak the notificatons when the screen is locked. Unfortunately the only way to have it not speak individual notifications is to turn each one off as there is no way to all notifications on or off at once. Hopefully ios 6 might remedy this with the do not disturb setting that is supposed to be included.


Does FileVault encryption slow read/write access on an SSD?

Every time you make the computer do something extra, in this case encrypting/decrypting all file access, it will take longer and the machine will slow down a bit.

FileVault 1 did slow things down noticeably, but with FileVault version 2 (Introduced in OS X 10.7 (Lion)) running on an SSD there is no noticeable decrease in reading or writing files. I have this enabled on a 15" MacBook Pro Retina and a 2012 11" MacBook Air. The only time it is noticeable is when you reboot, as it requires a password before starting the boot process.

You may notice that the system is slow when you first enable FileVault 2, since it has to encrypt the whole drive. Once that is done you will probably forget that it is on.

If you decide that you don't agree with me, turning FileVault off is easy enough. You will, once again, have the slow initial period as the whole drive is decrypted.


iOS / ipadOS app with share action for SCP / SFTP?

You can SFTP using iOS Shortcuts app.

Shortcuts can take input from a share action.
Shortcuts has an action ‘Run Script Over SSH’ and passes action input to stdin.
You can cat stdin to a file on the destination.


What is Firmware.scap in the /EFI partition?

I suspect the second file is a security update. The 1st one most certainly is a no-fly zone.
Has to do with firmware I think.

However, never ever mess with your (U)EFI partition, or you may have a very expensive Apple doorstop on your hands...

Well, my own EFI partition is mounted here. You can mess around with it all you like on an external bootable USB stick.

I'm doing this just to see if I'm able to run an unallowed version of OSX on a very old, already scrapped Mac Mini.

OS bootloader seems to depend on (U)EFI, namely...
Revive a broken bootloader/ EFI partition, and you may do wonders. I think.

Just look at this:
http://xpcboot.weebly.com

Have fun, but don't break a working Mac...


Usually it is recommended to use public DNS servers like Google 8.8.8.8 and 8.8.4.4 in situation like this.

You can delete any other DNS in your syst pref Networks- DNS or make sure the Google is at the top of the list.

If you want to get in to the DNS then use a little app called namebench which will analyze and recommend to you the best (fastest) DNS server. I have used the namebench and followed its recommendation and yes, my loading of the web pages is faster.


The specs say that it only supports a single external display.


Problem downloading some urls with cURL on OSX

Have you tried running

brew update

and

brew updgrade

before

brew install homebrew/science/gmt

Usually many problems with formulas may be solved by simply updating & upgrading homebrew and its formulas!


Applescript click automation in Google Chrome browser?

You can also click elements with JavaScript:

tell application "Google Chrome" to tell active tab of window 1
    execute javascript "document.getElementById('chrome-web-store-title').click()"
    --execute javascript "document.querySelectorAll('.tile-grid .most-visited')[3].click()"
end tell

Focusing an existing tab by URL:

tell application "Google Chrome"
    repeat with w in windows
        set i to 1
        repeat with t in tabs of w
            if URL of t starts with "https://mail.google" then
                set active tab index of w to i
                set index of w to 1
                return
            end if
            set i to i + 1
        end repeat
    end repeat
end tell


Turns out that Books on Catalina is a disaster. It moves all of your data from wherever you had it in iTunes (in my case an external drive) and puts it onto your internal drive. There is no interface to change the location (you can do it with a symbolic link created in terminal I believe).

mv ~/Library/Containers/com.apple.BKAgentService/Data/Documents/iBooks/Books/ /Volumes/SomeDrive/Books
ln -s /Volumes/SomeDrive/Books ~/Library/Containers/com.apple.BKAgentService/Data/Documents/iBooks/Books/

I have a new November 2019 MacBookPro, so I can't download to Mojave.

For more reading and complaining check the following link:

https://macmost.com/forum/how-do-i-manage-my-audiobook-library-in-macos-catalina.html


How do I restore files accidentally deleted by the move operation in finder?

STOP ALL FILE OPERATIONS AND UNMOUNT YOUR HARD DRIVE

If you haven't written to the Drive since then, it will eventually save you.

When Moving files like this, they get marked as deleted on the drive.
Therefore you can only try to recover them.

Which means:

Get a Recovery-Software like DataRescue
Or a free (CLI) programm like PhotoRec
Try recovering the files.


MacBook Pro Factory reset started installing OS X El Capitan but now OS X Mavericks installer appears

Install Mavericks and upgrade it to El Capitan. When your do so it should create a proper recovery partition. Reboot into that and erase the disk and re-install El Capitan.


This isn't built into macOS so this is something you are going to have to script and do a bit of customization.  You will need the following:

Custom location for your sound
Script to randomize the sound
launchd plist to run the script at a set interval

Custom Location for Sound

System sounds are in the /System/Library/Sounds directory which I don't recommend attempting to modify.  You can copy them to ~/Libary/Sounds or another custom directory of your choosing.  This way, you can add your own custom sounds without interfering with the System sounds themselves.

Script to Randomize Soundfile

The script below will generate a random number between 0 and the number of files you have in your sound directory.  It will then create an array of all the file names and then select a random filename (array element) which it will then copy that file to another file called CustomAlert.aif.  You can customize the filename and path to suit your needs.

#!/bin/bash
#
# script filename:  randomAlert.sh

#User Defined Variables
  sdir="/Users/foobar/test"
  sfname="CustomAlert.aif"

#Remove Custom Alert Sound if already Exists

  if [ -f ${sdir}/${sfname} ]; then
    rm -f ${sdir}/${sfname}
  fi

#Get Number of Files in Directory
  numfiles=(*)
  numfiles=${#numfiles[@]}

#Generate Random Number
  rnum=$(( $RANDOM % ${numfiles}  + 0 ))

#Put names of files into array
  fnames=(*)

#Copy file to Alert Sound File
  cp ${sdir}/${fnames[${rnum}]} ${sdir}/${sfname}

exit

Make sure the script's permissions is set to allow execution:

chmod +x randomAlert.sh

Finally, make sure the script is in a "safe" location (a folder in your home directory is always a good place)

Launchd plist

To have the script run, you need to use the launchd service.  The plist can go in any one of 3 locations:

~/Library/LaunchAgents - For just one user, run as the user (i.e. yourself)
/Library/LaunchAgents - For all users, run as the user
/Library/LaunchDaemons - As a system daemon (run as root)

I recommend either of the first two; it doesn't make sense to run as a system daemon.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN"
  "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>Label</key>
    <string>com.user.randomSound</string>
    <key>ProgramArguments</key>
    <array>
        <string>/Users/USERNAME/Path_to_Scripts/randomAlert.sh</string>
    </array>
    <key>StartCalendarInterval</key>
    <array>
    <dict>
        <key>Hour</key>
        <integer>00</integer>
        <key>Minute</key>
        <integer>00</integer>
    </dict>

</dict>
</plist>

Once you have copied it to the appropriate directory, you need to launch it with launchctl

launchctl load com.user.randomSound.plist

Set your Alert Sound to the Custom File

In your settings, set the alert to CustomAlert.aif.  Even though the sound will change, the name of the file will stay the same.

That's it!  Every 24 hours, your script will kick off and set a new random alert sound.


Photoshop CS4 works with 10.4.11 and above. So yes it'll work with Snow Leopard or Lion.

There might be some minor issues on Lion. I don't know if the have been corrected since.


AppleScript: How to right-click, without deselecting text, in Google Chrome?

A workaround for "Google Chrome" (also work on any application): use dd:x,y and du:x,y

It's for a drag and drop, but it's a simple click when you put the same coordinates, like this:

do shell script "/usr/local/bin/cliclick kd:ctrl dd:. du:." -- mouseDown and mouseUp at the current cursor location


Why is the System Preferences lock decorative and no longer preventing changes when locked?

On Mojave, the categories with no padlock requirement are Contacts, Calendars, (no app has requested access to Reminders yet), Photos, Camera, Microphone, Automation and Advertising.

Those requiring Admin password are Location, Accessibility and Full Disk Access.

Analytics does not require unlocking to change Share iCloud Analytics but does for Share Mac Analytics and Share with App Developers which are otherwise input inhibited.

Former list permissions didn't require me to enter root password as far as I remember. So it shouldn't ask on a later time either.

You can check whether password is required or not by

tccutil reset Microphone

or any other item like AddressBook. See this blog for the same

https://www.felix-schwarz.org/blog/2018/08/new-apple-event-apis-in-macos-mojave or man tccutil.

As for those protected ones, +- buttons are given and they are greyed out if padlock is locked.


What's a normal value for kernel_task RAM usage?

Yes, that amount is normal.

As kernel_task performs a lot of tasks on behalf of user-space processes (i.e. the ordinary programs you're running on your computer), the actual memory usage of kernel_task will vary a lot according to which programs you're currently running, and what you're doing with them.


Is it legal to use content from Apple developer site for internal training documents?

Well, not a lawyer here, but you could infer that your use would be considered acceptable use based on the following information, as long as you don't use any paid content (content obtained as part of a paid developer program) in these presentations:

Support Center - Registered Apple Developers has a question titled "What are the terms and conditions of being a Registered Apple Developer?", the answer for which points to the Registered Apple Developer agreement (PDF).
The agreement PDF talks about publicly available information and confidentiality here:

  4. Confidentiality.
  You agree that any Apple pre-release software and/or hardware (including related documentation and materials) provided to you as a Registered Apple Developer (“Pre-Release Materials”) and any information disclosed by Apple to you in connection with Apple Events or Paid Content (defined below) will be considered and referred to as “Apple Confidential Information”. Notwithstanding the foregoing, Apple
  Confidential Information will not include: (i) information that is generally and legitimately available to the public through no fault or breach of yours, (ii) information that is generally made available to the public by Apple, (iii) information that is independently developed by you without the use of any Apple Confidential Information, (iv) information that was rightfully obtained from a third party who had the right to transfer or disclose it to you without limitation, or (v) any third party software and/or documentation provided to you by Apple and accompanied by licensing terms that do not impose confidentiality obligations on the use or disclosure of such software and/or documentation.

Note the exclusion of "(ii) information that is generally made available to the public by Apple" from the list of Apple Confidential Information.
Also, when you browse through the documentation online (or download a PDF), they don't state those as Apple Confidential Information. However, you are allowed to disclose Apple Confidential Information to other employees/contractors who are also registered Apple developers.
The agreement PDF also deals with Apple Confidential Information disclosure here:

  5. Nondisclosure and Nonuse of Apple Confidential Information. Unless otherwise expressly agreed or permitted in writing by Apple, you agree not to disclose, publish, or disseminate any Apple Confidential Information to anyone other than to other Registered Apple Developers who are employees and contractors working for the same entity as you and then only to the extent that Apple does not otherwise prohibit such disclosure. Except for your authorized purposes as a Registered Apple Developer or as otherwise expressly agreed or permitted by Apple in writing, you agree not to use Apple Confidential Information in any way, including, without limitation, for your own or any third party’s benefit without the prior written approval of an authorized representative of Apple in each instance. You further agree to take reasonable precautions to prevent any unauthorized use, disclosure, publication, or dissemination of Apple Confidential Information. You acknowledge that unauthorized disclosure or use of Apple Confidential Information could cause irreparable harm and significant injury to Apple that may be difficult to ascertain. Accordingly, you agree that Apple will have the right to seek immediate injunctive relief to enforce your obligations under this Agreement in addition to any other rights and remedies it may have. If you are required by law, regulation or pursuant to the valid binding order of a court of competent jurisdiction to disclose Apple Confidential Information, you may make such disclosure, but only if you have notified Apple before making such disclosure and have used commercially reasonable efforts to limit the disclosure and to seek confidential, protective treatment of such information. A disclosure pursuant to the previous sentence will not relieve you of your obligations to hold such information as Apple Confidential Information.

The agreement prohibits you from sharing paid content available as part of a paid developer program with anyone (including other employees in your organization) here:

  7. Paid Content License and Restrictions. As a Registered Apple Developer, you may have access to certain proprietary content (including, without limitation, video presentations and audio recordings) that Apple may make available to you from time to time for a separate fee (“Paid Content”). Paid Content shall be considered Apple Confidential Information, unless otherwise agreed or permitted in writing by Apple. You may not share the Paid Content with anyone, including, without limitation, employees and contractors working for the same entity as you, regardless of whether they are Registered Apple Developers. Subject to these terms and conditions, Apple grants you a personal and nontransferable license to access and use the Paid Content for authorized purposes as a Registered Apple Developer; provided that you may only download one (1) copy of the Paid Content and such download must be completed within the time period specified by Apple for such download. Except as expressly permitted by Apple, you shall not modify, translate, reproduce, distribute, or create derivative works of the Paid Content or any part thereof. You shall not rent, lease, loan, sell, sublicense, assign or otherwise transfer any rights in the Paid Content. Apple and/or Apple’s licensor(s) retain ownership of the Paid Content itself and any copies or portions thereof. The Paid Content is licensed, not sold, to you by Apple for use only under this Agreement, and Apple reserves all rights not expressly granted to you. Your rights under this license to use and access the Paid Content will terminate automatically without notice from Apple if you fail to comply with any of these provisions.


Delete the following 3 files located in ~Library > Preferences > SystemConfiguration :

 com.apple.airport.preferences.plist
 com.apple.network.identification.plist
 NetworkInterfaces.plist

Delete the airport / wifi network interface and re-create.
Reboot and connect to WiFi


How can I share my iMac's internet connection with my iPad?

The answer you're looking for, though, is Internet Sharing:

Go into the System Preferences on your iMac
Go to Sharing, then click on Internet Sharing
In the dropdown, indicate that you want to "Share your connection from" Ethernet
Check the Airport box
You have the option to set your network name, channel, and to use WEP encryption by clicking "Airport Options".
Finally, check the box next to "Internet Sharing" on the left hand side.
At the prompt, click Start.

You should now be able to connect to the internet on your iPad by selecting the network you set up on your iMac.

USB sharing is also now easy and fast: Can I share my iMac's internet to iPhone or iPad over USB?


What causes PDF file size to increase when saving in Preview?

In his little-known novel, PDF Karenina, Leo Tolstoy wrote,

  Optimally encoded PDF files are all alike; every sub-optimally encoded PDF file  is sub-optimally encoded in its own way.

It's hard for anyone to answer why your PDF files are larger after Preview modifies them. A PDF file consists of many different kinds of data: images, content streams, fonts, document overhead, color spaces, extended graphics states, and a cross reference table. Just like one sentence might be concise and another verbose, but both are valid English and say the same thing, so too one PDF file might have a more verbose way of representing the same content as a more concise PDF file. We'd have to look at your exact PDF files. It's likely that they were created by a variety of different pieces of software, some consise, some less so.

It also matters what version of Mac OS X and Preview you are using, because that determine the software that writes the new PDF file when you do a Save As in Preview.

I can, however, tell you what gets larger about some of my PDF files. This story applies to my computer, running Mac OS X 10.5.8 and Apple Preview 4.2 (469.5).

One file, Giulio.pdf, is a 22-page document with text as text, not scanned images. It is 461,092 bytes large. I opened it in Preview, did File... Save As..., and saved it under a new file name. The new file is 724,421 bytes, or 57% larger.

I opened each file with Adobe Acrobat Professional, version 8.3.1 for Mac OS. I did Advanced... PDF Optimizer... Audit Space Usage.... A small dialog box gave a break-down of how many bytes were due to each category of usage, plus the percent of the total file size for the category.

The original Giulio.pdf has 390,754 bytes (84.75%) devoted to content streams, and zero bytes devoted to images. It is in the PDF 1.4 format. The file saved by Preview has 675,846 bytes (93.29%) devoted to content streams, also zero bytes of images, and is in the PDF 1.3 format.  Preview made the content streams 285,092 bytes larger, and that represents 73% of the file size difference between the two.

I wondered if the PDF 1.3 file format was inherently less efficient for storing this kind of file. I opened the original Giulio.pdf in Adobe Acrobat Professional 8, and did Advanced... PDF Optimizer... Make compatible with: Acrobat 3.0 and later and pressed OK. I saved the resulting file under a new name. The resulting file is in the PDF 1.3 format, and was 452,356 bytes, or smaller than the original. Its content streams are 375,171 bytes (82.94%), a similar proportion, but smaller than the content streams of original file.

Thus it seems we can conclude that the Preview app on Mac OS X 10.5.8 is not as efficient as some other PDF creators at making concise content streams in PDF files, and the difference is enough to account for three-quarters of the size difference in a PDF file without images.

I did a similar experiment on form k.pdf, a 1-page document scanned from paper. The original file is 303,730 bytes, of which 298,197 bytes (98.18%) are images. A copy of this file created by Preview using Save As... is 300,601 bytes, or 1% smaller. This file size difference is more than accounted for by a smaller "document overhead" category of bytes in the file created by Preview.

Thus it seems we also can conclude that Preview doesn't always cause a PDF file to increase in size. It depends on the nature of the original PDF file, and how concise it was to start with.


How do I monitor bandwidth use of specific websites?

Historygram is a neat extension for Safari, but it appears to only measure visits, not bandwidth. Feel free to email the author and ask if this extension could easily be modified to include bandwidth measurement.


Looks like there is an Eclipse extension for Fortran, aptly called Photran. It should run fine on the Mac.