Host a site on a Mac I have
my website locally on my Mac ready to host.
It is accessible locally via http://localhost running on MAMP.
Let’s say my static public IP from my ISP  is : 201.23.45.23
and I’ve already linked that IP with a domain like this : 201.23.45.23 —> http://mysite.online

Goal
I want to make my site accessible on the web, and host it on my local Mac.
I want my clients to see what I see on my http://localhost  when they visit
http://201.23.45.23
or
http://mysite.online

Note
I know that I can purchase a VPS or shared host, but the my intention here is to learn how to do it on my own on my local machine.

Question
Do I need to update my router to open port 80 and configure a port forward for that port?
Do I need to download an extra FTP server app like FileZilla to configure this ?
How would one go about and configure something like this ?
Any hints/suggestions/directions on this will be much appreciated !

Usually you don't need any additional tools like FTP-clients because you already have direct access to your file system via the Finder or the shell.

Since your host resides in a private network and connects to the internet via a gateway (your router) remote users don't have direct access to your Mac - they don't even know that it exists.

To enable access for remote users, you have to forward the public port 80 (and possibly port 443) on the router to the respective host's ports. Usually the router interface already contains preconfigured port-forwarding rules or you have to add them yourself:

public-router-ip:public-port –> host-ip:private-port

Here is an example of a D-Link router interface. Here I assume your host has the IP 192.168.0.2 and your web-server has the ports 80/443 open, the router's IP is 201.23.45.23:

All requests to 201.23.45.23:80 and 201.23.45.23:443 are forwarded to your internal host and its respective ports then: 192.168.0.2:80 and 192.168.0.2:443.

Name is here: a human readable name tagging the service. This may be the protocol name (e.g. HTTP) or a service name (e.g. Web server (http)). The drop down menu Application Name will probably auto-populate it - I don't own a D-Link Router so I don't know this.
In IP Address enter the IP address of your local Mac hosting the web server - not your public IP. The drop down menu Computer Name will probably show all available hosts in your internal network.
Public/Private Port as well as Traffic Type are self-explanatory.

The designations may differ slightly in your router's interface!

The standard MAMP http/https ports are 8888 and 8890 though. If you haven't changed this, the proper port-forwarding rules on the router would look like this then:

This means: all requests to 201.23.45.23:80 will be forwarded to 192.168.0.2:8888 and 201.23.45.23:443 to 192.168.0.2:8890 respectively.

You may even tell your clients to access the web server at port 20080/20443 (e.g. mysite.online:20080/main.htm). This is not recommended and inconvenient for your clients - it's just an example to show how to do it.

The forwarding rules with the standard MAMP http/https ports are then:

If you want to operate your own web server like this, I advise to set up a virtual machine (connected to a bridged interface - not NATed!) with VirtualBox, VMware Fusion or Parallels, install OS X & MAMP and run it there.

This will prevent ravaging your real system.


How to change a search direction in terminal I'm under OS X El Capitan 10.11.1. When I try to search in terminal text by cmd+F it starts to search from the beginning rather than from the end backwards as it was in terminal on Ubuntu.

So how can I change the search direction to start a search from the end in terminal?

press Cmd-F
to search backward press Shift-Enter


White on black in TextEdit Possible Duplicate:
  Default background color in Textedit

Is there any way to get text displayed in white and the background be black in TextEdit in plain text mode?

CMD +  T
Adjust document color.
Adjust text color.


Can I show a gif animation in a Photos.app slideshow? I'm creating a slideshow/movie in Photos, and some of my photos are actually animated gifs, but they appear as low quality stills in the slideshow.

Any way Photos can properly support these gifs?

Unfortunately the stock Photos app simply does not support the *.gif file type. To view *.gifs on a Mac you have 3 options:

Locate the file in a Finder window, highlight it, and then press the
spacebar
Locate the file in a Finder window, right-click, and choose to open
in Safari
Install a 3rd party application with *.gif support (such as 'PhotoScape
X' or 'Fragment', both free in the App Store. Unfortunately neither of these have the ability to create slide-shows)

I understand none of the above options help you with your slideshow project, and for that I apologize, but there is currently no way to make this happen.

With the addition of the Photos.app extensions (as of El Capitan) I was expecting someone to come out with an extension for *.gif support, but I have yet to find one or hear of one after searching tirelessly through the App Store and performing countless Google searches.


Transferring an iMovie project with AirDrop gives "Insufficient Space" repeatedly I've come across this problem a few times now.

I initiate a transfer of an iMovie project from my iPhone to my son's iPad (both with current software as of August 2016: iOS 9 and iMovie 2).
The transfer appears to complete, but then we see Insufficient Space. There's not enough disk space to copy this project. About X MB more space is needed on my son's iPad.
We free up some space on my son's iPad (more than X MB) and repeat the transfer.
Sadly, we see the same error message.  The free space we created in the previous step has disappeared.
We free up some more space and repeat this process, my hair gradually turning white.

Where is the free space going, and how can we successfully transfer the project?

I think the following is what actually happens when using AirDrop to transfer an iMovie project from one iOS device to another:

The project is transferred from the sending device into an "iTunes" holding area on the receiving device.  (I'm putting "iTunes" in quotes here, because iTunes the desktop app isn't actually involved in this AirDrop process).
The receiving device then copies the project from there into the main iMovie area.

The issue described in the question occurs when there is enough space to complete step (1), but not step (2).

The "iTunes" holding area can be managed, once you understand this and know what to look for.

On the main iMovie screen (which allows selection between Video / Projects / Theatre), there is an arrow-into-box icon.  This is at top left (iPad) or bottom left (iPhone):

Press the arrow-into-box icon and then select the iTunes tab.  This lists the items available in the "iTunes" holding area I described above.

Projects that failed to complete an AirDrop transfer due to a failure at step 2 are listed here.  This is the cause of the repeated lack of space.

Tapping on an item imports it into iMovie (as in step 2 above), if there is enough space.

Tapping the bin icon allows items to be deleted.  Deleting unwanted items should help to free up enough space to resolve the issue.


How to fix/clean burnt MagSafe 2 connection I got some sand in my MagSafe 2 port and as a result the pins got messed up - they look “burnt,” I guess because the electrical flow got messed up. As a result it is hard to get a proper connection, I have to jiggle it around a lot, and even when it does work it gets extremely hot now.

The burn is on both sides of the connection (the cable and the computer) so I can’t fix this by just getting a new cable.

I have tried cleaning it with 70% rubbing alcohol on Q-tips as I saw recommended on another site, but it didn’t do anything at all.

Can you recommend anything else I can try? I need this computer for work so I don’t want to send it to the repair depot to fix. Also I don’t want to do anything that would make it worse, especially since I’m still under warranty.

This is a mid-2015 MacBook Pro and MagSafe 2 port. Pics:

Yes, those are definitely burnt and this is because the sand allowed a gap just large enough that the electrical current arced from the adapter to DC-In port.

You can't clean this with alcohol - that's actually the last step.  What you need is something that's mildly abrasive.  You may have more luck cleaning the MagSafe adapter because those are pins where as the DC-In board are four conductive "dimples" surrounded by the most fragile plastic you'll ever run across.

What you can try:

Solder Wick.  Take a small piece and using a blunt tool (pen, pencil, etc.) and work it back and forth like a Brillo pad.
A very tiny piece of 800 grit sand paper (tiny enough to fit inside the DC-In port indentation) and work the same was as described with the solder wick.
Make a slightly moist paste of Bar Keepers Friend and water and "scrub" with a cotton swab (when I say slightly I mean just shy of being dry).

Once you've "scrubbed" the contacts, you can then use the alcohol to clean the contacts properly.  Basically, it's like cleaning "burnt on" anything  in the kitchen - you've got to scrub it off first, before you polish it.  Until you get it clean, it's not going to make proper contact.

If all else fails, the DC-In board is actually very cheap and very easy to replace.


As Lion now supports Resume, does it mean most softwares no long needs starting at login? As Lion now supports Resume, does it mean that most software no long need starting at login, as when they are open, they remain open in the next boot-up?
Of course it won't apply to those tools which only run once at login and auto quit afterwards.

Resume is an option that is enabled by the user; if the user doesn't select the checkbox when he shut-down Lion, then the applications will not be re-opened at start-up.
Resume is an option for applications that don't run in background, such as text editors, documents editors, browsers, which are opened when necessary. If also background applications would rely on that, then users would not have any possibility, if not closing all the applications they don't want re-opened by Lion; differently to have a background application re-opened when the Lion is shut-down or restarted, they would also have the other applications re-opened.


Macbook 15" showing green distorted logo and wont start I have macbook pro 15" (late 2011). Its showing a distorted green logo and loading bar on starting. Its taking around 10 min then showing just white screen. I tried resetting pram, but its still the same. What might be the issue ? How to fix ?

I would say that you have a dying/dead discreet GPU, as that's a known problem with your model of MacBook Pro. Booting into safe mode may be doing something to help your GPU (I have an Xserve with a confirmed dying GPU that boots in safe mode but not without it) so it boots properly. I would highly recommend getting your MacBook Pro replaced as soon as possible via the Apple program. I would suggest you run Apple Hardware Test and verify that your GPU is dead/dying, but this may not be possible given your current state. Similarly, you can run a GPU stress test program like Unigine Heaven and see if your GPU quits.

In any case, seeing if you can get your computer replaced probably isn't a bad idea since it's pretty likely your GPU is dying. Go to an Apple store, explain the issue, and they'll probably give you a new computer.


Symlinked Dotfiles Are Not Working I'm on macOS Catalina and I'm trying to move all my "dotfiles" into a folder, where I can place them under version control, then symlink them back  into the home folder.  I've created a hidden ".dotfiles" folder within the home folder, moved the dotfiles into it, then symlinked them back into the home folder with:

ln -s <dotfile name> ..

However, terminal complains that the commands associated with those dotfiles are no longer found.  I'm not sure what exactly I'm doing wrong, but any help would be greatly appreciated.

Your ln syntax is wrong, which is leading to self-referential symbolic links. For example:

% mkdir .dotfiles
% cd .dotfiles/
% touch .foo
% ln -s .foo ..
% cd ..
% ls -l .foo
lrwxr-xr-x  1 tph  wheel  4 Dec  5 10:38 .foo@ -> .foo

At this point .foo exists but it's a symlink to itself, not to the copy in .dotfiles.

Probably the easiest way to do it is to cd ~ and make the symlinks from there:

% cd ~
% ln -s .dotfiles/.foo .
% ls -l .foo
lrwxr-xr-x  1 tph  wheel  14 Dec  5 10:46 .foo@ -> .dotfiles/.foo


Can I use my iPhone 4 sim in another iPhone 4 I was just wondering if I am able to use my current iPhone 4 sim in another iPhone 4 because my current phone is breaking. Thanks

Yes.
But beware of locked iPhones. Some iPhones might be locked to other wireless carriers.


Apple Watch exercise calculation I just walked on my treadmill for 20 minutes. I don't see anything in the exercise ring. How is the exercise time counted?

Have you tried calibrating your Apple Watch? According to the support article, Calibrating your Apple Watch for improved Workout and Activity accuracy, calibration helps improve accuracy of things like distance and pace when GPS is not available. An example of this would be when you are walking or running on a treadmill.


Configure terminal dimensions to show as Lines x Columns In my terminal, when I ask to show Dimensions (profiles -> window -> dimensions), it shows the dimensions as Columns x Lines, but when I use resize -s 25 200, I am actually resizing as Lines x Columns, so I would like the dimensions to display in the same way.

Is there any way to get the Dimensions in the title to appear in the same order as the parameters in resize -s?

There is no straightforward way to change the Terminal option, you can define your own resizing function though to accomplish this (you may want to add error handling if required):
tsize() {
     resize -s ${2:-25} ${1:-80}
}

Put this into your .bashrc (and deploy to all your computers if you are using several).


Accesing files with Mac not booting Is it possible, say with Lion recovery partition or any other way, to access individual files on the hard drive to copy them before reformatting it to do a clean install?

It is not possible to boot Mac OS in "any flavor" as it always fails loading kernel - including safe mode or single user.

It is an early MacBook Air, so it is not possible to use "Target Disk" mode.

You can boot your system from a system installed on an external drive. If your internal drive isn't damaged it will mount and you can copy files off of it.

If you have a Lion recovery partition you can use Disk Utility to "image" the main partition of your drive onto an external device before you format and reinstall. You will have to restore this image onto another device before you can pull files off of it.

It is arguably eqsier reinstall Lion directly on top of the existing OS which should create a bootable system without overwriting your files–but to be safe, make a backup image before doing this.

Insert mandatory lecture about the importance of a good backup strategy which should make emergency measures like this largely unnecessary.


can't use publickey authentication for ssh with sierra I have had a script that has worked for a number of years that runs on linux (ubuntu 14.04) that ssh's to my iMac.

i set up public private key pairs for the script to log into the iMac.
I have struck a problem so i regenerated the public private key pairs using
ssh-keygen -t rsa -b 2048  then i put the public key in ~/.ssh/authorized_keys
i made sure the permissions of .ssh where set to 0600

i did the reciprocal key generation on ubuntu and the imac can log into ubuntu
i have updated ports on the imac.

a transcript of ssh -v 192.168.1.111 (imac) from (ubuntu) follows:

pete@ZEN:~$ ssh -v 192.168.1.111
OpenSSH_6.6.1, OpenSSL 1.0.1f 6 Jan 2014
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug1: Connecting to imac.local [192.168.1.111] port 22.
debug1: Connection established.
debug1: identity file /home/pete/.ssh/id_rsa type 1
debug1: identity file /home/pete/.ssh/id_rsa-cert type -1
debug1: identity file /home/pete/.ssh/id_dsa type -1
debug1: identity file /home/pete/.ssh/id_dsa-cert type -1
debug1: identity file /home/pete/.ssh/id_ecdsa type -1
debug1: identity file /home/pete/.ssh/id_ecdsa-cert type -1
debug1: identity file /home/pete/.ssh/id_ed25519 type -1
debug1: identity file /home/pete/.ssh/id_ed25519-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_6.6.1p1 Ubuntu-2ubuntu2.8
debug1: Remote protocol version 2.0, remote software version OpenSSH_7.2
debug1: match: OpenSSH_7.2 pat OpenSSH* compat 0x04000000
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-ctr hmac-sha1-etm@openssh.com none
debug1: kex: client->server aes128-ctr hmac-sha1-etm@openssh.com none
debug1: sending SSH2_MSG_KEX_ECDH_INIT
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: Server host key: RSA 19:dd:96:1d:99:9b:53:1a:71:b2:3f:2d:93:d0:c4:d9
debug1: Host 'imac.local' is known and matches the RSA host key.
debug1: Found key in /home/pete/.ssh/known_hosts:1
debug1: ssh_rsa_verify: signature correct
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey,password,keyboard-interactive
debug1: Next authentication method: publickey
debug1: Offering RSA public key: /home/pete/.ssh/id_rsa
debug1: Authentications that can continue: publickey,password,keyboard-interactive
debug1: Trying private key: /home/pete/.ssh/id_dsa
debug1: Trying private key: /home/pete/.ssh/id_ecdsa
debug1: Trying private key: /home/pete/.ssh/id_ed25519
debug1: Next authentication method: keyboard-interactive
Password:

The fact that the log shows the key in a first iteration of offering public keys (note that it says "offering RSA public key") indicates that it is coming from the ssh-agent or another source of keys.

Did you check if the old id_rsa key is maybe still stored in the ssh-agent?


Unable to access web through VPN I've had VPN setup on my OS X Server forever, but I've only used it for remote access to manage the server itself, never as a pass through to the internet at large. It occurred to me that when I travel it might be useful to have my communications routed through my server, so I've tried setting it up to do so and I'm not able to get it to work.

I've switched on "route all communications through VPN" in the client
settings.
I don't have any routes defined in the VPN settings of Server.
My server acts as a DNS server already so my VPN settings point to it
as the first DNS server.
I have a public DNS server listed as the second.

When I connect to the VPN and try to get to a web page, no luck-- Safari just times out.

I can "host google.com" successfully from the terminal and if I use an IP address in the Safari location bar, I still can't connect. So I don't think the problem is DNS.

I can get to the web when logged in locally to the server, so I think the port is open.

I had experimented with IceFloor a few years ago, but have since removed it-- I'm not entirely sure where to look for remnants of it but I don't see any files for it floating around and I don't see pf in the process list.

Any other ideas?

I think we could use some more detail about your VPN, I'm guessing it's openvpn?

From memory you should allow 'route all comms' in the server settings and create a default route from your vpn-client subnet to the server's gateway or exit nic. You'll also want to make sure firewall settings allow traffic between the IPs & ports you want.

Finally, check what can ping what else to determine the point of the problem. Check if your client can ping the server's internal VPN IP address, its external interface while traffic is routed through the VPN, then its default gateway. If that doesn't highlight the problem and you can ping the external gateway while traffic is routed through the vpn (use traceroute to confirm the path) check if the server can actually reach the external hosts you're attempting to connect to.


Can I delete the logs in the /private/tmp folder? Seems like there are around 5,000 wifi logs, each 2MB each, totaling nearly 10GB on my disk in /private/tmp. Can I delete these logs, or will macOS automatically delete them itself? I tried making a file using the mkfile command until I had about 2GB of disk space left, but nothing was automatically cleared.

In the standard configuration, launchd will run the "periodic-daily" script once a day with a low priority. The periodic-daily script will run the /etc/periodic/daily/110.clean-tmps script, which in turn removes the files in /tmp (which is the same as /private/tmp) that haven't been accessed for 3 days.

So normally these log files will be deleted every 3 days, unless ofcourse something is still writing to them - or you yourself are opening them all the time to check them.

You do not specify the file name of the files you're worrying about. Normally it should be safe to just delete log files in /private/tmp/.


How do I stop the dock from moving to my second monitor? I use an external monitor with my Macbook Pro, often to run Windows VMs with a task bar at the bottom.  While trying to use the task bar, I often accidentally summon the dock to the second monitor.  How do I stop the dock from moving?

Note: I'm aware of the option to go back to the old one-space-for-all-displays behaviour.  I don't want to go back to the old behaviour, I want to fix the new one.

Note, repeated: This isn't a duplicate of the question which asks why this happens.  I know why it happens, but there's nothing there that would help me to prevent it from happening.

Unfortunately, there is no way to prevent the Dock from moving from monitor to monitor in any version of OS X.


My MacBook Air won't charge My MacBook Air won't charge, the MagSafe doesn't even have that green or red orange light and when it does it isn't very bright.

The Battery Icon on the upper right corner indicates not charging.

When I pull the MagSafe out of my MacBook Air it would turn-off but still it doesn't mean its charging.

I could only use my MacBook Air if I'm plugging the magSafe even if it doesn't charge. My battery is still 0%

Because you explain the problem perfectly, and in short:

The battery does not charge, and your Macbook does only work with MagSafe attached

There's only one option what could be the problem...

The battery is dead, let me explain you why:

Your battery is ignored somehow, and your Macbook uses power directly from the MagSafe adapter. If you couldn't even use the Macbook with the cable in it, the cable could be the problem. Since it works with cable-attached, it's not.
You can use the macbook with cable in it as explained above.


How to map the bottom right Trackpad corner to right-click programmatically? I’m looking for a command (defaults write …) to enable right-click by tapping the bottom right Trackpad corner.

This can be enabled as follows: System Preferences → Trackpad → Point & Click → enable Secondary click and select “Click in bottom right corner”.

However, I’m looking for a way to do this programmatically.

More details

To find out which settings to modify using the defaults command, I usually do something like this…

Disable the desired setting in System Preferences and close the preference pane.
Then:

cd /tmp
defaults read > before

Then, change the setting in System Preferences and close the preference pane.
4.

defaults read > after
diff before after

A long time ago (I think it was still on Snow Leopard) this brought up the following solution:

# Map bottom right Trackpad corner to right-click
defaults write com.apple.driver.AppleBluetoothMultitouch.trackpad TrackpadCornerSecondaryClick -int 2
defaults write com.apple.driver.AppleBluetoothMultitouch.trackpad TrackpadRightClick -bool true

However, it seems like there’s more to it than just these two settings. I’ve tried disabling the setting in System Preferences, then running these commands, then logging out and back in again, but it had no effect.

I spent some more time debugging this, and it seems there are multiple setting locations (on multiple hosts) for the same setting.

AFAICT, each user gets his own host. The login screen uses a separate host. It makes sense to enable some settings (like Trackpad tap to click) for both these hosts.

Furthermore, OS X seems to have separate settings for Magic Trackpads and built-in MacBook Trackpads. The commands in my question only enable the Magic Trackpad settings.

Now, I try to enable it everywhere:

# Map bottom right Trackpad corner to right-click
defaults write com.apple.driver.AppleBluetoothMultitouch.trackpad TrackpadCornerSecondaryClick -int 2
defaults write com.apple.driver.AppleBluetoothMultitouch.trackpad TrackpadRightClick -bool true
defaults -currentHost write NSGlobalDomain com.apple.trackpad.trackpadCornerClickBehavior -int 1
defaults -currentHost write NSGlobalDomain com.apple.trackpad.enableSecondaryClick -bool true


OSX HDD not working after I removed a partition on it I recently removed the Ubuntu disk partition from my macbook, now my osx or hdd is not recognizable and I am forced to perform the internet recovery mode to no avail.

Update:  I swapped out my original hard drive with a SSD that I recently bought.  My MacBook is up and running using the new SSD, however the original HDD when plugged in via USB appears in Disk Utility, but I am not able to use it.

Upon clicking 'First Aid' for either ASMT 2115 Media or the other two "--" below it I received the error message "First Aid process has failed.  If possible back up the data on this volume.  Click Done to continue.

This entire problem happened when I tried to erase my Ubuntu partition (which I believe is the 2nd "--" under ASMT 2115 Media.  Upon doing so, this is when this entire problem started.

Although I have a clean Sierra on my SSD, I would still want to be able to access this hard drive to see if I can salvage my photos, documents and programs already located on it.

Output of diskutil list:

/dev/disk0 (internal, physical):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *1.1 TB     disk0
   1:                        EFI EFI                     209.7 MB   disk0s1
   2:          Apple_CoreStorage Untitled                1.0 TB     disk0s2
   3:                 Apple_Boot Recovery HD             650.0 MB   disk0s3

/dev/disk1 (internal, virtual):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:                            Untitled               +1.0 TB     disk1
                                 Logical Volume on disk0s2
                                 8CAA5C80-BB12-4432-9950-5DF80AA23AA8
                                 Unencrypted

/dev/disk2 (external, physical):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *320.1 GB   disk2
   1:                        EFI EFI                     209.7 MB   disk2s1
   2:                  Apple_HFS                         302.6 GB   disk2s2
   3:                  Apple_HFS                         17.1 GB    disk2s3

Here is the result of diskutil info /dev/disk2s2 which was my original HDD

Device Identifier:        disk2s2
Device Node:              /dev/disk2s2
Whole:                    No
Part of Whole:            disk2

Volume Name:
Mounted:                  No

Partition Type:           Apple_HFS
File System Personality:  HFS+
Type (Bundle):            hfs
Name (User Visible):      Mac OS Extended
Journal:                  Unknown (not mounted)
Owners:                   Disabled

OS Can Be Installed:      No
Media Type:               Generic
Protocol:                 USB
SMART Status:             Not Supported
Disk / Partition UUID:    000059E3-08FD-0000-6F45-0000C7470000

Disk Size:                302.6 GB (302643589120 Bytes) (exactly 591100760 512-Byte-Units)
Device Block Size:        512 Bytes

Volume Total Space:       0 B (0 Bytes) (exactly 0 512-Byte-Units)
Volume Available Space:   0 B (0 Bytes) (exactly 0 512-Byte-Units)

Read-Only Media:          No
Read-Only Volume:         Not applicable (not mounted)

Device Location:          External
Removable Media:          Fixed

Googling issues with ASMT 2115 on macOS brought me here. I had an issue, similar to yours, when testing this external hdd enclosure.

Somehow by formatting SSD in Yosemite from Parallels (which was previously formatted on Sierra), I managed to get HDD into state which nor Sierra nor Yosemite could read/mount/format anymore on macOS. I could use eg. Ubuntu to format the disk, but that was not the point. I wanted to understand what is going on and why macOS started hating my disk.

I was not able to partition the disk or erase it from Disk Utility. The useless ultra generic error messages was not helpful at all, so I tried to format it from terminal with diskutil eraseDisk HFS+ OSX GPT /dev/disk3. There I was able to partially format the disk but finalisation broke with more errors. I was suspicious about electronics in this enclosure and macOS driver for it because I had several of them, and several SSD HDDs all showing same issue. All that lead me to investigate MBR/GPT of the disk in question.

What was strange to me was that fdisk saw unknown partition ID and gpt did not work at all.

Disk: /dev/disk3    geometry: 14593/255/63 [234441648 sectors]
Signature: 0xAA55
         Starting       Ending
 #: id  cyl  hd sec -  cyl  hd sec [     start -       size]
------------------------------------------------------------------------
 1: EE 1023 254  63 - 1023 254  63 [         1 -  234441647] <Unknown ID>
 2: 00    0   0   0 -    0   0   0 [         0 -          0] unused
 3: 00    0   0   0 -    0   0   0 [         0 -          0] unused
 4: 00    0   0   0 -    0   0   0 [         0 -          0] unused

And gpt did not work at all:

sudo gpt -r show /dev/disk3
gpt show: error: bogus map
gpt show: unable to open device '/dev/disk3': Undefined error: 0

Then I found about Hybrid MBR/Protective MBR/GPT issues people had, mostly due to BootCamp which was responsible for creating the Hybrid MBR conditions that was causing many problems to dual boot users (lost system partitions etc.). I was certain I created condition like that by my self (by using different non compatible OSX versions tough).

The solution in this case was to clear the hybrid MBR data, or even better to clear all GPT/MBR data on the disk (if you do not need the data), and start over.

I was not able to use Apple utilities successfully, but GPT fdisk (gdisk) worked great for me. SIP fill forbid gdisk from working on system disk (unless it's disabled), but it works great with external HDDs. gdisk revealed that my MBR and GPT were very different.

sudo gdisk /dev/disk3
GPT fdisk (gdisk) version 1.0.1

Partition table scan:
  MBR: MBR only
  BSD: not present
  APM: not present
  GPT: present

Found valid MBR and GPT. Which do you want to use?
 1 - MBR
 2 - GPT
 3 - Create blank GPT

It's worth noting that:

Option 1 reads MBR partition table (as seen by fdisk) and converts
them to GPT.
Option 2 uses existing GPT (as seen by gdisk) and deletes the MBR partition table (becoming protective MBR)
Option 3 will start fresh with a new empty GPT.

If you want to save data on your HDD, do not do this. You have to repair it from gdisk. My fix was using option 3, then zaping (deleting all partition information) whole disk and recreating blank GPT:

x
z
Yes
y

After that I was again able to initialise/format the disk in Disk Utility again (and in terminal).

More info about GPT can be found here and here on gdisk homepage.

The fastest way to get gdisk is by brewing from cask with:
brew cask install gdisk

Hope this helps someone.

IMHO - it is not unlikely that disks will end up this way if they are eg. used between OS'es. macOS should really have support to handle them without breaking a sweat, but sadly - it does not.


Location of blocked numbers within iTunes backup Tools such as iExplorer allow you to easily browse through an iTunes backup and it's contents, and then things like the plist command for converting preferences down to readable XML. Where would the location of the plist or sqlite DB that contains blocked numbers on an iPhone such as described in the apple docs?

I looked into your question, and I think it might not be possible to find blocked numbers within a backup (or at least not in a recognizable form). I know that it is possible to find these numbers if you have messages synced with iCloud. Through the messages app on a Mac, you can go to preferences (⌘ + ,), and from there view any blocked numbers that are synced.

I am still looking through finding the blocked numbers in the backups myself, but I am unsure that I will find them there. If I come across more I will edit the answer further.

I hope this helps and best of luck of finding the blocked numbers through that backup.

(I am new to StackExchange, so I appreciate any feedback that would help me improve my answers or how/when I answer)


Errors when transferring Time Machine to a new drive I tried transferring my Time Machine volume to a new drive using the instructions provided by Apple, where it requires that I drag-and-drop via the Finder, but I got a ton of errors. At least a dozen at the same time. I don't recall them all, but some were quite strange. I have transferred a Time Machine drive once before, and it took 24 hours, but there were no errors.

There were a lot of "This operation could not be completed." errors. I think the codes were along the lines of -50 and -8300. I also noticed one particularly strange error, saying something like "The version of iWorks used to create this document is older."

What do these all mean, and what can I do to fix them? I already ran "Repair disk" on both the source and destination volumes, with no errors.

I am in the same situation: I am trying to move my Time Machine backup from a 1TB LaCie d2 Quadra disk to a new 3TB LaCie Quadra, both on FireWire 800. I have followed the same Apple instructions as you and get a bunch of -50 errors after a while.

My current approach is to repartition the new drive and use:

sudo cp -R /Volumes/OldTimeMachine/Backups.backupdb /Volumes/NewTimeMachine

but I don’t know if that will copy things correctly. My reading of the man page for cp suggests that it should (this is OS X 10.7.5).

I found this thread on MacRumors Forum which may explain things, although I am not sure. If using cp fails I will try updating the firmware in the older drive using the LaCie Firmware Updater for Mac from this support page and go back to using Finder to copy the backup.


zero pad numbers in `cal` (or `gcal`) output? This seemed pretty easy, but I have not found a good way to do it.

In Terminal, cal will give this output:

   September 2015
Su Mo Tu We Th Fr Sa
       1  2  3  4  5
 6  7  8  9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30

That is, it will show the calendar for the current month.

I would like to have it display like so:

   September 2015
Su Mo Tu We Th Fr Sa
      01 02 03 04 05
06 07 08 09 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30

This seems like it would be fairly easy to do, but so far I can’t crack it.

Initially I thought I would just look for the numbers 1-9 with one space on either side. That works… except if the number is on Saturday, or Sunday, because then there's no leading/trailing padding.

So I'm at a loss. I even looked at GNU cal which seems to have a bazillion options, but I couldn't find one for this.

I'm sure there's a way to do this with sed/awk/tr/etc but I can't figure it out. Would prefer as “lightweight” of a solution as possible, as this is something that will run frequently, but I'm not adverse to installing something else via brew if it can do a better/ more efficient job.

sed to the rescue:

pse@Mithos:~$ cal 09 2015 | sed -e 's/ \([[:digit:]]\) /0\1 /g' \
                                -e 's/ \([[:digit:]]\)$/0\1/g'
   September 2015
Su Mo Tu We Th Fr Sa
      01 02 03 04 05
06 07 08 09 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30

Combining the two sed commands into one is left as an exercise to the reader.


How does Airplay from iCloud actually work? Airplay from iCloud is part of the newest Apple TV update however I don't understand how it is supposed to work. Should I see a new option on my device when I'm airplaying something from it? This is all I could find on apple.com

Apple TV will play content from iTunes in the Cloud instead of your AirPlay device when possible. Requires iOS 7 on AirPlay device.

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

Found this unofficial item:

  Today’s update also brought AirPlay From iCloud, which lets guests
  stream their purchased music, photos, and videos stored in iCloud to
  another person’s Apple TV. If you bought World War Z on iTunes, you
  can now go to a friend’s house with an Apple TV and watch it there
  without having to log into their Home Sharing account or store it on
  your phone. It’s all streamed from iCloud.

So, I guess you browse the iTunes store (or maybe the Videos app) on your phone, select something you bought, tell it to start playing, and then AirPlay it over to your friend's ATV.  Or your own ATV, I guess, although it would seem easier to play it on your own ATV using the ATV menu itself.


Is there any limit to the number of users connected via Personal Hotspot? How many users can be connected to an iPhone's personal hotspot? Does the limit differ from device to device? I want to know the limit of maximum users.

Quoting from an Apple support article about Personal Hotspot (emphasis mine):

  When you connect a device to your Personal Hotspot, the status bar turns blue and shows how many devices have joined. The number of devices that can join your Personal Hotspot at one time depends on your carrier and iPhone model.

I believe the typical limit is usually between 3 to 5 devices.


gpt recover: unable to open device '/dev/disk2': Resource busy I am trying to repair an external hard drive that is showing up under diskutil list and the Disk Utility app, but says "First Aid process has failed. If possible back up the data on this volume. Click Done to continue.". I have tried these things:

$ diskutil list
/dev/disk0 (internal, physical):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *251.0 GB   disk0
   1:                        EFI EFI                     209.7 MB   disk0s1
   2:                 Apple_APFS Container disk1         250.8 GB   disk0s2

/dev/disk1 (synthesized):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      APFS Container Scheme -                      +250.8 GB   disk1
                                 Physical Store disk0s2
   1:                APFS Volume Macintosh HD            243.7 GB   disk1s1
   2:                APFS Volume Preboot                 22.6 MB    disk1s2
   3:                APFS Volume Recovery                515.0 MB   disk1s3
   4:                APFS Volume VM                      2.1 GB     disk1s4

/dev/disk2 (external, physical):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *1.0 TB     disk2
   1:                        EFI EFI                     209.7 MB   disk2s1
   2:                  Apple_HFS MyDisk                  999.8 GB   disk2s2
$ diskutil repairDisk /dev/disk2
Repairing the partition map might erase disk2s1, proceed? (y/N) y
Started partition map repair on disk2
Checking prerequisites
Checking the partition list
Adjusting partition map to fit whole disk as required
Checking for an EFI system partition
Checking the EFI system partition's size
Checking the EFI system partition's file system
Checking the EFI system partition's folder content
Checking all HFS data partition loader spaces
Checking booter partitions
Reviewing boot support loaders
Checking Core Storage Physical Volume partitions
The partition map appears to be OK
Finished partition map repair on disk2
$ sudo gpt recover /dev/disk2s2
gpt recover: unable to open device '/dev/disk2s2': Resource busy
$ sudo diskutil mount readOnly /dev/disk2
Volume on disk2 timed out waiting to mount
$ sudo mkdir /Volumes/USB
$ sudo mount -t hfs /dev/disk2 /Volumes/USB
mount_hfs: error on mount(): error = -1.
mount_hfs: Resource busy
$ diskutil unmountDisk /dev/disk2
Unmount of all volumes on disk2 was successful
$ diskutil eject /dev/disk2
Volume timed out while waiting to eject

What else can be done to fix this, at least to get it readonly so I can copy the data out of it to another drive.

https://github.com/gcunhase/PaperNotes/blob/master/notes/mymacnotes.md

By default the gpt command requires a exclusive lock on a drive before preforming an write operation to the drive. This can not happen, when a volume residing on the drive is mounted. With respect to disk2, the typical solution would be enter the following command, before entering the gpt command.

diskutil unmountdisk disk2

The drive is identified as disk2. The volume containing user data on this drive is identified as disk2s2. To mount this volume as readonly, first the volume has to be unmounted, then mounted readonly. The commands are given below.

diskutil unmount disk2s2
diskutil mount readonly disk2s2

I should note that the volume you were trying to access appeared to be mounted, because you were getting an error message when trying to use the gpt command. The command give below will output text, if the volume is mounted.

mount | grep disk2s2


MBP shut down and will not power back on My MacBook unexpectedly shutdown and not responding to power button or even battery status button, the lights on battery status isn't showing too. What happened? What should I do?
Edit : the charger light is dim and it's blinking amber and green light.

After searching the net and not coming up with any solution, i went to Apple Care Center and they had it diagnosed, turned out, it was full of dust. They recommended me having it serviced every 6 months. Phew, now its working fine.


dtruss not working on Mojave Running dtruss on 10.14.4 (Xcode 10.2) gives me this:

tmp$ sudo dtruss ./ls
dtrace: failed to enable '
 #pragma D option quiet

 ': Failed to enable probe
CSCppMachTaskContainer pid_for_task failed for task 20003, err 5CSCppMachTaskContainer...

This is not a code signing issue (I resigned that ls I'm running). I also already disabled System Integrity Protection so it's not that either. Did anyone see this?

I have learned today that dtrace isn't really supported any more:

https://news.ycombinator.com/item?id=17853312

I'm leaving this out in case someone runs into this.


Logitech HD Webcam C310 to make Video Calls (FaceTime HD Camera not detected) My FaceTime HD Camera (Built-in) is not detected anymore. Logitech C310 HD Webcam System Requirement does not include MacOS meaning the web camera may not be compatible or work with Macs.

As for Video Calls, it states "You’ll get HD 720p video calling on most major instant messaging applications". I wonder if anyone has used the C310 to overcome a failed Face Time camera issue (in that I can use it to make FaceTime calls with the C310).

The Logitech HD Webcam C310 is compatible with OS X Yosemite 10.10 and later as mentioned in the product description on it's website.

An external webcam can be used with FaceTime. Refer to the Apple Support document, Choose which camera or microphone to use more details.


Are .apple files potentially synonymous (or a wrapper to) .dmg files? We lost a .dmg file on an harddrive. Our tech guy was able to recover files from the drive but not one of them is a .dmg file. But they are a lot of .apple file. Can the .dmg file we are looking for be one of them?

The .apple files are probably either AppleSingle or MacBinary files.  The Apple file system keeps more information about a file than other filesystems (Window, Unix, etc.) do, so AppleSingle and MacBinary formats were created to package up all that information in a way that could be transported on any file system.

So if you're looking for MyDisk.dmg but instead find MyDisk.apple, that's probably the encoded version of the file you want and you need to decode it.  Try downloading the free StuffIt Expander and see if it can convert the files for you.


Making changes to a Smart Group's distribution list persistent Is there a way to make changes to a Smart Group's distribution list persistent?

Problem Description

In Address Book, I right-click on a Smart Group and select "Edit Distribution List".

I then select a work address for a contact that has multiple email addresses.

If I close the the "Edit Distribution List" menu and then go back into it, my change from home/other to work for that particular user did not persist.

The problem is that when I send an email using a smart group, I cannot ensure that everyone will receive the email to their work email address.

Any thoughts?

Distribution lists are not persisted for smart groups. On Lion, if you search Address Book help for "distribution list", you will see a page called "Select addresses for group members". Below step 2 is this piece of bad news: "You can't choose smart groups."

Some versions of OS X show smart groups in the Edit Distribution List window, but as of Lion, this is simply the user interface being misleading.

Speaking of Lion, users who use iCloud for contacts will see the Edit Distribution List menu item disabled, because this feature is not yet available with iCloud.


Outlook - Keyboard shortcut for searching across all folders Say I want to run searches like the following:

from: John
to: Emily

across all my Email folders (i.e. inbox, sent, etc.) in Outlook 2011.

How can I set up a keyboard shortcut so that Outlook takes me to a text field where I can enter those queries?

Perhaps if you could clarify your request a bit.

Outlook for the Mac has several keyboard shortcuts for find here:

EDIT --> FIND --> (etc)

That all open a text input field for finding things. In fact COMMAND-OPTION-F brings up the search tab with the focus on the find field where you can type your query in.

Since this is so easy to find I can only conclude that you are looking for something more than that?

BTW, I just remembered that Outlook uses Spotlight to do it's searches, so you could do your search there and add criteria to the searches you need and save the searches as smart folders.


How to remove a very thin screen protector from an iPad? I have an iPad with a "Paper-Feels Like" screen protector, which I now want to remove. I have tried toothpick, fingernails, etc., but it is so thin and well-placed that I cannot find an edge.

Apple support are convinced there is no protector at all.

Any other suggestions what I could try?

Take and post a macro photo of the corner of the screen with very good light (and possibly use a prop to keep the camera still) and you might not need a magnifying glass to show if the cover was removed by someone when you didn’t realize it.

If you’re sure it’s on and cant make a purchase, I suppose you would want to use a copper wire or nail that you know is less hard than the glass and try to scratch the screen in a corner area to deform the protector material. There’s no way the cover and adhesive are going to be harder than glass. And if you’re wrong, you’re not super likely to damage the glass trying to locate a cover someone else might have removed for you already.

https://geology.com/minerals/mohs-hardness-scale.shtml

If you don’t mind a minor scratch, you could use a knife or razor blade to score enough of the corner to get the cover off or make a lip you could then slip the blade under. I don’t recommend that and let the cover wear or just pay for a replacement screen when yours no longer makes you happy. I worry if your screen has adhesive, and is that bonded, you might not like the glass or be able to clean the residue unless you know from the manufacturer what chemical will remove the adhesive and not damage the glass or the coating on the iPad.


Mac os x ipfw forward from ip:port to ip:port I want when on my local machine redirect from 192.168.64.88 port 80 to localhost port 9790. How can I do it with ipfw rule?

I found the solution:

sudo ifconfig lo0 192.168.64.88 alias
sudo ipfw add fwd 127.0.0.1,9790 tcp from me to 192.168.64.88 dst-port 80

After a restart you have to run this commands again.


Can Apple delete an app installed via iTunes or the App Store without your permission? I had always thought the answer to this was no. I have an app that was pulled from the iOS App Store (VLC) still on my non-jailbroken phone and thought this was proof that Apple can't remote wipe an app. But I just heard a claim that they can remote wipe apps installed via their app purchase portals if they choose.

Is this true? True for just iOS apps or just App Store apps?

Yes, it's true Apple can remotely delete apps. This is a failsafe in case a nefarious app accidentally makes it past the review process. Not sure about Mac App store, I doubt the ability exists there. It's a different installation/update process.

I don't think it's been done before, and I wouldn't worry about it. It's a good thing. I would want an app that say sniffs my credit card numbers or is actually a trojan horse of some kind to be removed from my iPhone post haste.


I cannot open Safari, when I did open -a Safari error -10810 appeared I tried searching what error -10810 is but nothing came up on Google. Any idea on how to fix this or go around this?

When opening an application with the open command, you should use the -a option, e.g:

open -a "Safari"

From the man page for the open command:

  -a application
       Specifies the application to use for opening the file

Note: If you use the -a option, you typically do not need to specify the pathname or even use the .app extension. Just the format as in the example shown above should work.

In Terminal, the executable permission (and others) output of:

ls -l /Applications/Safari.app/Contents/MacOS/Safari

Should be:

-rwxr-xr-x

If not, then in Terminal, run the following command:

sudo chmod 0755 /Applications/Safari.app/Contents/MacOS/Safari

This will ensure the proper permissions on the Safari executable and should stop you from getting the error you've got.


How to mount a shared folder as disk with `rwxr-xr-x` permissions? I shared a folder from the host system (OSX) and use mount it in the guest system (OSX). But it is mounted only with rwx------ mode. I granted an rw access for the shared folder for a user in the guest system and for everyone as read-only. But in the guest system the folder is going mounted to the /Volumes/ as a shared disk with rwx------ permissions. How can I mount it with rwxr-xr-x permissions?

Update 1:

in the host system it has rwxr-xr-x+ permissions

Update 2:

the problem sounds to be like here: permissions for mounted internal disk [ask ubuntu]. So is it kind of related to fmask, dmask (umask)?

Update 3:

here is similar situation, but on linux 700 instead of 755 permissions on auto-mounted USB HDD. so there is a /etc/fstab.hd file on osx but it considered be useless

Update 4:

it looks like all AFP shares appears as drwx------. How to change it?

You need to specify the permissions when executing mount - the local file permissions or the permissions you set with chmod on the directory to which you mount your share will not be taken into consideration.

You should do mount -t <fs_type> -o m=755 /path/to/source /destination

I'm not sure which filesystem type is what you're trying to mount (is it nfs? or hfs?) - you only refer to a host system and a guest system without any more details. You'll need to specify the correct file system type to the mount command (but I'm presuming you have already done that and it did work). Also, it would be a good idea for you to read the man for the relevant mount command (so, if the fstype is hfs, you'll need to read man mount_hfs; similarly, if it's nfs, you need to man mount_nfs; have a look at the bottom of man mount for more fs specific mount commands).

Hope that helps!


Can I safely rename all directories in my home directory to lower case? I am somewhat picky about my filesystem structures. I really, really dislike directories with capital letters.

I'm more used to Windows where there are a lot of "special" folders in the home directory where care must be taken when renaming folders.

I'm currently using Lion and trying to force myself to use OS X more often.

I would like to know if its safe to just rename the directories, e.g. Documents, Downloads, Public, Sites. Will the OS know where to look for the new directories? If not, is there a recommended way to do this?

As far as OS X is concerned, this is acceptable IF you have selected a non-case sensitive filesystem.

The non-case sensitive filesystem is the default, so unless you selected case sensitivity during installation of your operating system (or in Lion's most likely case, your previous operating system), you should be fine.

When selecting file system case sensitivity (or not), it should also be known that while the operating system itself will be okay with this, certain applications may not. There are problems using nearly all of Adobe's applications on a case sensitive file system. At the time of this answer, the Adobe Knowledge Base article regarding this issue was last updated roughly 9 months ago (2010-11-03) and this is still the case. Adobe's only answer to the problem was, and remains, to not use case sensitivity.

It is possible that other software also suffers from this issue, or may suffer from similar issues if a case sensitive filesystem is used.


Why do I have to drag my new apps into the application folder? I'm a new Mac user and I've been installing a few different apps for different things. A lot of these use .dmg files.

Why exactly do they all expect me to drag the icon into the application folder? What is the point of this?

An application on a Mac is just a folder full of files with a .app extension. However, macOS hides this fact from you and displays the folder as a file with an icon. Now when you download something it's very uncomfortable to download multiple separate folders (without a download manager). Therefore this "App Folder" has to be put inside a single file somehow. This is  accomplished one of three ways:

Using a .zip file (a container that compresses its contents to save space)
Using a .dmg file (which is a flat file filesystem–as opposed to a hierarchical file system)
Make an installer (which, however, also has to be either in a .zip or .dmg because installers are folders on a mac, too)

Since most apps are self-contained and do not need anything outside of the app folder, an installer is not only overkill but also slower than just distributing the app folder.

You can obviously launch apps from wherever you want; it's only a custom or a recommendation to put them into /Applications as it easier for you to find it again and it works with multiple users.


Can I use any Sim to activate/set up iPhone 5s I recently ordered a straight talk iPhone 5s from swappa. I plan to just use it as a wifi device but my question is, can I use any sim card for the initial set up or does it have to be specifically straight talk sim. Also does the sim have to be activated and working?? And after the initial set up and activation can I simply remove the sim card and the phone still work as a wifi device? Sorry this is my first time buying a phone.

Yes, there is a SIM card required to activate your iPhone. After activation you can use your iPhone without any SIM card (except some features off course). You could use a SIM card from your current phone, provided that it is a nano-SIM (i.e. the iPhone 5s SIM slot supports nano-SIMs).


Is there a possibility that older OS X apps will break in the new macOS? I've been using an app named CourseNotes for college and just noticed it has not been updated since 2014. I've used it for years and has a lot of important notes in it, and I don't seem to get the same functionality in apps like EverNote.

In the new upcoming macOS, is there a chance it will break and I will lose this data?

I've been scanning the Internet for days and I can't seem to find a good answer. Contacting the developer has resulted in no answers whatsoever.

Yes applications can break when a new OS is introduced. The APIs that it calls could have been changed or possibly removed.

This is why many apps will get updated just after an OS release and why developers get a beta test of the OS so they can check.

If the developer is not active anymore then you have to be the one who tests it. In large organisations there is often a complex plan to upgrade an OS: all the applications that the organisation uses have to be tested before agreement to update the OS is given. This is one reason many organisations have stayed on old versions of Windows (e.g. Windows XP) because they can't get all apps to pass or no-one has given the budget to test.


How to reveal dot files in finder? In the finder, files that begin with a . (dot) are not being shown for me.

How can I configure the finder to reveal all files, including ones that begin with a dot?

A handy related shortcut to reveal files that begin with a . (dot) in Finder dialogs that popup from a File->Open action is:

Shift + Command + "."

This toggles "." (dot) files to show/ hide without needing to restart Finder.

You can also define an alias to quickly toggle hidden files within Finder:

alias AllFilesTRUE='defaults write com.apple.finder AppleShowAllFiles TRUE; killall Finder'
alias AllFilesFALSE='defaults write com.apple.finder AppleShowAllFiles FALSE; killall Finder'


Strange loading screen when MBP battery dies and reboots I have a 2007 Macbook Pro and for nearly two years, the battery has been toast. In April, Apple replaced the logic board. Since the repair, whenever the power cable comes loose, the MBP shuts off as expected.

Before the repair, when the power cable was unplugged, the MBP simply shut off. Now, when I plug it back in and turn it on, it boots back up in the previous state, but has a white screen with loading bars at the bottom.

I haven't found anything related to this on the web. Is this related to the new logic board, or is there something else I should be concerned about? The MBP is running Leopard and is up to date.

This feature is called Safe Sleep. Apple notebooks will keep the RAM contents alive (sleep in PC jargon), but write a copy to the disk (hibernate, in PC jargon) at the same time.

If the battery runs out while the computer is sleeping, when it wakes up, it needs to read the RAM contents from disk, and thus you get the progress bar you are seeing.

Apple doc about it is here


How to prevent one app from saving/restoring any Saved State I want to turn off the restoring of an application window (in my case, iTerm).
How to turn it off, but just for this specific application ?

There is a specific command to prevent any app from saving state, rather than just locking the state folder…

defaults write com.apple.Preview NSQuitAlwaysKeepsWindows -bool false

If you don't want a permanent switch, just to prevent it on one single occasion, then deleting/moving the Saved State folder in ~/Library/Saved Application State/ would be the simplest.


How to present a keynote and start playing itunes music When I am in that full-screen mode presenting a keynote, using the iTunes media keys seems to just exit the keynote instead of playing a song from iTunes.

How can I play a song from iTunes whilst staying inside the keynote presenter?

Keynote can play audio across all slides, but it needs to be inserted differently. Rather than using the Media button to insert audio you need to insert your audio via the Document icon and then click the Audio tab, and drop your audio tracking this way.

This audio then becomes a "Soundtrack" and will play across all slides in the presentation.


How to check what causes iPhone battery to drain out? Last night before I went to sleep my iphone battery was at 30% and the active usage was about 6 hours ( since last full charge). However this morning when I woke up I found that my battery went flat. Upon some checking I discovered that it was on active usage for 12 hours. Which means that when I was sleeping either

Someone played with my iphone for 6 hours, or
Some rogue apps that ran in the background were silently draining my battery even though they shouldn't

Possibility 1 is very remote. So I would like to investigate on possibility 2. How to know what causes the iphone battery to drain out even when it is not in use?

Edit: I switched 3G and WIFI off when I was sleeping.

There is a general tips page on maintaining great battery life, as well as general terms about battery replacement.

Personally: This sounds like a bad battery. It sounds like it just plainly is not holding a charge after a certain discharge point. Remember that iOS multitasking is not true multitasking. Barring streaming audio (actually persistent audio in general), there is (almost) NOTHING that your phone can constantly do for more than 20 minutes at a time.

I've streamed audio for hours (hours being... maybe 5?) during the day at ~40% and it did get under 20% by the time I was done, this was both on an iPad, and roughly equivalent on an iPhone 4. Connected WiFi, 3G (on the iPhone) enabled but not being the active radio in use, of course.

I don't know that you're able to see what's draining the battery, Apple forbids "task management apps". A possible workaround to see if it is app involved or a bad battery, is to drain your phone to a similar level, open the fast app switcher bar (double tap the home button), tap-hold on any application in the task bar until they begin to "jiggle", then press the white minus inside the red circle on EVERYTHING. This will kill any and all tasks that aren't first-party. (For example, it will not stop the occasional housekeeping/tasks that Mail, Phone, Safari, or other built-in apps are allowed to do.)

Having said that, to properly test, ensure that mail's auto-fetch is off (or in push only mode at best), make sure that you have no tabs in Safari with "live" or automatically refreshing content. Safari IS ALLOWED TO BACKGROUND, and has always been able to, to the best of my knowledge. At least since iOS 2.something (where I started with an iPhone 3G).


I lost my albums and books I lost my albums and books in iPhoto and cannot retrieve them.  Is there anything I can do to retrieve these lost files?

If you've deleted them, you'll need to have a backup to restore the file from. If it's a laptop, hopefully you had local snapshots enabled, in which case you can go to the folder that contained your iPhoto library, enter Time Machine and restore the file.


Set ForkLift as default file viewer Is there a way to set ForkLift as the default file viewer, to a degree? PathFinder somehow does this, see http://cocoatech.com/faqs#3, but how does it do this and could that option be set to redirect to ForkLift instead of PathFinder?

Path Finder looks like it's modifying the "NSFileViewer" preference. You can set this manually from Terminal to point to ForkLift (I tried this, and it seems to work):

defaults write -g NSFileViewer -string com.binarynights.ForkLift2

(The -g sets this preference globally for all applications.)

However, be warned that the Path Finder website lists some applications that don't respect this setting, such as the Dock and Firefox.


How to use 2 FullHD monitors to one Type-C port on Macbook Pro 15 2018? I've seen multiple questions were people are told you can't really use one port but it depends on your adapter and how you use it. I have a startech USB-C to 3 HDMI adapter:

And I've been using this adapter for my Dell XPS 13 9630 to connect to 2 external monitors and it works perfectly fine. Doesn't support 3rd monitor of course.

So I connected my Macbook Pro 15 2018 to the same adapter and the two monitors are mirrored. Been looking a bit online and it seems like people say you have to use different ports on the macbook. And I'm really surprised to see that a 3 times cheaper Dell XPS can handle two monitors through one port, but the macbook only sees it as one external monitor.

Ideally I'd want to have 3 FullHD monitors connected to this adapter, but I has to support at least 2 simultaneous monitors.

So does anyone know how do I get them to work through one adapter?

The Startech adapter you've got works as a MST (Multi-Stream Transport) hub. MST is a part of the DisplayPort 1.2 standard, which makes it possible for monitors and computers to support "daisy-chaining".

Daisy-chaining is most often seen where the monitor has both an input and output DisplayPort adapter, allowing you to connect the first monitor to the computer, and the second monitor to the first monitor. If both monitor and computer support MST daisy-chaining the two displays will act as seperate displays, exactly like if they had been plugged in directly to the computer. Note however that the monitors share bandwidth, so you wouldn't be able to have them at the same resolutions and refresh rates as possible when using seperate cables connected to the computer.

The problem for you is that macOS does not support MST daisy-chaining. I believe this is a software limitation and not a hardware limitation. Instead macOS supports daisy-chaining Thunderbolt monitors (such as with the Apple Thunderbolt Monitor).

Therefore it is not possible to get your StarTech adapter working with macOS. Indeed StarTech also lists that it is only compatible with (some) Windows PCs.

However it is certainly possible to connect two Full-HD displays to a single of the Type-C ports on the 2018 MacBook Pro. These ports are really Thunderbolt 3 ports, so you have a lot of options here. You can buy both adapters as well as full-fledged Thundebolt 3 docks that allows connecting multiple displays over DisplayPort/HDMI as well as adding extra USB-A, USB-C, Firewire, Ethernet, Audio, eSATA or other connections as well as SD-card readers, etc. Some of these even supply power to the MacBook Pro so that you can charge your MacBook Pro over the same, single cable.

An example of such a product is the OWC Thunderbolt 3 14-port dock:

https://www.owcdigital.com/products/thunderbolt-3-dock-14-port

They also have other variants such as a 12-ports dock and a dock with FireWire 800.

You can also get similar products from Belkin, Elgato, Caldigit, Iogear, etc. Even StarTech produces one (same make as your adapter):

https://www.amazon.com/StarTech-com-TB3DKM2DP-Thunderbolt-Dock-DisplayPort/dp/B07BJJX47G/ref=as_li_ss_tl?ie=UTF8&linkCode=sl1&tag=reality&linkId=b1418a14da750a87c5d7c2a099401212

That is a $123.99 dock/adapter with 2 DisplayPort, 1 USB-A and 1 ethernet connectors.


App Store keeps showing wrong badge count App Store on my iPhone keeps on showing that there are 3 new updates, but when I click on updates, it shows 0 new updates.

It will update the badge count to 0 new updates as well, but not much later the 3 new updates will appear. See screenshots:

How can I get the correct badge count? It bothers me that the App Store says there are new updates, while there aren't.

iOS 6.1.3 / iPhone 4s

Thanks, bmike, for the theory. It allowed me to find at least one practical solution.

Go into the App Store. Select Purchased → All. Now carefully scroll down the list. You will find one or more apps with a status of Install instead of Open. Go ahead and install them. If you have not upgraded to iOS 7 you may get a message that says that the latest version requires iOS 7, but you may download the latest compatible version. Touch Download and it will install.

These are the updates appearing in the badge count.


iPad books do not show all images I have an iPad2 (brand new) onto which I have loaded books from the app store. Most of these books are showing a blue question make where the images should be. This includes the 'iPad User Guide" from Apple itself.

In the "iPad User Guide," it also shows the following error message:

This page contains the following errors:
error on Line 1 at column 1: Document is empty error on Line 1 at column 1: Encoding error

On some books, double tapping the icon will display the picture but on others it wont. If I attempt to adjust the font size, the app just crashes.

Has anyone come across this? Is there some magic setting I'm missing?

BTW: PDF books work fine.

I just installed the latest update for iBooks and the problem is fixed.


I can't update my iphone 4 from ios 7 to ios 7.1.2 I have been trying to update my iphone 4 from ios 7 to ios 7.1.2 for months but it has never worked. I go into software update in settings, I see that I can update my phone to 1.7.2 so I press download and install. Then comes terms and conditions so I press "I agree". Straight away it starts downloading but it is pretty slow. It keeps on downloading until it is halfway done with the process bar. Right beneath the bar were it stood estimated time remaining it says now "preparing update..." When that happens the update suddenly is super slow. It nearly doesn't go forward. After few minutes of waiting, the update stops and I recieve a message saying "Software update failed. An error occured downloading IOS 7.1.2." I have tried rebooting my phone but that didn't work. It's like something is preventing me from updating my phone but i don't know what it is Can please someone tell me what I am doing wrong

Have you tried doing it using iTunes after connecting the phone to a computer - Mac or a PC? That should work technically.
You should be able to set the phone up as new if everything else fails.

Don't rely on the OTA, especially coz it's the old version of the OS you'll be getting.


How to fix when I can nslookup and dig an internal hostname, but I cannot ping or ssh to the internal machine? I can nslookup and dig an internal hostname, and I get a rapid response, but I cannot ping or ssh to the server.  All external hostnames work fine for both ping, ssh, dig or nslookup.

ssh -vvv xxxx-xxx-xxxx-1.xxx.xxxx.net
OpenSSH_5.6p1, OpenSSL 0.9.8r 8 Feb 2011
debug1: Reading configuration data /Users/gregcain/.ssh/config
debug1: Applying options for *
debug1: Reading configuration data /etc/ssh_config
debug1: Applying options for *
debug1: auto-mux: Trying existing master
debug1: Control socket "/Users/gregcain/.ssh/master-gregc@xxxx-xxx-xxxx-1.xxx.xxxx.net:22" does not exist
debug2: ssh_connect: needpriv 0
ssh: Could not resolve hostname xxxx-xxx-xxxx-1.xxx.xxxx.net: nodename nor servname provided, or not known

I've done a lot of searching on the net, and on this site, and it appears it's got something to do with mDNSresponder.   I've added two stanzas to /System/Library/LaunchDaemons/com.apple.mDNSResponder.plist

-AlwaysAppendSearchDomains <- this shouldn't matter, since I am using FQDN.
-NoMulticastAdvertisements <- I believe this one disable bonjour broadcast

I've also tried turning off mDNSResponder, but then name resolution fails outright.   If I add entries to /etc/hosts, then I get working name resolution.  But I need to be able to connect to DNS.

I'm pretty confident our DNS is setup correctly, as it works for everyone around me.  I've also spun up a linux VM, and I'm able to connect as I would expect, using the same /etc/hosts and /etc/resolv.conf.

Any suggestions would be greatly appreciated.

UPDATE - >
nslookup

set all
Default server: 10.xxx.xxx.xx1
Address: 10.xxx.xxx.xx1#53
Default server: 10.xxx.xxx.xx2
Address: 10.xxx.xxx.xx2#53

Set options:
  novc          nodebug     nod2
  search                recurse
  timeout = 0       retry = 3   port = 53
  querytype = A         class = IN
  srchlist = corp.amdocs.com

Starting from Lion (except Yosemite between 10.10 and 10.10.3), the command for flushing the DNS cache is:

$ sudo killall -HUP mDNSResponder

There is a solution at https://superuser.com/questions/326848/strange-ns-behavior-on-os-x-cant-connect-to-ssh-server.


Muting system volume upon logout using launch agent I'm attempting to create a script for muting the system volume which gets triggered upon logging out or shutting down. This is to avoid hearing the startup chime really loudly the next time I start the machine.

Using the instructions provided in this post, I have created a RunAtLoad launch agent that calls the script shown below:

#!/usr/bin/env bash

set -o errexit
set -o nounset
set -o pipefail

IFS=$'\n\t'

onLogout ()
{
    osascript -e "set volume output volume 0"
    exit
}

trap onLogout SIGINT SIGHUP SIGTERM

while true; do
    say starting
    sleep 86400 &
    wait $!
done

The idea being that the script is called and made to sleep until it receives one of the trapped signals, at which point the onLogout function is called in order to mute the volume.

Currently it's not working as intended, the volume remains unchanged when I log out and log back in. However, I've found that if I manually unload the launch agent that launches the script (using a launchctl unload call), then it works perfectly. The system volume is muted immediately.

Initially I thought perhaps the trapped signals weren't being received by the script when I performed a logout. But after adding some debugging code to the onLogout function as shown below, I have eliminated this as a possible cause.

onLogout ()
{
    printf "Before mute\n" >> ~/Desktop/log.txt
    osascript -e "set volume output volume 0"
    printf "After mute\n" >> ~/Desktop/log.txt
    exit
}

When I performed a logout, and logged back in, there was a "log.txt" file on the desktop with both of the Before mute and After mute debugging lines present.

And I don't believe the reason is that the osascript call for performing the muting is somehow failing when a logout is carried out. Due to the set -o errexit line in the script, if any part of the script fails, then it should halt execution and exit immediately. This means that if the muting operation is failing, I shouldn't be seeing the After muting line in my log file. Indeed, when I tested this by replacing the osascript line with something I knew was guaranteed to fail, the log contained only the Before muting line as expected.

I'm at a loss to explain what's going on. Clearly the onLogout function is being called correctly as explained above, but for some reason the osascript call seems to only run when I manually unload using launchctl. When I log out manually it just skips over it somehow.

Any help would be greatly appreciated.

In Terminal, execute the following command to disable the chime completely until reenabled:

sudo nvram SystemAudioVolume=%80

If this setting is not retained, try:

sudo nvram SystemAudioVolume=%01

sudo nvram SystemAudioVolume=%00

or

sudo nvram SystemAudioVolume="  "

To reenable the chime:

sudo nvram -d SystemAudioVolume

Info gleaned from:

https://business.tutsplus.com/tutorials/how-to-silence-the-startup-chime-on-a-mac--cms-21212

https://www.howtogeek.com/260693/how-to-disable-the-boot-sound-or-startup-chime-on-a-mac/


The Java JAR file ... could not be launched I'm trying to download the file http://algs4.cs.princeton.edu/code/algs4.jar and launch it with Jar Launcher (the default application). However, I'm getting this:

Following https://discussions.apple.com/thread/4827576?tstart=0, I've also tried to use Archive Utility; this appears to create an algs4.jar.cpgz file but I'm not sure what to do with it. How can I open the JAR file?

Even though the error message says to check the Console I couldn't find anything useful there. However if you try to run the JAR file from the Terminal you get this error:

no main manifest attribute, in ./algs4.jar

This error means that the JAR file is missing the "Main-Class" parameter in its MANIFEST.MF file. The Main-Class parameter tells the Java runtime which class is the Entry Point, i.e. which class to run first when launching.

You can add this parameter using the Terminal. First of all download the JAR file from the Princeton website, then run the following command (assuming the JAR file is in your Downloads folder):

jar ufe ~/Downloads/algs4.jar TestAlgs4

This command updates the MANIFEST.MF file within the JAR. Once that is done the JAR file should run from the Finder or the Terminal successfully.

Having said all that, you only get the error if you try to run the JAR like an executable. I don't think you're meant to do that. You are meant to just place the JAR file somewhere the Java runtime can find it, and then refer to it in the code you write as you do the exercises in this book. There are clear instructions here on what you are supposed to do with the JAR file here: https://algs4.cs.princeton.edu/code/


Are my safari and chrome passwords synced? I like to use safari for light browsing (and to prolong battery life).Sometimes I switch to chrome , when I need to(syncing stuff to android,etc).

I would like to know if my passwords(maybe even bookmarks) are getting synced or not.

I am using yosemite 10.10.4 .

If its not being synced out of the box, is there any software that does the syncing ?

No - the browsers can try and grab a one time dump of settings, but you'll need a third party tool to either store/inject the password from a unified database or sync the results.

Best suggestion I have is to invest in 1Password, which syncs thru multiple methods and has extensions for Safari, Chrome and Firefox.

The data also syncs to iOS devices Manual import of various settings when you open a browser repeatedly is a pain.


Tried installing Windows 10 on MacBook Pro from a USB...failed I attempted to install Windows 10 Home on my son's MacBook per the instructions and assurances of others as to how simple this would be. I apologize but apparently I am a moron because not only did it not install whatsoever but now I have a single line on the screen saying "no bootable device--insert boot disk and press any key". I have no idea how to simply get back to a functioning status. Any suggestions?

Try to install Windows 10 via an empty DVD by burning the ISO to it through disk utility. I used a DVD-R with 4.7GB of space on it and after the Mac restarts when BCA finishes it should boot into the Windows installer.

If the problem persists just restart the Mac again and hold Option as soon as it starts and you should see a boot menu it should show either EFI boot or Windows whether your Mac supports EFI boot.


Macbook pro will not connect to wifi? I have a Macbook pro late 2011. It has always been connected to the same wifi and never had any problems. I updated to Yosemite and now my wifi goes off all the time. Most of the time when I the in the password for the wifi it simply says invalid password. It is the correct password.

I have followed lots of articles about this problem with Yosemite and tried all the suggested trouble shooting tips I can find. I even phoneed up Apple care and they just went through the same trouble shooting techniques which sometimes works by chance and then the wifi disconnects again.

On my MacBook Pro I sometimes had similar difficulties. It always turned out that the cause were weak signals or interferences. Please try the following measures:

Move your Mac closer to the WiFi Router / Airport. Alternatively place your router in a better spot (e.g. elevated).
Change our Wifi from the 2.4 GHz to the 5 GHz band (If you provide more info on your router, I might be able to give more info on how to do that)
Try to look for other devices that could cause interferences like TVs, bluetooth devices, microwaves.
If you have to use the 2.4 GHz band, try switching to a different channel. See what channel the WiFis around are using and choose a channel number that is farthest away from the others. Ideally select channel 1, 6, or 11.

You can analyse your WiFi environment pressing alt and your WiFi icon in the MenuBar. You will get some info like this. If you hover the mouse over other network names you also get information about those.

This article, for example, has more info on the issue.


How can I watching TV shows and movies from Hulu or Netflix while being offline on my iPad or Nexus? I'm a paid subscriber of both Hulu and Netflix and I'm a commuter that uses public transportation (i.e. subway), unfortunately lack of internet connectivity prevents me from using these services (Hulu/Netflix), so I'm looking for easy way to view Hulu and/or Netflix offline (w/out internet connectivity).

disclaimer: I am NOT trying to do anything illegal, I just want to be able to enjoy Hulu & Netflix by storing the content on either a Nexus 7 (preferably) or iPad mini.

How can I do it?

Netflix just released an iOS app that allows downloading of some content. Not all content is licensed for any country and some countries have no licensed content. As the licensing gets unified - expect more of this in the future.

Before the recent change, for a long time, both the netflix and hulu terms of service state that these are streaming services and not download services.

Netflix is at https://signup.netflix.com/TermsOfUse

Scroll down to Limitations on Use

  You may not download (other than through page caching necessary for
  personal use, or as otherwise expressly permitted by these Terms of
  Use), modify, copy, distribute, transmit, display, perform, reproduce,
  duplicate, publish, license, create derivative works from, or offer
  for sale any information contained on, or obtained from or through,
  the Netflix service, without our express written consent.

Hulu is at http://www.hulu.com/terms and it has a list of things that are not allowed. Including in the prohibition of:

  removing, disabling, bypassing, or circumventing any content
  protection or access control mechanisms intended to prevent the
  unauthorized download, stream capture, linking, framing, reproduction,
  access to, or distribution of the Hulu Services.

Whether these agreements are legal or violating them is illegal is something for the local courts, but it's clear you should not expect to use these services to download or time-shift the content. At the moment, your iPad can rent or buy content for offline viewing and Amazon also has a decent selection of downloadable content.

Additionally, you can usually rip CD/DVD you own with software like RipIt for offline viewing. Most Mac these days ship without optical drives, so you can still rip using either Remote Disc or using external USB drives.


Macbook Pro HD/SSD Dock mount drives as read/write Ok, so just bought myself a dock so I can wipe some drives and use others as storage. Most of these drives originated from windows Machines and thus are formatted NTFS and not FAT/FAT32

Currently I can dock the drives with little to no issue what so ever. However the one issue I do have is the fact that these drives are mounting as read only. I can take the files off of the drives I think, if I need to.

Now I guess my question would these be read only because they are NTFS formatted drives, or is there another reason? If there is other reason, is there any means I can get around read only attributes. Or am I going to have to format the drives somehow? How would I format them to a useable medium if they are read only?

Natively, Mac OS X cannot write to NTFS formatted volumes.  There are downloads like NTFS-3G which can enable you to read/write to NTFS partitions, but I've had mixed success with them.

If you want to format the drive so you can perform read/write operations and want to boot from it, please follow this link.  The format you want drives in is HFS+ (Mac OS X Extended Journaled).


Bluetooth connection issues with LG Soundbar and Macbook Pro or iPhone I picked up an LG soundbar a few months back, largely as it allowed me to stream audio using bluetooth which seemed a great idea for streaming from either my MacBook or my iPhone. Since i've had the soundbar i've had issues with this feature though. The streaming is flaky at best, at times it will stream for hours but other times it will drop out endlessly. No matter what dropout I get the device remains paired according to both my MacBook Pro (Mid 2010) and the LG Soundbar. I tend to be streaming using Spotify but i've had the same issues with iPlayer and iTunes also.

The symptoms are though that the audio simply stops being outputted by the device whilst it continues to play. Sometimes this is a short dropout (less than a second to a few seconds) and other times it stops for good (although remaining paired). Using my iPhone this seems to happen a little less but it still happens. I talked to LG support who were adamant that there was no issue and that the streaming should be fine. They told me to make sure that I was using the correct Bluetooth profile however which should be A2DP. From what I can tell this is supported by Mac's but I wasn't able to work out if this is what I'm actually using let alone how to switch to it if I'm not.

The closest I've got to anyone talking about similar issues is with regard to audio quality over bluetooth from a Mac that can be resolved by adjusting the quality with this command:

defaults write com.apple.BluetoothAudioAgent "Apple Bitpool Min (editable)" 40

I've tried this and this hasn't improved anything. Heard rumors it could be related to Wi-Fi interference too but nothing solid on this either. Running out of ideas, anyone else have any?

I have a samsung soundbar, and an Onkyo, I use bluetooth pairing from my macbook, and motorola phone- exact same issue on both sound bars. Apparently bluetooth pairing just blows. I think it might be interference from the multiple devices in the same area using bluetooth.  (PS4 uses it for the controls, Samsung smart tv uses it for the remote). It definitely is not the macbook, as the problem happens from my smartphone, and I am a support tech for apple, and know how to troubleshoot the mac.


Partitioning Software Is there an equivalent on the Mac platform to Partition Magic or GParted that will allow me to resize, move, and/or change partitions on the fly without formatting, or disturbing the data that is already on the disk?

iPartition (only ≤ OS X 10.13)
iPartition is now legacy. The company, Coriolis, finally closed in 2019. There is still a (now essentially freeware/donationware) version of iPartition available for download, but only good to OS X 10.13 for pre CoreStorage disks.
It allows you to move and resize partitions without deleting any data. It also works for Boot Camp volumes and other PC disks.

With iPartition, resizing a partition is as simple as selecting it, grabbing the resize handle and dragging. Not only that, but if you have several operations to perform, iPartition lets you queue them up and run them one after another, so you can have a cup of coffee while iPartition works. This feature, coupled with iPartition’s ability to automatically rearrange your existing partitions when necessary, makes iPartition the easiest partitioning tool that you’ll ever use.


How to cleanup HDD after installing a new OS X version using TimeMachine? A very nice feature of TimeMachine is the possibility to configure a new Mac automatically. Nevertheless, when you switch from OS 10.6 to OS 10.8 using TimeMachine during installation, there are a lot of files that are not needed anymore in 10.8. Unfortunately, the setup does not recognize this and I have to remove them manually. Is there a possibility to remove all system files that are only needed for < 10.8 automatically?

I'm pretty sure there is no such thing. But you do have a couple of options.

Get another totally clean installation of 10.8 and diff your whole filesystem. Then decide upon each "extra" file if it needed by you or your applications.
The "easy" option. Do a clean 10.8 installation and then restore from time machine into a folder on your desktop (f.ex.). Then manually copy over the files and stuff you want to keep


Create multiple jobs in same terminal Basically I have two jobs:

Compiling a code
Download a youtube video with using youtube-dl command

Both of the above commands use the terminal. I want to execute both of these commands in the same shell. I don't want to use another terminal, nor do I want to use another tab. I read something there is a command fg to do that stuff but don't know how to use it. Suppose I have started downloading video using youtube-dl. How can I hide that process and compile codes. And once I am done compiling I switch over to see how much the video has downloaded and vice-versa.

You can use screen. This allows you to set up new screens in your shell which you can switch between.

Quick reference guide:

ctrl-C creates a new screen
ctrl-N switches screens
ctrl-D ends screen


app store purchases disappeared So before about three years ago i had downloaded the apps; classic angry birds,tiny wings, and the full fruitninja using my app store account. But now ever since i bought a ipad mini, it doesnt show these record of purchased apps or even display these apps in the appstore when i type up their names.

Is there a way to work around this and restore my purchases and keep these paid apps?

Purchases as default never disappear. If you can't open via App Store I suggest opening safari and search for "Angry Birds iTunes" or any other relevant app. When you open the page from safari, the iTunes App will open by default and you will be able to download the app.


iPhone Gmail App won't stop sending notifications I tested out the Gmail App on my iPhone 4 (iOS 5.1.1) and have now stopped as it keeps asking me for my login details. I haven't deleted it.

It is continuing to send notifications even though I have switched them off for the app in the Notification Center Settings.

How can I stop the notifications?

I don't want to delete the app.

The Notification settings aren't laid out very well. To fully disable notifications, you need to change pretty much all the settings on an app's notifications page in Settings.
Make sure you have turned off every switch circled here, and change Alert Style to None:


How to change the url of a Chrome app shortcut? I have 2 Google accounts (personal/work). If I go to the Google Calendar site, on the work account, in Chrome, I can go to ... / More tools / Create shortcut..., which will create a Google Calendar.app file.

I can then add it to the dock - but, this goes to the wrong account :(

If I do Show Package Contents I can open the Info.plist file, and I see the url inside:

    <key>CrAppModeShortcutURL</key>
    <string>https://calendar.google.com/calendar/r</string>

Now if I change the url to https://calendar.google.com/calendar/b/1/r (which is the correct way to choose a specific Google account), I would expect it to work.  But in fact that doesn't change anything.

But actually, even if I put any random website here, it will still go to Google Calendar so basically I think this has no effect at all, which is surprising.

Ideas?

I also had this issue (trying to create an app shortcut to the second Google Calendar account) and solved it by creating a web app manifest before creating the app shortcut:

Copy the JavaScript below
On the Google Calendar page, open the Chrome Devtools (right click anywhere on the page and select "Inspect")
Go to the Console tab and paste the copied JavaScript
Modify the URL if necessary to whatever URL you are trying to create an app for
Hit return to run the JavaScript

const startUrl = 'https://calendar.google.com/calendar/u/1/r';
document.head
  .querySelector(':first-child')
  .insertAdjacentHTML(
    'beforebegin',
    `<link rel="manifest" href='data:application/manifest+json,{"start_url":"${startUrl}"}' />`,
  );

This will add a Web App Manifest for this website which will be used when creating the app.
Once you have done this, you can create the desktop app as normal:

Click on the three dots menu > More Tools > Create Shortcut
Check "Open as window" and select "Create"

Now you should have a separate desktop app for your second calendar account!
Source: https://github.com/karlhorky/pwa-tricks#change-starting-url-of-pwa-in-chrome

Alternative: Editing an Existing Manifest
If you're trying to add a different PWA than Google Calendar where the page either specifies a manifest already or sets the Content Security Policy directive manifest-src, then the above solution may not work, potentially also returning an error such as:
Refused to load manifest from 'data:application/manifest+json,...' because it violates the following Content Security Policy directive: "manifest-src 'self'".

To get around this, you can use Chrome Local Overrides to modify the start_url in the Web App Manifest:

On the page of the application, open the Chrome DevTools (right click anywhere on the page and select "Inspect")
Locate and expand the <head> element and find the link element with rel="manifest". Note the file path in href.

Open the Sources tab in the DevTools. If you have not used overrides before, you will need to set them up:

Switch to the Overrides 2nd-level tab (you may need to find it in the » menu)
If you Create a new folder in your projects or Documents folder called chrome-overrides
Click on ＋ Select folder for overrides and select the folder you created

Confirm any prompts at the top of the browser asking for access to the folder

Refresh the page to make sure all sources load. Locate the web app manifest corresponding to the file path you noted earlier. Right click and select Save for overrides:

Now the web app manifest is editable! Make your changes to start_url or anything else that you need, save the file and reload the page
The updated web app manifest has now been loaded, and you can install or create a shortcut to the PWA as normal

Source: https://github.com/karlhorky/pwa-tricks#solution-2-edit-an-existing-web-app-manifest


Connecting dual 27" Apple thunderbolt displays to PC I have two of the Apple 27" thunderbolt displays, and a Dell M3800 laptop running Windows 7. The laptop has a thunderbolt port, and can run one of the Apple displays just fine. When I daisy chain another Apple display, the display on the far end of the chain works, but the one on the near end of the chain goes dark.

Is there any way to connect two of these displays to this computer?

Note: The ports on both displays, and the PC are thunderbolt, not displayport.

The Thunderbolt Display does not support daisy-chaining Mini-DisplayPort.

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

I did see a report somewhere that computers that can drive two monitors over were able to get around this be inserting another Thunderbolt peripheral in the middle. I.e., Mac > Thunderbolt Display > Thunderbolt RAID > Mini DisplayPort monitor.


Where is USB -stick automounted in OSX? Not /media/usb/something like in Ubuntu Ubuntu automounts USB -fs to /media/usb/something. How is this in OSX? I cannot find anything in /media below.

All volumes (CDs, USB, harddrives, etc) are mounted into /Volumes.

After inserting a USB stick called USB I see the following:

alex@smiley:/Volumes|⇒  ls -lrt
total 8
drwxrwxr-t  30 alex  staff  1088 Aug  4 14:34 USB
drwx------   1 root  wheel   568 Aug  4 23:59 Family Backup
drwxr-xr-x   6 root  wheel   340 Aug  5 00:00 Time Machine Backups
lrwxr-xr-x   1 root  admin     1 Nov 14 20:55 System -> /
drwxr-xr-x  39 root  wheel  1394 Nov 14 20:57 SmileyBackup

In addition there you can see that my main drive is System. OS X creates a link to / for it automatically.

Also, Smiley Backup is another disk, and Time Machine Backups is a TimeMachine volume, and Family Backup is a remote shared drive I've mounted from another system.


How to enable/disable Do Not Disturb from shell on Mavericks? I would like to toggle the Do Not Disturb in the notification center with a keyboard shortcut.

I am using BetterTouchTool for some extra keyboard shortcuts but it does not support enabling/disabling the notifications in the default options.

It has an option for executing a terminal command so I'm asking here how to enable/disable Do Not Disturb from the terminal?

I found Schedule ‘Do Not Disturb’ In OS X Mountain Lion With Automator and I tried to run the commands but it didn't seem to work.

You can simplify the answer that razvanz provided by using the -currentHost argument to the defaults command.

Enable Do Not Disturb:

defaults -currentHost write ~/Library/Preferences/ByHost/com.apple.notificationcenterui doNotDisturb -boolean true
defaults -currentHost write ~/Library/Preferences/ByHost/com.apple.notificationcenterui doNotDisturbDate -date "`date -u +\"%Y-%m-%d %H:%M:%S +0000\"`"
killall NotificationCenter

(via https://heyfocus.com/blog/enabling-do-not-disturb-mode/)

Disable Do Not Disturb:

defaults -currentHost write ~/Library/Preferences/ByHost/com.apple.notificationcenterui doNotDisturb -boolean false
killall NotificationCenter

Now you could easily wrap this up as a script to enable or disable "Do Not Disturb" as a script that would work on anybody's machine regardless of system preferences. Here is an example of how to do that:

#!/bin/bash

set -eou pipefail

# From https://heyfocus.com/enabling-do-not-disturb-mode and
# https://apple.stackexchange.com/questions/145487

if [[ $(defaults -currentHost read ~/Library/Preferences/ByHost/com.apple.notificationcenterui doNotDisturb) -eq 0 ]]; then
  defaults -currentHost write ~/Library/Preferences/ByHost/com.apple.notificationcenterui doNotDisturb -boolean true
  defaults -currentHost write ~/Library/Preferences/ByHost/com.apple.notificationcenterui doNotDisturbDate -date "`date -u +\"%Y-%m-%d %H:%M:%S +000\"`"
  killall NotificationCenter
  echo "Do Not Disturb is enabled. Run $0 to turn it off (OS X will turn it off automatically tomorrow)."
else
  defaults -currentHost write ~/Library/Preferences/ByHost/com.apple.notificationcenterui doNotDisturb -boolean false
  killall NotificationCenter
  echo "Do Not Disturb is disabled. Run $0 to turn it on again."
fi

Source: https://gist.github.com/ryangreenberg/5267f68a8e7b07ea66370b4eb5580ab9