What are the practical differences between Bash and Zsh?

First, some important things:

Bash isn't going away. If you're already using bash, nothing will change for you. All that changes is that zsh will be the default login shell for new accounts, and even then, you can select bash instead.
Scripts are not affected. What changes is the shell for interactive use, i.e. the shell in terminals (and also a few other things that use the login shell, such as crontabs). If you have a script in a file with execution permissions, starting with a shebang line such as #!/bin/bash or #!/bin/sh or #!/usr/bin/env bash, it'll keep working exactly as before.
Zsh's syntax is not completely compatible with bash, but it's close. A lot of code will keep working, for example typical aliases and functions. The main differences are in interactive configuration features.

Now, assuming you're considering switching to zsh, which has been a possibility for years, here are the main differences you'll encounter. This is not an exhaustive list!

Main differences for interactive use

Configuration files: bash reads (mainly) .bashrc in non-login interactive shells (but macOS starts a login shell in terminals by default), .profile or .bash_profile in login shells, and .inputrc. Zsh reads (mainly) .zshrc (in all interactive shells) and .zprofile (in login shells). This means that none of your bash customizations will apply: you'll need to port them over. You can't just copy the files because many things will need tweaking.

Key bindings use completely different syntax. Bash uses .inputrc and the bind builtin to bind keys to readline commands. Zsh uses the bindkey builtin to bind keys to zle widgets. Most readline commands have a zsh equivalent, but it isn't always a perfect equivalence.

Speaking of key bindings, if you use Vi(m) as your in-terminal editor but not as your command line mode in the shell, you'll notice zsh defaults to vi editing mode if EDITOR or VISUAL is set to vi or vim. bindkey -e switches to emacs mode.

Prompt: bash sets the prompt (mainly) from PS1 which contains backslash escapes. Zsh sets the prompt mainly from PS1 which contains percent escapes. The functionality of bash's PROMPT_COMMAND is available in zsh via the precmd and preexec hook functions. Zsh has more convenience mechanisms to build fancy prompts including a prompt theme mechanism.

The basic command line history mechanisms (navigation with Up/Down, search with Ctrl+R, history expansion with !! and friends, last argument recall with Alt+. or $_) work in the same way, but there are a lot of differences in the details, too many to list here. You can copy your .bash_history to .zsh_history if you haven't changed a shell option that changes the file format.

Completion: both shells default to a basic completion mode that mostly completes command and file names, and switch to a fancy mode by including bash_completion on bash or by running compinit in zsh. You'll find some commands that bash handles better and some that zsh handles better. Zsh is usually more precise, but sometimes gives up where bash does something that isn't correct but is sensible. To specify possible completions for a command, zsh has three mechanisms:

The “old” completion mechanism with compctl which you can forget about.
The “new” completion mechanism with compadd and lots of functions that begin with underscore and a powerful but complex user configuration mechanism.
An emulation to support bash completion functions which you can enable by running bashcompinit. The emulation isn't 100% perfect but it usually works.

Many of bash's shopt settings have a corresponding setopt in zsh.

Zsh doesn't treat # as a comment start on the command line by default, only in scripts (including .zshrc and such). To enable interactive comments, run setopt interactive_comments.

Main differences for scripting

(and for power users on the command line of course)

In bash, $foo takes the value of foo, splits it at whitespace characters, and for each whitespace-separated part, if it contains wildcard characters and matches an existing file, replaces the pattern by the list of matches. To just get the value of foo, you need "$foo". The same applies to command substitution $(foo). In zsh, $foo is the value of foo and $(foo) is the output of foo minus its final newlines, with two exceptions. If a word becomes empty due to expanding empty unquoted variables, it's removed (e.g. a=; b=; printf "%s\n" one "$a$b" three $a$b five prints one, an empty line, three, five). The result of an unquoted command substitution is split at whitespace but the pieces don't undergo wildcard matching.

Bash arrays are indexed from 0 to (length-1). Zsh arrays are indexed from 1 to length. With a=(one two three), in bash, ${a[1]} is two, but in zsh, it's one. In bash, if you just reference an array variable without braces, you get the first element, e.g. $a is one and $a[1] is one[1]. In zsh, $a expands to the list of non-empty elements, and $a[1] expands to the first element. Similarly, in bash, the length of an array is ${#a}; this also works in zsh but you can write it more simply as $#a. You can make 0-indexing the default with setopt ksh_arrays; this also turns on the requirement to use braces to refer to an array element.

Bash has extra wildcard patterns such as @(foo|bar) to match foo or bar, which are only enabled with shopt -s extglob. In zsh, you can enable these patterns with setopt ksh_glob, but there's also a simpler-to-type native syntax such as (foo|bar), some of which requires setopt extended_glob (do put that in your .zshrc, and it's on by default in completion functions). **/ for recursive directory traversal is always enabled in zsh.

In bash, by default, if a wildcard pattern doesn't match any file, it's left unchanged. In zsh, by default, you'll get an error, which is usually the safest setting. If you want to pass a wildcard parameter to a command, use quotes. You can switch to the bash behavior with setopt no_nomatch. You can make non-matching wildcard patterns expand to an empty list instead with setopt null_glob.

In bash, the right-hand side of a pipeline runs in a subshell. In zsh, it runs in the parent shell, so you can write things like somecommand | read output.

Some nice zsh features

Here are a few nice zsh features that bash doesn't have (at least not without some serious elbow grease). Once again, this is just a selection of the ones I consider the most useful.

Glob qualifiers allow matching files based on metadata such as their time stamp, their size, etc. They also allow tweaking the output. The syntax is rather cryptic, but it's extremely convenient. Here are a few examples:

