2018 MacBook Pro experiencing very poor battery life (<4 hours) with light usage I bought a new 2018 15'' MacBook Pro with Touch Bar a couple weeks ago. So far its battery life has been abysmal, reaching 0% after less than 4 hours of very light usage (only web browsing).
I decided to test the battery life today by having my regular applications (Safari, Firefox, and a few others) open and just letting the MBP sit on my desk. I should emphasize that there are absolutely no intensive programs running whatsoever; just a couple of web browsers and things like iMessage.
Right off the bat, it tells me at 100% charge that I have 2:07 remaining.
Around 20 minutes later, I checked again it is already down to 90% charge with 3:36 remaining.
Another 10 minutes later, it is down to 85% with 3:04 remaining.
After 3 hours and 46 minutes, the battery level reached 0% and the machine went to forced sleep.
Considering that Apple's advertised battery life is 10 hours, I find it extremely perplexing that my MBP is getting less than 4 hours of battery life doing nothing except sit on my desk with a couple web browsers open in the background. During this test, there were just nine tabs open between the two browsers, and they contained only mundane sites like Wikipedia and Gmail.
Has anyone else experienced issues with battery life on the 2018 MBPs? If you are getting close to the advertised 10 hours, what kind of activities are you doing?
UPDATE:
After further testing using gfxCardStatus, it appears that having a program using Java open in the background forces the graphics card to stay at the high performance discrete option. Is there any workaround for this? It is frustrating to have to close a bunch of applications every time I go out so that my battery lasts throughout the day.

Considering your updated question that your problem is that running a Java-program forces the discrete GPU active thus draining your battery:

This is a known bug with some older versions of Java and JavaFX. Upgrade your Java to the latest version to see if that fixes this for you (see java bug JDK-8132775 and JDK-8041900).

If that still does not fix it, find the offending application and open its application bundle. Inside you'll find a Info.plist file, which you'll want to edit to add the key:

NSSupportsAutomaticGraphicsSwitching

the key should be a boolean set to true.

This should fix the problem if the application uses a sufficiently new version of Java.

If you're not confident doing this, report the GPU behavior as a bug to app developer and hint them about NSSupportsAutomaticGraphicsSwitching. Hopefully they will put out an update fixing the problem.

If your Java program does not come as a .app but instead is a bare jar-file, you'll want to convert it to an app first. Use the jar2app script to convert it to an app, and then use the instructions above to add the NSSupportsAutomaticsGraphicsSwitching key. Download jar2app from here:

https://github.com/Jorl17/jar2app


Control Spotify with Media Keys How can I use the media keys (previous track, play/pause, next track) for Spotify instead of iTunes?
OS X 10.9.4

If you use the Spotify desktop app, the media keys on OS X work by default (sometimes iTunes randomly "retains" the keys: just reboot). For the best results, don't keep iTunes and Spotify open at the same time.

If you use the Spotify Web Player, you can enable the media keys using BeardedSpice, a free application which enables you to control web-based media players using you keyboard media keys. It also works for YouTube, for example.


Can I rescind the choice to share data about my iTunes library contents with Apple? I installed the new iTunes 11 on my Mac and I accepted to share my iTunes library with Apple. There were some initial welcome screens and I opeted in when I started the new version of iTunes the first time.

How can I cancel this sharing of data with Apple?

In iTunes, you can opt back out of sharing details by opening the preferences and selecting the store preferences tab.


iPhone audio bluetooth I have a 2012 Prius C. The Bluetooth for the phone works fine but the audio to play music from my iPhone will not play over the car radio.  Why does one work and not the other?  How do I fix it?  Thx.

Here's the relevant passage from the 2012 Prius C's user manual:

Before using the Bluetooth® audio/phone, it is necessary to register a Bluetooth® device in the system. Follow the procedure below to reg-
ister (pair) a device:
Press the tune knob and select “Bluetooth” using the tune knob.
Press the tune knob and select “Pairing” using the tune knob.
A passkey will be displayed.
Input the passkey into the device.
Select “Yes” to register the device. Depending on the type of device, it may register automatically.
If a Bluetooth® device has both music player and cellular phone func-
tions, both functions will be registered at the same time. When delet-
ing the device, both functions will be deleted at the same time.
If the off-hook switch is pressed and the “PHONE” mode is entered
when no phones have been registered, the registration screen will be
automatically displayed.

Basically, the music should just work. Try re-setting it up again and report back by commenting under this answer.


The Keyboard on my iMac seems to be typing slow and garbled The bluetooth keyboard on my iMac seems  to work for a while then starts to skip letters or mix up letters while I am typing. It seems there is also a delay between the time I type a character and when it shows up on screen. I've switched to my wired keyboard and the same thing happens. If I reboot, the problem goes away for a while, then comes back. Any suggestions?

Hold down the Shift and Option keys ('Alt' on some keyboards) and, at the same time, click on the Bluetooth icon in the menu bar.
Find your keyboard on the device list and select "Factory Reset"
Confirm "remove" when prompted.
Reconnect keyboard.

I tried "resetting NVRAM and SMC" as Apple Support mentioned but didn't enough to solve. If the solution above doesn't solve the problem, please try to reset NVRAM and SMC before following the solution steps.


How To Duck Audio in Logic Pro X In garageband ducking audio was a one-click operation.  However I cannot find how to preform the same action in Logic Pro X.

This can be done using sidechain compression in Logic.
Create a new track and insert a sound (eg Kick drum) on every part you want the sound to duck, then set the output to no output.
Go to the track you want to duck and add a compressor and then set the side chain input to the track you created in the step above.
Tweak the threshold, attack and release settings to get your desired effect.


Where is the icon used in this dialogue box? Where on my disk can I find the icon used in this dialogue box in OS X？

It may be Security.icns in OS X 10.7.3

I cannot find it in:

/System/Library/CoreServices/CoreTypes/Contents/Resources
There are only LockedIcon.icns and UnlockedIcon.icns in this folder who looks like the icon in the dialogue box,the size of the icon in the dialogue box is 128x128px, but LockedIcon.icns and UnlockedIcon.icns is 32x32px.

lockedIcon.icns

So they are not the same icon.

/System/Library/CoreServices/Finder.app/Contents/Resources/
/System/Library/CoreServices/Problem Reporter.app/Contents/Resources
/Applications/System Preferences.app/Contents/Resources
/Applications/Utilities/Keychain Access.app/Contents/Resources
/System/Library/CoreServices/Certificate Assistant.app/Contents/Resources/

Lock Icon

The lock icon is located in

/System/Library/CoreServices/SystemAppearance.bundle/Contents/Resources/Assets.car

Install Theme Engine

Note: You may want to download the released version.
Open the file
Select Security
Drag the icon to the desktop to convert to a png

Finder Icon

macOS just places the app icon in front of it.


How to interpret the USB info in my MacBook Pro's System Report? I'm trying to find out if my MacBook Pro USB ports are USB3.

It seems to have two USB2 ports and one USB3 port:

But my MacBook Pro only has two USB ports. How do I interpret this report? Do I have USB3 or not? And if it's only one of them, how do I know which one?

Knowing what make and model of Mac you have would be very helpful in deciding what you have exactly as the specifications page on that model at apple.com would have the info you seek.

But a little interpretation of your screenshot will show that you have two USB busses. One has your FaceTime camera (the camera built into iMacs and MacBooks) and one with the keyboard and IR receiver (that is built into MacBooks).

Note that there is nothing under the USB 3.0 bus, which likely means there is nothing plugged into either of your USB ports (amiright?). So plug a USB 3 device into one of these ports and bring this report up again. Then try it in the other port. If they show up under the USB 3 bus then both ports are USB 3.

Or you could just google your Mac's make and model and follow the link to Apple's support site with the specifications of your Mac.


How to stop mail app from sending me an e-mail with "reply all" When I want to do "reply-all" to a message that involves multiple people, the mail app includes myself in the list of recipients. Is there a way to turn off this feature?

Like Tyson said, normally this doesn't happen, but maybe your Mail.app is configured to send you a copy of your mails sent.

Go to Mail > Preferences > Composing and see if you have "Automatically Cc (or some other selection) myself" selected and unselect it if you do.


The disappearing scroll bar I found that many apps have disappearing scroll bar.
For example, this:

actually has scroll bar if I scroll with my track pad. (and I have no way to screenshot it as it keeps get disappearing).
I found it inconvenient for me, is there any way I can let it stay on all the time? thx
I'm using apple mouse on MBP, and the Operating System is,
$ sw_vers
ProductName:    Mac OS X
ProductVersion: 10.15.7
BuildVersion:   19H512

System Preferences > General and in block "Show scroll bars" select "Always"


How to use WiFi for everything, except a specific connection to my NAS (Ethernet) WiFi is the best connection at my house for most things. I have it first in network preferences under service order.

However, I have a NAS connected over a local switch which I want to connect to via Ethernet.

The route is such that if I use WiFi, I reach the NAS via Powerline which dramatically slows the link.

When I disable WiFi I can connect to the NAS nice and quickly over Ethernet. If I do this, then all my other network connections go over Powerline and they are bad.

Question: How do I have both adapters enabled, prioritising WiFi, but utilising Ethernet for my NAS connection?

Note: I have tested and OSX does not find the local switch's Ethernet route with both adapters enabled and WiFi prioritised. It dumbly uses whatever is in the service order, whether it's Ethernet or WiFi. I had hoped it would choose the best route.

It dumbly uses whatever is in the service order, whether it's Ethernet or WiFi. I had hoped it would choose the best route.

It doesn't "dumbly" do anything.  It performs as expected; if priority is given to WiFi, it will direct all traffic over that connection.  Keep in mind, macOS (out of the box) doesn't prioritize traffic as it's not a router/switch.

  Question: How do I have both adapters enabled, prioritising WiFi, but
  utilising Ethernet for my NAS connection?

