OS X Server (Mavericks) requires wired network connection for Caching? I recently installed OS X Server on my Mavericks machine, and want to use the server (among other things) to cache software and app updates for other devices on my network. However, when I try to turn on the Caching service, I get the following message:

Unable to start service.
Caching requires a wired network connection on portable computers. Connect to a network using a wired connection before starting the service.`

However, my Macbook Air doesn't have an ethernet port! I at one time had an ethernet adapter (using Thunderbolt) but I sold it. Any suggestions for how to get around this problem?

Via this Apple kbase article:

You can specify advanced configuration settings for the Caching service with the command line or by editing /Library/Server/Caching/Config/Config.plist.
Interface | Listen on all interfaces |    The BSD name of a network interface to be used by the Caching service.
Setting values for a key
To set a key with a simple value, you can use the serveradmin(8) command. For example, to set the Interface key to en1, you would execute this command as an administrator:
sudo serveradmin settings caching:Interface = en1

I am unable to find any evidence anywhere that Server can use wireless interfaces, but if you connect a USB to Ethernet Adapter and use its interface number in the line above you should be able to use Caching Server.


Cannot partition internal SSD High Sierra I wanted to install MacOS Mojave on a new partition just to check it out. But I cant partition my internal drive using disk utility. I'm running High Sierra 10.13.5. I've included a screenshot of disk utility.

Any suggestions?

No room

The answer is in your screenshot.

Macintosh HD is too full and as a result partitioning the drive would result in a partition too small.

First Screenshot:
“This volume can’t be split because the resulting volumes would be too small”

You need to clear out some space on Macintosh HD by deleting some files. This may help with that, but please know 256GB computer is very small and is not meant to be partitioned to run two OS’s. Can it be done? Yes, but you are basically going to me limited to a couple files on each OS.

I would just suggest installing macOS Mojave on a partition on an external drive (such as the one in your screenshot).


Windows are not showing when using cmd+tab On some occasions, when I use cmd+tab to switch to a window, the window itself doesnt show- though the menu bar of that window does show.
If I want to show the window, I have to the doc and click the icon- and then the window will show.

I thought it has to do with the desktop space of that window, but it isnt- I just can't seem to make the window show on cmd+tab, I have to click it from the doc.

Am I missing something? is there a way to show the window when using cmd+tab?

I was going to add post as comment but i don't have the privilege

When does this happen to you?
if it happens in Parallels Desktop Coherence mode, try Alt+Tab


iTunes is not recognizing my iPod Touch 4th generation iTunes is not recognizing my iPod Touch. I tried re-installing iTunes but that didn't help. At first, my iPod was recognized by the computer as a digital camera but this has already been fixed.

First, try connecting to a different computer and/or using a different cable to rule out the possibility of it being something other than the iPod.

Next, check if there are any defects with the iPod. If you are using iOS 5, configure it to back up all your data to iCloud.

Finally, you may want to consider putting the iPod into recovery mode and trying to restore from there. If that does not work, you may want to visit the Genius Bar to check for any hardware issues.

How to do it: http://support.apple.com/kb/HT1808

Note: if you are out of warranty, and suspect it may be a physical issue, you may just want to continue using the iPod as it is, because once you put it into recovery mode you may not be able to get out of it


OpenMPI already installed in OS X? I've been looking for MPI for OS X and some websites say that it is already installed in OS X (since 10.5).

Could someone point out where is it installed? I cannot find mpicc nor mpirun. Or should I build OpenMPI from code?

Neither mpicc nor mpirun are installed on a stock Mountain Lion system nor present with Xcode v5 or lower.

The homebrew packaging system has a trivially simple install (v2.0.1):

brew install open-mpi

You could also build your OpenMPI from code:

https://sites.google.com/site/dwhipp/tutorials/installing-open-mpi-on-mac-os-x

It appears from this article, that Lion dropped the inclusion of a build of OpenMPI - but I'd go with the instructions above rather than the MacPorts version if you don't already use MacPorts.


Get MacBook to say Thank You when plugging in the power cord? I would like to know how can to create an applescript which is executed when I connect the power cord to my MacBook. I would like it to say "Thank You"

This worked for me:

global thanks

on run
    set thanks to false
end run

on idle
    set battStatus to do shell script "pmset -g | grep \\*"
    if battStatus contains "AC Power" then
        if thanks is false then
            say "thank you"
            set thanks to true
        end if
    else
        set thanks to false
    end if
    return 1
end idle

Open Script Editor, Save as Application, Check "Stay open after run handler" to keep the program running. The only downside is you'll have to keep this program open at all times. You can set it to launch when you login. Maybe someone else has a better way to address this.


Siri does not recognize Apple Music on macOS When instructing Siri to play something on macOS that is not in my music library, it says, for instance, "You don't have anything by [artist] in your music".

I can see that it suggests other sources, including Apple Music.

It does not work on the latest macOS (10.14.2, 2018 MacBook Pro), but it does on iPhone Xs with the same Apple ID and subscription. When I open iTunes, I can see that the subscription is active and I can play content from there.

Is there a setting that enables Apple Music as source for Siri on a Mac?

Make sure that you are using the same Apple ID.
From this Apple Support article:

Mac: From the menu bar at the top of your computer screen, choose iTunes > Preferences.
On the General tab, select iCloud Music Library to turn it on. You won’t see an option to turn on iCloud Music Library until you sign up for Apple Music or iTunes Match.
Click OK.


How do I stop an AppleScript script that is stuck in an endless loop without restarting my Mac? I stupidly ran an AppleScript script on my Mac running macOS Mojave and the script is running in an endless loop. I thought something obvious like pressing the Esc key would end the program. However, neither the Esc key or anything like CTRL + Z etc works.

How can I interrupt the loop and end the script using a hotkey or similar method?

I tried to click the program but it won't let me unless the loop of the keystrokes stop.

NOTE: I need to save my work so I can't shut it down.

https://support.apple.com/en-il/guide/script-editor/scrptedshtcut/mac

The answer is indicated here. Command + period (.)


I have a broken iPad that is being replaced tomorrow, is there any chance I could still keep the broken one? I got an iPad mini on Wednesday through the post but I opened it to find it damaged. It is only a tiny chip but I rang apple and they are sending me a new one and I am giving this one back. Does anyone think thar it might be possible for me to buy the broken iPad from apple for cheap? It's chipped in the front and engraved on the back so surely it would make more sense for me to buy it as my sister has expressed an interest in it.

Has anyone been in this kind of situation?
Thanks.

As a former Apple employee, I can tell you this is not possible. Apple will use undamaged parts from the one you return to create refurbished units that are sold online, as well as service replacements for Genius Bars. If they shipped you the replacement in advance, you could technically just not return the damaged unit, but you will be charged for it after a certain number of days (I believe 30).

If your sister wants a good deal on one I would keep an eye out on the refurbished section of the Apple Online Store, or on Craigslist or eBay.


Is there an equation in Numbers that will give me the sum of numbers based on a separate column? I'm trying to find out if there is a way to create an equation that looks at one column, if it is equal to a certain value, then add the value in the other column?

Example:

#Table of running values:

Type     Cost
-------------
A        $4
B        $2
B        $1
A        $6

I'd like to be able to create another table that results with this:

# Summation of each type

Type     Total
--------------
A        $10
B        $3

Any help in setting up an equation to do this summation would be helpful.

I figured it out. The method is called =SUMIF(). I am so happy. :)


How to reset or rebuild application search database in ios? I am having a strange problem on ios. When i search for any app by typing its name in the search screen, the corresponding app shows up, WITH THE EXCEPTION, of firefox for ios. Its odd to me that my firefox app is completely ommitred from search results and I have to manually find the app each time I want to use it. Is there a way to rebuild the app search database in ios?

You need to make sure the app is included in Siri's search index.

To do that on iOS 12, go to Settings -> Siri & Search.

Scroll down to find the app.  Turn on the switch.  Wait a few min then try searching for the app again.


Some hotkeys not working for certain apps I'm trying to understand why select hotkeys will not work in certain apps. For example, Command+ will not work in WhatsApp to make text bigger, and CommandControlF will not work in Joplin to make it full screen.

My suspicion is that another application is hijacking this hotkey, but how do I verify this? How do I check which commands the computer is actually executing?

Nothing is being hijacked.  To make an app full screen or to make text larger, it must be supported by the application.  This holds true for not only shortcuts, but text substitution as well.

A quick search of the Mac Keyboard Shortcuts for the Full Screen shortcut says this:

  Control-Command-F: Use the app in full screen, if supported by the app.


iMac Target Display Mode I am trying to go into target display mode on my iMac. Its a 2012 iMac which does support TDM. However, I don't have a standard iMac keyboard because I bought a refurbished Mac which comes with a different keyboard & mouse. That being said, I can't use the Command + F2 key combination to go into TDM. How am I able to without doing that?

Have you tried all the  steps recommended by Apple?

Use Target Display Mode

Follow these steps to start using your iMac as a display:

1   Make sure that your iMac is turned on, and the other Mac is logged in to a macOS user account.
2   Connect the Mini DisplayPort or Thunderbolt cable between the two computers.
3   Press Command-F2 on the keyboard of the iMac that you want to use as a display.

After you press Command-F2, your iMac displays the desktop from the connected Mac.

If Command-F2 doesn't work

If your iMac doesn't switch to Target Display Mode when you press Command-F2, check these things:

•   Make sure that the iMac you're trying to use as a display supports Target Display Mode.
•   Target Display Mode works only when your primary Mac is logged in to a macOS user account. For example, if your first Mac is at the FileVault login screen, pressing Command-F2 on your iMac does not enable Target Display Mode. You must first log in to your Mac (using a regular display, if necessary) before you can use an iMac in Target Display Mode.
•   Make sure that you're pressing Command-F2 on the keyboard that's connected to the iMac you want to use as a display.
•   In Keyboard System Preferences, if the checkbox is enabled for "Use all F1, F2, etc. keys as standard function keys," the key combination changes to Command-Fn-F2.
•   Make sure that your Mini DisplayPort or Thunderbolt cable is connected to both computers.
•   If you're currently logged in on the iMac you want to use as a display, try logging out to return to the login window. Then press Command-F2 again.
•   Some older Apple keyboards and third-party keyboards might not allow Command-F2 to toggle display modes. If this happens, use the keyboard that came with your iMac to toggle Target Display Mode on and off.
•   If your iMac is currently started up in Windows, it won't enter Target Display Mode. Target Display Mode isn't supported in Boot Camp.


Battery life of macbook air with different hardware configuration Apple states that the 2014 11-inch MacBook Air has a battery life of 9 hours and the 13-inch model has a battery life of 12 hours.
These stats are for the default configuration:

Processor: 1.4GHz dual-core Intel Core i5 (Turbo Boost up to 2.7GHz)
with 3MB shared L3 cache;
RAM: 4GB of 1600MHz LPDDR3 onboard memory;
Storage: 128 Gb or 256 Gb PCIe-based flash storage.

MacBook Air can be upgraded though:

Processor: configurable to 1.7GHz dual-core Intel Core i7 (Turbo
Boost up to 3.3GHz) with 4MB shared L3 cache;

RAM: configurable to 8GB;

Storage: configurable to 512GB flash storage.
I believe the component that has the biggest impact on battery life is the processor, though also RAM could affect battery life. What about storage?
Do you have battery life stats of an upgraded MacBook Air?

Power is important for me but also battery life and weight, so I'd buy a MacBook Air, otherwise if I only cared about power I'd buy a MacBook Pro.

There was a pretty good study done on this specific question done here. Also, it's important to note that Apple's stated battery life is based upon very light workload tests.

http://www.anandtech.com/show/7113/2013-macbook-air-core-i5-4250u-vs-core-i7-4650u/4

Key take aways

Idle/light workload battery time is nearly the same
Medium and heavy workloads the time is reduced (which makes sense since the CPU is doing more)

Spoiler images

(source: anandtech.com)

(source: anandtech.com)

(source: anandtech.com)


How can access to start up menu on Macbook Air 2011? I have a Macbook air 2011 /4g/ 11" , I format my hdd from disk utility and now I want to access to startup menu to reinstall it, I try that with holding option key and it just show me the internet recovery, my  internet speed is very low, after about 8 hours it's show me the start up menu finally and ask me to reinstall the lion 1.7 so on that time because of some issues I just turn my macbook off because I think everything downloaded,

Now, again when i turn it on for continue the installing process it's show me again the internet recovery and want to download from internet again

How can I access to the downloaded data and continue the installation (command+r and option key again get me directly to Internet Recovery)?

You need to start using Internet Recovery, and once it's started (which can take a while) you can then select the menu item to install the OS. See the (rather detailed) description of the Internet Recovery system here.

Please note that with a slow internet connection, this is going to be a slow process. This is because after downloading and running the Recovery system, it is then going to go away and download the OS installer - and that is quite large.

An alternative might be to go to an Apple Store and borrow their (rather fast!) WiFi connection to do this, if you have one close by.


See iAd Revenue in the new iTunes Connect layout? I'd like to know how I can see my iAd revenue in the "new" iTC layout? Two days ago there was a link in iTC (I think the label even said iAd revenue or stats), but now all I have is the new iAd Workbench.
Do you know where the new page for iAd revenue is?

Looks like apple hides the url. After log in iTunes connect, visit https://iad.apple.com/itcportal/ directly.

Update:
visit https://iad.apple.com/


Do Macs run the full Windows OS making full use of Windows functionality? So I now know that Macs can run Windows, but I just want to confirm if it runs Windows like a normal Windows would run on a PC, with full functionality. In other words, just like you get an HP-Laptop with Windows in it as the operating system, is it the same thing with installing Windows on a Mac? I just want to be sure that they are one and the same, and not just some emulator with restrictions.

There are basically two ways you can run Windows on a Mac.

You can run Windows in an emulator like VirtualBox, Parallels or VMWare. You get the entire functionality of Windows, but it is running within a VM on another operating system so you don't get the entire performance of the Mac as the resources are shared between Windows and OS X.

But you can install Windows directly on a Mac with the help of Boot Camp. When you do this you are running Windows directly on the Mac hardware and get the entire functionality of Windows with all the performance of the hardware as OS X isn't involved.


Startup disk not correctly identified? I have a Mid-2010 4 core MacPro. I mainly run 10.6.8, as I have a large software investment I'm not ready to abandon. As part of my migration to the present day OS, I have multiple startup drives, 2 PCI based SSDs.

When I am running 10.6.8 and attempt to reboot into 10.10, I see this;

Obviously not 10.10. So I attempt a boot and disc utility comes up offering the usual menu to restore the OS drive. When I quit the utility, I'm offered a choice of startup drives:

Now, the startup choices appear correctly, and boot me into 10.10. When running 10.10.2, I get a fast boot back to 10.6.8.

As it stands, I need 2 boots to get into 10.10 when running 10.6.8 prior. Why does the system still see any remnant of Lion?

Edit - perhaps the right question is - "Sagan SSD contains 10.10, why does this show as 10.7 when trying to boot into it while running 10.6.8?"

In response to the comment, diskutil list shows -

and it appears to me that when I try to boot Sagan SSD it's the recovery HD that tries to boot.

Did you try to press the "option" key during startup? This will prompt you to select the startup disk if several are available. Set the system to boot into the one you will boot into most often, and if you want to boot into the other, press "option" when you switch the Mac on and wait for the prompt.


If I delete a voice memo from the Music app, will it also be deleted from the Voice Memo app? I want to remove the voice memos from my Music so it doesn't come up when playing songs, but I want to keep the voice memos.

To clarify, I did not purposely move my voice memos to the Music app.  When I synced my phone to iTunes, all of my voice memos were added to my music library, and when I synced again later on, those voice memos were added to my phone as songs.

Will deleting voice memos from the Music.app also delete them in the Voice Memos.app?

I use an iPhone 6s running iOS 11.

I have tried it on iOS 11 with a new VoiceMemo. Here is what have I done:

I have created a new voice memo, then I have synced the phone to the computer (running latest iTunes). The voice memo showed up in both my music collection in iTunes (even separate playlist) and within the songs on the phone. At least according to iTunes. But then I have tried to search for voice memos in the Music app, but it did not show up. Was this done with some old software?

Anyhow deleting the voice memo on the computer - never mind what it says - will leave it on the phone. But of course, I suggest to back up.


Is there software to mirror a Windows PC via AirPlay? I would like to mirror my Windows PC to my Apple TV via AirPlay. I've found a few options which enable Windows Media Player to receive video via AirPlay. I've also found an application named Airfoil which allows you to stream audio from Windows. I know that the beta of Mountain Lion supports AirPlay mirroring, but is there a Windows option?

I use a program called AirParrot to mirror my Windows PC to my Apple TV (third generation). There is also a version that works on Macs.

Note that the ability to mirror a Mac to an AppleTV is a new feature of OS X Mountain Lion.


Cannot configure OpenDNS on iPad The instructions on Internet Safety Project seem simple enough, but, according to all the OpenDNS tests, websites are not working.

I am using a Wi-Fi iPad2 with iOS 7.

That site has the wrong IP addresses for the OpenDNS servers listed. Instead of 208.67.222.123 and 208.67.220.123 enter the correct addresses:

208.67.222.222 and 208.67.220.220

Source: opendns.com


How to bump up text size & other graphical elements system wide On Mavericks, my monitor resolution is set to 1920 x 1080 @ 60Hz (1080p) on SMS24A350H.

Everything looks great. But I noticed small icons in Finder window with small text. That I adjusted with Finder view options globally. But I could not solve the problem of small fonts appearing in system dialogue windows such as in “Get info” window and System Menu bar etc. It is hard to read text there and icons looks smaller.

In specific applications I can adjust zooming in contents area, like in Safari or Google Chrome but there also system wide objects like labels on tabs appear too small.

Screen zooming under system preferences is not a solution I want. I don’t want to trade off monitor resolution either.

Is there a way to get slightly zoomed everything system wide, which affects all applications and objects appearances?

Managed to try Quartz debug in my Mavericks. After enabling HiDPI display mode, I got this in display preferences.

Noticed only 960 X 540 (HiDPI) is available. which doubles everything that appears on screen.

very nice and crisp looking font and icons are smooth but it is too big for the need. Just double.

Is there a way to get a resolution option with HiDPI for slightly smaller view size without compromising Graphics engine resolution. My monitor is Samsung 24' LED.


2009 Mac Mini HDD as an External Drive for a 2011 Mac Mini HDD I have a unique plan:

I have a 2009 Mac Mini mid-2009 with 10.6 OS X.  I just got the 2011 Mac Mini with 10.7.  But I am planning to use the hard drive from the 2009 Mac Mini with 10.6 OS X as an external USB drive for my new 2011 Mac Mini.

Question:  Can I boot from the external USB with 10.6 from my new 2011 Mac Mini?  (Using the Option key when turn on the computer, etc.)  So, that I can boot into either 10.6 (on the external USB drive) or 10.7 (the internal drive) from my mini 2011?

Intel Macs can boot to a USB volume, but in this case it will not work. The reason is because the new Mid 2011 macs ship with 10.7, as you mentioned. Macs ship with a minimum supported OS, and will not boot or allow installation of any OS prior to that. Therefore, a Mac that shipped with 10.7 will not boot to a 10.6 install. You'll probably be able to see in when holding option at startup, but if you select it it will likely show an Apple logo and hang there.


How can I use iCal and the iPhone calendar when I am travelling? I often move between Ireland, Germany/Switzerland (same timezone) and Israel.

I use MobileMe, iCal and (two) iPhones.

The problem is that Apple's calendar applications seem to assume that everything I do involves conference calls which happen at the same time in physical reality and hence in different times in each time zone.

I have lunch at 1 PM, regardless of whether I am in Ireland or Israel. I do not want to remember what time it is in Ireland when it is 1 PM in Israel when I make a note, in Dublin, for my lunch appointment in Tel Aviv.

I tried several settings (time zone support off, time zone support on) but nothing really works.

If I switch time zone support off (on ALL my devices), my lunch dates fluctuate a lot and I miss appointments because 3 PM is not 3 PM any more.

If I switch time zone support off (and miss one device), my appointments are subject to weird changes produced by the one device should I accidentally use it.

I finally concluded that it is best to leave time zone support on and tell all devices and computers that they are in Ireland. That way my lunch dates don't change any more.

But now all iCal and iPhone alerts are off and, here in Switzerland, alert me an hour late and for the wrong time.

How can I configure iCal and the iPhones to IGNORE time zones. I really have more local appointments than conference calls and iCal's behaviour is only good for conference calls.

I think you might want to try the "floating" time zone; I believe this will let an event be at a specific hour, regardless of the time zone.

(As for why use time zones at all: We have an office in Zurich, Switzerland, and one in New York, US, and we share some of our calendars; having time zone support means, as an example, that I can see at a glance if somebody's at a meeting in New York (and thus I should maybe call them later).)

PS: Also see Changing the time zone for an event, but note iCal: Floating time zone Calendar events are not supported on iPod touch / iPhone or MobileMe Calendar; iCloud supports "floating" (just tested), not sure about the iPhone...


Python socket program taking forever to run I tried to run following program on my Mac terminal.

import socket
mysock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
mysock.connect(('www.py4inf.com', 80))
mysock.send('GET http://www.py4inf.com/code/romeo.txt HTTP/1.0\n\n')

while True:
    data = mysock.recv(512)
    if ( len(data) < 1 ) :
        break
    print data;
mysock.close()

But it doesn't print anything and takes forever.  I tried some online platform to execute and got error message

  """Traceback (most recent call last): File "main.py", line 6, in
   mysock.connect(('www.py4inf.com', 80)) File
  "/usr/lib64/python2.7/socket.py", line 228, in meth return
  getattr(self._sock,name)(*args) socket.error: [Errno 110] Connection
  timed out"""

I put print statement after True: and before line "data = " and it prints statement there and then takes forever.

My Python environment is

"Python 2.7.10 (default, Jul 14 2015, 19:46:27)
[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.39)] on darwin"

And in different computer, it works.

Can anybody identify an issue?

Your program runs well on my MAC OS Mavericks (aka 10.9.5) with Python 2.7.5
It prints:

HTTP/1.1 200 OK
Date: Sun, 27 Mar 2016 07:42:22 GMT
Server: Apache
Last-Modified: Fri, 04 Dec 2015 19:05:04 GMT
ETag: "e103c2f4-a7-526172f5b5d89"
Accept-Ranges: bytes
Content-Length: 167
Cache-Control: max-age=604800, public
Access-Control-Allow-Origin: *
Access-Control-Allow-Headers: origin, x-requested-with, content-type
Access-Control-Allow-Methods: GET
Connection: close
Content-Type: text/plain

But soft what light through yonder window breaks
It is the east and Juliet is the sun
Arise fai
r sun and kill the envious moon
Who is already sick and pale with grief

I guess your program stuck while no answer was available within the TCP protocol time-out (either the server not responding or the link failing). If you want to avoid such case, you may put the "recv" statement in a separate thread and break after a time-out.
I found much help for this in this page: eli.thegreenplace.net/2011/05/18/code-sample-socket-client-thread-in-python/

Hope this helps.


Macbook Pro black screen during logon When I boot my Macbook Pro and log in, the progress bars starts scrolling. After a few seconds the screen goes completely black and then shows the progress bar again but all the rest around the progress bar is black.

I tried to reset the SMC settings but no luck. Anyone else experiencing this issue or knows how to fix it? I noticed this issue right after the upgrade to El Capitan, I don't know if it's related to that.

Specs (in case it helps troubleshooting):

MacBook Pro (Retina, 15-inch, Mid 2015)
2.5GHz Quad-core Intel Core i7, Turbo Boost up to 3.7GHz 16GB 1600MHz   DDR3L SDRAM
512GB PCIe-based Flash Storage
Intel Iris Pro Graphics +
AMD Radeon R9 M370X with 2GB GDDR5 memory

I had exactly the same thing happen. Upgrading to El Capitan resulted in my having to erase the entire hard drive and restore using my back up! Thankfully I always back up but so far I'm not happy with ElCapitan. This upgrade has brought so many problems which are ongoing. Apple are very helpful and can offer you a number of 'fixes' so I'd recommend contacting them. Sadly for me as I mentioned erasing he hard drive was my only solution. Good luck


How can I change the default font size for composing in Sparrow? I use Sparrow as my email client.

Recently, I sent an email with some wacky font sizes.  Now every time I compose a message, the default size is too small.  Even after I fix it, it reverts to the (small) size if I move the cursor to a new spot.

It seems like this would be an easy to find preference for default font and size, but I can't find the darn thing anywhere.  And it doesn't seem to be in Sparrow's online support.

I expect to be embarrassed by the answer, but can anyone point me to the right place?

I figured this out:

I had a problem that my font got changed size 11, and changing back to 13 didn't fix the default - the next email would go back to 11

The solution is this: Type some text and highlight it.  But instead of changing the font in the pulldown above the editing window (which won't change the default), so this instead:

With the text selected, in the top menu select Format > Font > Bigger or Smaller, till it get the size you want.  (You can also do this by hitting Command + or Command -.)

Oddly, that fixes the default, while using the normal size toggle doesn't.


How to add metadata to log archive, so that `log show --last` works? Whenever I run the log show command from the command line, I get a warning message, log: warning: The log archive contains partial or missing metadata.

This appears to prevent me from using the --last option to limit output to the most recent time interval. The failed log command returns an exit status of 65.

% log show --last 2s --style syslog
log: warning: The log archive contains partial or missing metadata
log: cannot use --last when archive metadata is missing
% echo $?
65

What I want to happen is something similar to what I get when I use the --start option with a timestamp in the recent past. The successful command returns an exit status of 0.

% date
Fri 10 Jan 2020 18:43:56 PST
% log show --start "2020-01-10 18:44:00" --style syslog
log: warning: The log archive contains partial or missing metadata
Skipping info and debug messages, pass --info and/or --debug to include.
Timestamp                       (process)[PID]
2020-01-10 18:44:04.459968-0800  localhost xpcproxy[99272]: (libsystem_info.dylib) Created Activity ID: 0x1f9010, Description: Retrieve User by ID
2020-01-10 18:44:04.460147-0800  localhost xpcproxy[99273]: (libsystem_info.dylib) Created Activity ID: 0x1f9020, Description: Retrieve User by ID
…[snip, remaining output elided]…
% echo $?
0

How can I get the log archive to contain sufficient metadata so that log show --last 2s works as I want it to?

This is observed on macOS High Sierra 10.13.6. My account has administrator access, which the log command requires to return any content. The access is demonstrated by the log --start command succeeding.

I have a very unsatisfying answer to this question: wait 10 days and hope the problem goes away by itself.

That approach just worked for me:

% date
Sun 19 Jan 2020 07:26:30 PST
% log show --last 2s --style syslog
Skipping info and debug messages, pass --info and/or --debug to include.
Timestamp                       (process)[PID]
% echo $?
0

Note that the message, log: warning: The log archive contains partial or missing metadata no longer appears, and the --last option now works.

While investigating, I came across the very useful essay, Inside the macOS log: logd and the files that it manages, by Howard Oakley. This pointed me to the directories /var/db/diagnostics/ and /var/db/uuidtext/.

I observe that subdirectories /var/db/diagnostics/Persist/ and /var/db/diagnostics/Special/ contain opaque .tracev3 data files:

% cd /var/db/diagnostics
% ls -lF@ Persist
total 533688
-rw-r--r--@ 1 root  admin   2730128 21 Dec 14:02 0000000000000061.tracev3
    com.apple.logd.metadata       40
-rw-r--r--@ 1 root  admin  10477520 22 Dec 20:45 0000000000000062.tracev3
    com.apple.logd.metadata       40
…[snip, omitted for brevity]…
-rw-r--r--@ 1 root  admin  10479128 18 Jan 22:56 000000000000007b.tracev3
    com.apple.logd.metadata       40
-rw-r--r--@ 1 root  admin   2431808 19 Jan 06:29 000000000000007c.tracev3
    com.apple.logd.metadata       40
% ls -lF@ Special
total 35624
-rw-r--r--  1 root  admin     1544 10 Jan 06:35 0000000000000048.tracev3
-rw-r--r--  1 root  admin     1536 13 Jan 04:43 0000000000000049.tracev3
-rw-r--r--  1 root  admin     1416 18 Jan 04:56 000000000000004b.tracev3
-rw-r--r--  1 root  admin   258128 19 Jan 05:25 000000000000004c.tracev3
-rw-r--r--@ 1 root  admin  2082432  8 Jan 02:58 000000000000004d.tracev3
    com.apple.logd.metadata      40
-rw-r--r--@ 1 root  admin  2087952 10 Jan 21:52 000000000000004e.tracev3
    com.apple.logd.metadata      40
…[snip, omitted for brevity]…
-rw-r--r--@ 1 root  admin  2097344 18 Jan 23:11 0000000000000054.tracev3
    com.apple.logd.metadata      40
-rw-r--r--@ 1 root  admin   984016 19 Jan 06:27 0000000000000055.tracev3
    com.apple.logd.metadata      40

Oakley says that the macOS log system rotates these files: gradually prunes out old and unnecessary content, then deletes old files altogether. The date stamps back him up. Note that the oldest tracev3 file in Special/ is only 10 days old. Older files existed in this directory when I originally had the problem, but are now gone.

It is interesting that many (but not all) of these files contain an extended file attribute "com.apple.logd.metadata". Oakley, in xattr: com.apple.logd.metadata, log metadata, says "their content and function are unknown". I speculate that the "metadata" term in the error message might be a reference to the data in the "com.apple.logd.metadata" xattr.

So, a wild guess is that a file in /var/db/diagnostics/Special/ had a corrupted or missing xattr "com.apple.logd.metadata". In the course of a week, this file became old enough and was discarded. Once that file was discarded, its metadata was gone, and the so was the problem.


How to type a capital letter from the extended Latin alphabet in OS X I'm aware that if you want to type a character from extended Latin alphabet in OS X (like in the word über), you just press the basic symbol key for a while and then a popup occurs with the list of extended symbols.

But, I would like to type this letter in uppercase. I press the symbol key (for Example U + Shift), then see the character popup. Then I press the number of the required symbol, although I am given an @ sign instead of the uppercase Ü.

How can I type capital letters with accents? I don't want to copy and paste symbols that I require every time from the web or developer console.

Hold the shift key then the number corresponding.  It works just fine.  I think you are forgetting to let go of the shift before hitting the number.  Hence the unexpected output.

Hold shift+U then, after popup let go of the shift key and hit the corresponding number.
Ü ← result


Enabling TSX on OS X How can I enable TSX on my Mac? The furthest I got was by trying to add a kext that would enable me to r/w to the model-specific register but I can't install non signed kexts on my Mac. Any alternatives?

Anything involving accessing low level features like CPU instructions is going to require kernel access. This is definitely a case of you should know what you're doing first, as messing with memory on the kernel level seems like it would have any number of terrible ways it could go wrong.

Assuming you do, you can install unsigned kexts by disabling the System Integrity Protection.

To do so, boot into recovery mode (hold ⌘R when rebooting), open Terminal (in the Utilities menu), and run csrutil disable. Then reboot as per usual and install the kext.


Change quickly icons of a folder and its subfolders I need to change the folder icons of a selected folder and all the subfolder inside it with the same PNG image.

Accept any mode (Bash scripts, Automator workflows and so on...), I have no preferences.

This is a solution using the macOS GUI:

Copy your PNG image to your clipboard.
With Finder.app, open the folder whose folder and subfolder icons you want to change
Press CMD + F to start a search
In the Search menu bar click the folder's name. "This Mac" must not be selected.
enter kind:folder
In the results select all folders (CMD+A).
Press CMD+Shift+I to show the Inspector.
In the Inspector window select the blue folder icon in the upper left
Press CMD+V to paste your PNG image. All selected folder icons will update their icon.

Let me know if this works for you.

Sometimes you have to click twice on the icon in the Inspector window in order to paste the image successfully.


How do disable iOS keyboard from displaying? When I press my finger down on the iPad in any app, the iOS keyboard pops up automatically. How do I disable this? It is very distracting when trying to paste text or a screenshot into OneNote for example.
iPad 12.9 2018
IOS 13.7

Disabling the text insertion gesture may be impossible unless you consider adding an external keyboard or setting up voiceover to intercept and remap that gesture. I have had good success with peers using physical keyboards or accessories and propping up their iPad. Or use an Apple Pencil for many gestures and scribbles, which lessens the time fingers are on screen.
Hopefully over time you can train yourself and just summon the keyboard when you want it, knowing the gesture that summons it is a tap and hold.
Here are the global touch delays, if you want to experiment with them.

I find these are invaluable for teaching people to experience the sub second delays needed for a gesture to be recognized, but in the end, the penalty of slowing down the keyboard also slows down other interactions and most people don’t use these unless they need it due to dexterity conditions that make the default timing problematic and over sensitive / too reactive.


Which service or application is responsible for Mission Control? From time to time I get my OS X bugging up like this:

I tried restarting Finder, Dock or WindowServer processes to no avail. Has anyone encountered this? May be there is a service or an app that I can relaunch to fix this? So far only restart helped. I didn't try the login/logout flow, but I'm pretty sure it would work too. So I wanted to know if there is a way to fix this while logged in.

The application responsible for Mission Control should be Dock.

Take a look at this article. Restart Mission Control in OS X Lion


How to clear iCloud Music Library? I didn't know this iCloud Music Library thing was automatically turned on in iTunes on my iMac. I do like this feature but I only want to have it turned on with my Macbook and iPhone. Now I have a lot of tracks from my iMac mostly recording or audiobooks that cluster up my iCloud Music Library. I don't see an option to clear the iCloud Music Library, and manually deleting 1,201 tracks would take me two and half hours. Is there a way to remove all tracks from iCloud Music Library?

Instead of deleting tracks one by one, you could take another approach.  Select a genre, delete it (that is, all the tracks of that genre), and repeat.


What is the minimum partition size for Mac OS 10.10 Yosemite? I'm about to set up a Mac mini to dual boot Mavericks and Yosemite for software development purposes. What's the recommended minimum size of a Yosemite partition?

I have run Mavericks/Yosemite on a 64 GB SD card and after a clean install, there was about 20-30 GB free.

I would say that you could install Yosemite on a 20 GB partition, but I would not recommend anything less than 30 GB.


Is there a way to convert audio files in Mac OS X or the command line without using iTunes? Now, I know I can use iTunes to convert music. But it's quite a pain.. All I'm asking is: Is there anything built into OS X or UNIX for converting files? Right now I simply want to convert .mp4 to .mp3..

I installed ffmpeg via MacPorts, although it also available via Homebrew (brew install ffmpeg) or download the binary.

To convert something like that, (without worrying about audio quality, which I know nothing about), I just use:

ffmpeg -i input.mp4 output.mp3

Here is an example of how you would convert a .wav file to .mp3 from their website:

ffmpeg -i input.wav -codec:a libmp3lame -qscale:a 2 output.mp3

Here is an example of how to find all .wav files larger than 50M, convert them to mp3 and then delete the original wav (aka, batch mode -- alter the find command to create your 'batch')

find . -size +50M -iname *.wav -type f -exec ffmpeg -i {} -codec:a libmp3lame -qscale:a 2 {}.mp3 -y \; -exec /bin/rm {} \;


What is this process, “usagetrackingagent”, and why is it showing under activity monitor on MacBook What is this process, “usagetrackingagent”, and why is it showing under activity monitor on MacBook?  Does anyone with Mojave or a MacBook in general have this process under activity monitor.  I quit the process and it hasn’t come back but was interested why it showed up in the first place. Thank you

It is running on my three Mojave laptops.

BSD System Manager's Manual                      USAGETRACKINGAGENT(8)

NAME

 UsageTrackingAgent -- Usage Tracking Agent

DESCRIPTION

 UsageTrackingAgent monitors and reports usage budgets set by Health, Parental Controls, or Device Management.

Obtained from: https://www.unix.com/man-page/mojave/8/UsageTrackingAgent/


Automatically close Chrome tabs (for certain websites) On our family mac, each child has a separate account, which is very nice.

The kids use Chrome for their browser, because the parental controls work so well (much better than the OS X built-in ones!), but the parental control mode doesn't allow extensions, and some of the websites they leave open (ChoreMonster, Mathletics) really peg the CPU.  If these sites are left open (on the kids' users) then when my wife or I try to log in to our user, our brand new mac is unbearably slow.

Is there an OS X-based way to shut down tabs for certain sites whenever it switches away from that user, or when the browser is idle for a long time?  A way that doesn't require a Chrome extension?

Automator, perhaps?

There's a Macworld article that may help you do what you want, although it focuses on logging out idle users in a fast-switching environment rather than closing applications. That said, if you have a launch agent monitoring the idle state of the user, it should be possible to have it trigger an AppleScript that brings Safari into focus and tells it to exit.

It might be easier to just have their accounts logged out when they're idle.


Open several PDFs from Terminal I am trying to open all PDFs in a folder from the Terminal.

When I do

open *.pdf

Preview (my default PDF application), opens only one of them.

Is there a way to get Preview to open all of them?
If not, what other PDF viewer works well for this?

Thanks!

Running Sierra 10.12.6 on a MB Pro.

If you want to just open a list of PDFs all at once, you just need to separate the file names (enclosed with quotes) by a space as follows:

open "file1.pdf" "file2.pdf" ... "fileN.pdf"

This will open every PDF specified on one line.

If you want to open every PDF in a particular directory, use the command (simple for/do loop):

for file in /Path_to_Directory/*.pdf; do open "${file}"; done

Both of the examples above use the default app associated with the file (Preview).  If you want to specify a particular app (maybe you have a different PDF viewer but want to use Preview) use the -a flag and specify the app:

for file in /Path_to_Directory/*.pdf; do open -a Preview.app "${file}";  done

Note:  Be sure to enclose the variable name in quotes (") to account for spaces and non-printing characters.  For example, if you have a file named "My PDF File.pdf", not including the quotes will cause the command to try and open each string ("My", "PDF", and "File") as separate files.


Why aren't my cores more busy? just purchased a 2010 Mac Pro, running High Sierra.  It has 12 lovely cores.

But, when I look at the CPU activity in the CPU History half of the rows are blank (image below).

Does this suggest one of my CPUs isn't working?

Each alternate line is a hyper threaded core, not a real core - count the lines, there are 24, not 12.

If you're doing something processor-intensive, it makes more sense to use real cores, so tasks first share out to all the top line of each virtual pair.

Edit for new image
Image showing

to the left - 2 simultaneous [yet separate apps] 3rd party app video conversions, still only the real cores needed - presumably the app threads according to the number of actual cores, for speed. If you add more tasks, they will start to add to the 2nd virtual core, but HT isn't as fast as 'real' for intensive tasks.
to the right -  a single conversion from Final Cut Pro, showing much better 'spread' of resources.

I'm sure someone will come along with a better technical explanation, but in short - no, it's not broken, both CPUs are functioning normally, but maybe the software isn't fully using all the resources.

I have no explanation for why FCP would work differently to 'regular' conversion apps, but the picture shows the difference.


How do I update my iPad to iOS 5 without losing data without the original computer? Im looking to upgrade my iPad to iOS 5.0 but deleting the media is not an option. I do not have access to the original computer that I used to place all the photos onto the iPad.  Any suggestions on how to update the iPad and still retain the photos/ make it easy to reapply them to the updated iPad?

The Macroplant family of programs for Windows and Mac, including the free iExplorer, permit you to mount an iPad in Windows Explorer or the Mac Finder and copy files out from the iPad's directory structure to your local hard drive.

I use the free iExplorer a lot. I don't have any experience with Macroplant's other paid apps with additional capabilities.

This could provide you with an inelegant but effective solution that would enable you to retrieve most of your media.


Determine Device for a File In a shell script, I need to determine the device for a file, subsequent use with diskutil, eg...

# ??? Assign device to FileDevice, based on full path.
diskutil info $FileDevice

df /path/to/file | sed -n 2p | cut -d ' ' -f 1

will give you the device the file is on. To combine this directly with diskutil info use

diskutil info $(df /path/to/file | sed -n 2p | cut -d ' ' -f 1)


is thre a way to find recent files with locate OR automatically update the database each time a file is created I am on MacOS Catalina. locate is a great command but unfortunately, I have difficulties to find files which have been created for example one hour ago or ten minutes ago.

It seems that I could circumvent this issue by updating the database with a higher frequency than every 24 hours.

But the other problem is that, when I launch the command /usr/libexec/locate.updatedb in root, it lasts much time before this command ends.

So I conclude that update rebuilds completly the database and doesn't update only the new files created from last locate.updateb execution : indeed, this would be a big gain of time if the command was not rebuilding all the database with all the files of the system.

Finally, I think about a simple strategy : modidy
/System/Library/LaunchDaemons/com.apple.locate.plistto force it to update for example the database every 5 minutes. But if the command /usr/libexec/locate.updatedb rebuilds all the database every 5 minutes, this doesn't make sense.

So, I would like to get feedback from people who have this kind of problem and how they solved it. I prefer to avoid using the command mdfind but if there is not available solution with locate and not the possibility not to have to rebuild all content each time (in my case, this would be each five minutes), I would be obliged to switch to mdfind.

By the way, a simple crontab launching every 5 minutes the command /usr/libexec/locate.updatedb is also allowed, isn't it ?

You could also advise me to use find with -mtime flag but find is very slow (associated with parallel, it might be an alternative, I don't know, actually, I am a locate fan since I have used it a lot on Linux).

Any clue/remark/feedback are welcome,

Regards

I prefer to avoid using the command mdfind

Why is that? It solves your problem with no additional work. Getting locate to do update constantly is going to keep your Mac busy scanning the entire hard drive almost all the time. In the meantime,

mdfind -name filename.txt

Will produce the same result with no extra work by you or by your Mac. Since macOS keeps Spotlight up to date automatically, this will find files immediately after they're created. You could even use a really short shell script like this:

#!/bin/sh

if [ "$1" ==  "" ]; then
    echo What files do you want to find?
else
    mdfind -name $1
fi

Then alias locate or some other command to call the script.


Prevent encrypted APFS volume on partition to automount / ask for password on login - Catalina I know similar questions have been asked before but I just can't believe this can't be solved, so I am going to ask again with specific details.
I have two partitions that are bootable on the internal drive of my Mac running macOS Catalina 10.15.7. Both are encrypted APFS volumes.
Whenever I log in to one of them, I am getting a promt, asking me for the password of the other. I do not want to store the password in the keychain to work around the prompt (for security reasons), in fact I do not want the other volume to be automatically mounted at all.
All I want is to be able to choose the boot volume on startup (via the [Opt] key).

I tried

adding this line to my /etc/fstab using vifs:

UUID=<UUID of the volume> none apfs rw,noauto

but this does not prevent the prompt from appearing.

changing the volume role via

diskutil ap changeVolumeRole <diskId> D

but this returns the error: Error setting APFS Volume role: Unable to set the APFS Volume Role (-69599)

Is there seriously no way of preventing disks from being automounted?
Can the Finder be at leat taught to not ask for the password?

Starting with MacOS BigSur 11.1. the /etc/fstab/ solution works (again):

find the volume label from the volume name:
diskutil list | grep <volume name>
the last entry (e.g. disk2s2) is the volume label.
find out the volume UUID from the volume label
diskutil info <volume label> | grep "Volume UUID"
open /etc/fstab for editing:
sudo vifs
add a line preventing the auto-mount of the volume:
UUID=<volume uuid> none auto noauto

Here's a complete example:
> diskutil list | grep "Macintosh HD2 - Data"
2:                APFS Volume Macintosh HD2 - Data       341.8 GB   disk2s2

> diskutil info disk2s2 | grep "Volume UUID"
Volume UUID:               C58A1BDC-593C-4854-B954-702A73ABD67C

> sudo vifs
# add the following line:
UUID=C58A1BDC-593C-4854-B954-702A73ABD67C none auto noauto

On the next reboot the popup asking for the password will no longer appear.


How to find culprit blocking TCP ports 80, 443, and 5223 on macOS? These ports, crucial to iMessage and Facetime, are blocked: TCP Ports 80, 443, and 5223 on macOS Sierra 10.12.2 (MacBookPro11,3). (https://support.apple.com/en-us/HT202078)

In Network Utility, I perform a scan and the only Open Port is 631.

When I run:

python -m SimpleHTTPServer 80

I get a few calls then it reads that:

  socket.error: [Errno 13] Permission denied

A few other terminal commands return similar responses.

Is there a method I can use to find the culprit that is blocking these ports (and likely others) on OSX? These ports specifically are needed for iMessage and Facetime.

I do not have Sophos or any other Firewall (that I know of).

There are two things you confuse:

FaceTime and iMessage require communication on ports specified in the article for outbound connections.
Your "Permission denied" message is related to opening the port 80 for inbound connections. It's not because of any process blocking it, but if you want to make a process listen on a port less than 1024, you need to use root, so:

sudo python -m SimpleHTTPServer 80


Time Machine and Volume backup issue after Sierra update I have updated to 10.12.5 yesterday and I am facing some issues with Time Machine and volumes where the backups are stored.
I used to have two Volumes where Time Machine backups are stored:

network volume
usb drive

The first problem I faced was that all the backups, either on network or on usb drive, stuck on "preparing backup" state.

I tried these solutions:

reset Time Machine (removing /Library/Preferences/com.apple.TimeMachine.plist
reset SMC and NVRAM

Nothing changed. Except for the fact that, since I reset Time Machine, my Volume with usb backup partition (HDMac) is not mountable anymore. Giving sudo lsof | grep disk2s2 I understood that system stuck on fsck_hfs. While backup on network drive is still on "preparing backup".

Can anybody help me?

The solution for my problem was simply waiting for some hours in order to obtain the backup.

To repair my usb drive I ran fsck_hfs -fy /dev/disks2.


Preview missing lots of fonts that are shown in font book Clean almost untouched install of macOS Catalina 10.15.2.

I haven't installed any fonts yet.

Font book shows me fonts for example PSL Ornanong Pro. This font doesn't show up in Preview.

I would like to use this font in Preview.

How can I use all fonts from Preview?

PSL Ornanong Pro is 'available to download' in Catalina: it is not initially installed. Have you actually downloaded it?

Font Book will display the name dimmed slightly. You can download it by clicking on Edit > Download, or Download on a right-click context menu.


Bootcamp not working after partitioning Macintosh HD I installed Windows 7 using bootcamp on my Early 2011 MBP. I gave 130GB to Win7 and rest to Mac HD. Once all was done, I created a new partition within Mac HD. The partition was created successfully but when I restarted computer and pressed "option" key, I was not able to see the Windows(boot camp), only Mac HD and Recovery HD.

How to fix that, is it not possible to have further partition after boot camp? Coz if I created partitions earlier to boot camp, boot camp assistant gives error of making one single partition.

need urgent help on this.

I also faced similar issue and was able to solve with post on apple discussions.

However follow these instruction carefully and make sure to have all backups in place.

Based on comment below, adding answer in post

sudo gdisk /dev/disk0

If you get any error messages at this point, report the error messages, don't proceed further.

You're now in gdisk interactive mode. Menus/commands are single characters followed by return/enter. So type ? and  and you'll get the main menu listing commands. Type p  and it will print (display) the current GPT. Since you have 5 GPT entries, you can't use a 1 for 1 GPT to MBR scheme like Apple does. The following suggestion is safe, but all hybrid MBRs are non-standard inventions, and therefore I can't tell you how Boot Camp Assistant or Disk Utility will react to this hybrid MBR should you decide to make changes later. What I can tell you is Windows, Linux, and Mac OS X themselves have no problem with this MBR scheme.

r         go to the recovery & transformation menu
h         create a new hybrid MBR
5         add partion 5 to the MBR
          accept the default MBR hex code of 07
y         set the bootable flag
n         do not protect more partitions
o        print (display) the MBR

You should have two entries. One type EE, one 07, with the 07 entry marked with * under Boot. If you don't, report back. If you do, write out the update partition information, and hope  a power failure doesn't occur for the next few seconds...

w      write partition table to disk

reboot. hold down option - you should be able to boot into either Mac HD, Recovery HD, or Windows.

I just tested this same five partition GPT and 2 partition MBR on a working system and the instructions above worked.

Note, so long as CSM-BIOS and thus MBR are required for Boot Camp instead of EFI booting Windows, we're stuck with flaky MBR problems, as well as the 2TB disk limitation for Windows boot disks.

Also, I filed bug ID 11980880 at bugreport.apple.com and referenced this thread.


Extending extending network using airport express I know that this has been discussed before but this is a slightly different scenario.

I live in a very elongated apartment and the signal is very bad in one end. I have a D-Link 655 (or something close) and I want to extend my wireless network using a Airport Express and a "powerline" (Ethernet over main power cables).

So to make it clear, the D-Link 655 will be used as wifi access point in one end and I want to use the powerline to be able to use the airport express as an extender and repeater in the other end.

Will this work provided the powerline provides a internet connection to the other end of the apartment?

Secondly, if all this works, using the Airport Express as an Airplay unit as well as an extender shouldn't be a problem right?

There shouldn't be any issue with using the Airport as an extender in that scenario.

Normally an Airport can only extend the wireless network by providing a bridge over Wifi between itself and another Airport (or Time Capsule)

Using an Airport as an extender with a non-Apple router requires you to connect the two using ethernet, usually with a physical cable however by using a powerline connection that will replace the physical cable with the Ethernet over powerline.

A few caveats, if you are using MAC address filtering on the ethernet interface of the devices, make sure you add the MAC addresses of the Powerline module connected to each as required.  Normally most routers only limit MAC address filtering to the Wifi interface, but there are some that will alow you to enable this on all interfaces.

Edit: There shoudn't be any issue with using the AirTunes functionality under this scenario either as well as it providing the required Wifi extension.


Can I call a phone number from the Terminal? In Yosemite, is there a way to start a phone call from the command-line aka Terminal?

Something like:

call +316123456789

You can with open "tel://+316123456789" start a phone call process - but you still need to click on the "Call" button to make the call.

To do so, you may also simply press ↩. To automate everything via Applescript:

open location "tel://+351918306031"
delay 2
tell application "System Events" to key code 36


No sound (speakers/jack) + microphone's dead after spilling water Sadly, yesterday I've spilled some water on my MacBook Pro (El Capitan).
Before you yell at me - it was closed, turned off and it wasn't a lot of water, the laptop was wet only on the top and under - not inside.

Today I've turned him on. At first battery wasn't recharging for some reason, but SMC reset fixed the problem.

At the first booting speaker was like talking to me, hard to explain but it was weird. Also only right speaker was "talking", despite the fact that only left side of the laptop was watered. Then there was no sound at all, not from the speakers, nor from the headphones. Also microphone's not working. USB ports are okay. The water was spilled from the left side of the laptop.
I know this is hardware issue, and something's broken, but I want to be 100% sure. No it's not muted.
I've also tried NVRAM reset a few times, but it doesn't fix the problem :(

There might be one factor, before spilling, my laptop "died" for the first time (battery energy ran off), but I doubt it's the case. (but hey, every info matters, right?)

It wouldn't be weird for me, if only left speaker wouldn't work, but built-in microphone not working is kinda weird in this case, isn't it?

I just want to ask you guys, what else can I check, before I'll be 100% sure it's dead inside?

I've plugged in external microphone - it's not working too.

I repair Macs for a living, and have seen just about every possible WRONG way of handling a liquid spill.

the answer is water.

If you inject water into your mac, you've f'd it up.

Consider 1 drop of water in a Mac to be the equivalent of ingesting 2 pints of JackDaniels in your body.

Drink 2 pints of Jack, and let us know how predictable you are... yeah.. it isn't going to end well..IF you end up with a hangover instead of an ER trip, you're lucky..

Water in your Mac is the same way. It is lethal.  as in, deadly. as in, if you do it, STOP everything and fix it. or your Mac could very well die.

General stupid ways of handling spilled water could include:

crossing your fingers and hoping that nothing got hurt
inserting your Mac into a gallon of rice and hoping that it dried out with no damage
inserting your Mac into a microwave to dry it out
restarting your mac (or plugging it in) without having disassembled it and cleaning out the water.
logging onto the internet with the mac and querying others to see what they'd do.

General intelligent ways of dealing with spilled water would include:

IMMEDIATELY shutting it off
NOT restarting it
NOT plugging it in
removing the battery (if removable)
fully disassembling the laptop (or taking it to a shop which does the above)

Water leads to all of the following actions:

shortouts (chips burning up)
corrosion
blown circuits
battery failure
fire
permanent damage
mold

IF you spill water in your Mac, shut it down. do not reboot it. remove the battery. disconnect power. Take it to a professional shop who repairs issues like this.

letting it simply sit for a few days will only prolong the damage, because water causes corrosion.

The ONLY correct action after a liquid spill is to fully clean the boards, dehydrate them, then reassemble.  and if you don't know what you're doing, you're likely going to cause MORE damage.

Based on your explanation, your Mac got water in it. and your running of it has likely blown the ADC circuit on the logic board, or possibly part of the USB sub-circuit.


Downgrading to ios 4.1 from ios 5 without shsh? I am looking for a way to downgrade to ios4 without having SHSH.

I found some tutorial one of this a youtube video: http://www.youtube.com/watch?v=QdMHvRsplnw

That say it's possibile to downgrade to ios 4.1. Has anyone tested?

I just can stay with ios5, everything has become too slow (especially the standard Music Library of my ipod touch)

Thanks

No. Without SHSH blobs it is not possible. And devices running the A5 (iPad 2 and iPhone 4S) it is not possible even with the blobs.


Cleaning the camera roll from my mom's iPhone 5s I'm trying to clean the gallery of the iPhone, I'm sending the images that I already put in the computer to the trash.
But the pics still are in the phone.

I'm an android user, so i don't know if the process is different for iPhone.

You will need to go to the "Recently Deleted" album and remove them as necessary if your iOS version > 8.1.

To remove all photos in "Recently Deleted", tap "Select" at the top and then "Delete All" at the bottom.


Fix app window on spaces change? I'm working with 2 screens.

On the smaller I have documentation open while on bigger I have IDE.
When making terminal fullscreen it will go big on one screen(bigger), while making other blank.

Is there a way to leave docs open on smaller screen?

This is a well documented problem with using a full screen app with multiple screens.

Essentially when you start any app into fullscreen, it starts a new desktop.  Depending on your OS and keyboard you can hit F3 (for example) to get Mission Control to show you your active desktops.

The thing you need to understand is that both screens when you use an external display display the same desktop at the same time.  You may have different windows open on each display, but the desktop layer remains the same.  When you go full screen, it falls inbetween the cracks of showing the same desktop across all available monitors, and going full screen, which by definition can only be one screen.

A lot of people would like to keep desktop 1 (for example) on one screen, and have the other screen hold a full screen app, but this would be simultaneously displaying 2 desktops at the same time, or rather 1.5 desktops...

It's an odd situation, but basically full screen and multiple monitors just doesn't work nice.

As a workaround, I would suggest using one of the many Window Management tools you can use to make your app as large as possible in a single click without actually using the full screen button that OS X provides.

I like an app called Moom for this, check out the website for various things it may be able to do to help you workaround this issue.  Many other similar apps (better, worse, cheaper or just different!) are also available.


New Mail client does not keep correct coloring of mail I recently upgraded from Mavericks to Sierra. The new Mail client bugs me: My main problem is a change in the way it sends clipboard copies of what was in the Terminal app.

Previously, when I sent a clipboard copy of my terminal in the old Mavericks Mail client, it kept the original formatting (i.e. the white characters on black background copied from within the terminal) and when somebody received it, it was as I sent it (i.e. white on black). This was a very convenient way to show what was copied from the terminal.

Now with Sierra's mail client, the background is changed to white so that the white text cannot be seen by the recipient. This happens even though at my end it looks fine (i.e. white characters on a black background).

How can I keep the original formatting as I copy it into Mail, so that when it's sent it is received at the other end still showing the black background?

The problem was with the transparency of the terminal window. The formatting kept the transparency value but the recipients' mail client could not handle this information.

I duplicated my terminal profile and set the background opacity to 100% and marked the new profile under Copy special to use that.

Now it works as I wanted


How to sync email sent from Mail to Yahoo Business Mail server? When I send email through Mail app using my Yahoo Business mail account the sent mail is only stored locally and not on the server. How do I make the sent mail stored on the server as well?

Apparently I had to set the INBOX to use the IMAP servers and then highlight IMAP server's Sent box, hit "Mailbox" in the top menu bar, highlight "Use this Mailbox For" and choose Sent.


Audio balance changes randomly in MacBook Pro Retina 15-inch' mid-2012 I'm having some strange issues on my MBP Retina running OS X 10.8.2.

The audio balance changes, and the right speaker is almost muted.

Anyone know what could be wrong here?

I've had this problem on multiple MacBooks (from my old Powerbook 15 from 2003 to prior to finding this question on my late 2011 MBP 13").

Apple has acknowledged it as a bug when pressing the volume buttons during heavy CPU usage way back in OS 10.2! The solution was to go back to preferences and set it back where you wanted.


Do applications preserve xattrs when saving? Do applications on Mac OS X (specifically the MS Office applications, but interested in others as well) generally preserve xattrs (Extended Attributes) on documents when saving them?

For example, if I add an xattr to a file:

xattr -w test "test attribute" mydocument.docx

Then open this in MS Word, make a change, and save, is the attribute maintained? What does

xattr -l mydocument.docx

print after saving?

Found a Mac running OS X 10.9.5. When saving through a terminal editor (vim) and GUI programs (TextEdit, MS Word), xattrs are preserved.


How to install framework (from pkg file) in a non-standard location? In brief, my question is this:

How can I install a framework from a *.pkg file somewhere other than under /Library/Frameworks (or /System/Library/Frameworks)?

Background

I want to install a version of Python 2.7.3 that lives under $HOME/Library/Frameworks/Python.framework and $HOME/python.

My goal here is to have a version of Python that is as independent as possible from the Python that comes with OS X Lion.  In particular, I want to have an installation of Python that is, as much as possible, not liable to be altered "behind-my-back" by system updates or other software updates.  That's why I want to keep this installation as clear as possible away from the "standard" places for them.

Among the problems I am trying to avoid by doing this is the buggy Tk framework that comes with the latest versions of OS X.

Therefore, a key sub-goal here is to install new Tcl and Tk frameworks, separate from the system-supplied ones.  The ones I want to install come from ActiveState ("Mac OS X (10.5+, x86_64/x86)"), in the form of a *.pkg file.

When I click on this file, I get presented with the usual "wizard"-like sequence of steps ("Introduction", "License", etc.).  At no point during this sequence I am offered the opportunity to choose a different installation location for these frameworks before I reach the choice of clicking on the INSTALL button.1

I suspect that if I click on this button, the installed files will go under /Library/Frameworks (or possibly under /System/Library/Frameworks), which is what I'm trying to avoid.  (Indeed, when I click on INSTALL, I'm immediately presented with an password-entry dialog, which is a pretty good indication that the installation will put files somewhere under /Library or /System.)

Therefore I'm looking for an alternative way to perform this installation that will allow me to explicitly set the destination folder for the installed files.

1Yes, the installer allows me choose a different volume for the installation, but it does not let me specify, e.g., $HOME/Library/Frameworks as the destination for the installed files.

You can safely install Python under /Library/Frameworks and not worry about it interfering with the "system" Python, although with a few symlinks and/or $PATH changes you can make it the default if you want.

As an alternative, you can install MacPorts and set its install root to whatever you want (the default is /opt/local, I believe, although this is configurable during setup), although the Python framework will still be installed under a Library/Frameworks subdirectory. I prefer the MacPorts distribution over the python.org one because there are many additional modules you can install which are pre-configured to build correctly, which isn't always the case when you use pip or easy_install, depending on what you're trying to build. MacPorts also has a pretty decent versioning system, allowing multiple versions to coexist side-by-side, with simple tools to switch between them. As an added bonus, the MacPorts Tcl is not "broken," so everything should work out of the box. YMMV :)


Why does OSX's system font menu sizes skip from 14 to 18? This is one of those things that has always seemed odd to me. I'm not sure if it's just typographic advice, or a hold over from when anti-alisiaing wasn't the norm in type but is there a known reason that the "size" options (which can be overridden by manual entry) jump from 14 to 18:

Sometimes you need 15, 16, and 17?!

It dates back to dot matrix printers, believe it or not. Today, fonts are defined by vector shapes and the device rendering them fills them in with as many pixels as it can manage. But in the old days, there were no vectors, just patterns of dots. The font-maker had to draw the dots for each size individually.

The Macintosh team came up with a clever way of rendering the typeface in different resolutions for screen and for dot matrix printer -- the printer could handle 144 dots per inch, so the team made the screen render at 72 dots per inch... and whenever your document had text at 9 points on the screen, the printer would use the 18 point definition, 10 point would use 20 point and so on.

But because each definition had to be created separately and stored separately on the limited-space disks of the day (this was before hard disks -- everything had to run from floppies!), only key size/pairs were chosen. For text fonts, you usually had 9, 10, and 12 (and therefore 18, 20, and 24) and for title or display fonts, you usually had 14 and 18 (plus 28 and 36 for the printer to use). Exceptionally, you could have pairs like 24/48 and 36/72.

Thus the typical font menu in a Macintosh application starts with 9 and goes to 14, omitting 11 and 13, then tends to jump to doubles of earlier sizes.


Where does OS X keep the FileVault password during reboots in an upgrade? For security concerns, I wonder how it would be possible for an OS X upgrade (e.g. from Mavericks to El Capitan), to reboot my Mac multiple times without asking me for my FileVault 2 password?

I mean, the whole drive is encrypted and even an OS X installer would not know the password after a reboot. In spite of that, it reboots one or more times without asking me for my password.

Therefore I suspect that Apple stores my password somewhere, either on disk, in NVRAM, or online, at least during the upgrade process. If so, wouldn't this be a serious security concern?

Can anyone shed a bit of light on this? How does it work?

There's an OS X feature called authenticated restart that stores the FileVault key in the SMC for the duration of the reboot. Apple acknowledges in the manpage that it does reduce FileVault security for the duration of the restart:

On supported hardware, fdesetup allows restart of a FileVault-enabled system without requiring unlock during the subsequent boot using the authrestart command.
WARNING: FileVault protections are reduced during authenticated restarts.
In particular, fdesetup deliberately stores at least one additional copy of a permanent FDE (full disk encryption) unlock key in both system memory and (on supported systems) the System Management Controller (SMC).  fdesetup must be run as root and itself prompts for a password to unlock the FileVault root volume.  Use pmset destroyfvkeyonstandby to prevent saving the key across standby modes. Once authrestart is authenticated, it launches reboot(8) and, upon successful unlock, the unlock key will be removed.


Is there any way to REMOVE alert default from All day events? I have not been able to figure out a way to remove that default alert of one day events in iCal? Is there any way of doing it? I use quite a bit of full day events as remainders of things, and I hate that I always have to go and manually remove the alert of each event.

Go to Calendar preferences and select alerts. Select None on All Day Events like in the image below. You have to do it for every Account defined (iCloud in the example image, but can be Gmail, On my Mac, Whatever...).


What is the equivalent of ~/.cache on macOS? I'm writing a tool that needs to cache files that are supposed to be hidden from the uninformed user and persist across reboots. On Linux, I am putting these files in ~/.cache. What's the equivalent of that on the mac?

Can I just use ~/.cache? I also read about ~/Library/Application Support and ~/Library/Cache, but I'm finding a lot of contradictory information.

The right place to store such files is "Library/Caches" (either in ~ or in the app sandbox, depending on whether or not your app is sandboxed).

Apple documents this fact here:

File System Basics

Especially take note of this quote:

  Use this directory to write any app-specific support files that your
  app can re-create easily. Your app is generally responsible for
  managing the contents of this directory and for adding and deleting
  files as needed.


El Capitan download problems I am trying to update a mac mini from OS 10 10 5 up to ElCap

App store tells me the app has Downloaded but nothing happens

I have looked at a few posts on this forum so have looked in the Apps folder but there is no El Cap installer there.

Any ideas how I can force another download, or find the installer on my machine(assuming it has actually downloaded)

Any ideas

Try to restart your computer and try repeat last actions.

It was helpful at similar discussion.


How can I set the default browser depending on time of day? I have a MacBook Pro from work. To keep my browsing history separate, I use 2 different browsers. (Chrome = Work, Safari = Fun)

I want to make my default browswer Chrome while at work (9 am to 6pm), and Safari my default browser in the evenings. This will prevent me from accidentially opening a link in the wrong browser.

How could I switch my default browser at predefined times throughout the day?

Update

There does not appear to be a 'set default browser' workflow in automator. Perhaps it would be possible to edit this file?

/Users/yourname/Library/Preferences/com.apple.LaunchServices.plist

https://discussions.apple.com/thread/2803775?tstart=0

Not nearly as complicated, but perhaps of value, is the app Choosy. It allows you to choose your browser every time you open a link outside of a browser. While this might sound onerous, it's actually pretty transparent, and I find it very useful in the leadup to going live with a new web project and testing in multiple browsers over and over and over…

Might suit the bill if one added keystroke isn't a problem. Of course, once you're inside Safari, links clicked will open in Safari (although there's even a way to modify this behavior.)

FWIW.

Choosy


Homebrew and Git - Wrong language on the command line I have a strange issue - when I use the git command which comes with the Command Line Tools package, the interface on the command-line is in English, as I want it to be. However, the version installed using Homebrew uses German in its output (I live in Germany, but my system language is set to US English and the computer was actually bought in Singapore, if it matters).

I believe this changed only recently. I had to give my Mac for repair and did so in a German store. Now that I have my computer back I noticed that Git's output is in German, not sure if they did anything to the system settings while they had it. As far as I know, this is the only command-line application that uses German as its language. Here is the output generated by the locale command:

LANG=
LC_COLLATE="C"
LC_CTYPE="UTF-8"
LC_MESSAGES="C"
LC_MONETARY="C"
LC_NUMERIC="C"
LC_TIME="C"
LC_ALL=

I would like to have Git talk to me in English. I know I can set the LANG etc. to English and it would (probably) work, but I would also like to understand where this change may be coming from.

Any ideas?

EDIT: to make things more interesting, I use another Mac that I got from work. It was bought in Germany, the initial language settings were German (which I changed to US English) and everything works fine on it, i.e. both Git installations (CLT and Homebrew) use English. Locale information from the locale command is the same.

Recently, I've started to observe the same behavior, particularly with git (and after updating to MacOS Mojave). At first, I thought it's an issue with git itself. So, I've reinstalled git with homebrew to no avail.

However, going to "Language & Region" tab in the MacOS "Settings", and removing other languages from the list that you don't need (note: these are different from the keyboard input sources) resulted in git displaying the command output messages in terminal in the desired language (in my case, English).

Notably, this problem occurred to me only in the macOS terminal (and not, e.g., VSCode's terminal).


In Shortcuts, how to find a specific photo? In Shortcuts, I added a PHOTOS / Find Photos action and I want it to select a certain specific photo. I see there is a filer "Name is something", but it does not seem to work.
I tried to enter the filename (IMG_123.PNG), but it does not find the correct photo.
Is the "Name" filter referring to some other name of the photo? The Caption (in shortcuts "Caption" is not offered as a filter) maybe?
Using iOS 14.3

Individual photos can be selected by their (file)names. But without the dot part.
So: Name is IMG_123
The letter case must also match!
The following will not match the photo named IMG_123.JPG:

IMG_123.JPG
img_123.jpg
img_123

To find out the filename of a photo in the Photos app:

open the photo
tap the action/sharing icon:
in the menu select Save to Files

The file name will be shown at the top, next to the file icon. No need to actually save the file.
PS: There does not seem to be a way to filter by photo caption.


Terminal not recognizing imacro:// as protocol, thinks it's a pathname I'm trying to run this from the terminal:

open /Applications/Firefox.app imacros://run/?m=macro.iim

This gives me the error

The file /Users/dave/Desktop/watch-nodejs/imacros:/run/?m=macro.iim does not exist.

The expected result is to open firefox and type "imacros://run/?m=macro.iim" in the url bar. This works on mac and windows, but for some reason mac thinks "imacros://run/?m=macro.iim" is a path to a file on my computer

Use

open /Applications/Firefox.app --args 'imacros://run/?m=macro.iim'

to prevent open from messing with the argument. Also quoting might help to stop the shell from stumbling over any special characters (not really required in this specific case).


Macbook pro looses the connection to USB adapter after sleeping Context:

MacBook Pro (13-inch, 2019, Two Thunderbolt 3 ports)
macOS Catalina 10.15.4
usb c adapter 1 (link): Hub USB C Ethernet.

Here I plug: ethernet, mouse (USB), keyboard (USB).

usb c adapter 2 (link): S-Hub-9838 with HDMI/USB 3.0/usbc and power supply.

Here I plug: HDMI for an external screen and the Mac charger

Problem

When I do not use the macbook, the power saving mode is activated. When I come back to the Mac, I press a key and it wakes up. Here is the problem:

adapter 1 works fine
adapter 2 does not work anymore! External screen does not receive any input and the mac charger seems unplugged.

In order to make the adapter work again, I have to unplug and replug the charger to the adapter 2.

Please note that this strange behavior does not happen with the official Apple adapter (link).

What I need

I need to avoid disconnections when the Mac enters the power saving mode.
Changing power saving configuration (e.g., avoiding the sleep mode) is not an option.

Is there a way to fix?

In order to make the adapter work again, I have to unplug and replug the charger to the adapter 2.

Basically, you have to reset the adapter.  The problem sounds like the USB controller on the adapter doesn’t handle sleep well (or at least waking from sleep).  This isn’t something that you can fix in macOS (or even should) as it’s an issue with the USB adapter itself - not a software configuration thing.

However, looking at your configuration, I would recommend you getting a dock instead of having multiple adapters (see this answer to a similar situation).  The dock will give you a much more stable connection and being Thunderbolt, it will be connected to the PCIe bus rather than the USB bus.


My Apple Script Editor code doesn't work gives "Syntax Error Expected end of line but found identifier." I insert this code:
tell application "Notes"
  set theMessages to every note
  repeat with thisMessage in theMessages
    set myTitle to the name of thisMessage
    set myText to the body of thisMessage
    set myCreateDate to the creation date of thisMessage
    set myModDate to the modification date of thisMessage
    tell application "Evernote"
      set myNote to create note1 with text myTitle title myTitle notebook "Imported Notes" tags ["imported_from_notes"]
      set the HTML content of myNote to myText
      set the creation date of myNote to myCreateDate
      set the modification date of myNote to myModDate
    end tell
  end repeat
end tell

And it gives me the error: Syntax Error Expected end of line but found identifier.
Any idea what the problem with the code is?

The problem is the version of Evernote I tried is not AppleScript scriptable.
When trying to add Evernote to the Library in Script Editor, in order to review its AppleScript dictionary, it errs with: Add Item Unable to add the item because it is not scriptable.
Additionally, when running the following command in Script Editor:
tell application "System Events" to ¬
    get has scripting terminology of application process "Evernote"

Its result is: false

Apparently at one time Evernote was AppleScript scriptable, however, in macOS Catalina, testing with Evernote from https://evernote.com/download/ and checking Evernote > About Evernote it shows:

10.11.5-mac-ddl-public (2530)
Editor: v121.2.15734
Service: v1.32.4
© 2019 - 2021 Evernote Corporation. All rights reserved

Looking for the typical AppleScript dictionary in /Applications/Evernote.app/Contents/Resources/ there is no Evernote.sdef file as would be expected if it was fully AppleScript scriptable.

If you do have a version of Evernote that is AppleScript scriptable then try the following, which I cannot test under the circumstances:
Change note1 to note in:
set myNote to create note1 with text myTitle title myTitle notebook "Imported Notes" tags ["imported_from_notes"]

You might also want to put in some parentheses. e.g.
set myNote to (create note with text myTitle title myTitle notebook "Imported Notes" tags ["imported_from_notes"])

Unfortunately without a version of Evernote that is AppleScript scriptable, I cannot offer more.


How to script brightness turning down and up? I am trying to create a applescript that puts my brightness to the max or minimum, but I don't know how to. I am trying to use this script

    repeat 10 times
    tell application "System Events"
        key code 122
        delay 0.1
    end tell
end repeat

but nothing happens.

Provided the necessary accessibility privileges are granted that permits UI scripting, this script programmatically adjusts the brightness of your screen by way of System Preferences:

tell application "System Preferences"
    set current pane to pane id "com.apple.preference.displays"
    reveal anchor "displaysDisplayTab" of current pane
end tell

tell application "System Events" to tell ¬
    process "System Preferences" to tell ¬
    window 1 to tell ¬
    tab groups to tell ¬
    groups to tell ¬
    sliders to set its value to 0.5 -- 0.0 to 1.0

quit application "System Preferences"

You can set that value you see to any decimal value between 0.0 (minimum brightness, display off) and 1.0 (maximum brightness).


Why doesn't the red dot shut down the program? If I use the red dot in the upper left of the last window of a program, why doesn't it shut the program down?

Except for rare programs that run without windows, what's the point of keeping programs running after all their windows are shut?

Great question. This was one of my first confusions about the Finder when switching to Mac. Here's what I think:

On other operating systems, the program menu is contained in the active application window. As such, each window is in essence a full instance of the program. (There's not as much integration with Windows Explorer, as there is with Finder on Mac OS. It' a tiny difference, but it really alters user experience.(My proof is the fact that you're asking this question.)

By contrast, on Mac OS X, the menu bar in the Finder is where all Apps' menus go. All running programs are tied to the Finder in a different way than on other operating systems. On Mac, a program may have auxiliary windows and such. In other operating systems, you generally have similar "panels" in their own window.

Also, remember that the yellow and green buttons only effect the window that they're in, so it seems odd to group a control that effects the entire app with two that only effect one window. Therefore, the "red dot" only affects the active window.

One notable exception is the Mac App Store. In that case, you are one hundred percent correct. Clicking the red dot closes the entire app. Notice how the App Store has no auxiliary menus or panes? Closing that Window does indeed mean you're exiting the app.


Fix formatted GPT in SSD I accidentally formatted my SSD's GPT while formatting a USB in Linux's gparted. Now, when running gpt in Mac's command line, this is  how my SSD looks like:

My-MacBook-Pro:~ user$ sudo gpt -r show disk2
       start        size  index  contents
           0           1         PMBR
           1           1         Pri GPT header
           2          32         Pri GPT table
          34  1000215149
  1000215183          32         Sec GPT table
  1000215215           1         Sec GPT header

I used to have 2 partitions on this drive: Mac OSX and a Windows 8.1 bootcamp partition. I wouldn't mind loosing the latter.

I have heard about being able to restore the partition with the gpt command in Mac. Is this possible in my case?

Thanks, Martin

If you don't want to use Disk Warrior or something similar to get your volumes back, there is a small chance to recover your partitions manually:

You'll need some tools and luck to accomplish that:

Install a full vanilla system (Mountain Lion or Mavericks should work) on a thumb drive. A recovery system will not work. Boot to the thumb drive, download and install wxHexEditor. Enable the root user and log-in as root.

A classical partition map of Mountain Lion without any Boot Camp partition would probably look like this on your Mac:

sudo gpt -r show disk2
      start       size  index  contents
          0           1         PMBR
          1           1         Pri GPT header
          2          32         Pri GPT table
         34           6
         40      409600      1  GPT part - C12A7328-F81F-11D2-BA4B-00A0C93EC93B
     409640   998536000      2  GPT part - 48465300-0000-11AA-AA11-00306543ECAC
  998945640     1269536      3  GPT part - 426F6F74-0000-11AA-AA11-00306543ECAC
 1000215176           7
 1000215183          32         Sec GPT table
 1000215215           1         Sec GPT header

A partition map of Mountain Lion with a Boot Camp partition would probably look like this (sizes may vary in your case - i have chosen a ~50 GB partition for Windows):

sudo gpt -r show disk2
      start       size  index  contents
          0           1         PMBR
          1           1         Pri GPT header
          2          32         Pri GPT table
         34           6
         40      409600      1  GPT part - C12A7328-F81F-11D2-BA4B-00A0C93EC93B
     409640   898536000      2  GPT part - 48465300-0000-11AA-AA11-00306543ECAC
  898945640     1269536      3  GPT part - 426F6F74-0000-11AA-AA11-00306543ECAC
  900215176      204800      4  GPT part - C12A7328-F81F-11D2-BA4B-00A0C93EC93B
  900419976    99795200      5  GPT part - EBD0A0A2-B9E5-4433-87C0-68B6B72699C7
 1000215176           7
 1000215183          32         Sec GPT table
 1000215215           1         Sec GPT header

Now we try to search for a specific text string of your Recovery HD-partition on your disk. In the example above this is the partition with index number 3.

Open wxHexEditor. In the menubar go to "Devices" -> "Open disk device" -> choose the appropriate diskNummber. Probably it's disk1 or disk2. The disk shouldn't have any further partitions like disk1s1 or disk1s2.
Try to arrange the windows like in the example below with straight red lines  and scroll to the very end of the disk (your visible offset number is approx. 51211000000):

Now hit the search button and enter manually:

/private/var/tmp/efiboot/efiboot

and enable "Text Search", "Match Case" and "Search Backwards" like in the example below:

This may take a while. Please check the position of the scrollbar indicator if the finding is realistic. If you've split your disc in 375 GB (Mac OS X) and 125 GB (Windows) then the string match should be at the beginning of the 4th quarter.

Make a note of the first offset number of the block containing the string.

Additionally scroll to lower offset numbers. It should be filled with zeros except the block directly preceding. If you find anything else than zeroes stop here.

In my example it's 68195037696. Divide that number through 512 to get its block number: 68195037696/512 = 133193433

Remove 244921 from the number found above to get the starting block of your Recovery HD.

In my example 133193433 - 244921 = 132948512.

Remove 1 from the number found above to get the ending block of your main volume.

In my example 132948512 - 1 = 132948511 (*)

With the starting block of the Recovery HD found, we may now add the different missing partitions:

You may have to unmount the device with:

diskutil unmountDisk diskNumber

(with the diskNumber you found above: probably disk1 or disk2)

First we recover the EFI partition by entering:

gpt add -b 40 -i 1 -s 409600 -t C12A7328-F81F-11D2-BA4B-00A0C93EC93B diskNumber

(with the diskNumber found above: probably disk1 or disk2)

Then we recover your main partition by entering:

gpt add -b 409640 -i 2 -s SizeOfPartition -t 48465300-0000-11AA-AA11-00306543ECAC diskNumber

(with SizeOfPartition = (*) - 409640 +1)

In my example that would be: 132948511 - 409640 + 1 = 132538872

Then we recover your Recovery HD by entering:

gpt add -b EndblockOfMainVolume+1 -i 3 -s 1269536 -t 426F6F74-0000-11AA-AA11-00306543ECAC diskNumber

Then you may label all the partitions with gpt label -i IndexNumber -l "Name" diskNumber:

gpt label -i 1 -l "EFI" diskNumber
gpt label -i 2 -l "Macintosh HD" diskNumber
gpt label -i 3 -l "Recovery HD" diskNumber

(with the diskNumber found above: probably disk1 or disk2)

Now restart your Mac to the thumb drive again. Open disk utility and check the restored volume for errors.

If everything is fine, backup the content of your main volume, partition the SSD, reinstall Mac OS X Mountain Lion and migrate your apps and users.

Good luck to recover your disk - i hope it works like that. If you are unsure or have any questions leave a comment here starting with @klanomath


Is there a way to make my macbook automatically execute a script every time I connect it to an external monitor? I would like to make my macbook automatically connect to a specific wifi and launch Lunar everytime I connect it to my external monitor, and vice versa when I unplug it, but don't know where to start...
I could write a script that keeps checking whether or not an external monitor is connected every, for example, 60 seconds, but I would like to do something like "event driven" that is neither checking nor doing anything at all until an event ("external monitor plugged" or "external monitor unplugged") occurs.
Any hint?

No one answered and I'm still looking for a simpler solution but I've found a workaround creating a little SwiftUI app.
//
//  ContentView.swift
//  HomeSweetHome
//
//  Created by Daniel Falbo on 20/08/2020.
//  Copyright © 2020 Daniel Falbo. All rights reserved.
//

import SwiftUI

struct ContentView: View {

    func execute(script: String) {
        let task = Process()
        task.launchPath = "/usr/bin/env"
        task.arguments = ["/Applications/HomeSweetHome.app/Contents/bin/\(script)"]
        task.launch()
    }

    var body: some View {
        Text("")
            .frame(maxWidth: .infinity, maxHeight: .infinity)
            .onReceive(NotificationCenter.default.publisher(for: NSApplication.didChangeScreenParametersNotification)) { _ in
                self.execute(script: NSScreen.screens.count > 1 ? "connect" : "disconnect")
        }
    }

}

It's basically just a Text object that listens for didChangeScreenParametersNotification.
Since the Text object must be alive in order to listen for notifications, an istance of the app must always be opened or minimized (does anyone have any idea on how to avoid this?).
Every time it receives a notification, it checks the number of connected displays, if there's only one display connected, it executes my disconnect script, else it executes my connect script.
This is what the scripts look like:
#!/usr/bin/env sh
#
# connect
#
open -a Lunar
networksetup -setairportnetwork en0 $SSID $PASSWORD

#!/usr/bin/env sh
#
# disconnect
#
killall Lunar
networksetup -setairportnetwork en0 $SSID $PASSWORD

And this is what the app looks like

This helped me connecting to a wifi programmatically


AppleScript to mark video file as TV show? I'm using Hazel to automate the conversion of video files to iTunes .mv4 format, however one limitation I've run into is being able to mark a video file as "TV show" or "Movie" before adding to iTunes.

I'd like to do this via Applescript so I can run it as part of my rule set up, but I'm more of an AppleScript copy/paster than a coder.

Here's a bit to start the copy/pasting process, from the excellent "Doug's Scripts" website:

http://dougscripts.com/410

This is the "Set Video Kind of Selected" script, which lets you choose what kind you want the file to be marked as TV Show, Movie, etc.


Put computer to sleep and have it ask for password on wake How do I put computer to sleep and have it re-awake asking for a password?

I'm looking for a terminal command to do this.

I tried pmset sleepnow did not work.

There are multiple answers to the question of how to programmatically enable 'Ask for password after sleep or screensaver' -- the option that appears in the Security preferences panel.

Once you've enabled that option, you can use the following command to run an AppleScript to sleep the computer:

osascript -e 'tell application "Finder" to sleep'