foo*(.): only regular files matching foo* and symbolic links to regular files, not directories and other special files.
foo*(*.): only executable regular files matching foo*.
foo*(-.): only regular files matching foo*, not symbolic links and other special files.
foo*(-@): only dangling symbolic links matching foo*.
foo*(om): the files matching foo*, sorted by last modification date, most recent first. Note that if you pass this to ls, it'll do its own sorting. This is especially useful in…
foo*(om[1,10]): the 10 most recent files matching foo*, most recent first.
foo*(Lm+1): files matching foo* whose size is at least 1MB.
foo*(N): same as foo*, but if this doesn't match any file, produce an empty list regardless of the setting of the null_glob option (see above).
*(D): match all files including dot files (except . and ..).
foo/bar/*(:t) (using a history modifier): the files in foo/bar, but with only the base name of the file. E.g. if there is a foo/bar/qux.txt, it's expanded as qux.txt.
foo/bar/*(.:r): take regular files under foo/bar and remove the extension. E.g. foo/bar/qux.txt is expanded as foo/bar/qux.
foo*.odt(e\''REPLY=$REPLY:r.pdf'\'): take the list of files matching foo*.odt, and replace .odt by .pdf (regardless of whether the PDF file exists).

Here are a few useful zsh-specific wildcard patterns.

foo*.txt~foobar*: all .txt files whose name starts with foo but not foobar.
image<->.jpg(n): all .jpg files whose base name is image followed by a number, e.g. image3.jpg and image22.jpg but not image-backup.jpg. The glob qualifier (n) causes the files to be listed in numerical order, i.e. image9.jpg comes before image10.jpg (you can make this the default even without -n with setopt numeric_glob_sort).

To mass-rename files, zsh provides a very convenient tool: the zmv function. Suggested for your .zshrc:

autoload zmv
alias zcp='zmv -C' zln='zmv -L'

Example:

zmv '(*).jpeg' '$1.jpg'
zmv '(*)-backup.(*)' 'backups/$1.$2'

Bash has a few ways to apply transformations when taking the value of a variable. Zsh has some of the same and many more.

Zsh has a number of little convenient features to change directories. Turn on setopt auto_cd to change to a directory when you type its name without having to type cd (bash also has this nowadays). You can use the two-argument form to cd to change to a directory whose name is close to the current directory. For example, if you're in /some/where/foo-old/deeply/nested/inside and you want to go to /some/where/foo-new/deeply/nested/inside, just type cd old new.

To assign a value to a variable, you of course write VARIABLE=VALUE. To edit the value of a variable interactively, just run vared VARIABLE.

Final advice

Zsh comes with a configuration interface that supports a few of the most common settings, including canned recipes for things like case-insensitive completion. To (re)run this interface (the first line is not needed if you're using a configuration file that was edited by zsh-newuser-install):

autoload -U zsh-newuser-install
zsh-newuser-install

Out of the box, with no configuration file at all, many of zsh's useful features are disabled for backward compatibility with 1990's versions. zsh-newuser-install suggests some recommended features to turn on.

There are many zsh configuration frameworks on the web (many of them are on Github). They can be a convenient way to get started with some powerful features. The flip side of the coin is they often lock you in doing things the way the author does, so sometimes they'll prevent you from doing things the way you want. Use them at your own risk.

The zsh manual has a lot of information, but it's often written in a way that's terse and hard to follow, and has few examples. Don't hesitate to search for explanations and examples online: if you only use the part of zsh that's easy to understand in the manual, you'll miss out. Two good resources are the zsh-users mailing list and Unix Stack Exchange.
An extensive collection of articles on switching to zsh on the mac can be found on scriptingosx.com and a useful Ruby script to bring your command history with you, can be found on Github.


Closing applications after documents are closed- OS X 10.8

If you want to disable showing an iCloud-centric open dialog when you for example open TextEdit or Preview, you can either disable syncing documents and data from the iCloud preference pane, or use this unexposed preference:

defaults write -g NSShowAppCentricOpenPanelInsteadOfUntitledFile -bool true

There are some third party applications like RedQuits that make closing a window quit an application. RedQuits only applies to closing windows by pressing the close button though. There is a noticeable delay before it quits an application, and it doesn't support excluding applications like Mail.

10.7 also added support for automatic termination, which as far as I know just means that applications that have no open windows are hidden from the Dock and the application switcher under certain conditions. If you for example open Preview, open at least one window in it, close all windows, and switch to another application, Preview is hidden from the Dock and the application switcher. The process is not actually terminated, but there might be some changes in how it is managed.


MacBook Pro Mid 2007 Not Showing Linux USB In Boot Menu

I tested booting from a USB flash drive on a (20 inch, mid 2007) iMac.

First, download the file ubuntu-16.04.1-desktop-amd64.iso from the Ubuntu web site: Download Ubuntu Desktop.

Second, erase and format a flash drive for a single MS-DOS (FAT) volume using a Master Boot Record (MBR) partitioning scheme.

Next, transfer the iso file to a USB flash drive using UNetbootin. This application runs on Windows, OS X and Linux. The instructions, when using OS X, are given at this site: How to create a bootable USB stick on OS X.

  Note: The message shown below is wrong. The USB flash drive can be used to boot off a Mac.

This flash drive did appear on the Mac Startup Manager menu. By selecting the icon, I was able to boot to a live version of Ubuntu.

The Ubuntu installation software places the Ubuntu startup files (GRUB) in a EFI partition. Unfortunately, the Mac firmware ignores these files. Therefore, nothing representing the Ubuntu installation appears on the Startup Manager menu.

When holding down the Option ⌥ at startup, the Mac firmware will look for the \EFI\BOOT\BOOTx64.EFI file on each EFI partition of all drives accessible at startup. Each occurrence will generate an icon with the label "EFI Boot" on the Startup Manager menu.

Searching, for the BOOTx64.EFI file in the folder \EFI\BOOT on a EFI partition, is part of the UEFI specification. For example, if you go to the "uefi.org Specifications web page", you can download and view the "UEFI Specification Version 2.5". Sections 3.5.1.1 Removable Media Boot Behavior and 3.5.1.2 Non-removable Media Boot Behavior (on pages 88-90) describe the naming of the BOOTx64.EFI file and that it should appear in the \EFI\BOOT folder.

When Windows installs, some of the startup files are stored in the folder \EFI\MICROSOFT. These files are also duplicated (with some renaming) in the \EFI\BOOT folder. Not all non-Apple operating systems do this when installing. For example, Ubuntu Linux does not. (Well, last time I installed in EFI mode it did not.) The Ubuntu installer does create a folder \EFI\UBUNTU with startup files (GRUB), which the Mac firmware by default ignores. To get Ubuntu to appear in the Startup Manager, you have to manually mount the EFI partition and copy the files in the \EFI\UBUNTU folder to the \EFI\BOOT folder. (Also, the copied grubx64.efi file needs to be renamed to BOOTX64.EFI.)

If you need to do this for two operating systems, then you will need a second EFI partition. This should not present a problem since an EFI partition is fairly small (<200 MB) and the limit on Macs by default is 128 partitions. However, to tell one operating system for the other, while viewing the choices presented by the Startup Manager, you may want to change the icons.

For example, I have rEFInd installed in a second 134 MB EFI partition on my iMac. (This happens to be the last of 9 partitions.) Additionally, I have Windows 10, Yosemite (on volume "Steelhead") and El Capitan (on volume "Steelhead2") installed. Below is a image of my Macs Startup Manager menu. (For a better view, click on the image or open in a new window.)

The icon can be changed by mounting the EFI partition and adding the icon file .VolumeIcon.icns to the root folder. A collection of these icons, for popular Linux and other operating systems, can be found here.

  Note: While the Mac Startup Manager can be used to boot Ubuntu, this extra step is unnecessary when Ubuntu is the sole installed operating system. In this case, one would be better off by blessing Ubuntu so this operation system is always chosen at Startup. The process for doing this is beyond the scope of your posted question.


It's the option key. Also called the Alt key on a windows keyboard.

It's the key to the between command and control.


Adding a song file to iTunes via the command line without playing the file

You can use the "Automatically Add to iTunes" folder for that (see PH19617):

cp song.mp3 ~/"Music/iTunes/iTunes Media/Automatically Add to iTunes/"

If iTunes is running, anything you copy into this folder will be imported into iTunes automatically (and deleted from the folder afterwards).

Please note:

The folder name might be language specific, so check the name on your system first.
Depending on when iTunes was installed, the media folder may be called either iTunes Media or Tunes Music


What rtmp streaming software solutions exist?

Try influxis.com, it's web based but you could get your cam streaming pretty quickly. There are free options also like Red5, it's open source and it doesn't use FMS.


What are the historic OS X versions' 'selling lines'?

Here is a list of Apple slogans. A good portion down is OS X slogans.


Is there a program I can install to make title/header bars attach to the window?

Way back in the OS 9 days, we could install hacks to do crazy things like recolour windows and move around those window controls, but now they are simply buried too close to the metal to do system-wide. Back in those days too many of these hacks would cause system instability. I'm sure Apple could have built in such customization cleanly in OS X, and indeed in the very early versions I recall some rudimentary functionality for "skinning" — but today having a consistent user interface is viewed by the company as a feature, not a liability.

I found this article with a fairly nice summary of utilities that bring some of the best features of windows to OS X. But unfortunately (fortunately?) adding extra menu bar clutter to every single window or moving the window controls isn't one of them.


Did I just brick my Apple TV's internet capability?

Do a clean install of tvOS 10 on your Apple TV

Download the tvOS 10 on developer.apple.com
Once the download is complete, launch iTunes.
Now connect your Apple TV 4 unit to your computer using a USB-C to USB-A cable.
Assuming your Apple TV 4 is connected to your computer and powered on, you’ll see your device listed in iTunes in the top left hand corner. Click on it to select.
Click on the ‘Restore’ button while holding down the left ‘Option’ key. A new window will come into view asking you to select a firmware file.
Select the firmware file you downloaded in step 1 and you’re good to go.

The restoration process won’t take that long and iTunes will throw you a prompt when things are complete.


How to duplicate the content of a MiniDV to a DVD?

There are a few ways to get a single large DV file imported from tape, depending on whether your constraint is budget or time:

1) QuickTime Pro 7 has a recording mode that can see DV devices. Yes, Apple still charges $29.99 for it, but the interface is simple and lets you record a long, single file. Just make sure the capture format in the app's preferences is set to 'Device Native' or something along those lines (I believe it wants to transcode to MPEG-4 by default).

2) WhackedTV was a free sample application provided by Apple to developers to demonstrate video capture frameworks. The app seems to be gone from Apple's site but a third-party mirror is available. This app lets you add a DV video/audio source, configure its capture format, and record as long as you need to. I still use this app on a regular basis.

3) A final option is to script the standard QuickTime 7 player via AppleScript to open a video capture window, which it will allow you to do even if you haven't purchased Pro. Unfortunately, I don't have the original source code for this script, so you would have to open up AppleScript Editor and QT7's dictionary and work it out through trial and error.

Any of these recording approaches will yield a .dv file (or a DV file in a .mov container), either of which can be taken in by iDVD, a simpler DVD app like Burn, or by Handbrake if you wish to transcode to MPEG-4/H.264.


Okay, the steps for resetting the SMC on a MacBook Pro with a built-in battery are as follows:

Shut down your computer
Keep the MagSafe adapter (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.

Is that what you did?

Resetting your PRAM/NVRAM

Older Macs had what's called Parameter RAM (PRAM), newer Macs use Non-Volatile Random-Access Memory (NVRAM). It may be worth you resetting your PRAM/NVRAM, using these steps:

Shut down your machine. Yes, a full shut down, not just logging out.
Press the power button and then press the commandoptionpr keys. You have to make sure you press these keys before the gray screen appears or it won’t work.
Hold those keys down until your Mac reboots again and you here the startup chime.
Let go of the keys and let your Mac reboot normally.

Note: When you log back in you may need to readjust some of your system preferences (e.g. mouse speed, time and date/timezone, etc).

Let us know how you go.


Share one calendar - keep other calendar local

Setting up Google to sync calendars will sync only Google calendars. Your local calendar on your iPhone remains local and is only synced if you choose to do so through iCloud.


Apache2 not running on High Sierra without Homebrew

I solved this issue:

httpd has to be started via sudo or by root.

This system is a clean install of High Sierra.

The solution was to run commands in terminal to
stop and restart httpd.

The solution to the ethernet
interface issue was to reset the PRAM.


Will the App Store reviewers allow scripts downloaded as text, if it is parsed via WebKit?

Apple's review team will reject your app if it looks capable of downloading executable code. They have erred on the side of rejecting apps that legitimately look like they will only even "interpret" the code since Apple stands far more to lose when third parties discover this path to executing code and inject the code between your web server and your app.

The stakes are too high - so you'll want to be very careful that you understand the risk to your app if you include this functionality.

The briefs app - which was submitted to the app store in Late 2009 I believe, was hung up in this "what is the difference between interpreted code, downloadable game data (think new levels for a game), executable code" review state until April 2013

http://blog.robrhyne.com/post/659211315/almost-on-the-app-store
http://iphonedevelopment.blogspot.com/2010/08/briefsapp.html
Wireframe iOS design apps for iPad?

Clearly, there are far more apps on the store that use interpreters so your path to approval is likely to be smoothed by the efforts and pain of the pioneers that got Apple used to the idea that they can ensure interpreted code and configuration doesn't turn into executables.


Why are there ghost items in my podcast list that I cannot delete?

Re-download the offending podcast then delete it.


How to run VLC on El Capitan? El Capitan claims "VLC.app will damage your computer."

I've had the same issue with El Capitan. Strangely, i could open the VLC.app from within the mounted dmg (OS X just said its unsigned) but not after I copied it to /Applications.

So I tried to copy it with the terminal like

cp -R /Volumes/vlc-2.2.1/VLC.app /Applications/

and voila, after that I could also open it from within the Applications folder.
Please note the "-R"-option.

I think this is safer than allowing malicious files to be executed by disabling Gatekeeper.


How do I fix printing from El Capitan to shared Windows printer?

Well, this worked pretty much: http://tweaks.com/windows/46495/enable-ios-airprint-support-on-windows/

15 minutes to set up and test.


How to make Adobe applications respect desktop/spaces?

Been struggling with this problem too, until I've found that the fix is, actually, very simple.

Right click on the Photoshop icon in dock > Options > Assign To "None".

This worked for me.


There is probably a login item that is attempting to run it still in your user account.

In System Preferences select Users & Groups then your account in the left hand list. To the right select Login Items and browse the list. When you find TotalFinder click on the small '-' at the bottom of the list.

This should fix it.

If that doesn't work and the Uninstaller they give you doesn't work then I suspect their uninstaller is running into a permissions problem caused by the upgrade to Mavericks. I would try a reinstall and then uninstall.


You can install this command line tool from github.com/nriley/brightness. The install is pretty easy if you have homebrew:

brew install brightness

And usage is straightforward:

Set 100% brightness: brightness 1
Set 50% brightness:
brightness 0.5

Unfortunately it doesn't work for external monitors. See Does Apple support DDC/CI for  3rd party displays via Apple's Thunderbolt to DVI adapter for background on why.


Does restoring from Time Machine also restore installed applications?

Yes - if you haven't excluded the /Applications folder from the Time Machine backups.

As for system patches - you're installing a new OS. Once you finish, load up the Software Update and it'll pull down the most recent Combo Update for you. Actually, it's better to use the combo update than a collection of patches you would have otherwise.

For more on this go to System Preferences → Time Machine → Options. It'll tell you what, if anything, you've excluded.
No. As long as you have sufficient space, you'll be fine. It doesn't need to be an identical drive.


Shared photo library moving into new photos app?

If you have Photostream turned on and set it to download Photostream photos, then iPhoto will put them in an Event by month. It will look similar to other photo Events that you've created. iCloud Photo Library sees these as just normal photos and will upload them. Everything in the System Library (which means the default Photos library) will get uploaded, so the only way to stop it is to turn off iCloud Photo Library or put those photos into a separate Photos library.

If you have iCloud Photo Library turned on in your Mac and iPhone, then they will eventually sync up.

All pictures in your iPhone Photos app will get uploaded into iCloud Photo Library (including screenshots and saved photos from other apps/internet).


MBR-partitioned HDD: How to encrypt Time Machine backup?

I think what you could do is creating a encrypted disk image on the external HDD and put your time maschine files in it for the timeframe your friend has the disk. To achieve this open the disk utility tool and choose File -> New -> Blank Disc Image (or Image From Folder).

BUT keep in mind that as long as this disk is not (re-)formatted properly it will be easy to recover unencrypted data which seems to be deleted or moved (using some fancy recovery tools).


Yahoo! Messenger says it supports Windows Live/MSN Messenger accounts, and is a Universal (iPhone & iPad) app.

Not free, but only $0.99 is Live Messenger Pro.


Can I use GPL-licensed source in my iOS app?

As this is a legal question you have to ask a lawyer about this, any answer on the internet (including this) is not reliable

However The Free Software Foundation (which write the GPL) have written this blog about GPL v2 and the App Store http://www.fsf.org/blogs/licensing/more-about-the-app-store-gpl-enforcement

This includes

  That's the problem in a nutshell: Apple's Terms of Service impose restrictive limits on use and distribution for any software distributed through the App Store, and the GPL doesn't allow that.


I have VMware and it does support native use of the video card. Boot Camp, of course, supports all of your Mac's hardware as well once you install the Apple driver set. I do not regularly play games anymore, so I cannot speak to how well something like Call of Duty would perform. What I can talk about is how well Windows performs in general when using VMware versus using Boot Camp.

When I had the stock amount of memory on my MBP (4 GB), Windows seemed to be "dragging" under VMware. Under Boot Camp it ran great. The main app that I use on Windows is Visual Studio, which is pretty resource intensive--although perhaps not as much as a game.

Once I added the maximum amount of memory that my MBP can take (8 GB), VMware's performance became respectable. I can now use Visual Studio side by side with the rest of Mac OS X and it doesn't feel "dragging" anymore. Of course, when I switch to Boot Camp I can tell the difference right away--with 8 GB of RAM this MBP became the best Windows PC I have ever had.

In summary, if you have a sufficient amount of RAM, I would give it a shot under VMware for gaming. But Boot Camp will always be your best bet. Hope this helps.


How to use the Terminal application to search or print a man page

man -t yourcommand | open -fa "Preview"

where yourcommand is the one you want the man page of. You can then use any of the normal search functionality in Preview and print the document as a normal PDF.


dd on Catalina gives "Permission denied" error even after grant it Full Disk Access in Security and Privacy

My bad.
If this happens to you, you might want to check the switch on your SD card to see if it is set to read-only. :)


Here's some other Git visual front-ends for macOS you might consider:

Sourcetree (free)
Github Desktop (free)
Fork (free evaluation, $49.99 after that)
GitKraken (Free Personal)


Video Lan Client can play just about every format of subtitle that's out there.


HTTP Get is not working stable after Netboot

Check the return value from curl. If there are problems you should get a non zero value. Something like this may work:

#!/bin/sh
echo trying download . . .
until curl http://example.com/test.file ; do {
    echo something went wrong. retrying download . . .
}; done
echo file downloaded.


Keynote Error Dialogue When Opening .pptx

Try to locate the .pptx file in Finder (instead of the Desktop), right click on it, then move the cursor onto Open with… and select Keynote to open the Powerpoint.

If that doesn't work let us know.


How Can I Restart in Windows Using a Script?

This works just using applescript. replace login_password with your login password.
Also make sure the path to BOOTCAMP is correct (it should be). Save as an application and open it when you want to reboot into BootCamp. This is two lines of code...

do shell script "bless -mount /Volumes/BOOTCAMP/ -legacy -setBoot -nextonly" password "login_password" with administrator privileges

do shell script "shutdown -r now" password "login_password" with administrator privileges


LaunchDaemon for pf won't load at startup

The problem was that there is a default plist for pfctl at /System/Library/LaunchDaemons/com.apple.pfctl.plist. They were conflict.

In that plist I set <key>Disabled</key> to <true/>, and everything works as expected.


Apps deleted in iTunes 11 not removed from iPhone & iPad

This seems like new feature since you can manage applications on your iDevice without changing others. This is way like iPhone Configuration Utility always do.


Your computer can't be shut down now, because software is being installed

Killing "installd" with Activity Monitor seems to have fixed the problem for me.


Have you changed your info.plist in boot camp assistant so you can use a .iso file for windows 8.1?

If you havn't follow my steps!

Find Boot Camp Assistant then DUPLICATE IT put it on your desktop right click it show package contents open info.plist then find PreUSBSupportedModels and remove the Pre JUST THAT save and open! then download a ISO

( Look up a activation key )

Here is download
( Dont need key to download )

https://www.microsoft.com/en-au/software-download/windows8

Always STAY cool!

By the way this is just so you dont lose storage on your HD Harddrive


Trapped: MacBook always shuts down during EFI SMC Update 1.8. Can't boot. How to remove updater from boot routine?

EFI firmware updates are 'staged' in the normally hidden EFI partition on your disk, which typically resides at device /dev/disk0s1.

Once in single-user mode, you can create a folder in which to mount this partition, then mount it like so:

mkdir /Volumes/efi
mount -t msdos /dev/disk0s1 /Volumes/efi

From here, navigate into the /EFI/APPLE/FIRMWARE/ sub-folder of the EFI partition.

If you find some files here, probably these are what your MacBook is trying to process and getting stuck on. You can safely delete them and reboot.


How do I FORCE restart a iPhone 4s with a broken sleep/wake button AND notification area stuck midway!

So Siri can open apps, but Notification Center is still there?

I'd guess you could try connecting to iTunes, make a backup, and restore from that backup over iTunes. Or you could use iTunes to install an iOS update if you aren't on the latest software. That'd force a restart but it might be overkill. You could also try draining the battery.

If the sleep button is broken, doesn't that bother you that you have to just wait for the screen to shut when you're finished or want it off? Maybe it's time for an upgrade.


Can I use one charger for all MacBooks from years 2008 to 2013?

The physical MagSafe adapter remains unchanged from a pinout perspective (the shape has altered externally from a T shape to an L shape and back again) for almost every Macbook except the 2012 Macbook Air and Retina Macbook which use MagSafe 2; Adapters are available to connect a MagSafe power supply to these machines, but you cannot use a MagSafe 2 adapter to power anything other than the 2012 Air and Retina at present.

You need to ensure that you use the correct power rated charger for the Macbooks.  Macbook Airs use a 45 watt supply, through to something like 85 watts for Macbook Pros.

It's OK to use a higher rated supply than is required, the charger only supplies what is asked of it, so a Macbook Air on a Pros power supply will only request its 45 watts, not get fried with 85 watts.

Conversely, it's not OK to do the opposite, running a MBP on an Airs power supply will request up to 85 watts of draw on a 45 watt power supply, and burn out the adapter eventually.


How often and for how long does Trim Enabler need to run?

What I used to do was enable TRIM, reboot, create and delete an encrypted disk image that almost filled the free space, leave my MBP idling overnight, disable TRIM, and reboot. That restored performance.

I'm not sure r/w volumes will tell you anything useful. The OS reuses erased blocks and the current controllers garbage collection is supposed to make TRIM largely irrelevant (or at least that's what I read).

I don't have that machine anymore and it seems like a lot riskier process under 10.10 so I'm not doing anything with TRIM on my Mac Mini w/ a Samsung 840 EVO.


Why many startups use IAP for their iOS apps, while they could direct the website to buy premium?

Yes, it's mandatory. Per the App Store Review Guidelines:

  If you want to unlock features or functionality within your app, (by way of example: subscriptions, in-game currencies, game levels, access to premium content, or unlocking a full version), you must use in-app purchase. Apps may not include buttons, external links, or other calls to action that direct customers to purchasing mechanisms other than IAP.

Some services absorb the IAP premium on behalf of the user, but I've certainly seen some services that just charge 30% more to subscribe/upgrade within the app, than they charge if you do it directly on their website.


It's not possible in Safari. It uses whichever search engine you define in Safari preferences. And the same applies to Google. Best I can do is use the one option they offer. I  don't know about other browsers.  There might be a programmatic way to do it but I don't know how to do it.

In Safari, it's way easier to change search engine. Go to address bar  (command+L), enter space(spacebar), choose search engine. There's no need to go to Safari preferences to do it.


You can create your own service in automator to provide this info in a popup.

Create a New Service in Automator and set it so the service receives image files in Finder
Add a Run Shell Script Action. Pass input as argument. One-liner shell script should be (depending on your path to exiftool) /usr/local/bin/exiftool -b -DateCreated $1
Pass the result into a Set Value of Variable Action. Create a new variable (I called mine EXIFDateCreated
Add a Get Value of Variable and select the variable you created above. Make sure to check the Ignore this actions input (...the first time you use this action, to separate the creation of variables chain from the getting. You can repeat the above steps numerous times to add other files you want to display, but for subsequent Get Value of Variables you would not ignore input).
Add a Run AppleScript Action the AppleScript could be:

    on run {input, parameters}
        set dateCreated to first item of input as text
        display dialog "Date Created: " & dateCreated

        return input
    end run

Here's a screen cap of the whole Automator service...

Save the Service as something like "Show EXIF Create Date" and make sure it is activated in the Keyboard Preferences (Under the Shortcuts tab). The action should now show up when you right click/command click on an image in the finder.

Note this can be tweaked to create a pretty decent alternate Info dialog, though this just shows the basics of how it can come together.


Generating a mask png from a color image?

You can do this in Photoshop, & I would imagine Pixelmator or any other decent graphics package could in a similar manner…
Invert Colour can also be done in Gimp - freeware, open source. If you want to use Gimp, then I'd recommend this Mac-specific build from https://www.partha.com/ which looks & feels far more 'Mac-like' than the official build.
Load your image, use the Magic Wand or equivalent to select the background.

Layer Menu > Layer Mask > Hide selection

You've now generated the basic mask shape.
The next bit is a bit fiddly, but you can automate it for future use.
Opt/click this new mask, then select all. Copy, click the picture item in the Layer, Paste. This will generate a new layer containing the black & white image of your mask.

Drag your original mask to the new layer (both thumbnails will then look the same.)
Disable your original layer to save confusion.
Click the main image in the thumbnail & Invert (Cmd/i)
That's your first mask. Save as png.
PNG with transparency is a 32-bit file rather than 24. Some apps differentiate this way, others including Photoshop have a dedicated "save Transparency" option which changes the bit depth for you.

Undo the Invert (or Invert again) then Opt/click the Mask & Invert.
That's your 2nd mask. Again save as png.

You could, of course, do each of these as a new layer, then saving your file as PSD or other native format would preserve all assets in a single file.


AppleScript returns error on defining date

Try:

set dateString to "Tuesday, April 12, 2016 at 12:00:00 AM"
set dateReference to date dateString

tell current application
    -- insert commands here
end tell

Another approach:

set y to 2001
set m to 6
set d to 12
set h to 12
set min to 12
set s to 12

set cd to current date
tell cd
    set its year to y
    set its month to m
    set its day to d
    set its hours to h
    set its minutes to min
    set its seconds to s
end tell


Issue with creating a symbolic link inside /System folder

I am guessing you are doing this to get git-svn to work. I've tested this on git 2.6.2. If so, link to non restricted directory:

sudo ln -s /Applications/Xcode.app/Contents/Developer/Library/Perl/5.18/darwin-thread-multi-2level/SVN/ /Library/Perl/5.18/SVN
sudo mkdir /Library/Perl/5.18/auto
sudo ln -s /Applications/Xcode.app/Contents/Developer/Library/Perl/5.18/darwin-thread-multi-2level/auto/SVN/ /Library/Perl/5.18/auto/SVN


Note:   Plotting just 2 points will give you a straight line only. To see any curvature in a date set, you must plot more than 2 points and the x values must span the proper region.

I think Excel, Numbers or Google Sheets would be your best bet. You can define an x range of values in one column and then calculate the y values. Both Excel and Numbers have charting/plotting capabilities. Be sure to select "scatter plot" as your choice for chart type. You can then plot the x and y data you generated. You can choose bar chart if that is what you want. Below is an image of your result using Google Sheets. If you change the x, y or y2 values the chart will update to reflect the new values. The image won't update though.

There are other plotting apps for the Mac. The Mac comes with Grapher which is good for charting functions. There is also Magic Plot, and Veusz.  These are probably overkill for what you want which is why I recommended a spreadsheet package.


How to disable "changing a repeating event" dialog in Mac calendar?

Unfortunately it cannot be settled up using CLI settings

  defaults  read com.apple.iCal

have no option to change default behaviour. But you can find useful a scripting with AppleScript


Accessibility — click a link/button by typing its text

In Safari you can use ⌥ Option⇨Tab to move through clickable controls/links on a webpage. Use ⇧ Shift⌥ Option⇨Tab move backward through the page. Then use the ⏎ Return key to open the link. You can make it a bit easier by turning on "Press tab to highlight each item on a webpage" in Safari → Preferences → Advanced. That will remove the need to use the ⌥ Option key, so just use ⇨Tab and ⇧ Shift⇨Tab.


Not sure if you're still having this issue and this is also for future users who have the same problem as well. A lot of people experience the app not loading problem.

The solution to this is fairly easy. All you have to do is restart your Apple Watch. You can do so by pressing on the side buttons (Digital Crown and the button below it) at once. Just wait for it to restart. If it doesn't help, reset it into factory settings.

Source: Cupertino Watch


osascript to trigger a hot key with multiple modifier keys in OBS Streamlabs is not working

OK, here is a workaround to the problem. Unfortunatley, this really isn't an answer as it doesn't explain why, at the lower OS level, the problem exists in the first place. It just works around the limitation by mapping key strokes with one or more modifiers to single keystrokes. Perhaps people who are more familiar with the keyboard at the lower levels of the OS can use this solution to figure out what might be happening.
Anyway, as mentioned, OBS Streamlabs can respond to single keystrokes as hotkeys that are simulated with applescript. For example, you can tell OBS to recognize "1" on the number pad as a hotkey. The problem, of course, is that using a single key as a hotkey will also generate that character in the terminal or any other app you are working in. So the trick is to tell OBS to set up a hotkey for numkey 1 and then remap a key stroke with one or more modifier keys to that single numkey 1 keystroke.
The low-level remapping can be accomplished with the free app Karabiner elements
So, using the app, I remapped the command + Num-1 combination to Num-1. So now when I run this simple script from the command line...
osascript -e "tell application \"System Events\" to key code 83 using command down"
...no character gets printed by the key stroke simulated by the one-liner above and the hotkey now gets triggered.
By they way, I could not figure out how to send keyboard output generated by an apple script to /dev/null. It doesn't appear to be possible, as best I can tell. So something like command + Num-1 that creates a "silent" keystroke is needed.
So, with this method, I can have a hotkey for all the rarely used keys on the keypad. I can also use all function keys that are not getting used by another app.


How to get Night Shift on both external monitors?

As the linked answers mention, disabling + re-enabling Night Shift seems to make things work fine. That said...
My guess is that "Night Shift" works by modifying the display profiles for monitors (certainly works that way for f.lux, you can see the display profile change in System Preferences). This happens on my system, and my suspicion is that I have two monitors with the same name (and EDID info, which is probably the actual identifier) => macOS can't figure out that both monitors are supposed to get the display profiles updated, and only one works correctly.


Deleted files from Macintosh HD still take up space

It's called local snapshots which works as a backup, if you are low in space the OS will automatically delete the stuff.


Is it legal to burn an iTunes playlist to an audio CD and give it a friend as a gift?

In Canada this is not legal. Private copying is covered by a levy you pay on the blank CD-R media you are burning the tracks to but private copies are for your own use, they cannot be given away. There's some contrast here with CDs that's interesting. With physical media like tapes or CDs the "owner" is the person in possession of the original copy. This definition made it legit, at least in Canada, to borrow original materiel, copy it, and then return it. The levy on the CD-R covered the royalty payment for the copy (in theory) and you weren't obligated to destroy copies if the original left your possession. With downloaded content you can't give away the original in the same sense as physical media. Lending downloaded media and non-private copying of downloaded media are essentially indistinguishable actions.

Some legal alternatives in Canada:

Buy all the songs in physical format and make your mix tape from those
Buy her the tracks as gifts via iTunes
Buy you and her a month subscription to Rdio and make her a shared playlist there

Downloaded content has taken all the romance out of making mix tapes, that's for certain.


If you have a paid developer account for AppleTV you can download, compile and install WWDC-tvOS. You can also download the OSX version (via the same link) and use Airplay to show the videos on your AppleTV.


go on the internet and type in find my ipod but then once you have done that type in your apple ID then take it out of recovery mode hopefully that should work


Disk Utility will not let me create new partition

It looks like you partition the whole drive to be the Mac drive.

To undo that and create multiple partitions follow following procedure.

How to Partition A Fusion Drive
Last updated January 10, 2013

See Controlled Fusion: Partitioning for Targeted Performance.

Shown below are two partitions of the Fusion drive in Disk Utility.

To partition a Fusion drive:

Backup your stuff (two backups strongly recommended).
Boot off any working drive (e.g. one of your backup clones).
Erase the Fusion drive (because your stuff might not fit on a downsize partition).
In the Partition tab, click the + button.
Drag the slider between the partitions to size as desired.
Set a name for the 2nd partition.
Apply.
Clone your system back to the new Boot volume (if too large, move some items first to the new 2nd volume).
Copy your other data (data not going onto the Boot volume) onto the 2nd volume.
Set the startup volume to the new Boot volume, reboot.


Safari appending .EXE to the end of .PDF

HTTP Header: Content-Disposition

Have the server include an additional Content-Disposition header when serving the PDFs:

Content-Disposition: attachment; filename="<MyPDF.pdf>"

This provides the browser with a strong suggestion for the desired filename and suffix. See How to encode the filename parameter of Content-Disposition header in HTTP? for a discussion about limitations and implementing this feature.

MIME Type

Additionally, make sure the server's PDF mime type in the Content-Type: header is set correctly. There are variations in use. application/pdf is the recommended type.

  The standard MIME type is application/pdf. The assignment is defined in RFC 3778, The application/pdf Media Type, referenced from the MIME Media Types registry.

Test with curl

Use curl -I http://example.com/mypdf.pdf to test and ensure the correct headers are returned by your server. curl can provide credentials to work as a logged in user.

Potentially related question: When sending headers to download a PDF, Safari appends .html


Wi-Fi process using up to 16GB of memory

This link provides instructions on how to reset your wifi configuration and removing/resetting specific plist files on your system under "Make a New Wi-Fi Configuration in MacOS Mojave" (with other useful Wifi tips), it could possibly help:

http://osxdaily.com/2018/11/19/fix-macos-mojave-wifi-problems/


Will leaving the screen of an iPad turned on 24/7 decrease its lifespan?

This is incredibly common for independant cafes and small restaurants using iPads as POS systems. I have personally had several iPads that are literally always on and they have lasted years.

I have also used cheap android tablets for the same purpose and as kitchen displays. They have their place and sometimes make sense but I’ve had to replace them often enough to say that I doubt that you would see a significant cost savings going that route.

If the outdoor weather proof box gets extremely hot you might see a difference but all the iPads I’ve used have been in fairly harsh conditions with very few problems.


Redirect to different machine with Server App

OS X Server uses Apache which is a very flexible application.  OS X Server does provide you with the ability to setup redirects (https://help.apple.com/serverapp/mac/5.0/#/apd1AB74EDF-C5B3-4C20-AD02-42120FF3B208)  If those settings are not sufficient and you are willing to tackle apache configuration files, there are additional options available to you.

Tutorial on Apache Redirects (https://www.digitalocean.com/community/tutorials/how-to-create-temporary-and-permanent-redirects-with-apache-and-nginx)

If you do a google search for "Apache configuration redirect" you'll find a lot more information on the topic.


Okay, today i redid this procedure in single user mode and it worked!


Required to fetch few details on FileVault

From man fdesetup :

haspersonalrecoverykey [-device] [-verbose]
    Returns the string "true" if FileVault contains a personal recovery key.

hasinstitutionalrecoverykey [-device] [-verbose]
    By default, this will return the string "true" if FileVault contains an
    institutional recovery key. On CoreStorage volumes specified using the
    --device option, this will return the hex representation of the public key
    hash instead of "true". The hash option is not supported for APFS volumes.
    This will return "false" if there is no institutional recovery key installed.

usingrecoverykey [-verbose]
    Returns the string "true" if FileVault is currently unlocked using the
    personal recovery key.

supportsauthrestart
    Returns the string "true" if the system supports the authenticated restart
    option. Note that even if true is returned, this does not necessarily
    mean that authrestart will work since it requires that FileVault be enabled.


Does secure erase through Terminal affect old user accounts?

Everything you describe seems to be just fine. To be totally sure I would re-enable FileVault and then cycle the keys (boot to recovery HD and erase the FV volume.) That ensures that each "block" is cryptographically scrubbed before you then re-introduce a new OS and then turn on FileVault2.

The main lesson to keep in mind is with SSD - be sure to enable FileVault before you put anything secure on the drive. That way when SSD swaps in new "excess capacity" blocks to replace others - you don't get old plain text data restored or have plain text data taken "offline" only to be possibly be put into service after you do the "wipe".

https://support.apple.com/kb/PH22241

The key phrase is:

  Note: With a solid-state drive (SSD), secure erase options are not available in Disk Utility. For more security, consider turning on FileVault encryption when you start using your SSD drive.


How can I maximise the life of my iPad battery?

According to Apple's website:

  Use Your iPad Regularly

  For proper reporting of the battery’s state of charge, be sure to go through at least one charge cycle per month (charging the battery to 100% and then completely running it down).


This is to me to know AppleScript with shell script.

My purpose is to use this to check the hard drive size.

I answer here.

#!/bin/bash
var=$(df -h / | tail -n 1 | awk '{print $4}' | sed 's|Gi||g');
checker=;

if [ ${var} -lt 40 ]; then
  checker=0;
  echo "The space is less than 40 Gb."
else
  checker=1;
  echo "The space is more than 40 Gb."
fi

if [ ${checker}=1 ]; then
  osascript <<'EOD'
tell application "Mail"
    set theFrom to “someone@gmail.com"
    set recipientName to ""
    set recipientAddress to “nobody@gmail.com"
    set theSubject to "The rest of hard drive space is less 40Gb"
    set theMessage to make new outgoing message with properties {sender:theFrom, subject:theSubject, visible:false}
    tell theMessage
        make new to recipient with properties {name:recipientName, address:recipientAddress}
        send
    end tell
end tell
EOD
fi


I just upgraded to Mountain Lion. Now I can't share files with the Snow Leopard on my network

Some troubleshooting steps to take:

Open the Sharing Preferences on the Snow Leopard Mac, and make sure that File Sharing is checked. Then click Options…* and make sure Share Files and Folders using AFP is checked.
On the Mountain Lion Mac, open Finder and click Go → Connect to Server… (or press ⌘K). In the server address box, enter afp:// followed by the IP address of the Snow Leopard Mac, then click Connect.

If you don't know the IP, you can find it by using Network Utility on the Snow Leopard Mac.

If that still doesn't work, open Terminal on the Mountain Lion Mac, and enter ping followed by a space and the IP of the Snow Leopard Mac.

If successful, you should see output like this:

64 bytes from 192.168.1.10: icmp_seq=0 ttl=64 time=0.249 ms
64 bytes from 192.168.1.10: icmp_seq=1 ttl=64 time=0.207 ms

In which case, there's something wrong with the file sharing set up.
If it's not successful, you'll likely get Request timeout errors, and it's a network issue.

Try those steps and post the results, and I'll update my answer with some more suggestions.


No Batteries Available ?-How to Check battery health on MacBook Pro early 2011

All the information you get from fancy 3d party is already in your system (that is where they get it from anyway).

Open your About This Mac, more info, system report and find Power:

It will tell you all about your battery.

It looks like this on my system:

Normally the Battery will keep a small reserve charge to be able to report its status to the computer. In your case somehow it was sucked dry completely :)

The good news is it is the battery, since your SMC is working and everything else is working based on the message "Replace battery". That same message was probably run all the time during your vacation, till the battery was exhausted to the level were the battery build in chip did not have enough power to talk to your OS. As for what caused that drain? did you leave your computer in a sleep mode ?


I was able to install the desired port by automating the activation process. The app fails to run due to some library version issues and I seem to be unable to fix those but that's a story for another answer or another question.

Create a script that continuously tries to install the port and automatically forcefully activates the discovered port that is blocking it. Copy paste the following into a file and call it port-instact.sh

if [ "$EUID" -ne 0 ]
  then echo "Please run as root"
  exit
fi
target="$1"
while [ 1 ]
do
    echo trying to install "$target"
    if [[ $(port installed "$target" | grep "$target") ]]; then echo "$target" present; break; fi
    line=`port install "$target" 2>&1 > /dev/tty | grep "port -f activate"`
    package=$(echo $line | sed -e "s/^.*port -f activate //" -e "s/. .*//")
    if [ "$package" = "$oldpackage" ]; then echo double \""$package"\"; break; fi
    oldpackage="$package"
    echo activating "$package"
    port -f activate "$package"