Put your NAS on a different subnet.  You can do this with a different switch, with VLANs (if your switch supports it) or you can direct connect it.  Just keep in mind if you want to share access to the NAS, you either need to have a multi-homed (multiple network adapters) on your NAS or you need a router between the networks (a layer 3 switch would be nice, but they're expensive)


how to run `hping` without `sudo` I've installed hping using brew install hping.

When I run hping without sudo I get:

$ hping 8.8.8.8
[open_sockraw] socket(): Operation not permitted
[main] can't open raw socket

When I run sudo hping, naturally, I get:

$ sudo hping -S -p 80 8.8.8.8
Password:
HPING 8.8.8.8 (en0 8.8.8.8): S set, 40 headers + 0 data bytes
len=46 ip=8.8.8.8 ttl=57 id=332 sport=80 flags=RA seq=0 win=512 rtt=1.4 ms
len=46 ip=8.8.8.8 ttl=57 id=46923 sport=80 flags=RA seq=1 win=512 rtt=2.7 ms
len=46 ip=8.8.8.8 ttl=57 id=25098 sport=80 flags=RA seq=2 win=512 rtt=2.2 ms
^C
--- 8.8.8.8 hping statistic ---
8 packets tramitted, 8 packets received, 0% packet loss
round-trip min/avg/max = 1.4/2.4/2.9 ms

My question here is, what permissions need to be changed to give hping the permissions it needs - and how do I do that?

It is always a security risk to run a binary as root. The better way of doing things would be to set the unix raw socket capability.

sudo setcap cap_net_raw+ep /usr/bin/hping3

That way the you dont give the binary permissions that it doesnt need.

(You can also look at set capabilites, e.g.: getcap /bin/ping)


Block a built-in keyboard in macOS 10.15.6 I'm looking for some tool that would turn off a built-in MBP keyboard. I would like to put my Planck on it.
I've already tried:

Krabinier's disabled keyboard. Not an option. Karabinier interferes with my QMK one-shot modifiers or something.
Command sudo kextunload /System/Library/Extensions/AppleUSBTopCase.kext/Contents/PlugIns/AppleUSBTCKeyboard.kext/
Used it. Don't work on 10.15.6(19G73). Before and after restart.

Do you know any other tricks, app or script?

I've checked Karabinier once again and I found a solution that will block build-in keyboard without messing QMK's OSM.

Disable a built-in keyboard when external is plugged. For me it's Planck EZ.

Be sure to also uncheck events modification in the "basic configuration" tab for the same keyboard.

That configuration seems to work for me.


Can't restore from iCloud backup in iOS 10 I'm having problems restoring an iCloud backup.

I updated my iPhone 6S yesterday from iOS 9.3.5 to iOS 10 by doing a restore so I can do a clean install. I do this for every major iOS version update and I've never had any issues before.

My problem is that during the setup process after updating to iOS 10, I select to restore the phone with an iCloud backup, but the restore process fails every time with a "Cannot restore backup" error.

I've read everything I could find in Apple Support regarding iCloud restore and iOS 10 upgrading and no article mentions this issue.

Is this a bug with iCloud? Is there any other way I can restore my apps to my iPhone from that backup?

EDIT:

Talked to Apple Support, one of the solutions they gave me was to put the device in recovery mode, then restore again to iOS 10 and then attempt to restore de backup. Didn't work for me but maybe it helps someone.

EDIT 2:

I just spoke with Apple Support again and they told me that the backups are safe and not corrupt. They also told me that a lot of users are starting to have this problem and they don't have a solution yet.

If the backup is corrupt, you'll be out of luck.
If it's just that Apple's servers are swamped right now, after the iOS 10 launch, then you may have better luck tomorrow or the day after.

It seems time to trot out the old adage...

"Any data not stored in at least three distinct locations ought to be considered temporary."

Even though you got away with it 9 times out of 10, there's always a 10th time.
Somebody gets bricked with every update; make sure it's never going to be you.
Backups are those useless things that take up valuable storage space & are totally pointless...
...until the day you need them.

You really should also have had a local iTunes backup, encrypted to preserve passwords etc, & that backed up to Time machine.
Optional off-site copy too - Backblaze etc -  in case the building burns down.

The smartest way to do any update.

Launch iTunes, plug in device.
When asked if you want to update click Download Only.
Whilst that's busy, switch to the Apps view in iTunes - download all available updates.
When complete, switch to your device view & Sync.
Back Up Now [with encryption, which preserves your passwords]

You now have fully up to date retrievable restore point, should anything go wrong.

Once the iOS download is completed, then you can Update.


What is wrong in this command about grepping and pandocing? I am thinking this answer which returns a broken PDF document in OSX 10.10.3.
The file test_dummy.tex is here.
pandoc test_dummy.tex -f markdown -t html | grep -E '(^<|^$|^ *$)' \
| grep -v "^<p" | pandoc -f html -o tables.pdf

where pandoc 1.13.2.1 and grep grep (BSD grep) 2.5.1-FreeBSD.
1 Mistake in test_dummy.tex -file (different than you having real LaTeX)
I installed Pandoc by brew install pandoc.
Something is wrong in the very beginning command
pandoc test_dummy.tex -f markdown -t html

returns a blank line, likewise pandoc test_dummy.tex -f markdown.
[fixed by the answer]

2 Connecting the full command still challenge
The command (with cabal Pandoc)
pandoc test_dummy.tex -f markdown -t html | grep -E '(^<|^$|^ *$)' | grep -v "^<p" | pandoc -f html -o tables.pdf

returns
! Package inputenc Error: Unicode char \u8:≤ not set up for use with LaTeX.

See the inputenc package documentation for explanation.
Type  H <return>  for immediate help.
 ...

l.134 ≤

[fixed the addition of this answer solves this part]
How can I troubleshoot this chain of commands?

If you get a blank line from pandoc then something is quite amiss.

My guess is you've got several `pandoc or the tex file is encoded oddly or throwing some error that the version I downloaded from dropbox isn't the same as the one you are using.

$ pandoc test_dummy.tex -f markdown -t html | wc
     311    1349   11676
$ pandoc test_dummy.tex -f markdown -t html | head

everything - etiology, symptoms, diagnostic tests, grades of aortic valve stenosis

Aortic regurgitation. The murmur of aortic regurgitation occurs during diastole as the aortic valve fails to lose completely and blood regurgitates from the aorta back into the LV. Murmur - high-pitched decrescendo murmur heard best along left lower sternal border.

Common causes of Aortic Stenosis Among Patients requiring Surgery. % http://emedicine.medscape.com/article/150638-overview#aw2aab6b2b4aa

<colgroup>
<col width="38%" />
<col width="38%" />
</colgroup>

$ which pandoc
/usr/local/bin/pandoc
$ wc test_dummy.tex
     210    1049    8801 test_dummy.tex

The troubleshooting would be to check the path to be sure you are using the tools you expect. Then break apart the chain of commands and inspect the beginnings of each output file using things like wc, head or more so you can make sure each link in the chain is working. The post you linked to is an exceptional answer by Kurt in that it explains exactly what the command line tools are doing with grep and why.


What software is available for 3D diagrams and graphs? I'm looking for software to generate pretty 3D diagrams and graphics for scientific publications, for example something like this: http://www.123rf.com/photo_9355990_space-fill-ball-and-stick-models-of-methanol.html

Ideally, the software should also allow me to somehow allow me to place objects programmatically, if I would like 100s of spheres.

This won't help with graphs, but for making molecular diagrams I highly recommend the open source Jmol, which is free for Windows, Mac, and Linux. It lets you create all sorts of molecules and export them as Java applets, images, or animations.


How do I recompile Bash to avoid Shellshock (the remote exploit CVE-2014-6271 and CVE-2014-7169)? Given that Bash 3.2 (the version shipped by OS X) is vulnerable to the remote execution exploit known as "Shell Shock" (CVE-2014-6271 and CVE-2014-7169) how do I rebuild Bash and secure my system ahead of an official Apple patch?

UPDATE: Note that Apple has now released the official patch. See below for details.

Status

Apple has released Bash security fixes for Shellshock and related vulnerabilities as "OS X bash Update 1.0". They can be installed through normal system update for people using OS X Mountain Lion v10.8.5 or OS X Mavericks v10.9.5 (they are included in Security Update 2014-005) and can also be installed manually. Official Apple fixes are also available for OS X Lion v10.7.5 and OS X Lion Server v10.7.5 but those are only available via manual download. The security fixes are available via different URLs based on the operating system version:

http://support.apple.com/kb/DL1769 - Mavericks (10.9.5 and above)
http://support.apple.com/kb/DL1768 - Mountain Lion (10.8.5)
http://support.apple.com/kb/DL1767 - Lion & Lion Server (10.7.5)

(If new patches are released, put them here but please keep these existing ones as well for reference.)

The Apple patch takes care of Shellshock and several other vulnerabilities and is fine for most people. tl;dr people can stop reading here.

HOWEVER, the attention drawn to bash by the Shellshock bug has caused many researchers to take a hard look at bash and more and more (hard to exploit) vulnerabilities keep being found. If you are highly concerned about security (because maybe you are running OS X Server to host a publicly available web site) then you may want to (try to) keep up with the vulnerabilities and patches as they keep rolling in by compiling bash yourself. Otherwise, don't worry about it.

Look for Apple to release another update to bash some time in the future when the dust settles on finding further vulnerabilities.

An official set of patches of bash itself for bash 3.2, patches 52, 53, and 54 (which correspond to Bash 4.3 patches 25, 26, and 27) are available which fix both CVE-2014-6271 and CVE-2014-7169, as well as the 'Game over' displayed below. This has been tested by me (@alblue) and the post has been updated accordingly (and then additional updates were made: see revision 41 for the post that stops at patch 54).

Many additional vulnerabilities have been reported against bash. According to Michal Zalewski's post if you have patch 54 (and presumably Apple's official patch) "there's no point in obsessing about the status of these individual bugs, because they should no longer pose a security risk:"

CVE-2014-6271 - original RCE found by Stephane. Fixed by bash43-025
and corresponding Sep 24 entries for other versions.
CVE-2014-7169 - file creation / token consumption bug found by
Tavis. Fixed by bash43-026 & co (Sep 26)
CVE-2014-7186 - a probably no-sec-risk 10+ here-doc crash found by
Florian and Todd. Fixed by bash43-028 & co (Oct 1).
CVE-2014-7187 - a non-crashing, probably no-sec-risk off-by-one
found by Florian.  Fixed by bash43-028 & co (Oct 1).
CVE-2014-6277 - uninitialized memory issue, almost certainly RCE
found by Michal Zalewski. No specific patch yet.
CVE-2014-6278 - command injection RCE found by Michal Zalewski. No specific patch yet.

It gets pretty confusing. Fortunately Chet Ramey, the official bash maintainer, posted a CVE to patch mapping. His post refers to patches for bash 4.3, I (@OldPro) have translated them to patches for bash 3.2, which is what is applicable to OS X. Also, since this post he has released patch 57, so I added that below:

 bash32-052      CVE-2014-6271                           2014-09-24
 bash32-053      CVE-2014-7169                           2014-09-26
 bash32-054      exported function namespace change      2014-09-27 ("Game Over")
 bash32-055      CVE-2014-7186/CVE-2014-7187             2014-10-01
 bash32-056      CVE-2014-6277                           2014-10-02
 bash32-057      CVE-2014-6278                           2014-10-05

See David A. Wheeler's post for a timeline and greater detail.