done

Make the file executable via chmod +x port-instact.sh
Run it as root sudo ./port-instact.sh scite and wait


How to insert the document to the end of the Word doc instead of the beginning?

Use the end of content property the get the end position of the text object.

Here's the script, tested on Microsoft Word Version 16.13

set FilePath to choose file
my AddAttachmentFileToWordDoc(FilePath)

on AddAttachmentFileToWordDoc(FilePath)
    set f to FilePath as text
    tell application "Microsoft Word"
        set StartRange to (end of content of text object of active document) - 1
        set theRange to create range (active document) start StartRange end StartRange
        insert file at after theRange file name f with confirm conversions
    end tell
end AddAttachmentFileToWordDoc

An alternative to a range, you can use after last character of active document, like this

on AddAttachmentFileToWordDoc(FilePath)
    set f to FilePath as text
    tell application "Microsoft Word"
        insert file at (after last character of active document) file name f with confirm conversions
    end tell
end AddAttachmentFileToWordDoc


Open Java .app application bundles with double click on a Mac without Apple's Java 6

From replies to a question I asked on Apple's java-dev list it would appear that on a Mac with Java 8 from Oracle installed, but not Java 6 from Apple, there is no current way to open a Java application bundle that was created using Apple's own old jar bundler technology. I suspect this is because the JavaApplicationStub is written to expect some aspect of Apple's Java not present in Oracle's Java.

From a user's point of view the only thing to do would seem to be to download and install Java 6 from https://support.apple.com/kb/DL1572 while it is still available.

From a developer's point of view the safest bet would be to embed Java within one's application bundle using a tool such as jwrapper (www.jwrapper.com). Alternatively there may be tools for creating a bundle that will run with Oracle's Java 8+.


How can you tell / identify which macOS Recovery actually boots with a dual macOS installation in one APFS partition/container?

This is 2013 iMac with High Sierra and Catalina installed in the same APFS container. When first booted to a recovery you will a small icon next to Reinstall macOS, which represents which macOS is install. Below is High Sierra.

Next is Catalina.

By selecting macOS Utilites->About macOS Utilities from the menu bar, you can get a larger icon. Below is High Sierra.

Next is Catalina.

By selecting Reinstall macOS from the initial window, you can get an even larger icon and a label. Below is High Sierra.

Next is Catalina.

By selecting Utilties->Terminal from the menu bar, you can get Terminal application window. If you enter the command sw_vers you will the the version of macOS. Below is High Sierra.

Next is Catalina.


What does the 'Special Paste' menu item in Xcode do?

It's a fairly obscure and hard to find official documentation covering it feature of the OS X pasteboard being capable of storing several presentations of object data on several pasteboards.

Basically, you can have multiple items in a pasteboard and they are object oriented - so for image if you have copied an image - there is metadata that you could paste - especially when the image itself isn't passable into a plain text document.