@alblue posted build instructions through patch 55. I (@OldPro) added patch 56 and 57 to the instructions but have not tested it.

Testing for the original Vulnerability

You can determine if you are vulnerable to the original problem in CVE-2014-6271 by executing this test:

$ env x='() { :;}; echo vulnerable' bash -c 'echo hello'
bash: warning: x: ignoring function definition attempt
bash: error importing function definition for `x'
hello

The above output is an example of a non-vulnerable bash version. If you see the word vulnerable in the output of that command your bash is vulnerable and you should update. Below is a vulnerable version from OS X 10.8.5:

Testing for the new Vulnerability

There has been an update to the original post and Bash 3.2.52(1) is still vulnerable to a variation of the vulnerability, defined in CVE-2014-7169

$ rm -f echo
$ env X='() { (a)=>\' sh -c "echo date"; cat echo
sh: X: line 1: syntax error near unexpected token `='
sh: X: line 1: `'
sh: error importing function definition for `X'
Thu 25 Sep 2014 08:50:18 BST

The above output is an example of a vulnerable bash version. If you see a date in the output of that command your bash is vulnerable.

Disabling auto-imported functions to prevent "Game Over"

Researchers noted, without classifying it as a vulnerability, that a script could hijack a function in a subshell using auto-imported functions:

$ env ls="() { echo 'Game Over'; }" bash -c ls
Game over

The above code on an affected system would display Game Over instead of the directory listing you would expect from ls. Obviously, echo 'Game Over' could be replaced by any nefarious code you want. This became know as the "Game Over" bug.

Prior to the availability of patch 54, both NetBSD and FreeBSD disabled auto-importing bash functions by default, partly to prevent "Game Over" but mainly to contain any further errors in the parser (such as CVE-2014-7169) as they were continuing to be discovered, and added a new command line flag --import-functions to re-enable the old default behavior. I (@alblue) have prepared a patch (against 3.2.53) for others to use if they want to adopt this behaviour as well and have included it below. By default this patch is not enabled in the build script below. I (@OldPro) believe this patch is no longer necessary or a good idea, because it breaks backwards compatibility and the vulnerabilities it protects against are very well addressed by patch 54 and earlier patches, and enabling this unofficial patch prevents future patches from being applied.

(Note to question editors; please do not enable this by default, as it is an unofficial patch.)

a0c5c4d66742fddd0a35001cb91798a5fbf8a2f5  import_functions.patch

The patch can be enabled by running export ADD_IMPORT_FUNCTIONS_PATCH=YES before running the build. Note that enabling this patch will disable patch 54 and any future patches because future patches cannot be guaranteed to be compatible with the unofficial patch.

Apple Patch has Game Over vulnerability, sort of

As pointed out by @ake_____ on twitter the official Apple patch is still vulnerable to environment clobbering of executables:

$ env '__BASH_FUNC<ls>()'="() { echo Game Over; }" bash -c ls
Game Over

Users should decide for themselves how important this is. I (@OldPro) think it is nothing to worry about because there is no known exploit for this behavior (it was not even given a CVE identifier) because in general unprivileged remote attackers cannot set the name of an environment variable and attackers with privileges cannot use this to gain privileges they do not already have (at least not without exploiting an additional vulnerabiltiy).

To provide a little background, bash allows you to define functions, and furthermore allows you to export those functions to subshells via the export -f command. This used to be implemented by creating an environment variable with the same name as the function with its value set to the function definition. So

$ ls () { echo 'Game Over'; }
$ export -f ls
$ echo $ls
Game Over

This happened because export -f ls created an environment variable named ls. The "Game Over" vulnerability was that you could directly create this environment variable without having to first define the function, which meant if you could inject the right variable name you could hijack a command. Apple tried to fix this by making it hard to create a variable with the right name. The official bash patch 54 actually makes it impossible to create a variable with the right name by using variable names that include % which is a character not allowed in a variable name, effectively putting exported function definitions in a different, reserved namespace.

If none of the above makes sense to you, don't worry about it. You are fine with the Apple patch for now.

System Binaries

OS X 10.9.5 (the latest stable release at the moment) ships with Bash v3.2.51:

$ bash --version
GNU bash, version 3.2.51(1)-release (x86_64-apple-darwin13)
Copyright (C) 2007 Free Software Foundation, Inc.

You can obtain and recompile Bash as follows, providing that you have Xcode installed (and have run xcodebuild at least once before to accept the license):

$ # If you want to disable auto-imported functions, uncomment the following
$ # export ADD_IMPORT_FUNCTIONS_PATCH=YES
$ mkdir bash-fix
$ cd bash-fix
$ curl https://opensource.apple.com/tarballs/bash/bash-92.tar.gz | tar zxf -
$ cd bash-92/bash-3.2
$ curl https://ftp.gnu.org/pub/gnu/bash/bash-3.2-patches/bash32-052 | patch -p0
$ curl https://ftp.gnu.org/pub/gnu/bash/bash-3.2-patches/bash32-053 | patch -p0
$ # See note above about ADD_IMPORT_FUNCTIONS_PATCH
$ [ "$ADD_IMPORT_FUNCTIONS_PATCH" == "YES" ] && curl http://alblue.bandlem.com/import_functions.patch | patch -p0
$ [ "$ADD_IMPORT_FUNCTIONS_PATCH" == "YES" ] || curl https://ftp.gnu.org/pub/gnu/bash/bash-3.2-patches/bash32-054 | patch -p0
$ [ "$ADD_IMPORT_FUNCTIONS_PATCH" == "YES" ] || curl https://ftp.gnu.org/pub/gnu/bash/bash-3.2-patches/bash32-055 | patch -p0
$ [ "$ADD_IMPORT_FUNCTIONS_PATCH" == "YES" ] || curl https://ftp.gnu.org/pub/gnu/bash/bash-3.2-patches/bash32-056 | patch -p0
$ [ "$ADD_IMPORT_FUNCTIONS_PATCH" == "YES" ] || curl https://ftp.gnu.org/pub/gnu/bash/bash-3.2-patches/bash32-057 | patch -p0
$ cd ..
$ # Note: DO NOT ADD SUDO TO XCODEBUILD HERE
$ xcodebuild
$ build/Release/bash --version # GNU bash, version 3.2.57-release
$ build/Release/sh --version   # GNU bash, version 3.2.57-release
$ sudo cp /bin/bash /bin/bash.old
$ sudo cp /bin/sh /bin/sh.old
$ sudo cp build/Release/bash /bin
$ sudo cp build/Release/sh /bin

(Note: you can run this by copy-and-pasting the above code block, going into Terminal and then running pbpaste | cut -c 2- | sh. Always take care when running random scripts from the internet though ...)

After this, the Bash version should be v3.2.57:

$ bash --version
GNU bash, version 3.2.57-release (x86_64-apple-darwin13)
Copyright (C) 2007 Free Software Foundation, Inc.

For security, and after testing, I recommend that you chmod -x the old versions to ensure they aren't re-used, or move them to a backup site.

$ sudo chmod a-x /bin/bash.old /bin/sh.old

Other answers have solutions for those using MacPorts or Homebrew; these don't fix the problem, they just install additional versions of Bash. Please see those answers if you want to upgrade those specifically.

Thanks

Thanks to Chet, who looks after bash, and has been making these patches available. Thanks to everyone else who has commented on this and improved it over time.

Now Apple has released the real fix, though this might still be useful. Because they only released a fix for Lion and up, and the official patch provides GNU bash, version 3.2.53(1)-release (x86_64-apple-darwin13), however, the Game over bug is still somewhat vulnerable. At this point, rebuilding your own version of Bash against 3.2.57 is probably more secure than relying on Apple's patch, unless you do it wrong.


Access Mac mini remotely (Screen Sharing + File System) I have a Mac Mini connected to a Time Capsule (connected to a DSL modem, getting a new external IP address every 24 hours).

Any recommendation on how to access the Mac mini remotely (both file system and screen sharing) when I am not at home? (Also it would be nice to have a solution that works with Wake on LAN, so that the Mac mini can be asleep when not in use)?

Screen Sharing and file sharing works perfectly fine from within the network but I am not sure what's needed to access it externally. What are my options?

You need to configure port-forwarding on your Time Capsule.  Since your ISP doesn't give you a static IP address, then you will need a dynamic-DNS service to resolve your home's IP address to a URL which you will use when you're away from home to connect to your Mac Mini.  You'll also need to configure your Time Capsule to handle Wake-On-LAN/Wake-On-Demand packets.  In the bullet points below I've listed the basic requirements and included links to step-by-step instructions for each step.

You need a static IP address from your ISP or a dynamic DNS service like dyndns.com to resolve a changing IP address from a URL which you can choose.
You need to setup Wake-On-Demand as described by Apple on your Time Capsule
Finally, you need to forward ports on your Time Capsule to your Mac Mini so that incoming connections from your client software when you're away from home can reach your Mac Mini.


Man in the Middle Network Proxy for iOS that supports SSL? I'm trying to do examine some apps and what kind of network traffic they're using on my iPhone.

I've set up Charles (including SSL certificates & provisioning profiles).
Then, I tethered my laptop to my iPad to get a connection, and then shared that internet with my iPhone via WiFi.

For some reason, the apps I'm working with seem to think that they're not online. Safari works with this set up.

What are my options for seamlessly sending network traffic to a Mac for analysis, without jailbreaking?

If it matters, I'm running iOS 5.1 on an iPhone 4 and Mac OS X Lion on the white plastic unibody (Mid-2010) MacBook.

Use mitmproxy. It's proven for this sort of thing. A while back there was some uproar about the app Path uploading the adressbook to its servers. This was what was used to discover it. The guy wrote up how he used it and that's a nice intro on how to install and use mitmproxy.

From the site :

  mitmproxy is an SSL-capable man-in-the-middle HTTP proxy. It provides
  a console interface that allows traffic flows to be inspected and
  edited on the fly.

  mitmdump is the command-line version of mitmproxy, with the same
  functionality but without the frills. Think tcpdump for HTTP. Features

  Intercept and modify HTTP traffic on the fly
  Save HTTP conversations for later replay and analysis
  Replay both HTTP clients and servers
  Make scripted changes to HTTP traffic using Python
  SSL interception certs generated on the fly


Stopping Apple Watch Workout when wet Frequently I cannot stop the timer for a run in the Workout app if I am too sweaty - the touch screen does not recognize my finger press, and neither the side button or Digital Crown help.

Is there a combination of buttons or maybe even gestures that can be used to stop the timer?