When you have a png image in your clipboard, the "special" is renamed:

Paste Image Name

I presume there are all sorts of items you could have "special" aspects of which to paste into an Xcode document in addition to the name of an image, especially if an UTI is defined for that object:

https://developer.apple.com/library/prerelease/mac/documentation/Cocoa/Conceptual/PasteboardGuide106/Articles/pbConcepts.html


Big Sur - Homebrew Install - illegal variable name

You need to install homebrew with this command:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

Note: Use /bin/bash rather than /usr/bin/ruby.
The curl command inside the $() expression is executed and returns the content of the install.sh file. Then, the shell replaces the $() expression with these install instructions. As the install instructions are written for bash rather than ruby, bash is needed to execute them.
I could not reproduce the "illegal variable name" issue, however. Therefore, here are a couple of other workarounds that might help:
Option 1: Switch to bash or zsh
The "illegal variable name" could occur if you are not using bash or zsh as your terminal shell, but csh or tcsh instead. (You could find out using echo $0.)
Try switching to bash or zsh before executing the install command:
/bin/zsh
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

The first line starts a zsh shell. (You can also try /bin/bash instead, but I think, Big Sur uses zsh by default, now.) Then the second line is executed in this shell, which should circumvent the "illegal variable name" error.
The reason is that the bash and zsh shells might handle the $() expansion differently than csh and tcsh. If csh interprets everything after the $ as variable, it might consider $(... is an illegal variable name.
Option 2: Install from downloaded file
If, as mentioned in the comments, you have already downloaded the install.sh file, try executing the following in your terminal:
/bin/bash /path/to/install.sh

Here, /path/to/install.sh needs to be replaced by the actual path of the downloaded file. You could just type /bin/bash  and then drag-and-drop the file to your terminal, which should insert the path.


Messages.app notification only shows contact number instead of contact names on macOS

I managed to fix this by going to System Preferences > Language & Region.  I changed the default language from English (UK) to English (Canada) and quit System Preferences.  I then changed the default back to English (UK) and then quit System Preferences again.  I then restarted macOS.
I have absolutely no idea why that works.  From the number of similar posts on the internet proposing different solutions, I suspect there are multiple possible issues leading to the same problem.  However, this it worked for me on macOS Big Sur 11.0.1.  Unfortunately I can't find the link describing this solution to give credit but if anyone does find it do link in.
Hope this helps you.


Safari showing border of transparent PNG

I just faced the same issue and stumbled upon this question.

For me, the image showed a thin, medium-dark, shadowy border at the edge between the non-transparent and the transparent part of the image.
The issue was only visible in Safari.

For me, the solution was to simple add transform: translateZ(0px) to the image. This changes the rendering of the image in a way that prevents the border.

However, you might want to restrict this fix to Safari since it causes the image to be rendered pixelated in Chrome.


Are there Anti-Theft apps for iPad similar to cerberus for Android

Apple makes their own anti-theft app, and it seems to be a fairly reasonable app as far as features. You can find out more about it here.

As of iOS 6, and the latest version you can use it to remotely (among other things):

Lock your device
Erase your device (the app doesn't work after this)
Display a message to the user
Play a sound
Geolocate the device
Get directions to the device
Put it in Lost mode, and allow the finder to call you while the device is locked (iPhone only)

Note that it has to have a internet connection, in order to communicate with whatever you are looking it up with. Also, it must have GPS for an accurate location - although wifi only devices that are connected to wifi should display their location, but it will be more general.

This app is the best one for iOS devices. Others have the limitation of sandboxing that Apple uses for security reasons. But sandboxing limits the features other anti-theft (it should be called "Recovery") apps can have.


Mac mini with an iPad as the only display?

Sidecar lets you use an iPad as a secondary display for your Mac. So Sidecar doesn't have any such kind of mode that lets you use an iPad as the only display.
You can, however, explore some 3rd party solutions which claim to make your iPad usable as a standalone display for a Mac mini. A such prominent 3rd party solution is Luna Display, Headless Mode

https://shop.astropad.com/pages/headless-mode

With Luna Display, turn your iPad into the primary display for Mac mini. Combine the best of Mac mini and iPad by harnessing the processing power of the Mac mini and the edge-to-edge full display of the iPad.
Minimum Requirements

Mac mini must be a 2011 model or later, and running macOS 10.11 (El Capitan) or later
iPad must be an iPad 2, iPad Mini, iPad Pro, or iPad Air model running iOS 9.1 or later (32-bit devices are not supported)
External mouse and keyboard connected to Mac mini are optimal for this setup in case of MacOS permissions and logins

How to Get Started

An external display is required to get set up, but is only needed the first time you configure your devices (unless FileVault is enabled).
Luna Display requires a Mac application to run. For Headless Mode, if FileVault is in use, an external display will be needed to unlock your drive whenever you reboot.

https://help.astropad.com/article/218-how-do-i-use-luna-display-in-headless-mode

Headless Mode: Using your iPad as the display for Mac mini
What you will need to get started:

Mac Mini

iPad

Luna Display and latest versions of the Luna Display apps, available for download at lunadisplay.com/hello

Reliable local WiFi network connection or USB cable
We recommend connecting an external keyboard to your Mac mini.

P.S.: No affiliation whatsoever with Luna Display or any subsidiaries. Never used it personally before.


What are the RAM requirements for OS X 10.10 Yosemite

Absolute minimum is 2GB... though 4GB would be a more tenable minimum, 8GB more comfortable, 16GB would be able to breathe properly.

8GB really is the 'minimum sensible' for a modern OS, whatever the official spec says.


Are foreground applications allocated more system resources than others?

It's most probably not psychological as multiple things affect the allocation of system resources, and being a foreground window is one of them.
In general all processes (and even threads) running on a system has a priority, which is used to determine the amount of CPU resources made available to it. If you open a normal GUI program, it will start with a priority of 46. If it is the foreground window, the priority is increased by 1 to 47.
The actual range of priorities on a live system is much larger as other things factor into the process priority. They range from 0 (lowest priority) to usually 97 (queue in a real time process). For ordinary programs you run, you'll usually see priorities such as 20 (utility program), 31 (base priority), 46 (background) and 47 (foreground).
You might be experiencing the impact of a feature known as "App Nap". It essentially slows down applications that the system thinks the user is not actively using in order to speed save energy and/or improve performance of other apps.
Specially it targets apps that are:

not the foreground (selected) app
hasn't recently updated visible information on screen
isn't playing audio
isn't using OpenGL 3D graphics
isn't actively managing energy usage using IOKit/NSProcessInfo

When those conditions are in place, the application can be put into App Nap. If you look at Activity Monitor in the Energy tab, you'll see a column named "App Nap". If this says "Yes", the app is napping.
When an application is in App Nap it runs slower due to a reduction of its CPU priority, throttling of I/O and throtting of timers.
You can read more about App Nap in Apple's documentation here:
https://developer.apple.com/library/archive/documentation/Performance/Conceptual/power_efficiency_guidelines_osx/AppNap.html
As far as I recall, the priority of an App Nap'ed program is 4.


Save attachments from Mail.app based on subject

First create a rule that looks for ANY  of the Manifest in all of the variations or DSR

Like So:

Then save this script (assuming you are using 10.8 Mountain Lion. )
In the folder ~/Library/Application Scripts/com.apple.mail/

    using terms from application "Mail"
    on perform mail action with messages theMessages for rule theRule

        set codeList to {"CV", "VS", "SAA", "TK", "DHV", "LH"}
        set subFolder to ""
        set theDate to do shell script "date +%Y_%m_%d_%H%M%S"
        --set ruleName to name of theRule

        -- The folder to save the attachments in (must already exist)
        tell application "Finder" to set attachmentsFolder to ((path to home folder as text) & "Dropbox:DSR") as text

        tell application "Mail"

            repeat with eachMessage in theMessages
                set theSubject to subject of eachMessage
                repeat with i from 1 to number of items in codeList
                    set this_item to item i of codeList
                    if theSubject contains this_item then

                        set subFolder to this_item

                    end if
                end repeat
                if (count of (eachMessage's mail attachments)) > 0 then

                    try

                        tell application "Finder"

                            if not (exists folder subFolder of folder attachmentsFolder) then
                                make new folder at attachmentsFolder with properties {name:subFolder}
                            end if
                        end tell
                        -- Save the attachment
                        repeat with theAttachment in eachMessage's mail attachments

                            set originalName to name of theAttachment
                            set savePath to attachmentsFolder & ":" & subFolder & ":" & originalName

                            tell application "Finder"

                                if (exists file originalName of folder subFolder of folder attachmentsFolder) then
                                    set savePath to attachmentsFolder & ":" & subFolder & ":" & theDate & "_" & originalName
                                end if
                            end tell
                            try
                                save theAttachment in file (savePath)

                            end try
                        end repeat

                    end try

                end if

            end repeat

        end tell
    end perform mail action with messages
end using terms from

And point the Run Applescript at it.

If you are using an earlier Mac OS. Then you should be able to place the script where ever you want.

Thats it.

My tests all have worked. But it is late here and I should be in bed. So let me know if any issues and I will try and sort. :-)

The one thing to note is I have added a time stamp instead of a number for same named files. It is more reliable.


How to suppress the Delete From All Devices confirmation in the Photos app?

Command+Delete avoids the confirmation dialog.


Is there a way to make a 2009 MacBook (A1342) boot from USB?

Any Intel Mac should be able to boot from USB. So the possibilities are:

that this particular Mac can't boot at all
that the USB disk is not configured correctly.
that the USB port is damaged.

Make sure that the USB drive uses the GUID partition map (not Apple Partition Map, nor Master Boot Record).
Make sure the OS on the boot disk is an OS that supports that hardware: - macOS 10.6.1 (Snow Leopard) to 10.13.6 (High Sierra).


How does "Find my Mac" work, since there's no GPS in a Mac?

It checks what Wifi networks are in range and then looks up their locations in a big database of known Wifi access points -- I think Apple use the Skyhook database.


iMac Intel 21.5" EMC 2805 Looping chime on booting

I finally fixed my imac. Here is steps:

I bought a new EFI chip from https://macunlocks.com/
I changed chip on mainboard my imac.
Finally my mac was opened but lanuage was chinese and ask me efi password(new chip has no efi pass.)
Reset PRAM with CMD + Alt + P + R how to reset PRAM
Fixed! Imac living after 2 months later.

I founded solution and similar situation from here.


Where can I find the latest java update for Mac OS systems prior to 10.6?

The Java updates for OS X come from Apple, not Oracle (that "owns" Java and provides downloads for Windows and Linux). In general, Apple doesn't seem to support OS X versions prior to 10.6 (that's something like an unofficial policy, they seem to support the latest 2 versions only), so in general you can't get official Apple updates for anything, including Java, for 10.5 and below. There were ideas about some open source substitutes for Java, but I am not sure what happened to them. Given the recent Java issues, Apple may decide to create and distribute Java update for 10.5, but I won't bet on that.


I don't think my macbook can sense the right temperature

Before making bold claims it could be the fan control app that you downloaded.

Try installing this free app to see what temperature readout you get with it.

As for your computer been very hot, anything above 50 Celsius feels hot to people. Your computer can operate up to 100 Degree Celsius (internally, the CPU) at which you would have blisters if you touch it.

If you have a household thermometer use it to check. The Mac body is designed no to exceed 60 Celsius since people could end up having burns and sue Apple for that.

If you still think your Mac goes way to hot, bring it in for service.


Upgrading macbook pro to mavericks - performance question

The question is, will Mavericks operate faster than Mountain Lion on my MacBook ? Will my hardware be able to run 10.9 efficiently ?

Yes. Mavericks has the same system requirements as Mountain Lion, but offers huge gains in energy efficiency, memory management, graphics performance, etc. And it's free!

If you're already in the process of moving over to Mountain Lion, I can't think of any reason not to jump directly to Mavericks instead.


You have to let it finish FileVault decryption entirely before you can turn it back on. This can take hours or sometimes days, so you'll have to be patient. Encryption also takes nearly as long. There's nothing to do but wait for it to complete.

If you have a MacBook, be sure to keep it plugged in, as FileVault wont decrypt or encrypt while on battery power.

You should still be able to use your computer while it decrypts/encrypts.


Is there a Mac OS X Terminal version of the "free" command in Linux systems?

As @khedron says, you can see this info in Activity Monitor.

If you want it on the command line, here is a Python script that I wrote (or perhaps modified from someone else's, I can't remember, it's quite old now) to show you the Wired, Active, Inactive and Free memory amounts:

#!/usr/bin/python

import subprocess
import re

# Get process info
ps = subprocess.Popen(['ps', '-caxm', '-orss,comm'], stdout=subprocess.PIPE).communicate()[0].decode()
vm = subprocess.Popen(['vm_stat'], stdout=subprocess.PIPE).communicate()[0].decode()

# Iterate processes
processLines = ps.split('\n')
sep = re.compile('[\s]+')
rssTotal = 0 # kB
for row in range(1,len(processLines)):
    rowText = processLines[row].strip()
    rowElements = sep.split(rowText)
    try:
        rss = float(rowElements[0]) * 1024
    except:
        rss = 0 # ignore...
    rssTotal += rss

# Process vm_stat
vmLines = vm.split('\n')
sep = re.compile(':[\s]+')
vmStats = {}
for row in range(1,len(vmLines)-2):
    rowText = vmLines[row].strip()
    rowElements = sep.split(rowText)
    vmStats[(rowElements[0])] = int(rowElements[1].strip('\.')) * 4096

print 'Wired Memory:\t\t%d MB' % ( vmStats["Pages wired down"]/1024/1024 )
print('Active Memory:\t\t%d MB' % ( vmStats["Pages active"]/1024/1024 ))
print('Inactive Memory:\t%d MB' % ( vmStats["Pages inactive"]/1024/1024 ))
print('Free Memory:\t\t%d MB' % ( vmStats["Pages free"]/1024/1024 ))
print('Real Mem Total (ps):\t%.3f MB' % ( rssTotal/1024/1024 ))

As you can see, you can just call vm_stat from the command line, though it counts in 4kB pages, hence the script to convert to MB.

The script also counts up the "real memory" usage of all running processes for comparison (this won't match any specific value(s) from overall memory stats, because memory is a complex beast).

Here's an example of the output of the script on my system:

[user@host:~] % memReport.py
Wired Memory:           1381 MB
Active Memory:          3053 MB
Inactive Memory:        727 MB
Free Memory:            1619 MB
Real Mem Total (ps):    3402.828 MB

(very slightly adjusted to match the tab sizing on StackExchange ;)


Apps randomly crash when using keyboard shortcuts in popups

It seems a faulty keyboard layout produced by Ukelele seems to be the culprit. Switching to the default keyboard layout fixed it for me. If someone can shed some light on how this works I would appreciate it.


What determines the limit on voicemail storage on an iPhone 7?

Whoever you spoke to one the phone was wrong, your carrier limits the number of voice mails you can have stored.


How to setup Apple Mail so it truly removes email from Google?

The challenge is that Gmail uses "Labels" to attach to messages, and messages can have zero or more than one label, while IMAP puts messages in folders (Inbox, Trash, etc) and every message is in one, and only one, folder. Thus, when Mail.app tells the Gmail server to delete a message from the Inbox, the Gmail server cannot reliably tell if it should just remove the "Inbox" label from that message (leaving it with one fewer label, possibly still having other labels, or maybe no label but still available in the "All Mail" view) or if it should more permanently remove the message completely from the database.

The "fix" is to setup Gmail to not show the messages in multiple IMAP folders (by turning off the "All Mail" folder) and to also have the Gmail servers "expunge" the message when the Mail.app tells it so rather than doing it "automatically", even though that (default) setting on the Gmail server seems to imply that the "auto" setting would be what was desired.

I have not tested ALL of these settings (I mostly rely on the "30 days in the trash" feature of Gmail to empty things: https://support.google.com/mail/answer/7401?hl=en ) and I have only recently updated to "El Capitan", but things do not seem any different from my Yosemite, Mavericks and earlier experiences. Note that as of May 2020 I am still using the same setup in systems up to and including Mojave, but have not done any testing of Catalina. The way the system works seems to be the same using either a "regular" @gmail.com account or a "Google Apps for Domains" @yourdomain.com account.

I do, however, have things set so that email does get put into the trash properly on the Gmail side of things, and it looks like there are settings available to delete things immediately, and it works on my system in the way I want it too.

So the detailed instructions are:

At http://gmail.com/, log in to your account and select the following:
"Settings" -> "Forwarding and IMAP"
Check "Enable IMAP"
For "When I mark a message in IMAP as deleted"

Check "Auto-Expunge off - Wait for the client to update the server."

For "When a message is marked as deleted and expunged from the last visible IMAP folder"

Check "Immediately delete the message forever"
(I have my system set up to "Move the message to the Trash" and rely on the 30 days mentioned above)

You need to select the "Save Changes" button at the bottom for this to take effect.

These settings will only invoke the deletion (or move to Gmail Trash) when the message no longer has any Gmail tags associated with it, or in other words, when an IMAP client removes the message from all of the IMAP folders. Since one of the "folders" that can be displayed in a Gmail IMAP client is "All Mail", just deleting a message from the Inbox of the IMAP client will not cause it to go bye-bye. Thus we need to limit the "Labels"/"Folders" that Gmail exposes as IMAP folders:

On Gmail, select the following:
"Settings" -> "Labels"
Check the "Show in IMAP" checkbox for "Inbox", "Sent Mail", and "Spam" and UNCHECK the "Show in IMAP" checkbox for all of the other "System Labels". Any user generated non-system label can be set to "Show in IMAP".

Note that unchecking the "All Mail" "Show in IMAP" checkbox might make a whole bunch of email that has no other labels (is in no other IMAP folder) no longer be visible in Mail.app or any other IMAP client. Using the Gmail web interface to search up these "orphaned" messages and adding the Inbox label or some other label that is shown in IMAP would make them visible again to Mail.app.

With the Gmail system set in this manner, I find that the best Mail.app settings to use are to have the "Mail" -> "Preferences" -> "Accounts" set up for the Gmail account in question set so that "Mailbox Behaviors" is set to only "Store on the Server" for the "Sent" and "Junk" mailboxes. I have those two boxes checked, and have the boxes for "Drafts" and "Trash" unchecked. These two need to be unchecked because we have set the Gmail server to not expose those boxes as IMAP folders.

I only rarely go to the Gmail web interface, doing almost all of my interactions with Gmail through Mail.app or the iOS Gmail app. Some of these settings might have alternative setups if one did a lot of website interactions.

For Mark's desired outcome of deleting the messages immediately, the above settings should work - when a message is moved or deleted from the Gmail Inbox and Spam folders, it should immediately be deleted from the Gmail server. The message could still be available in Apple's trash can, but that is not linked to the server's trash can. (If the "Move the message to the Trash" setting was set on the Gmail server, the server will move it to the server's trash, and thirty days later, it will be gone). I do not know if Mail.app will send the "expunge" signal to the Gmail servers immediately, or only after the local Mail.app trash has been emptied, or on some other synchronization schedule.

An alternative might be to have the Gmail server expose the server trash as an IMAP folder and have Mail.app store the trash on the server. With the "Immediately delete the message forever" server setting set, this should behave as desired - emptying the trash in Mail.app should cause the Gmail server to delete the message forever. I have not actually tested this immediate deletion setup, so if anyone has any actual experience with this, please let us know.

The key to all of these is to NOT expose the "All Mail" as an IMAP folder, and to counter-intuitively have "Auto-Expunge" turned off so that the options for deleting the mail are available to be selected.

This also will not have a direct impact on messages manipulated via the Gmail website - when you use the website to remove all labels from a message, that message will still be in the "All Mail" collection, and will not be immediately delete or moved to the trash. It might be necessary to go to the Gmail website and look through the "All Mail" collection and dispose of anything that has no labels.

Note that in Yosemite and later, when you set up an account that Mail.app recognizes as a Google or Gmail account (including accounts of organizations that are hosted at Google), it will not set up the account designated as "IMAP", but will instead designate it as "Google IMAP" and will select and then grey out the "Advanced" setting of "Automatically detect and maintain account settings" which can cause the SMTP account associated with the "Google IMAP" account to also have this Advanced setting of "Automatically detect and maintain account settings" to be selected and greyed out, so it cannot be unselected. This also seems to happen when system upgrades happen and mail accounts are updated when the Mail.app program is updated.

To force the creation of a "regular" IMAP account, one can create a new account in Mail.app but use bogus IMAP server information that Mail.app does not recognize as Google servers (such as "smtp.notgm.comm" and "imap.notgm.comm"). After the account is created as a "regular" IMAP account, my testing indicates that changing the server information to the correct Google server does not change it into a "Google IMAP" account, and the "Automatically detect and maintain account settings" can (and probably should, if you don't want things to get changed without your knowledge) be unchecked. I do not know if the "Google IMAP" account designation has any other features or abilities that the "regular" IMAP account does not.

For completeness, here are the required settings for Google's Gmail system as of Nov 2015:

imap.gmail.com
Gmail IMAP user name: Your full Google account address (e.g. "me@gmail.com" or "me@company.com")
Gmail IMAP password: Your Google account password
Gmail IMAP port: 993
Gmail IMAP TLS/SSL required: yes

smtp.gmail.com
Gmail SMTP user name: Your full Google account address (e.g. "me@gmail.com" or "me@company.com")
Gmail SMTP password: Your Google account password
Gmail SMTP port (TLS): 587
Gmail SMTP TLS/SSL required: yes

Let me know if this works for you and we can update the answer with any detailed improvements you might discover.

More info is at https://web.archive.org/web/20151022160428/http://jeffschuette.com/2012/03/07/setting-up-apple-mail-to-rock-and-roll-with-gmail/ and https://web.archive.org/web/20151108133234/http://jeffschuette.com/2013/11/05/apple-mail-and-gmail-part-deux/ for Mavericks where Mail.app handles the "All Mail" label better than it previously did. For myself, I have kept the "All Mail" label not exposed to IMAP even in Mavericks and have continued with this practice in Yosemite and El Capitan.

This article from MacWorld back in 2013 covers some of the same info, and has some screenshots:

https://www.macworld.com/article/2048781/how-to-delete-gmail-messages-so-theyre-truly-gone.html


How can I empty the trash with "rm -rf ~/.Trash/*" from Finder?

It would be easier to use an alias like this:

alias et="(shopt -s nullglob; find ~/.Trash /Volumes/*/.Trashes/501 -mindepth 1 -delete)"

rm -rf ~/.Trash/* doesn't work if the list of filenames is longer than getconf ARG_MAX, and it doesn't include files that start with a period. Deleting files in trash folders often requires root permissions though.

tell app "finder" to empty and trash -e (see hasseg.org/trash) can be run silently or on the background, but they are just as slow as emptying the trash from the GUI, and they make Finder display error dialogs if for example files are in use.


How do I get the XFX R6770 Core Edition video card to work with my Mac Pro?

Unfortunately, OS X Lion does not have driver support for the XFX R6770 Core Edition video card. You will have to upgrade to OS X Mountain Lion for the graphics card to work.
Since your MacPro (1,1) is "officially" unable to upgrade to Mountain Lion, you will have to "trick" your MacPro into thinking it is actually a MacPro(2,1). The reason for this is because a MacPro(2,1) can have Mountain Lion on it.
To do this, you will have to follow this guide to change the kernel of your MacPro. I have summarized the procedure of the guide if you prefer, so continue reading.
Before Reading: Please look to the links at the bottom, which are links on how to do some of the things mentioned in this guide
Explanation
The first issue (lack of EFI64 on MacPro(1,1)) can be dealt with by using the Chameleon bootloader. Chameleon will emulate EFI64 and therefore load 10.8. Chameleon has to be booted by your Mac as if it were Windows. Apple calls this BIOS emulation “Legacy Boot”. Legacy boot will only boot from internal connectors like the SATA, so no USB or Firewire drives.
Requirements
This will require a spare HDD in addition to the drive that your OS is on.

Download 10.8 From the app store. (you will need to do this on a supported mac)
Download Xcode from Apple.
Download Chameleon-2.1svn-r192
Go into Disk Utility and partition your spare HDD. Click the options button and choose Master Boot Record. Choose two partitions, the first 1GB (named BOOT) and the second can use the remainder of the disk (named Installer). Both partitions are formatted Mac OS Extended Journaled.
Run the Chameleon installer.
Change the install location to the BOOT that you created earlier.
Click Customize here and choose Standard under the Chameleon Bootloader package.
In Terminal: run sudo bless --folder /Volumes/BOOT --file /Volumes/BOOT/boot --setBoot --legacy
Download this folder and place it in the root of BOOT.
Inside, add your serial to the SMBIOS.plist and in org.chamleleon.boot.plist set the default partition to 0,2 which is the installer partition.

Now to the installer.

Locate your 10.8 installer. Right-click and chose ‘show package contents’. Locate InstallESD.DMG in the SharedSupport folder. Double ckick on InstallESD.DMG to mount it.
Open Terminal and navigate to the Mac OS Install ESD drive. cd /Volumes/Mac\ OS\ X\ Install\ ESD/ should do it.
Still in terminal, you need to mount the hidden BaseSystem.DMG type open BaseSystem.DMG and hit enter.
Now open Disk Utility. Click on BaseSystem.DMG on the left, then click restore, then drag your installer partition into the destination field.
Click Restore. This will put everything but the packages and kernel on the installer partition. (You may need to rename your installer partition back to “installer” as it may now be called MacOS BaseSystem.)

Next steps are to copy mach_kernel from MacOSInstallESD to the Installer partition.

In Terminal navigate to the Installer ESD with: cd /Volumes/Mac\ OS\ X\ Install\ ESD then copy mach_kernel to the installer partition with cp mach_kernel /Volumes/Installer/mach_kernel. Have a quick look in terminal to see that it’s there with: cd /Volumes/Installer/ then ls. You should see it there.
Now in your installer partition there is a system folder, and in that is an installation folder, in there is a packages symlink. Delete it and the copy the packages folder from the MAC OS Install ESD.
Finally you need to open OSinstall.mpkg with flat package editor which is part of the XCode install.
Drag Distribution to your desktop and open it in text edit.
There is a section headed var PlatformSupportValues there is a list of board IDs in speech-marks and separated with commas. like Mac-F42D88C8,Mac-F2218EA9,Mac-F42D86A9 you need to add your mac’s board it to it. This is specified in the smbios.plist in the Extra as Mac-F4208DC8 so if you’re using that smbios.plist then add that value. close TextEdit and go back to the flat package editor. delete Distribution from the package and then drag the one you edited from desktop into flat package editor, then save the package.

The Ultimate Moment

Now re-boot and hold down Option to bring up the list of drives, choose boot, then franticly tap the up or down arrow key until the Chameleon list of bootable drives appears. Choose Installer.
(The disk with osx on should be the GUID partition scheme). When the installer has completed, Chameleon will keep trying to boot the installer so edit org.chamleleon.boot.plist.
Set the default partition  to your Mountain Lion partition. It will probably be 1,2 or 2,2.
After the installation had completed, I used nano to create an fstab file in /etc. This has two entries in it which stop the boot and Installer mounting when OSX boots so they dont appear in Finder.
The entries look like this for each Partition you want to hide:
UUID=39C933A6-E5A4-3CFB-8841-21C89B0EDF77 none hfs rw,noauto change UUID to the appropriate one. The UUID of a partition can be found in system report under Serial ATA.

Links and Resources

Create entries in fstab to prevent volumes mounting
Editing OSInstall.MPKG with Flat Package Editor
Copying mach_kernel
Mounting BaseSystem.dmg
Finding InstallESD inside Install Mountain Lion


The video app on iPhone does not remember last watched position

Go to Settings → Videos and choose where to resume playback.


What happens to the data for an app that gets removed during the update from iOS 5 to iOS 6?

The upgrade to iOS 6 doesn't remove apps, so this is more of a case where things don't go as planned so it's going to be very hard to discern why this happened in your case (and similarly for others with the same symptom but not necessarily the same cause).

You should not lose data from an app - iOS update or not and the procedure is the same as if you lost data on an app anytime. Restore the phone from your backup to get back the data.

In this case, you may (sadly) find that the backup has corrupted data (or data that is otherwise not usable), but in most cases, this cures the loss of data and will allow you to start moving forward on iOS 6.


iPhone 7 deactivated – Won't get recognized on any Mac/PC

Try erasing the phone from Find my iPhone on iCloud.com. The phone thinks it has been stolen.


Where does docker desktop "start on login" option get stored and how to stop Docker from doing this outside of docker desktop?

To disable docker from starting up when you log in:
Click on the docker icon on the menu bar and select preferences:
Disable the checkbox which says "Start Docker Desktop when you log in". Hope that helps.


iPhone 4S won't connect to Pebble after forgetting phone

You have to forget both Pebble XXXX and Pebble XXXX-LE from the Settings on the iPhone. Then, you will be able to reconnect them through the Pebble app on the phone.


I've somehow enabled overtype mode in Slack and I can't get back to insert mode

My original solution (crossed out below) no longer works. Things that do work:

If you have a Mac keyboard, press the Help key to toggle between insert and replace mode
If you have a Windows keyboard, press the Insert (or Ins) key to toggle between insert and replace mode
Restart Slack (quit and relaunch); refreshing no longer works

I contacted Slack support and was told to use ⌘+R to do a quick refresh and reset the mode from overwrite to insert.
From Slack support team:
> Thanks for writing in about this! We've seen this occur on Mac computers recently as well, and the good news is there is an easy way to switch! To reset the mode from overwrite to insert, this should be possible with a quick refresh using Cmd+R
Explanation: This is because slack is using electron, which is essentially a wrapper around a browser to create a desktop app. Other "web" commands work like ⌘+[ and ⌘+] to traverse your "browser history" backward and forward, respectively.


You have an iMac setup as a server, and it is DMZ'd?  Probably a very bad idea.  VPN provides protection.  With it in DMZ mode, all you need is Apple Remote Desktop and it's much faster.  Albeit, much less protected.

I'd UN DMZ that machine, and setup a proper VPN.


Photos not synching from iPhone 5S to iCloud

Try first by checking on your phone on how much your photos are using up in your iCloud by navigating to: Settings -> iCloud -> Storage xx GB Available -> Manage Storage -> iCloud photo library and there you'll see there amount of photos and videos you have available in your iCloud.
Uploading photos can take a very long time and there lower upload bandwidth you have the longer it'll take and sometimes it might seem like it stopped uploading but really it might just be uploading a long video clip which could sometimes be a few GB long.
What I've also realized at least with iOS 9.2.1 that navigating away from the photos app might cause they upload process to pause so I'd suggest you that if you feel comfortable to remove the auto lock feature on your iPhone that you should turn that off at least for the time that your doing the bulk uploading by navigating to: Settings -> General -> Auto-Lock and select "Never" and then leave your iPhone connected to power with the WiFi connected and within the photo app.
The final verification that you'd want to verify is that you have the adequate amount of storage available on the iCloud account that you're connecting to.


In Lion, the "Open File" dialog doesn't refresh until 30 to 60 seconds after the window appears

I don't know if this is relevant, but many times when I go to any kind of file dialogue or even just click on some tool or something, I get a few seconds (or more) of beach ball while my second HD (non-boot drive with most of my documents/non-OS files) wakes up and gets up to speed. I can hear it revving up and when it gets to speed the OS unfreezes… so maybe if your file directories are being cached in memory or the drive cache, when the HD wakes after 30 secs for whatever reason, it updates the directory lists in memory?

I'm thinking this isn't super common complaint so maybe it's HD settings specific like my problem (I think I set my 2nd HD to have energy saving options somewhere when I installed it and haven't found a way to have it spinning 24x7.


How do I install a .dmg file without being a sudo user?

.dmg is not an app, it is a disk image. If you double-click the file, it should mount a virtual disk in the Finder. From there, you will be able to drag and drop the image into your applications folder.

Since you don't have admin rights on the computer you're using, you'll need to drag it into your user Applications folder (/Users/yourname/Applications/, needs to be created manually)


Why won't my website favicon show up in Safari favorites bar automatically?

The solution to my question is to upload a Favicon.png file to the root directory of my website as such. This is where Safari pulls the favicon to show in the favorites bar.


Why it's not possible to save a PNG image from Preview when a mask is added?

This is a bug with Preview.

Preview -[CIImage initWithCGImage:options:] failed because the CGImage is nil.
Preview Error: CGImageForSavingWithFlattenedEXIF:depth: failed
Preview finalize:2403: image destination must have at least one image

You can report bugs to Apple at https://bugreport.apple.com.


iPad apps transferring to iPhone through iCloud

In settings->Itunes & App Stores you can choose whether to enable automatic downloads for apps purchased on other devices.

Assuming the app is compatible on both this means if you turn it on for Apps on your phone, then it will download itself to the phone after purchasing on the iPad.


For what ever it is wort, here are my personal experience.

I have a mid 2012 MBA with 4 Gig RAM and 256 Gig SSD.

It has a Mavericks OS 10.9.2, MS Office 2011, 3 Browsers ect..(browser could eat up to 700 meg of RAM)

I have 110 Gig of videos and pictures.

I am a "normal" (no offense) user thus no serious programing or heavy duty video or photos rendering. (those are the CPU and RAM killers)

So far having multiple apps open,  I have not noticed a slow down in performances.

The Activity Monitor on mavericks has a great feature called memory load, and I always stay in the green range.

I would say having more is not a must have but nice to have (so a question of Budget)