First, pause the workout by pressing the crown and side button at the same time (here's an example taken from a swimming workout).

This will pause the workout until you can dry your fingers.  An unfortunate side-effect of pressing these buttons will be that a screenshot will be taken if you also turned on the feature to take a screenshot when these buttons are pressed.

After your fingers are dry, you can end the workout in the normal manner by swiping to the right and tapping End.


"No Devices Syncing" in menu bar Previously in the menu bar when I click on the "Refresh" icon it use to say Sync Now and now it says No Devices Syncing.

Is this feature now obsolete due to MobileMe not available anymore?

Yes you are correct, this was part of MobileMe and is no longer supported.


Why do I have SyphonInject on my Mac? I don't ever recall installing anything called SyphonInject. I just noticed that I have it in the Launchpad and it sounds menacing.

Is this something that comes preinstalled in a MacBook?

Is it okay to completely remove it?

Is this something that comes preinstalled in a MacBook?

No. It is a 3rd party app.

  Is it okay to completely remove it?

Yes, it is okay to remove it if you don't use it. It must have been installed by the previous owner.

If this MacBook is a shared computer and it's possible that some other user may be using the app, it's safe to leave it.

Further relevant discussions on Web:

SyphonInject what is it
Is Syphon Inject a "safe" program that's used in OBS?


What does Python Launcher do? When download python from https://www.python.org/ and install it, I saw 2 apps installed, it is easy to see the purpose of IDLE but I am confused with the purpose of Python Launcher.
What does Python Launcher do ? When do I need to it?

For running Python on a mac start at Python's documentation

Python Launcher allows you to run python scripts from the desktop.

The documentation says

  To run your script from the Finder you have two options:

    Drag it to PythonLauncher

    Select PythonLauncher as the default application to open your script (or any .py script) through the finder Info window and double-click it. PythonLauncher has various preferences to control how your script is launched. Option-dragging allows you to change these for one invocation, or use its Preferences menu to change things globally.

From other Stack Exchange questions I think Python Launcher is not part of the python that Apple provides as part of the OS. But as you really should not use that python I have never tried to see.


CoreStorage changed to Apple_HFS after resizing and Recovery HD popped in the middle of my disk I have a weird thing that happened today on my Mac's disk.

I had my main partition Macintosh HD and a 150 GB Linux partition. I tried to split up the Linux partition into two smaller ones using Disk Utility (on Sierra) but it failed.

Since then, my Recovery HD popped between the Linux partition and Macintosh HD, making me unable to delete the Linux partition: Disk Utility would then try to resize Recovery HD to 150 GB if I delete the Linux partition.

It seems Recovery HD is not hidden anymore as it should be... When I try to use cmdR at boot time it loads the Internet Necovery like if it wasn't seeing the Recovery HD partition...

I've tried repairing all my disks from the Internet Recovery, it repaired errors, but it didn't seem to have changed anything to my poor alone Recovery HD partition.

Here is the output below of diskutil list, as you can see Recovery HD is listed as Apple_HFS instead of Apple_Boot and Macintosh HD is listed as Apple_HFS instead of Apple_CoreStorage.

If anybody know what's going on, I would really appreciate the help. MacOs is booting fine and it seems I can access my data, I've checked random files. It's really really weird that Macintosh HD's type is Apple_HFS instead of CoreStorage, when I run diskutil cs list I got "No CoreStorage logical volume groups found".

It seems the Disk Utility has reverted my Macintosh HD CoreStorage containing the Recovery HD to two Apple_HFS regular partitions without my consent. How do you think I could fix that ?

I think I fixed it.

First of all, you need to revert Macintosh HD into a CoreStorage using
diskutil cs convert /dev/disk0s2
Then, reinstall MacOs on Macintosh HD using the Sierra installer for the Mac Apple Store without loosing data, creating a new Recovery HD partition.
Lastly, erase the old Recovery HD partition labeled Apple_HFS with Disk Utility.


Find iTunes songs with specific format (MPEG 1, Layer 2) Recently I discovered that my iTunes Library contains songs with the MPEG-1, Layer 2 format.
It's impossible to sync them to my iPod. So I want to convert them to AAC or MP3.
But therefor I need a list of all songs that have that format.

Is there any way to get a list of all MPEG-1 Layer 2 formatted tracks in my iTunes library? To make things a little bit harder, they all have mp3 as extension.

If the files have mp3 as the extension, mdfind kMDItemContentType==public.mp2 or searching for kind:mp2 in Finder won't work either.

You could try using mplayer's command line utility. It can be installed with Homebrew or other package managers.

IFS=$'\n'; for f in $(find ~/Music -name *.mp3); do mplayer -identify -frames 0 "$f" 2> /dev/null | grep -q 'layer-2 audio' && echo mv "$f" ~/Desktop/; done


Dictation with browser : have Mac Book Pro speak out web pages Can I use dictation to have Firefox/ Safari to read me pages?

Using a MacBook Pro - OS X 10.9.4

In Safari:

Mark text, secondary click (aka right-click), speech.

Alternatively it's also in the edit menu.

Settings can be adjusted in System Preferences -> Speech


How can I transfer songs etc to iPod without access to iTunes account? My stepdaughter has brought her iPod home with her. We would like to transfer some photos and songs from our computer onto her iPod, but her mother has it connected to her own iTunes account. Since she is unwilling to share the password, we can't do it via iTunes syncing.

I thought I would be able to do it by just dragging across but it seems not. Any ideas?

You have to manually manage the music and videos in order to do this.

You can manually manage music by:

Plug the iPod into your computer and open iTunes.
Under the Summary Tab, Select the "Manually Manage Music and Videos" checkbox.
You should now be able to drag songs and videos onto the iPod as you expected.
One other note: if you are on iTunes 11, after performing the actions above, go to the "On This iPhone" tab (the last tab), and use that to manually manage music and videos.


Bluetooth skip not working iOS 7 on iPhone 4

Noticed that when I pair with my car's BT, the track skip button on the steering wheel doesn't do anything. Tried un-pairing and re- pairing. Toggled BT. It used to work fine on iOS 6. Tried multiple apps like Pandora and Music, both have the same issue.

Anyone else seen this?

I had the same issue when trying to stream music over a Bluetooth connection from my iPhone to the stereo in my 2007 BMW. Worked fine with iOS 6, was broken after upgrading to iOS 7.

This issue can be fixed by disabling Control Center access from the lock screen: Go to Settings -> Control Center -> Access on Lock Screen; set this option to off.

(You will still be able to access Control Center after you unlock your phone, but not from the lock screen.)

Now I'm able to skip songs using both the buttons on the steering wheel and the ones on the stereo/nav unit again!


Switch to different app in different desktop instead same desktop I have 2 windows of Chrome opened in Display 1 & 3. Beside that, there is Terminal run in Display 1. Display 2 has some windows from other apps. In this case, I offten switch between Terminal in Display 1 and Chrome in Display 3.

When I open Terminal in Display 1 and do Cmd ⌘Tab window switch to Chrome in Display 1, instead of Display 3. Currently, I have to shift right/left the space twice to switch it.

Is there shortcut key to accomodate this case?

There are many variants on this question...

In short, Spaces is not designed to accommodate any app on more than one Space.

So the simple answer is, "No."

Possible alternative workarounds...

Use  Cmd ⌘   `  to switch between open windows of the app you just switched to.
Use dedicated key commands to switch to a specific Space rather than App - by default  Ctrl ⌃  plus  [number]  - & remember where each one lives. This is my preferred method, which I've been using since Spaces was invented.


Convert image type and save to relative folder with automator I found a question and working answer here How to create an Automator service to convert images from one file type into another file type using the right-click contextual menu? but it is saving the output file to desktop only. I can understand that this can be saved to relative path(like if source file is in directory /Desktop/Resources/myImage the output file in path /Desktop/Resources/myImage/Converted) with some actions in automator like set value for viable etc. But I am not familiar with that. How to use the set value for variable and get value for variable.

You don't need to play with variables. When I configure the service as below, it makes a copy of the files (?!) when I use the New Folder action. Then it is a matter of converting the files in the new folder.


How can I use Dropbox for iPhone and iPad backup and not iCloud? Both devices drove me nuts until I caved and increased my iCloud storage for backup.  I couldn't find a way to change default to my Dropbox account.  Please tell me how....

Tubedogg is right; there is no way to directly back up to your dropbox.  However, if you have your heart set on storing your backups in dropbox, you could back up to your computer and use a sym link to route iTunes' backups to a dropbox folder


Syncing iOS devices to multiple Macs with same Apple ID Not really a duplicate to the specific question but related:
  Sharing music in the iTunes library with multiple accounts and iOS devices.

I got a 2011 13-inch MacBook Air for my upcoming college courses.  This is my second Mac, I also have a 2010 Mac Mini.  Part of the reason for the Air is it's lightweight and mobility.  Part of this sacrifice is a somewhat small 128gb, means it just isn't reasonable to store my music library on the Air.  I'd like to keep my verging on 40gb music collection on the Mini.

I also have an iPad and an iPod touch.  I would like to sync my iPad and iPod to my Mini for music and my Air for documents, such as PDFs, school files, iCal and Address Book.  Is this possible?  Is there anything I have to do before I start syncing to the Air?

A Google check didn't bring up anything relevant to what I was attempting to do.

Yes, this is possible.

This was tested using an iPod touch 4th generation, a 2010 Mac Mini and a 2011 MacBook Air.  iPod running iOS 4.3 and Macs running Lion

Sync your iPod to the Mac storing your music library.
Ensure to select 'Manually manage music' from your device's main screen in  iTunes.
Manually sync your music to your device.  (This didn't take long as the  iPod didn't delete the existing music before attempting to sync.)
Sync the iPod to the 2nd Mac.  At the iTunes prompts to replace music and photos select 'Cancel', optionally select 'Don't remind me again' as well to avoid the prompt.
Manually sync other info to your device, such as iCal, Address Book and Mail Accounts.

This way you can have music/videos on a storage machine and your other important info on a daily user.

Of course...iCloud makes this a little obsolete.  But, good to know for when you have limited Internet access.

There was a time when it "worked" to plug an iPod into separate computers with the same Apple ID. Have you tried just plugging them in? I think the key was that you need to manually manage music and videos on the iOS device. You probably don't want the computer syncing automatically either. There is a setting for that in iTunes preferences.

Syncing iPhones with multiple computers is a big bag of hurt. I don't think that this works at all.

Hopefully iCloud works perfectly and solves all these problems for us sometime this fall.


Is it better to have more cores or higher processor clock speed to decrease build time for iOS projects I am trying to pick the most appropriate hardware to speed up build time for iOS projects - I don't know if I should favor faster processors (3.5 GHz) with fewer cores (6) or slower processors (2.7 GHz) with more cores (12).

Here's great article about this subject.

  More cores, slower clock speed

  Pros

  Applications that support multi-threading will greatly benefit from having a higher number of cores at their disposal
  Increasing the amount of cores in your CPU is a cost effective way of increasing performance
  Multi-threading support for applications will continue to improve over time
  You will be able to run more apps at once without seeing performance drops
  Great for running multiple virtual machines

  Cons

  Lower single threaded performance than a higher clock speed processor

  Fewer cores, higher clock speed

  Pros

  Better single threaded performance
  Lower cost option

  Cons

  Fewer cores to split between applications
  Not as strong multi-threading performance

Since Xcode is able to compile sources in parallel, I'd recommend using more cores. To compile one file You don't need so much speed on one core.


JavaScript working when disabled (factory settings) in iOS is a bug? I have noticed all my iOS devices and my those of my friends have JavaScript disabled in Safari settings by default (Settings > Safari > Advanced). Yet, JavaScript seemed to be working on all websites.

When I turned it on, websites continued working as expected. But when I turned it back off most websites didn't work correctly because, you know, JavaScript is essential to them. My question is, why was it turned off by default and still working? I have iOS 11 and there's a similar question with iOS 10 here: iOS 10 Safari JavaScript setting disabled. Is this a bug or is there a reason for this?

"My question is, why was it turned off by default and still working?"

Obviously it was not turned off. The better question is: why was it displaying as disabled when it clearly was not? The only answer is that it is a mistake (regardless as to whether it was intended or not, which let's hope for everyone's sake it was not).

"Is this a bug or is there a reason for this?"

It's a bug whether there's a reason or not.

I've sent this information along as a 'Bug report' to Apple via both...
https://www.apple.com/feedback/iphone.html
...and also...
https://www.apple.com/feedback/safari.html

If this bothers you, I suggest you do the same.


Where is the convert command in macOS? I need to convert a PNG file to an EPS file. Various sources on the Web refer to the convert command on macOS, but that program does not appear to exist on macOS High Sierra.

How do I get it?

There is no command/utility named convert built into macOS.

convert utility is installed as part of ImageMagick. You can easily install ImageMagick using Homebrew by running:

brew install imagemagick

To install Homebrew, run:

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"


£# key binding changed after El Capitan update I have a Macbook Air (13-inch, Mid 2013) running OS X El Capitan. Prior to upgrading to 10.11.4 pressing SHIFT + 3 returned the £ (pound) sign and alt + 3 returned the # (hash) key. Since upgrading these have been reversed! Can anyone advise how to switch this back? Why has this happened?

It seems that after upgrading my keyboard settings have been changed from US to UK. To fix the key binding issue described above I needed to go to:

System preferences -> Keyboard -> Input sources and click the + button to add UK as my input source, then delete the US input source in the menu of the LHS. Thanks very much for Mark for getting me to check this.


Removing numerous ‘homepage’ entries from Contacts.app with AppleScript extremely slow A syncing issue with Outlook left me with hundreds, if not thousands of duplicate contacts. After managing to merge duplicates without Contacts crashing, I was left with 177 contacts, most of which with many repeat homepage entries. Rather than dying of boredom removing these by hand, I put together some AppleScript to do this for me, thinking that this would take a few minutes. It’s been a week now – the script starts well enough but soon slows down continually and also takes more and more memory from the system, until the spinning beachball of doom appears halting the script. One issue is that I seem to only be able to delete a contact’s urls one at a time in sequence, instead of all at once.

So the question is, what have I got wrong making this script near useless? Could it have something to do with iCloud syncing? Or is AppleScript inherently inefficient? (The constant saving is there because of the random times the script would cease functioning.):

tell application "Contacts"
    activate
    with timeout of 72000 seconds
        set myPeople to people
        set numPeople to (count of myPeople)
        repeat with i from 1 to numPeople
            set myGuy to item i of myPeople
            set myGuyName to get name of myGuy
            set personUrls to (the urls of myGuy whose value contains "outlook")
            set urlNum to count of personUrls
            if urlNum > 0 then
                repeat with j from urlNum to 1 by -1
                    log ((time string of (current date)) & " – [" & i & "/" & numPeople & "] " & myGuyName & " (" & j & "/" & urlNum & "): " & (the label of item j of personUrls))
                    delete item j of personUrls
                    save
                end repeat
            else
                log "No problematic URLs found for " & myGuyName
            end if
            if note of myGuy is not missing value then set note of myGuy to ""
        end repeat
        save
        log "Final save"
    end timeout
    return
end tell

That's bold to assert AppleScript being inefficient (vague term) as a cause.  Of course, it very well could be a factor, but it feels a little awkward to say that your script is inefficient, and woefully so.  I don't know if that is the only reason the script runs slowly, but it's a good place to start making fixes, which I'll outline by extracting problem lines in your code:

⚠ set myPeople to people

Redundant.  There is little point in assigning a value to a variable that you don't intend to use in a meaningful way (e.g. for manipulating data without changing the source, or, if you really need to, for making scripts easier to read or debug).  Nowhere else in your script do you make a reference to myPeople, except for one other line that is also redundant.  Therefore, don't waste an operation (and potentially memory, but not really in this particular case) creating a variable you don't need.

⭕ set numPeople to (count of myPeople)

Redundant in principle (I note that you do log the value of numPeople, though it's only used to give you an index reference, which you don't need to know; see next comment).

⚠ repeat with i from 1 to numPeople
       set myGuy to item i of myPeople

Ignoring for a moment the log call that references numPeople, then the entire purpose of the declaring numPeople is to allow iteration through a list by way of a counter variable (i in your case) that is used to access each item through its index (position),  i.e. item i of myPeople.  There are many instances where this would be very appropriate, but it is slower than letting AppleScript worry about how it accesses list items, which it can take off your hands using this syntax: repeat with myGuy in people

⚠ set urlNum to count of personUrls

Redundant, for the same reason as above.  As an additional note, I would personally choose to evaluate the size of a list using the length property.  This doesn't apply to nested lists of lists for which you want to include deeply-nested items in the final number, but that's not the case here.

As soon as a script has evaluated (retrieved) an object, its properties will have been retrieved as part of that evaluation.  length is a property of a list object, and its a simple, unary value (an integer), so accessing that value will always be quick.  count is a command.  It performs some undisclosed operation(s) and returns a value.  I don't know what those operations are, and they will be performed at the C-language level, so probably (almost certainly) aren't slowing this script down at all.  But, in principle, it's something to bear in mind as there are other situations† a command and a property seemingly do the same thing, but the property is demonstrably faster.

†Can't recall them right now.

⭕ if urlNum > 0 then

Redundant, in principle.  There is an else clause that you might insist on keeping, but the only thing it does it to log the fact that nothing was done.  If someone asked me how to intentionally slow a script down because it's just too efficient, this might be one of my answers.

⚠ repeat with j from urlNum to 1 by -1

This is flagged for both the use of a counter variable, j, and for its position within the if block.  If urlNum were set to 0, the repeat loop hear would never be entered, and the script would continue executing the code that follows it.  But, as will become clear, the entire repeat block is redunant.

⚠ log ... (the label of item j of personUrls))
   delete item j of personUrls

I'm questioning the necessity of this log command as a whole.  It's certainly not as self-defeating as the one I mentioned earlier, but it does perform a current date command call, and a lookup in the personUrls list object.

In situations where you do require a counter variable to iterate through a list, do as you did above, and declare a variable to which can assign the current list item's value, i.e. set hisURL to item j of personalUrls.  In crude terms, each time you ask AppleScript for [the value of] item j of..., it must access the list object and perform a look up, which is a relatively expensive operation to perform.  Declaring a variable means the lookup is only performed once, then the value (a copy of the original) is stored in memory, for which retrieval is quick and easy in computational terms.

Returning to the value being logged, its worth seems negated by the immediate deletion of the URL data.  I'm wondering if you might have just wanted a means of tracking where your script had reached in its run, which needn't be so involved.  Using your counter variables, you could simply: log [j, i] (logging their upper bounds once is sufficient, since those values don't change during a loop).

The delete command, when viewed in the context of the repeat loop in which it is called, is going to be slowing things down a lot.  You are iterating through every item in a collection in order to delete it...

⚠ save

...then you save your changes.  How would I intentionally make my script run as slowly as possible ?  I would perform a save operation on the entire address book a number of times equal to numPeople * urlNum.  This value is at least 177, but it's actually multiples of this.  The total number of times you need to perform the save operation, I imagine, would be 1.

The Knock-On Effects:

Now we know that iterating over PersonUrls was not necessary, the entire repeat block can be replaced with the line: delete every url of myGuy whose....

As something to be mindful of, any script that features nested repeat loops are going to be inefficient: the number of operations performed is a product of each list's size.

I actually note that you do mention attempting to delete a contact's URLs en masse, which didn't work for you, forcing you to do it iteratively.  However, as you didn't supply any code showing the methods you tried to do mass-deletion, it's not possible to offer insight into why it failed for you.

Removing the repeat block has a cumulative benefit of negating the parent if block, irrespective of my earlier comments on it.

Conditionals can be expensive expressions to evaluate, particularly performing 177 of them that were never needed.

The Refactored Code:

Continuing back up through the script, the preceding variable declarations all become redundant, which leads to the eventual conclusion that your entire script is functionally equivalent to:

use application "Contacts"

tell (a reference to every person)
    delete (its urls where the value contains "outlook")
    set its note to missing value
end tell

save

System info: AppleScript version: 2.7  System version: 10.13.6

What Now ?

Was your ultimate goal to remove all URLs containing "outlook", or did you plan on retaining one "outlook" URL for contacts that have them ?


How do I restore the behavior of the fn key after Mojave update? I updated to Mojave yesterday and my fn key seems to have changed behavior.  Previously, I could hold fn and press delete to foward delete.  Now, if I press the fn key, it has different behaviors.

In spotlight, it clears my search.  In chromes URL window, it highlights the URL.  In vim, I'm not really sure what it's doing but it exits insert mode as a result.  I miss my fn key. :(

Soooo . . . I've done this to myself.  I'm not sure how I've done it, and I don't like answering my own questions, but in case anybody else finds themselves in this situation . . . here goes.

I never use caps lock so I typically remap caps lock to control.  While I was doing this, evidently, I also remapped fn to escape by accident.

Apple > System Preference > Keyboard
Click 'Modifier Keys'
Sometimes there's a dropdown allowing you to remap the fn key (it seems like it's only there when you have an external keyboard too which may be why I couldn't find it when I looked here before to reset the behavior)


Phone App in Mobile Data settings Why can I disable/enable Mobile Data for "Phone"? Are there any public mobile network providers transmitting voice that way? Can voice "channel" get broken along with data "channel" still functioning?

Your phone app requires data for things like visual voice mail which require a data connection.

So, why can you turn this off?

Most, if not all, domestic (at least here in the US) carriers do not charge you (count against your data allotment) for the data access required to get visual voice mail if you have a qualifying smartphone plan.

However, when traveling internationally, you will more than likely be charged for even recieving those messages. From an excerpt from AT&T's Support Website:

  International data or messaging charges apply to receiving, replying
  to and forwarding voicemail messages while roaming internationally.

So, to prevent being charged while roaming, you can disable the data usage for the phone.

Does this mean turning off mobile/cellular data for the Phone app will stop visual voice mail?

No.  As long as you have a data connection, including WiFi, you will get your VVM. It's when you're roaming and not connected to WiFi where you won't get it.


Damaged and can't be open app error message I bought the iBoostUp app when I was using Lion, and one day it suddenly stopped working, I uninstalled it, and yesterday I got Mountain Lion hoping that it would get magically fixed, but it didn't.
Any clues on how to restore the app?

  “iBoostUp” is damaged and can’t be opened. Delete “iBoostUp” and download it again from the App Store!

In Terminal, run "xattr -rc /Volumes/Application.app", that should fix it (naturally, replace "/Volumes/Application.app" with your actual application path. No need to disable GateKeeper.


Why the same MacMini provides different MAC addresses for different OS? I run MacOS and CoreOS Linux on the same MacMini. The same network interface has MAC f0:18:98:ea:7f:9f under MacOS and has MAC 38:f9:d3:16:96:ce under CoreOS. First one is printed on a box of this MacMini, second one isn't.

Why does it have two different MAC?

MacMini 2018 gen, with T2 chip.

MAC addresses are assigned to network interfaces, not to computers. The F0:98:18 address is for the wireless card, and the 38:F9:D3 address is for the wired Ethernet interface.


Is there a keyboard shortcut to navigate full screen windows of the same application? Or is there some app that will let me do it. This bug has been forever since Lion. Isn't it about time apple fixed it?

Witch also includes full screen windows, and ⌥⇥ selects the next window from the current application by default.

Or if you use an application that has its own implementation for full screen windows (like WriteRoom), ⌘` usually includes custom full screen windows.


iPhone: Is it possible outside of jail breaking an iPhone device to access cache.db? Is it possible outside of jail breaking an iPhone to access the cache.db from iOS 8.3 or above? I am currently using iMazing and I seem to not be able to find the cache.db file.

I found this source

  https://www.macrumors.com/2015/04/13/ios-8-3-ifunbox-itools-sandbox-app-access/

that seems to confirm this.

However, I want to be 100% sure about this.

Edit: I can access it through simulator, but not on actual device properly.

It's possible with iFunbox and iExplorer to view root files, but neither helps you edit them. It offers a sand-boxed version of iOS filesystem. You won’t be able to make any hard changes on your device without a proper jailbreak.

By default, the iOS is jailed. And jailbreaking removes the jailed status and allow us the full view of iOS filesystem with applications like iFunBox.

Here is iExplorer if you want to give it a try.

https://macroplant.com/iexplorer


Retina display compatible Python IDLE? On my Retina MacBook Pro, the Python IDLE development environment has blurry, non-retina text.

Is there a way I can make the text retina?

IDLE:

At the moment this isn't likely to be fixable, unless you're fairly comfortable with OS X development and want to rewrite parts of the underlying GUI library.

According to this bug report on Python.org, it's an issue with the TkInter GUI library, which IDLE apparently makes use of. TkInter in turn is based on Tk, which is a cross-platform GUI toolkit, which means it almost certainly doesn't use the standard OS X text renderer, which is the only way to get "free" Retina text.

As an alternative, perhaps look at ways to make the default python shell or IPython running in Terminal more useful to you?


Backup files from Terminal in Recovery Mode I want to transfer files in Recovery Mode https://support.apple.com/en-us/HT201314. I opened Terminal in Recovery Mode and tried to copy files to external hard drive. I use this code

// I used cd .. to get to the topmost folder
cd Volumes // takes me to volumes
ls
cd OS\ X\ Base\ System
ls

The problem is that this creates a loop. Upon cd-ing to OS\ X\ Base\ System it takes me back to the start, namely the / folder that contains Volumes. I want to copy the whole Document directory and Desktop directory. What I am doing wrong?

EDIT>

When I first enter the Terminal, I am in private/var/root/Library, the system created a var folder when figuring out something is missing I guess.

My goal was to copy files to the external hard drive. They are stored in Macintosh HD (I originally thought I will find Macintosh HD in a subfolder of OS X Base System - wrong assumption). There was no Macintosh HD in Volumes folder, because I first needed to unlock it (I use FileVault).

First you need to find the lvUUID of your Macintosh HD. Use this command:

diskutil list // lvUUID

Look for text looking similar to this:

Logical Volume on disk0s2
4B2EFAAE-C871-4E6D-AB15-2DDE604B97CE // this is lvUUID
Unlocked Encrypted

To unlock use this command:

diskutil cs unlockVolume lvUUID #replace lvUUID by the one shown in the diskutil listing

You will be prompted with password for your user account.
After that Macintosh HD will be present in /Volumes/ folder.

All thanks to klanomath for enlightening me. See full Q&A here: No Macintosh HD in Volumes folder


What's fastest: iPhone 4 tethering with bluetooth, usb or the new hotspot feature? I'm going to use the internet on a MacBook 5,2 and I have an iPhone 4 with iOS 4.3.1 and it's jailbroken (and using TetherMe), if it makes any differences.

Fastest to slowest:

USB
WiFi hotspot
Bluetooth

Keep in mind the power draw of the options. From most battery efficient to least:

USB (It helps that it's also charging at the same time.)
Bluetooth
WiFi


Can I get the code of a TestFlight app? I have hired a developer to create an iOS app. He was working on it and showing me the progress on TestFlight but now he is not responding, don't know what's going on.

Now can I get the code from a TestFlight so that I can hire a new developer who can start from where the previous guy left?

No - you might retain a copy of the application by transferring it to iTunes in case you take legal action to arbitrate or ask the courts to assist you with your contract with your developer.

Apple doesn't receive code from developers when an app is submitted (test flight submissions work the same as app store submissions) - just the compiled program.


How to Backup Email on Apple Mail? I am new to this Mac world and on the first day of my new job my boss gave me a tedious task to Backup Emails on Apple Mail. Basically, there are 3 email ids, and these are our support email database. So there are tons of emails stacked in the inbox. I have to backup all the emails, contact list, and even the address book. I had a look online for manual procedures and found out that Apple Mail Export and Time Machine Backup are best suited for these backup issues. I did try them, but the problem is they are taking too long. I need a quick solution to Backup emails on Apple Mail.

Are there other alternatives to Backup emails on Apple Mail that are quick, safe and easy to operate? Do let me know asap. Thanks

The thing with backups is that they're just a copy of your data at a given point in time. Now, keep that in mind for a moment as I continue to offer another possible solution below (but read my caution afterwards).

It seems to me from your question you're just wanting a quick drag and copy solution. So, for instance, you could just make a copy of your Apple Mail data. To do this:

Go to Finder
Press and hold the option key while you click on the Go menu
Select Library
You can let go of the option key now
Within the Library folder you'll see a folder called Mail
Copy this folder (just right-click on the folder and select Copy "Mail", or press command+C)
Navigate to where you want to save your backup (obviously another drive!)
Now you can paste a copy (e.g. by pressing command+V)

There you have it, you've made a copy of all your Mail data.

A word of caution

However, you really need to consider if this will achieve the ultimate aim of what your boss wants? Remember I previously mentioned this was just a copy at a given point in time. This means if a month later you have a hard drive failure and need to restore your Mail backup, the data you'll restore is a month old (unless you've made a more recent copy - but that's something you have to remember to do manually).

This is where backup software (such as Time Machines) comes in. Time Machine automatically makes regular backups. Yes, the very first time TM makes a backup it will take a long time. However, after the initial backup, all subsequent backups take much less time. You may want to read: Use Time Machine to back up or restore your Mac.

Finally, there are other options to Time Machine, such as Carbon Copy Cloner and SuperDuper!


Delay when using the volume buttons When I change the volume using the buttons on an Apple Wireless keyboard (with a Mac Mini) I almost have a huge delay between the key press and the action (up to several seconds and from time to time even several minutes).

using the slider on the menu works perfectly (without delay)
resetting the PRAM does not bring any improvement
I do not have any sound-related third party utility as boom (see an Apple Support discussion)

Any idea what the cause could be?

Edit

Brightness is affected as well
I also noticed that the process loginwindow is not responding and uses 100% of one core
The console shows no errors

Typing sudo killall coreaudiod in the terminal fixed the issue straight away for me.

It also removed the delay on the keyboard brightness buttons.
Issue started after going back to internal speakers after streaming audio through airport.


I can't upgrade my Mac from macOS Sierra to macOS Mojave. Admin password required So because of the quarantine my school sent me a computer to do my work and I want to upgrade the OS. It's running macOS Sierra, and I wish to upgrade it to run macOS Mojave. I can't do so as it keep asking me for administrator name and password.

Is there anyway to get around this?

Your Mac is asking for an administrator name and password for a reason. It wants to make sure that only an authorised user is making a major change to the computer as upgrading the operating system software.

You generally cannot work around it. You'll need an administrator username and password to be able to upgrade macOS. You should consider getting in touch with the person/team responsible for this and seek their assistance.


Macports issues after Mountain Lion upgrade After upgrading Lion to Mountain Lion, the MacPorts system seems broken.

Refering to the MacPorts's migration page, the best solution seems to unistall all and reinstall all the ports.

Is there a simpler/less drastic solution?

Here is how I fix it (after Mountain Lion update):

install the latest MacPorts DMG dedicated to Mountain Lion over the old one;
install the latest Xcode version from the AppStore (it doesn't update by itself!);
launch Xcode and agree to the licence;
in Xcode's Preferences, at the Download's tab, in the Components section, install Command Line Tools (as since Xcode 4.3);
don't forget that you must read and accept licence for it, this is possible after running the following command in the terminal: sudo xcodebuild -license.

Without this step, if you try to use sudo port install [something] or others, you'll have the following return: Error: org.macports.build for port libunwind-headers returned: command execution failed

in terminal:

sudo port selfupdate
sudo port upgrade outdated

After that, everything works except MongoDB, After some research, I found this article (How to upgrade MacPorts to OS X 10.8 Mountain Lion) by Phil Freo.

Thanks to this article, which reassured me in my approach, I also found the solution to my last issue:

  Everything finished and worked properly except MongoDB. Currently there is an incompatibility between boost 1.50 and MongoDB which can be resolved with these two commands, assuming boost 1.49 was previously installed on your machine:

sudo port activate boost @1.49.0_0
sudo port -n install mongodb


Can you block calls on the iPhone? I have an iPhone 4S running iOS 5 and cannot find (after trying) any app that blocks calls. Is there anything out there that can block calls on the iPhone?

I have not found a 3rd party application that does this well. You can obviously block a number via your cell carrier. Since I could not find a good method to block calls with an application I ended up adding the number to be blocked to my contact list and assigned a "silent" ring tone to the contact. Although it will not block a incoming call it will cause the phone to play a silent ringtone when the number in question calls. Not a true block caller solution but at least a potential workaround.


Google Earth coordinates and Aperture place I'd like to geo-tag some already-imported photos in Aperture.

To get the correct location, I'm using Google Earth. However, when I copy/paste the coordinates into Aperture Places, the maps shows a completely different location.

Here's an example. The coordinate is

4°15'13.02" N 118°38'00.54" E

I use this converter to get a LatLon coordinate

04.2536167°, 118.6334833°

but when I paste this value in Aperture, the Place doesn't match on the map. The location seems to be correct, because when I use this in Google Maps it shows the same point.

Any hint on geolocating a photo in Aperture?

An applescript to take care of this:  http://www.underdoug.ca/2012/08/13/geotagging-with-google-earth-and-aperture/


iCloud just display the photos and do not download them as the iPhone does I've always been an iPhone user, however, I just recently bought my first MacBook Pro and one of the things that made me upset was iCloud, it downloaded all my photos and videos to the device, I'd like it to do as it is on the iPhone only displays the photo, however, it only downloads it when we open it. It's possible?

PS: I researched a little bit about, however, I did not find anything: /

Photos is designed to either download every photo to your Mac when using iCloud Photo Library  or "Optimize Mac storage" which stores fewer photos on your Mac based on the amount of space you have.


How do I install pgadmin3 using brew cask? If I try running brew cask install pgadmin3, as suggested on an unknown website http://macappstore.org/pgadmin3/ I get "Cask 'pgadmin3' is unavailable: No Cask with this name exists.", an error message that doesn't get any hits on this stack exchange.

$ brew cask install pgadmin3
Updating Homebrew...
==> Auto-updated Homebrew!
Updated 1 tap (homebrew/cask).
No changes to formulae.

Error: Cask 'pgadmin3' is unavailable: No Cask with this name exists.

Another user encountered the same problem, and thought that it was necessary to install pgadmin4 instead. How do I install pgadmin3 with homebrew?

It's necessary to turn on cask-versions, a project mentioned at https://github.com/Homebrew/homebrew-cask-versions

$ brew tap homebrew/cask-versions
Updating Homebrew...
==> Auto-updated Homebrew!
Updated 1 tap (homebrew/cask).

==> Tapping homebrew/cask-versions
Cloning into '/usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask-versions'...
remote: Enumerating objects: 228, done.
remote: Counting objects: 100% (228/228), done.
remote: Compressing objects: 100% (217/217), done.
remote: Total 228 (delta 16), reused 51 (delta 10), pack-reused 0
Receiving objects: 100% (228/228), 92.05 KiB | 4.84 MiB/s, done.
Resolving deltas: 100% (16/16), done.
Tapped 208 casks (248 files, 350.3KB).

$ brew cask install pgadmin3
==> Satisfying dependencies
==> Downloading https://ftp.postgresql.org/pub/pgadmin/pgadmin3/v1.22.2/osx/pgadmin3-1.22.2.dmg
######################################################################## 100.0%
==> Verifying SHA-256 checksum for Cask 'pgadmin3'.
==> Installing Cask pgadmin3
==> Moving App 'pgAdmin3.app' to '/Applications/pgAdmin3.app'.
  pgadmin3 was successfully installed!

Also, when the application is first opened, a '“pgAdmin3” can’t be opened because it is from an unidentified developer.' message will be encountered, which can be fixed by opening the application from the application folder, as documented at The app can’t be opened because it is from an unidentified developer


Adding RAM memory to my 2011 iMac I am adding more RAM memory to my 2011 21-inch iMac. It currently has two 2 GB memory cards. Can I leave those two cards in place and simply add two new 4 GB memory cards, or do I need to remove the existing cards? Is it OK to mix 2 GB and 4 GB memory cards, provided I stay under Apple's 16 GB limit?

Absolutely. RAM can be mismatched and combined in every way. However, 2x2GB will not be as fast as 1x4GB memory. That being said, it shouldn't really matter that much.


How do I Change Force Touch "taptic" or haptic feedback on MacBook Pro? I love my new MBP Retina but I would like to change the amount the Force Touch vibrates.  I know there are the settings called Light, Medium and Firm to change not only the amount it vibrates but also the intensity of the force required to actuate.  I am wondering if there is any way to turn the vibration of the Taptic Engine up even further to receive a more tactile click. Is this possible? Can I use BetterTouchTool to achieve this result? I tried to mess around with it a little bit but I don't think it works.

I think the hardware has plenty of "weight to shake things more" because on the "Firm" click setting, the Force Touch vibrates quite a bit. I just wish that that was the default level of haptic feedback. (I could do without Force Touch; I just want a really solid "click" when I click.)

I really miss the mechanical button on my old Macbook Pro.


How can I change the default 1 hour duration of a new appointment in the iOS calendar? My calendar appointments automatically default to an hour for the end of appointment. I am running on iOS 11 on my iPhone.

How do I change the default time to just 1/2 hour?

I don’t see anything in the settings app for changing this for the calendars.  Only the default reminder times have a preference.

I use Siri for this and it works great for me

Hey Siri, make an appointment at 10 A.M. for 15 minutes.
add a recurring appointment for 30 minutes starting at 9 A.M. on the 28th of every month

change the title to review finances


How to restore Mac OS X on a new hard-drive? I am going to upgrade my MacBook Pro hard-drive, but before doing so I'm trying to figure out how to restore OS X on it. My DVD drive doesn't work so I cannot re-install from the DVD.

I have a recent Time Machine backup, is that enough to restore the OS? And in that case, what would be the procedure? Also, in case the Time Machine restoration fails, is there any way to re-install OS X from a USB or external hard-drive? Any suggestion would be much appreciated.

Yes a Time Machine (TM) backup is sufficient; you don't need to "install" the OS and then restore the backup.  However you will need a copy of the OS at least and that can definitely be placed on either a USB stick or external HDD. The OS media contains the utilities you'll need to restore the TM backup.  Example here.

(edit for clarity) Depending on how new your MBP is, more specifically which version of OS X you have, you may also have a built in Recovery that has all the tools you need to do this as well.


Is it possible to use Time Machine on a shared USB Hardrive? I've a iMac with an external HD derserved to Time Machine. I also have a MacBookPro.

Is it possible to make this config :

Share the disk on the iMac so that the MBP sees it on the network
Ask Time Machine on the MBP to use this shared disk for the backups

?

Note : Currently, I use this HD for Time Machine on both Mac, but I have to change the USB connection from one Mac to the other each time I want a backup to proceed.
I'll prefer just to have to mount the shared HD.

It should be possible, but it will not be able to use your existing MBP backup (you will need to start it from scratch). Just plug the disk into the iMac, make sure it is being shared, and then select it in Time Machine setup on the MacBook Pro and let it do the initial backup.

The reason you can't use the existing backup is that when you use a disk for Time Machine it uses that disk directly, since it is attached to the machine and the machine knows no other machine is modifying it. When you use it over a network it creates a disk image and puts the time machine data in the disk image (in essence, it is a poor man's version of thin provisioning. Migrating between these two configurations is possible, but non-trivial.


Will Time Machine back up new data and bypass OS back up? Since Time Machine will back up new data as a higher priority, what if the Mac's hard drive is 800MB full, and the back up drive is only 500GB?

Since the OS system files are the "old data", will Time Machine back up the newer and newer data and therefore "forget about" the older data including the OS X system files, and that a "restore", if it is ever needed, will not be able to restore the Mac into a bootable condition?

First, I must say if you are running Lion you shouldn't worry about this, as all Lion machines have a "Restore Partition". That is they save all the system files required to restore the system on a special "section" of the disk unaccessible under normal conditions. If you ever do want to access this Restore Disk, simply hold down the option key while your Mac is booting up, and you should see be able to select it.

Time Machine, as far as I can tell, DOES backup system files. It full copy of your drive. Nonetheless, time machine backups are not bootable. You can save space by excluding system files, or any other big files you might not want/need to back up. Here are some articles that might help you with that: Time Machine tips and troubleshooting, Guide To Excluding Data from Time Machine Backups.

If you don't, time machine will leave them, no matter how old the data gets, and it would display an error/warning if you run out of space rather than deleting them. Time machine makes sure to always have at least a single full copy of your system.

Regarding space, you can backup a larger drive with a smaller one, as long as your Time Machine Drive can hold all the space you are using on your larger drive. So if you have 800GB in your system, but have only used 200GB, you could back it up with a 500GB drive, though it is not recommended, because if one day you do fill the drive Time Machine wouldn't be able to have a single full backup. Nonetheless, if you keep your actual disk usage below your Time Machine Disk capacity, you should be fine, with at least one full backup.

My final recommendation is you check those articles and save space for your backup, excluding the system files (Time Machine backups aren't bootable anyways. You'd need an installation disk or a Recovery Drive.) and any other large, unimportant files. Finally, keep an eye on your backup, and if you find out you do need more space I really recommend buying a larger hard drive! Time Machine can come up pretty handy in times of despair!


Thunderbolt display firmware update 1.2 keeps reappearing, but is not compatible I've got a problem with the Thunderbolt display firmware 1.2. My screen is not compatible, because it was purchased in 2012 and the update can not be performed. However, the update keeps reappearing on the App Store updates.

I tried the what Apple recommends, however nothing changed and the update keeps posting. Many people are complaining about it. Anyone has an idea how to disable this update?

I had a similar problem: The "Thunderbolt display firmware update 1.2" kept reappearing in AppStore, even though the uppdate seemed successful.

According to Apple the update was successful when the the Firmware Version is 26.2 and the Port Micro Firmware Version is 2.0.7 (visible in About this Mac -> SystemReport).

Above versions were correct in my case, but the update still kept appering in AppStore... (probably I did download and install the update manually after the first failure, but I don't remember ...)

To get rid of the annoying update in AppStore I used the softwareupdate command on the commandline:

softwareupdate --ignore TBdisplayFWUpdate1.2

The update package name may vary. For example:

softwareupdate --ignore ThunderboltFirmwareUpdate1.2

To find the correct name of the update for your machine, use the following command and copy the update package name up until the "-"

softwareupdate -l


How to change the move / calorie Activity goal on an Apple Watch? I've recently set up a new Apple Watch; during the setup process I selected the "most active" setting (Very Active, I think).

Now that I've seen the daily targets in the Activity app, I realise that the move/caloria goal (red ring) is too high.

Can I change that?

I've looked in a bunch of places, including the general Settings, Health settings, and Activity settings (all in the Watch app on the iPhone) - and the Activity app on the iPhone. But no luck.

Additionally, can the three goals be changed independently?

The option is hidden behind a long/hard press - so not easily discoverable:

Tap on the Activity app from your Apple Watch's Home screen.
Swipe left until you see the Move ring.
Press firmly on the screen.
Tap on Change Move Goal.
Adjust your move goal to whatever you'd like and tap Update.

Source: How to set a calorie goal with Activity for Apple Watch

The calorie goal is the only configurable goal.


App from USB always shows verifying app dialog I have a USB drive, and I decided to transfer a few apps from my Mac to the USB that took up a lot of space. Now every time I launch an app from the USB, it always shows the verifying dialog.

Is there a way to prevent this?

Check the box

  Don't warn me when opening applications on this disk image

and then hit open. Note that I don't know how to revert this change.


ffmpeg arguments used for converting to mp4 I have been suggested two different ffmpeg commands for converting an mkv file to an mp4 while just re-encoding the audio (to aac) and leaving the video portion as is. Here are the two commands:

ffmpeg -loglevel panic -i source.mkv -vcodec copy -c:a aac -strict -2 -ab 160k -ac 2 -ar 48k target.mp4
ffmpeg -i source.mkv -c:v copy -c:a aac -b:a 384k -strict -2 target.mp4

Could someone please explain the difference? OK, more precisely, I am curious about the things the first command does in addition to what the second one does. Is it necessary to use a -log level panic argument? What happens if it's omitted?

I understand the second command thoroughly. But the additional arguments in the first one are confusing me and I didn't find much help in the ffmpeg documentation either. In particular, I want to understand what the -ac, -ar, and -ab arguments accomplish and why are they not used in the second command.

ffmpeg duplicates syntax. Except for the values used, and that the first command set the sampling rate instead of using the default, the commands are effectively the same:

 -loglevel panic  - merely makes ffmpeg less noisy in the shell
 -vcodec copy     = -c:v copy
 -acodec copy     = -c:a copy   # unlisted in the command, but listing here to show there is consistency
 -ab              = -b:a

Note: The other answer info is correct.

There is a guide online; it lists what every possible argument means.


Silverlight Plug-In in Safari 12 is there any way to enable the Silverlight Plug-In in Safari 12? I need this plug in to watch a live sport event.

Thanks!

is there any way to enable the Silverlight Plug-In in Safari 12?

No, there is no way to make the current version of the Silverlight plugin work with Safari 12.

As of today, no actively supported web browser on macOS can run the current Silverlight plugin (neither Safari, Chrome nor Firefox, see below for more information). The culprit is the technology the plugin is based on: NPAPI, which has been deprecated in all major browsers because of security concerns, the latest of them being Safari with version 12.

This means that you must use an unsupported browser, with all the risks that entails.

If you insist on using Silverlight on macOS, I think your "safest" bet would be Firefox 52 ESR for that specific sports site. You can download it from Mozilla's release repository.

Firefox 52 ESR has been replaced with Firefox 60 ESR, but its latest version is somewhat recent, released on June 25 2018.

As explained above, neither Safari 12, Chrome version 45 or later nor Firefox 52 or later support NPAPI plugins, with the exception of Adobe Flash.


Is it possible to run a windows OS off a Flash drive/thumb drive on a Mac? In theory, is it possible to run Windows OS off a flash drive, so that on starting up the machine, if the stick was in the USB slot, it would startup on that 'hard disk' and run windows programs off it?

I'm basically asking because I'm having nightmarish issues trying to get Bootcamp to partition my drive and run Windows on the partition. I've been searching the problem and it seems to be an ongoing problem going back to 2014, which amazes me.

In theory, yes, but in practice it would be quite slow and cumbersome doing so from a flash drive.

My suggestion would be to search here for an answer to whatever your Bootcamp issue is (or ask a question about it).

However, if you really want to bypass the internal drive, then I would recommend using an external hard drive (instead of a flash drive) to run Windows from. Be aware though that the process for doing this is quite involved. For example, read this question for one way to achieve what you want.


How do I use the MacPorts version of nano as my default text editor? I tried installing nano using "port install nano", but using the "nano" command doesn't open the macports version.

$ which nano
/opt/local/bin/nano

$ /opt/local/bin/nano --version
GNU nano version 2.2.6 (compiled 13:17:29, Nov 26 2013)
(C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
2008, 2009 Free Software Foundation, Inc.
Email: nano@nano-editor.org Web: http://www.nano-editor.org/
Compiled options: --disable-wrapping-as-root --enable-color --enable-extra --enable-multibuffer --enable-nanorc --enable-utf8

$ nano --version
GNU nano version 2.0.6 (compiled 18:58:13, Aug 24 2013)
Email: nano@nano-editor.org Web: http://www.nano-editor.org/
Compiled options: --disable-nls --enable-color --enable-extra --enable-multibuffer --enable-nanorc --enable-utf8

$ echo $PATH
/Users/zach.alnasser/golang//bin:/opt/local/bin:/opt/local/sbin:/Library/Frameworks/Python.framework/Versions/2.7/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin

I want to use the nano in /opt/local/bin, but even though that directory is at the beginning of my $PATH, the native nano continues to open. Even if I rename /usr/bin/nano, it complains that /usr/bin/nano doesn't exist, instead of using the macport version.

You can either rename or completely remove /usr/bin/nano, then:

ln -s /opt/local/bin/nano /usr/bin/nano

The above command creates a symbolic link from /usr/bin/nano to /opt/local/bin/nano


Disable ⌘+p and ⌘+s in Terminal.app I continually hit ⌘-P and ⌘-S while Terminal is in focus, due to alt-tabbing between my text editor and other programs.

Does anyone know how to disable these keys in Terminal.app?

You could try out Keymando which will let you set specific shortcuts for programs. In this case, you would set those commands to do nothing.

Another solution would be to use iTerm 2, which allows you to specify shortcuts for keys (or to ignore).


Why doesn't my messages icon on my iPhone 5 display the number of messages? I don't know if I may have accidentally changed some settings, but now the icon on my Messages doesn't display the number of unread messages. However, my Mail app does, so I am not sure why this is. I tried going through settings to see what I could find, but to no avail.

How do I fix this?

You've turned it off in Notification Center.

Open Settings, then scroll to Notification Center and tap it.
Scroll down to the "Include" section; "Messages" should be there. If not you've turned off notifications for it altogether; scroll on down to "Do Not Include" and you should see it there. In either case, tap it.
Tap the "Badge App Icon" switch so it's on.

Your messages count should be back.


Apple Mail's "Remove Attachments" not removing attachments from hard drive I'm trying to slim down my email archive by removing attachments I no longer need, using the "Message > Remove Attachments" command in Apple Mail.

After removing several GB worth of attachments within Mail, I noticed that my ~/Library/Mail/ folder wasn't getting any smaller. Digging into the folder structure, I found that all of the attachments I had 'removed' from the emails are still present in the filesystem, deeply nested in the ~/Library/Mail/ folder.

I've tried quitting and restarting Mail, rebuilding the mailboxes, and restarting the computer, but the files remain.

Are others experiencing this behaviour? Is it possible to have the attachments removed from the hard drive when 'removed' from the email?

Running macOS Sierra 10.12.6

I stumbled onto a solution after several hours. Hopefully this can help others.

Background

I wanted to remove attachments larger than 1MB from emails older than 5 years. I made a smart mailbox with criteria for "has attachments" and "date recieved not in the past 5 years". I did a "select all" on the ~25k results and chose "Message > Remove Attachments" from the menu bar. Mail chugged away for half an hour, and afterwards the attachments were removed from the email messages, but the "Library/Mail" folder hadn't changed in size. Drilling into the "Library/Mail" folder structure in the Finder, I confirmed that the files were still there.

The missing step

I have my email sorted in folders in the Mail sidebar:

On my mac
     Project 1
     Project 2
     Etc

In order for the removed attachments to actually be deleted from the file system, I had to click on each folder in Mail's sidebar. Something about opening the folder in Mail seemed to cause that folder's messages' removed attachments to be deleted from the file system.

**Important to mention that this was using a POP email account, and the messages were long ago deleted from the server, so there wasn't an issue of Mail re-downoading the attachments from the server.


Command to collect windows of one or all apps in one monitor? My setup allows my laptop and desk machine to share a large-screen monitor in addition to their own displays. Both machines are connected to the large monitor with their own HDMI cables, and that monitor has a switch for choosing which one to display. All good.

Sometimes I have the large monitor showing one machine's stuff and I need to check something on the other machine -- and as it happens the app on that machine has its windows open on the large screen, so I don't see them. Rather than switching the large monitor to the other machine, is there some command to make the second machine collect that app's (or all apps') windows into its own display?

The only way I've found that works is to pull the HDMI cable out of the second machine, which forces all of its open windows back into its own display. I'd prefer a way that doesn't involve connecting and disconnecting the cable. System Settings -> Displays is no help.

Machines are late-2008 MBP and mid-2010 Mac Mini Server. Running Lion on both.

Thanks.

You can use a third party window manager like Stay to assign windows to the display where you'd like them to reside. By using Stay to restore windows, all of them move to their designated spot. For example, you could set your windows to the display that you're currently viewing.


What should I consider before buying external monitor for my MBP? I'd like to buy an external monitor for my Retina MacBook Pro mid 2015 (2880x1800 native resolution). I have 2 Thunderbolts 2 ports.

I have the following questions that need answers to help me choose the best product :

What monitor size/resolution I should consider?
how will I Connect my mac to my monitor ? HDMI? Thunderbolt ?

Thanks,

What monitor size/resolution I should consider?

This is entirely up to you.  What makes sense for you?  Determine what features/specifications are important, then your budget, and then start shopping.  This will always be a subjective decision

  how will I Connect my mac to my monitor ? HDMI? Thunderbolt ?

This is less subjective; the question is, what does the monitor support?

Your MacBook will have both mini DisplayPort and HDMI  meaning you can use either cable.  Which one you use is entirely up to you, but my recommendation is

Go with DisplayPort as HDMI can be very flaky (just search this site for examples)
Use the port that matches your monitor - don't convert the signal.  I am a bit proponent of not converting display signals; converting introduces unreliability.  If you must convert a signal, use an active adapter.