An iTunes Applescript that appends to tag only when it doesn't match part of the tag string? I'm trying to find a way to add a keyword or group of words/tags/strings to a set of selected iTunes tracks if they haven't been added. A use-case would be to add extra metadata in a comment such as (live) or (remix).

If some tracks previously contained (live) while appending, then it would not append it- only the non-matched files. So a comment tag containing (remix)(fast)(accordion)(random) would become (remix)(fast)(accordion)(random)(live) afterwards. However, if reapplied, it would skip this track.

The closest thing I can find is Smart Append, but its for Windows only (being JavaScript).

The well known Doug has an append to tag script, but it doesn't have any detection capabilities. I peeked into the code (by right click > Show Package Contents) and can't seem to wrap my head around editing the script.

Anyone know of an existing script or a way to modify the existing script?

This script works if the keyword is between parentheses as in your example, otherwise partial match will be a problem. Example : "fast" match "faster"

property matchCase : true -- or false -- change according to your needs

set myTitle to "Append to Comments Tag, if the keyword not exists"
set keywordSeparator to ";" -- keyword separator

tell application "iTunes"
    set sel to selection
    if sel is not {} then -- if tracks are selected...
        set s to "s"
        set x to (length of sel)
        if x is 1 then set s to ""
        set be to (display dialog "Enter keyword to append to the beginning or ending of each selected track's Comments tag:" & return & return & " If more than one keyword, use this character " & keywordSeparator & " as separator." default answer "" buttons {"Cancel", "Beginning", "Ending"} cancel button 1 with title myTitle)
        set appendage to text returned of be
        set buttonOpt to button returned of be is equal to "Ending"
        if appendage is "" then return
        set listOfAppendage to my makeListOfKeywords(keywordSeparator, appendage)
        set oldfi to fixed indexing
        set fixed indexing to true
        repeat with t from 1 to x
            tell contents of item t of sel
                try
                    set tresult to my checkExistKeywords(comment, listOfAppendage, buttonOpt)
                    if tresult is not false then set comment to tresult
                end try
            end tell
        end repeat
        set fixed indexing to oldfi
        activate
        display dialog "Done!" buttons {"OK"} default button 1 with icon 1 with title myTitle giving up after 4
    else
        activate
        display dialog "You must select some tracks first." buttons {"Cancel"} default button 1 with title myTitle
    end if
end tell

on checkExistKeywords(tagValue, tKeywords, tOpt)
    set isAdding to false
    repeat with tKey in tKeywords
        if matchCase then
            considering case
                contents of tKey is not in tagValue
            end considering
        else --Ignore Case
            contents of tKey is not in tagValue
        end if
        if the result then -- no match
            set isAdding to true
            if tOpt then
                set tagValue to tagValue & tKey
            else
                set tagValue to tKey & tagValue
            end if
        end if
    end repeat
    if isAdding then return tagValue
    return false -- nothing to add
end checkExistKeywords

on makeListOfKeywords(tofind, t)
    set ditd to text item delimiters
    set text item delimiters to tofind
    set t to text items of t
    set text item delimiters to ditd
    return t
end makeListOfKeywords


Will the iPad now come with EarPods? Since Apple recently announced the new EarPods to go along with the iPhone 5, I've wanted a pair.

The only thing is I'm planning on buying an iPad in a few months, and if the iPad comes with EarPods I'm fine with a wait - it's not urgent.

So, will the iPad come with EarPods?

The New iPad currently being sold on the Apple Store doesn't come with headphones of any kind, according to their site:

So it seems unlikely that they'll start shipping them with EarPods, especially since the EarPods are already on sale.

That said, there's no way to answer this question aside from pure conjecture. Perhaps a future model of the iPad will ship with the EarPods.


Search inside documents with spotlight For years I had used spotlight to search inside of plain text files and other documents. As of late, Spotlight no longer searches inside documents it appears to only search their titles. Is there any easy fix to this? I'm running mojave (10.14)

An easy fix is to use EasyFind to look for and inside files.  Easyfind is quick and versatile. You can select the type of files to look in if you want or just scan them all. Not as quick as Spotlight but more settings to control where you look. The app is free.


IMAP emails disappearing from Apple mail on one computer when moved on another! I have an IMAP email account active on both my home and work computers (both Macs). The problem I am having is that when the emails are downloaded onto both computers from the server, if I delete an email or move it to a folder, on one Mac, it then disappears completely from the Inbox on the other one! The two computers are not linked in any way, and the email account is set up exactly the same on both computers using the same username and password. I can’t see any setting that gives an indication that it will delete an email if it is moved from the Inbox of another computer.  Also, other colleagues who have the same email account set up on their computers, don’t lose any emails from their Inboxes when I move them from mine. They, however, are using Windows PCs not Macs.  Any thoughts or help would be much appreciated. Thanks!

I'm sorry but you're getting it wrong. This is the expected behavior of IMAP. IMAP is to keep all devices synced with the server. That means, if you delete an email on one computer, it eventually disappears from all the others. If you mark something as read on one computer, it eventually gets marked as read on all of the others. I hope this clears things up.


AppleScript 'choose from list' - I'm having trouble with Multiple Selections I have a series of AppleScripts which are saved as apps. For simplicity sake let's say the apps are literally named App1, App2, and App3.
I've made a simple list that asks the user to make a selection, then opens that app. It works fine for single selections…

choose from list {¬
    "App1", ¬
    "App2", ¬
    "App3"} ¬
    with prompt "What would you like to do?" with multiple selections allowed and empty selection allowed

if not result is equal to false then activate application (result as string)

But I also need to be able to select multiple apps at the same time and launch them all together (or sequentially).

Currently, if I pick App1 and App3 I get a Choose Application dialog saying "Where is App1App3?" which obviously doesn't exist.

How can I change the code so that it sees the selections as separate apps and launches them correctly?

At the point where you are having a problem, result is a list. Try looping through the items in the list.

set answer to choose from list {¬
    "App1", ¬
    "App2", ¬
    "App3"} ¬
    with prompt "What would you like to do?" with multiple selections allowed and empty selection allowed
if answer is not false then
    repeat with appitem in answer
        activate application appitem
    end repeat
end if


iPad battery calibration? I bought an old iPad 4 mini which was somewhere in desk with empty battery for last who-know-how-many years. The result is battery in a bad shape obviously, iPad works great but shuts down when battery shows about 45% left. No big deal, I can live with that, considering how difficult it is to replace. But, I'd expect it to recalibrate after some time, that iPadOS will notice and change its 0%-100% range to match lower capacity of the old battery but that didn't happen. After months of usage, it still behaves the same way. Is there any way how to force the recalibration?

As resolved in comments:

Try calibrating the battery by fully charging to 100%, and then draining it to when it crashes. From personal experience, letting it die out slowly overnight is better than sudden crashes due to increased demand while using.  Some users report doing the charge-discharge cycle twice. https://apple.stackexchange.com/a/15568/313842
If battery is still out of order, do a hard reset. This is an advice on several blogs I saw, and now this answer is one of them.

  Press and hold the restart button combination. If the iPhone can't be shut down normally, simultaneously press and hold the right button combination for your iPhone:

  iPhone 6S and earlier, iPad, and iPod Touch: Power button + home button
  iPhone 7 and 7 Plus: Power button + volume-down button
  iPhone 8, 8+, and X: Volume up, then volume down, then power button

  ... Continue holding the buttons. Do so for 10 seconds until you see the startup Apple logo on your screen, then release the buttons.

https://www.wikihow.com/Hard-Reset-an-iPhone

Adding some advice: keep iPhone plugged in, or at least on higher charge levels. Same reason for which Apple advices the same while upgrading iOS


Paint.NET alternative for Mac OS X I would be extremely grateful to anyone pointing me in the direction of the Mac OS X analogue for the free Windows image-editing software Paint.NET.

Basically the way I use it is I take lots of screenshots for work, then put arrows in there, some ovals and text - it's all for documentation purposes - mainly for Confluence.

The feature I can't live without is the arrows - they have points where you can easily curve them creating a very good visual e.g. for tutorials.

And of course it's great that you can do all of that in a lightweight app, couple of clicks manner.

You can use builtin Preview.app for adding arrows, shapes, text, magnifying glass etc. It's not as lightweight as Skitch mentioned by @jherran, but does the job You need.


How can I AirDrop my photos and videos from my iPhone5 to my MacBook Pro Retina? iPhone 5 is running iOS7.
Macbook Pro is the 15" MacBook Pro Retina on Mavericks.

I have AirDrop enabled on both but the phone and Macbook don't see each other. Both keep searching, searching, searching ...

FYI, I have enabled Bluetooth and WiFi on both devices are also on the same WiFi network. There is also no firewall between them and they are within 2 feet of each other.

Apple tech is supposed to "just work" and it almost always does so intuitively but this one has me scratching my head. What is going on here?

With iOS 8 and OS X 10.10 Yosemite, you can share files over AirDrop between Mac and iOS.

With Mavericks and earlier, and iOS 7, this is not possible. AirDrop on iOS only works with "other nearby iOS 7 devices", and AirDrop on OS X only works "between supported Wi-Fi-enabled Macs" and they must "click the AirDrop icon on their computers".

iOS: Using AirDrop details the inability to share cross-platform:

  AirDrop for iOS supports only iOS 7 devices. You cannot use AirDrop on iOS to share with OS X, and OS X users can't use AirDrop to share with iOS devices.

AirDrop on OS X is detailed in OS X: Can I use AirDrop with my computer? and OS X Mountain Lion: Share your files with others near you (emphasis mine):

  AirDrop is one of the great new features of OS X Lion and later, which provides a really easy way to share files between supported Wi-Fi-enabled Macs without having to connect through the local Wi-Fi network.

  To see other people nearby, click the AirDrop icon in the sidebar of a Finder window. The other people must also click the AirDrop icon on their computers.

AirDrop on iOS is detailed in iOS: Using AirDrop (emphasis mine):

  AirDrop lets you share photos, videos, websites, locations, and more with other nearby iOS 7 devices.


Screen annotation software to draw on any app in OSX I want to draw on any app pdfs, videos, code. It would be helpful to aid in demonstration in a class setting for me. Do you know if any such app exists that does not require an external pen i.e. using mouse or trackpad to draw.

Check out Snappy App - it allows you to grab any part of your screen and float it above the screen - then you can draw on it, change its transparency, shrink it down, whatever. There's a free version which does more or less all you'd want and the in-app purchases are very cheap (you need an in-app to draw on things).
I've also just recently been introduced to https://presentify.compzets.com/ which takes a different approach but might also meet the requirements.


Software to increase my volume on iPod nano 6th gen? I have an iPod Nano 6th Generation and it had been working perfectly fine, but one day suddenly my up volume button got stuck. That button can't be pressed as it has gone down completely. I searched a lot and it seems to be a common problem that the buttons stuck and also I got a useful link here but I do not want to open up my ipod on my own.

Is there some way through software by which I can increase my volume?  I tried restoring my ipod but even that does not increase my volume to the full. I just want a software solution through which I can increase my volume up to the full. At the moment my volume is at mute so can anyone please help me.

I don't know of any software that can change the volume but you could use Apple Earphones with Remote to change the volume even though the buttons don't work.

http://store.apple.com/us/product/MB770G/B

I also found this, a remote that can be used with any headphones:

iLuv Universal Headphone Remote For iPod


Should I be worried about a case-sensitive data volume? I've got a late-2014 27-inch Retina iMac with a 3TB fusion drive. It's at my workplace, which I haven't been to in over a year as I write this in mid-2021. For various reasons, the machine needed the disk to be reformatted and have macOS reinstalled, which was done in person by a very helpful IT person at work. It is currently at macOS Big Sur 11.3.1.
However, for reasons that are opaque to me, the IT person seems to have formatted the main system data volume (MacHD - Data, which is mounted as /System/Volumes/Data) as Case-Sensitive APFS. This is certainly not the default, although it hasn't given me any issues that I know about. (Indeed, I only realised it because I ran homebrew's brew doctor command which informed me.)
So:

Should I be worried?
Is there anything I can do about it short of wiping the disk and reformatting yet again (which I am loathe to do for obvious reasons).

Update: I have discovered that at least one piece of software that I occasionally use does not work: Microsoft’s OneDrive — I can’t put the synced folder on a case-sensitive volume. (I don’t particularly like OneDrive, but I occasionally need it for work — and the application proper is easier to use than the web interface.)

An example of a typical problem is Adobe's Creative Suite/Cloud software, which famously does not work on case-sensitive volumes.
Other than errors arising from /Path/To/File being different from /path/to/file, there is no inherent danger in using a case-sensitive format.
I'd be more concerned about a 7-year-old hard drive in that Fusion drive!


What is /dev/cu.Bluetooth-Incoming-Port and /dev/cu.iPhone-WirelessiAP So I was flashing my ESP8266 using Arduino and when selecting  the port for flashing I saw this:

I don't know what the red highlighted ports mean? What are they? And what happens if I flash them?

They are virtual serial ports matching paired/connected Bluetooth devices. For example "iPhone-WireeiAP" refers to tethering your computer to your iPhone to use its internet connection from your Mac. This can be implemented via a virtual serial port served over Bluetooth - however, it is obviously not done from your Arduino flashing tool.

The menu just lists any serial port found on your system - it does not indicate that they can be flashed. For example you cannot flash your iPhone this way.

If you try and flash them anyways, most probably nothing will happen at all. You will risk that while flashing you're sending something that the remove device (could be anything really) interprets as a correct command. Then you could risk for example altering settings on the device, or any other type of facility offered through the virtual serial port. Most likely everything will just be rejected as invalid commands though.


Can't find all features of iCloud Photo Sharing with non-Apple devices It appears that the full complement of features of sharing a photo album with iCloud photo sharing is only open to fellow Apple devices.

For example, only Apple devices can subscribe to the album and then comment, like and add photos/videos (depending on my permission selection). However, If I want to share the album with non Apple devices, then I have to send them a link and they can click on the link and see the photos and videos but they do not have the option of adding photos or videos or liking or commenting.

Is this correct?

This is correct. Apple did not reimplement all features of the iCloud protocol in its Web interface. You can install Google photos on your Mac or iOs devices, if you like, but it has also its problems.


MacBookPro trackpad is on crack! It's as if an alien entity has commandeered the trackpad, and it highlights things when it has not been asked to do so; the mouse jumps erratically all over the place, AND opens up random windows unbidden. In this state it's nearly impossible to write anything on the computer in this condition.
Guidance, anyone?
MacBook Pro
Mac OSX 10.6.8
TenQ

I was having the same problem with on my Retina. Rebooting and SMC reset didn't help.

Surprisingly I was able to fix it by pressing down hard in each upper corner as recommended in this Apple Communities thread. According to it the problem is due to pressure on the trackpad and pressing down resets/releases that somehow.


How do I get Google Notifier (Mac) to report the number of new messages in Priority Inbox? I'm using Google Notifier for Mac 1.10.6.879 and I want it to report the number of new messages in Priority Inbox. Previously, I had Notifier report the number of unread messages that had a certain label assigned to it (it was a quasi-Priority Inbox). I set up the notifier by going into terminal and typing:

defaults write com.google.GmailNotifier Label -string "LABEL"

When I substitute out LABEL for Priority Inbox, it doesn't provide an accurate unread count:

defaults write com.google.GmailNotifier Label -string "Priority Inbox"

Doesn't it make complete sense that Google Notifier and Priority Inbox should work together?!

I think that the label GMail uses for the Priority Inbox is "Important". Have you tried using that?


Second password for SSH-only access TL;DR: I want to have a simple password to unlock my computer with physical access and a complex password to connect over ssh. This, using the same account.

I'm looking for a solution to manage access to my computer. For someone who has physical access to my computer (like myself and a couple of my friends who will use it every once in a while), I would like to have simple and short password that keeps complete strangers out. However, I would like to have another complex password for the SSH server, because the SSH server will be available from the public internet from time to time and having a simple password would be to much of a security risk.

I have looked into passwordless authentication using ssh keys, but that's not what I'm looking for, because I want to be able to ssh into my computer from any device. (And as far as I understand, my computer should have a list of trusted ssh-keys.)

So ideally, I want to have a simple password to unlock my computer with physical access and a complex password to connect over ssh.

I think the real solution is to create a non-admin account which can be accessed via ssh (presumably the account you want to use via physical access will have sudo privileges). The ssh account should not really have anything or be able to do anything other than let a user log in. You can then sufrom that user to the actual account you want to use, which will give you an additional layer of security and better logging regarding who is accessing the system (or trying to)


OSX ssh-agent: no password pasting, and problem with PKCS#8? I use ssh on my machine, and have set up a long not-human-friendly passphrase which is saved in my password manager.
What makes me crazy every time is that I cannot paste into the window pictured below. I know the Remember password in my keychain option and use it. Sometimes I have to enter a new one though. Why can't I paste into a password field?

Same thing for the dialog which pops up when plugging in encrypted disks.

Some updates:

I found out how i can circumvent the dialog: just use ssh-add -K ~/.ssh/id_rsa, and then I can paste the passphrase into the terminal.
As mattmcmanus mentioned, my Key is encryted using pkcs8 which was broken on Yosemite's ssh-agent. This is unrelated to the above problem, but it did occur to me at the same time (read here).
using ssh-add still not fixes this for encrypted disks.

The dialog for ssh-agent can be circumvented by adding the key in the console/terminal: ssh-add ~/.ssh/id_rsa. You can then paste the password into the terminal. Also, adding the -K option to ssh-add will save it to the keychain as per Oliver Lacans comment.
As mattmcmanus said, id_rsa encryption using PKCS seems to be broken on OSX Mavericks ssh-agent. The fast workaround is to decrypt the keyfile, and encrypt it again with the standard ssh procedure (Key-derivation method: MD5...):

mv id_rsa id_rsa.pkcs
openssl rsa -in id_rsa.pkcs -out id_rsa
# enter passphrase to decrypt
chmod 0600 id_rsa
ssh-keygen -f id_rsa -p
# enter passphrase to encrypt again


How to access a connected iPhone device from within Terminal? How can I access the connected iPhone or iPad from within Terminal on OS X? I want to get all the photos (only photos) from the connected iDevice and save it to any directory in my OS X filesystem. I don't want to use the iTunes and instead just want to do it all within Terminal.

I want to get the file path like /Volumes/my_iphone_name, but for some reasons I didn't find anything such in /Volumes subdirectory. Also, diskutil list didn't get me anything that seems related to the connected device.

So where is there my iPhone detected on the entire filesystem?

This is probably not the answer you're looking for, but apparently this can't be done. Please see this question: iOS mount point in macOS


How can I make iTerm2 *cd* into a directory by clicking on *ls* results? Would it be possible to make some sort of remap where command-clicking or highlighting some text in the terminal triggers iTerm2 to attempt to cd <text>? Would make life somewhat easier when navigating around complex directory trees with long names.

I found these instructions for making command-click trigger an action on the clicked filename or word. But after trying the Run command... option with cd \1 (for "cd to this clicked item"), that doesn't seem to work.

The answer below evidently does not work on remote logins; if anyone has a solution that does so, I will accept your answer.

I've found that you need to go Preferences -> Profiles -> Advanced -> Semantic History and use Run coprocess... and echo cd \1 to get the desired result.

Don't ask me why this works or how I found this solution.


iOS 10: Clear 'Up Next' Queue in Apple Music I like to use Up Next in Apple Music on my iPhone, and sometimes I want to clear its contents to add new music to it. Earlier in iOS 9 it was possible but now I don’t see any way to do this in iOS 10.

Is it possible to CLEAR the Up Next queue?

(I know how to delete a single track from the queue)

Using iPhone 7, iOS 10.2 (Public Beta)

One workaround to clear the queue and also to play a single song:

Quit the Music app. This will clear the "Up Next" queue.
Find the song you want to play alone.
Tap–hold the song to hail the contextual menu.
Tap "Play Next". This creates a new queue for the lone song.
Tap the queue and play the song.

I admit it's frustrating in that it interrupts music if already playing. And it's unintuitive.

https://www.apple.com/feedback/


Mac book: Is battery cycle low means mac book still can be used at long time ? I try to buy an old mac book pro mid 2012. Old user of this mac uses mac by electric all the time, so the life cycle till now just 3 cycles, but this computer has been used for 1.5 years.

My question is: if this mac is only 3 cycles, does this mean the battery still as good as new mac ?

Thanks :)

I can speak from experience that the battery from by 2011 MBP 13' died (like only 10% of designed capacity left) after 56 cycles. It met a precipitous decline after a certain point. You may want you weigh your risk on the cost of replacing the battery.


Bluetooth module do not see any discoverable device My MacBookPro (Retina, 15-inch, Mid 2015) do not see any Bluetooth device. So I can't connect external wireless mouse and keyboard and this is annoying.

This is a log from a Bluetooth Packet Logger.

[Feb 22 16:55:12.033]  [NOTE]  OS X Version 10.13.3 (Build 17D47) / Model ID: MacBookPro11,5
[Feb 22 16:55:12.035]  [NOTE]  Bluetooth Software Version: 6.0.2f2
[Feb 22 16:55:12.036]  [NOTE]  Host Controller:  Broadcom / 0x05AC / 0x8290 / v153 c4801 / Built-In (Yes) / Location ID (0x14300000)
[Feb 22 16:55:12.036]  [NOTE]  Support:  Deep Idle (No) / WoBT (Yes) / BTRS (No) / New Idle Policy (Yes) / Idle Time (500 ms)

[Feb 22 16:58:48.306]  [HCI EVENT]  [200E] Command Complete - LE Create Connection Cancel - Status: 0x0C
[Feb 22 16:58:48.306]  [KERNEL]  Received Command Disallowed (0x0C) error -- In UHE mode?
[Feb 22 16:58:48.306]  [HCI COMMAND]  [FCFE] Vendor Specific Command [FCFE] - Read Local Firmware Info - Info Type: Read Current Bluetooth Mode
[Feb 22 16:58:48.307]  [HCI EVENT]  [FCFE] Command Complete - Broadcom VSC Event - Read Local Firmware Info
[Feb 22 16:58:48.307]  [KERNEL]  Not in UHE Mode -- continue

Here is system info

OS: macOS 10.13.3 17D47 x86_64
Host: MacBookPro11,5
Kernel: 17.4.0
Shell: zsh 5.3
Resolution: 1440x900
DE: Aqua
WM: Kwm
Terminal: iTerm2
CPU: Intel i7-4870HQ (8) @ 2.50GHz
GPU: AMD Radeon R9 M370X, Intel Iris Pro
Memory: 3736MiB / 16384MiB

Some images illustrating the problem.

Does anybody know how to solve this issue?

I've had the same things happen over the past 6 months (mine's a mid-2012, thought). I've tried to find out the root cause on many occassions - but I'm pretty sure it's a culmination of many, many different factors (wear and tear, bumps/drops, formatting drives repeatedly, etc.). Just found this though:

  § UHE Button Operation:
  Your Bluetooth USB adapter may have UHE button, this is applied in the condition
  when computer system is without BTW driver installed but need to make
  connection with Bluetooth enabled keyboard or mouse or any HID devices

I also use iTerm2, which is notorious for provisioning issues (can't have a worse problem when it comes to the command line).

Bluetooth gets in the way a lot (for me), so I've messed with the settings quite a bit. I wouldn't be surprised if the same was true for you. Likely through iTerm as well, which worsened the situation.

The largest cause seems to be from inconsistent settings, firmware upgrades, and the kernel issues that come with them. Doesn't take long for it to start taking a toll on the battery, power settings, and worsening kernel panics, kind of like this (old but relevant): https://forums.gentoo.org/viewtopic-t-506162.html

You will have to dig deep. But the issue is buried under some random setting, plugin, or other microscopic detail. Find the source, then patch the kernel appropriately.


iPad air 2 screen rotation I just got an iPad Air 2. I would like to lock the screen rotation but it doesn't have the rotation lock switch. I also checked this community and tried someone's answer, which was to go to control center. This didn't work because I didn't see  rotation lock control in control center.

On an iPad Air 2, to access the screen rotation controls:

Turn on/unlock iPad
Swipe up from the bottom of the screen
Tap icon which shows padlock with rotating arrow around it - White is on, Grey is off.

Source: Apple

There has also been a noted issue on iOS 8 (pre-8.1) with the rotation lock. You may, if you haven't already, try updating to iOS v8.1+ should the above steps not work.


How to Uninstall System Apps by AppCleaner? I know there is the graphical method by which you can individually remove each system app such as Chess, Safari, Mail, Game Center, Photo Booth, FaceTime, iBooks, iTunes, Maps, Dictionary, Automator, Notes, Messages, and ImageCapture.

However, this is taking too much time and I would like to control their removal better because my SSDs are only 120 GB and I need more space.
I am considering the application AppCleaner enough smart capable of doing the process because it can well decide which is a system app and what is not.
So the thing what remains is to make the system apps look like normal apps, probably.

A terminal approach would probably be most appropriate if not possible otherwise.
I would like leave the removal of those applications for AppCleaner in the end.

I see these locks on the icons of my systems apps in AppCleaner

Space taken by OS X applications

I run patrix's command

sudo du -sm /Applications/{Chess,Safari,Mail,FaceTime,iBooks,iTunes,Maps,Dictionary,Automator,Notes,Messages,ImageCapture}.app

I get

5   /Applications/Chess.app
40  /Applications/Safari.app
28  /Applications/Mail.app
4   /Applications/FaceTime.app
27  /Applications/iBooks.app
219 /Applications/iTunes.app
8   /Applications/Maps.app
12  /Applications/Dictionary.app
du: /Applications/Automator.app: No such file or directory
6   /Applications/Notes.app
16  /Applications/Messages.app

where you see that I close more than 300 Mb because of them.
That is too much with my 128 GB SSD.

How can you remove system apps by AppCleaner?

The remove the locks so that you can delete macOS system apps go to
AppCleaner -> Preferences -> General Tab
and Uncheck "protect default OSX Apps"

I just cleaned up garageband from macOS Sierra 10.12.5 which was shown as locked (system protected app) as shown in your image.

EDIT: As @leo said, please be warned that removing some system app like messages might break/ crash a whole set of applications or even the entire OS. SO please be careful about trying this


how to stop spotlight indexing an attached camera When I attach my video camera (for the purpose of importing some clips into FCP-X) I noticed that spotlight is indexing the camera (which does show up as an external disk when I connect it, via the USB cable)  I'm pretty sure that there is some contention between spotlight trying to index these files and FCPX trying to import them.  Is there a way to stop Spotlight from indexing the attached disk?

System Preferences > Spotlight > Privacy

Add your camera once and it should be remembered.


Verify Time Machine Encryption from the Command-Line? Is it possible to verify whether a given Time Machine volume (for example, returned by tmutil machinedirectory) has encryption turned on?  This is for regulatory compliance, so it needs to be fully scriptable.

If you know the UUID before you mount the disk you can use:

diskutil coreStorage list XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX

This will give the following output.

Logical Volume Family XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
----------------------------------------------------------
Encryption Status:       Unlocked
Encryption Type:         AES-XTS
Conversion Status:       Complete
Conversion Direction:    -none-
Has Encrypted Extents:   Yes
Fully Secure:            Yes
Passphrase Required:     Yes

If you know the mountpoint of the disk, you can get the UUID by the following command.

diskutil info /MOUNTPOINT | grep UUID | awk '{print $3}'

And if you do not know the mountpoint you can always run

diskutil coreStorage list

A MacMini with two encrypted drives (Macintosh SSD & Backup Mini) will give the following output.

CoreStorage logical volume groups (2 found)
|
+-- Logical Volume Group XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
|   =========================================================
|   Name:         Macintosh SSD
|   Status:       Online
|   Size:         250140434432 B (250.1 GB)
|   Free Space:   16777216 B (16.8 MB)
|   |
|   +-< Physical Volume XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
|   |   ----------------------------------------------------
|   |   Index:    0
|   |   Disk:     disk0s2
|   |   Status:   Online
|   |   Size:     250140434432 B (250.1 GB)
|   |
|   +-> Logical Volume Family XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
|       ----------------------------------------------------------
|       Encryption Status:       Unlocked
|       Encryption Type:         AES-XTS
|       Conversion Status:       Complete
|       Conversion Direction:    -none-
|       Has Encrypted Extents:   Yes
|       Fully Secure:            Yes
|       Passphrase Required:     Yes
|       |
|       +-> Logical Volume XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
|           ---------------------------------------------------
|           Disk:               disk2
|           Status:             Online
|           Size (Total):       249804886016 B (249.8 GB)
|           Size (Converted):   -none-
|           Revertible:         Yes (unlock and decryption required)
|           LV Name:            Macintosh SSD
|           Volume Name:        Macintosh SSD
|           Content Hint:       Apple_HFS
|
+-- Logical Volume Group XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
    =========================================================
    Name:         Backup Mini
    Status:       Online
    Size:         999860912128 B (999.9 GB)
    Free Space:   0 B (0 B)
    |
    +-< Physical Volume XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
    |   ----------------------------------------------------
    |   Index:    0
    |   Disk:     disk3s2
    |   Status:   Online
    |   Size:     999860912128 B (999.9 GB)
    |
    +-> Logical Volume Family XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
        ----------------------------------------------------------
        Encryption Status:       Unlocked
        Encryption Type:         AES-XTS
        Conversion Status:       Complete
        Conversion Direction:    -none-
        Has Encrypted Extents:   Yes
        Fully Secure:            Yes
        Passphrase Required:     Yes
        |
        +-> Logical Volume XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
            ---------------------------------------------------
            Disk:               disk5
            Status:             Online
            Size (Total):       999542136832 B (999.5 GB)
            Size (Converted):   -none-
            Revertible:         No
            LV Name:            Backup Mini
            Volume Name:        Backup Mini
            Content Hint:       Apple_HFS


macOS Sierra console search criteria Is there a way to filter the console by multiple criteria?
I'd like to display only warnings and errors from the PHP log file. The following searches for the string error warning which doesn't exist

When you open Console, you automatically enter "All messages" section, but you can try switching to Errors and Faults filter which is already created there.
It will give you additional search options the next time you try to filter messages, just click on a search bar and choose what type of messages you want to view.
Hope it'll help.


USB Optical Mouse not working with Mac Mini I have a Mac Mini. I also have a cheap optical mouse.

The two do not seem to be able to co-exist.

I've tested the mouse on a Windows PC. I've tested the USB ports of the Mac with the keyboard and another, similar mouse (but one which is rather terrible ergonomically).

Can anyone suggest things I could try to reolve this?

I've turned the Mac on and off several times but it's done nothing. Occasionally a mouse pointer will appear for a couple of seconds under the Apple logo in the top left of the screen, but it won't move and clicking has no effect.

Best way to see if they recognize each other:  Go to System Information.  You can do this a couple ways, but the quickest is to hold Option and click on the Apple icon at the top right. You will see "System Information" where "About This Mac" used to be.

On the System Information screen, along the left you will see these categories: Hardware, Network, and Software.  At the bottom of the Hardware portion, you will see the USB section.  Click here, and you will see your mouse if it is recognized by the computer.  It will be listed under one of the USB Hi-Speed Bus's.

You've already taken the other troubleshooting steps, so I'm guessing that it won't be there.  If that's the case, then the mouse doesn't work with your Mac, unfortunately.  I have only seen this on one other mouse, and it was a cheap Logitech.

I hope this at least confirms something for you, even though it may not be the news you wanted.  Might have to get a new cheap mouse, but at least they aren't too terribly expensive these days.


Login Script for deleting contents of /private/var/folders We have fleets of laptops that have limited space once our software is installed on it. What ever the issue that is causing the creation of theses files and --err not flushing them, we are ignoring for the moment. But I would like to automatically delete the contents /private/var/folders/. We have maybe 5-10 students log in to a laptop a day. Not sure if that will be an overkill. Any help would be appreciated.

It's a simple way. You can use the getconf DARWIN_USER_CACHE_DIR command to get the per-user temporary files and caches directory. and remove it. edit the '/etc/profile' file, add the following codes in it(not test yet):

userTempDir=`/usr/bin/getconf DARWIN_USER_CACHE_DIR`
rm -fr $userTempDir*


Screen capture utility no longer saves to Desktop In the last few weeks, screen capture stopped working on my MBP. Well, partially.

I can still capture to the clipboard with command + control + shift + 4, but if I try to do a standard capture to a file, my Mac plays the screen capture sound but nothing gets saved on my Desktop.

I'm running OS X 10.9.2. The issue has survived a reboot.

Any suggestions?

None of the answers above helped me, but I discovered the my case:

Shift + Command + Control + 4 saves the screenshot to the clipboard.

Shift + Command + 4 saves the screenshot to a file on Desktop.

So if you're using the first short-cuts, you have to manually open a photo editing app and paste the image, but this can be done automatically with the second short-cut.


Application not running, but dock thinks it is, so i can't quit/open it This has happened to multiple applications so far, i'm not sure what causes it, but it seems to happen after force quitting (sometimes).

First, you force quit it, and it does, but the dock shows that it is still open, but not responding. If you go to activity monitor, it does not show up. When you try to use the killall command by name, it tells you "No matching processes belonging to you were found". If you drag the file location into terminal, it still does not work. Deleting (using the rm command, as moving to trash does not work as finder claims the application is running) and reinstalling does not do anything, so i believe it has to do with the dock, or something else on the mac, not the application itself.

OS X Yosemite Version 10.10.3

Edit:

My guess as to what might've happened is the application quit, but the computer never got any indication that it did for whatever reason, so telling it to quit does nothing, but you're not allowed to open an already open application, so you can't open or close it.

Things that do not work:

Terminal : killall Dock

Terminal : killall Finder

Applescript : tell application "(application name)" to activate

Finder Menu : Relaunch

This sounds like a problm with the Dock itself rather than the application. Try killall Finder in the Terminal which restarts the Finder and the Dock.


Mobile data connection lost on iPhone 5S I have iPhone 5S with 10.1.1 iOS and sometimes happens to me that I loose mobile data connection. In other words in top left corner on my screen there is provider (operator) and right next to it I usually have LTE. This LTE disappears from unknown reason (even in places that are 100% covered by LTE, but that is ok, I can accept it) but the problem is that it doesn't come back until I restart iPhone completely. I tried to restart data connection or some other things, but nothing worked. Only turning off and on again completely. Has anyone experienced this or have suggestions? Many thanks

This is probably not a problem with your phone. It is up to the carrier to decide which individual handsets are actually allowed on LTE on the current cell tower. So you might just be experiencing that your carrier hasn't got enough capacity to allow everyone on LTE, so they put you on a slower network.

So even though a coverage map tells you that LTE is available - it doesn't necessarily mean it is available to everyone.


Precautions to prevent iPhone virus from attachment In a momentary lapse of sanity, I opened up an attachment (a .pdf) from an unknown email address (the domain doesn't seem to be a website) in the gmail app on my iPhone 5. Realizing that there was a reasonable probability that there was a Trojan, I quickly closed the file.

I now have the following related questions:

Is there any chance I just put a virus on my iPhone?
If so, what should I do to scan my phone and verify?
In the future, is there a recommended way to scan such attachments as a precaution before opening them?

Looking at a number of questions on this website, I have learned that for my (non-jailbroken) phone, it is fairly unlikely that I got a virus, but I'd appreciate knowing that for sure.

You are most likely safe, as there are extremely, extremely rare cases of getting a virus this easily, as iOS is extremely secure. There are no incidents of getting a virus from PDF on iOS, so you are definitely secure.


How do I remove the left column in finders column view? When in column view in finder, there may be several columns displayed, one for each folder. Let's say the one I really care about is 5 folders deep, and so its far to the right side of the window. How can I make that folder the "root" of the column view window? Alternatively, how do I remove the left-most column/folder from being displayed?

Just drag your folder to the "Favorites" panel and it will be the root folder for that window. You can see the full path at the bottom, my folder (Mateus) is deep in the HD but the parent columns are not showing.


Bluetooth headphones volume too low. Any 3rd party solution to boost? I alr set the mic input volume in sound in system preferences to max but its still too soft

For wired headphones you have a lot of options. Bluetooth literally is a digital signal, so you have no options other than better receiver to power your headphones. Since you can’t change out Mac amplifier to increase the current or voltage you have two choices For analog:

Choose lower impedance headphones or more efficient headphones (Sealed or noise cancelling) to make more sound from the same output power.
Choose a headphone amplifier to increase the power out or a 100 W  Bluetooth amplifier to really make some noise.
USB DAC can be as cheap as you like - this would be a digital amplifier.

For Bluetooth, the max is just like the dial on the amp, it doesn’t turn any more so once you hit max volume, you have to replace the hardware.

Even if you turn Bluetooth to eleven, max is max.


Mac Mini Sleeping When Idle We are having some issues with 2 Mac minis running Mojave.  They go to sleep after a couple of minutes the user logs out.

We tried playing with the pmset settings without luck

Here are my current settings

~/Documents/vc:$ pmset -g

System-wide power settings:

Currently in use:

standby 1

Sleep On Power Button 1

womp 1

autorestart 0

hibernatefile /var/vm/sleepimage

proximitywake 1

powernap 0

gpuswitch 2

networkoversleep 0

disksleep 0

standbydelayhigh 86400

sleep 0

hibernatemode 3

ttyskeepawake 1

displaysleep 0

tcpkeepalive 1

highstandbythreshold 50

standbydelaylow 86400

Does anyone knows how to keep them awake 24/7?  Our monitoring systems complain about the minis being unreachable.

You have some errors in your power settings.

hibernatemode 3.  3 is the default for portables; since you have a Mac mini, this is incorrect; it should be 0 (default) for desktops.
standby 1.  If you don't want your machine to go into standby at all, this should be set to 0
autopoweroff seems to be missing. This should also be set to 0 as it's enabled by default.

Issue the command

pmset -a hibernatemode 0 standby 0 autopoweroff 0


Corrupted WD hard disk? Macbook Air says "hard disk not readable" So one night I finished editing a video and I was so excited that I got up and realised the hard disk was still connected to my Macbook Air. When I stood up, the hard disk was hanging on the Macbook Air for one second. When I realised the hard disk was hanging, I quickly sat down and moved the hard disk to an appropriate position. The hard disk was working for 10 mins and then I accidentally put my hand and applied a bit of pressure on top of the hard disk and heard a crackling noise. Since then,it just stopped working. So I force quit all my programs and when I tried to connect to my  hard disk to my Macbook Air, an error pop up saying "hard disk not readable.". I tried to connect the hard disk with a different USB cable but the problem was still not solved. I believe I may have corrupted my hard disk and I hope I'm able to repair it and get my files back. I read online that many people are also experiencing this issue with WD's hard disk. I also tried to use 3rd party recovery softwares but it won't solve the problem just yet because I can't even connect my hard disk to my  MacBook. I also tried connecting my hard disk to my Windows laptop, no luck. I also rebooted my MacBook air, no luck. My hard disk is a WD 1311B.

I hope someone can help me.

Thanks,

Jeff

Update

I tried to reformat my hard disk but wasn't able to do so.

I FIXED IT!. I didn't change the hardware parts or anything!. All I done was that I went on my Windows laptoo and when I clicked initialised in Disk Management, I clicked the second bullet point not the first!. After that, I just created a new volume and ran a recovery software on it. Done and dusted!


Using Lightning headphones in my Dell laptop I have an iPhone 7 with Lightning headphones. I got a connecting adapter to use 3.5mm compatible headphones on an iPhone 7. But, is it possible to use these Lightning headphones on the 3.5mm jack of my Dell laptop? I tried Googling and haven't found any converter/adapter.

You would need a USB to Lightening adapter for that. The newer Dell laptops do come with USB-C port adapters.


The Apple-authored driver appletmp.sys halts Windows 7 startup on Macbook Air Following a Windows Update which required a reboot, Windows 7 (64 bit) cannot launch successfully.  The Windows System Recovery tool has been unable to fix the problem with any of the recovery points I have tried.  The only system image available is from the same time as the Windows Update, so it seems pointless to try.

This thread on the Apple Discussions board has more details.

Any suggestions?

I wound up doing a fresh install of Windows 7 and leaving the trackpad off.  It probably makes sense to keep a USB mouse handy.


How can I sync my iPad/iPhone with iTunes except for the apps/iBooks? There are several GB of data on my iPad which I do not need to have on my MacBook Pro. I want to sync my iPad with iTunes on my Mac except for...

iOS apps
iBooks

But whenever I try to sync, I am prompted to first transfer all the purchases to iTunes - otherwise the apps will be removed from my iPad.

Can I avoid this dilemma? I thought that iCloud saves what apps/iBooks I use on my iPad.

The reason why it's asking you to transfer purchases is because your Mac doesn't have the apps (and the data associated with said apps (e.g.: game data, documents, etc).) on file on the computer. When it's transferred, it can successfully back it up without losing your data.

As far as I can tell, there is no way around it; you are going to have transfer the files. After that, go to the "Apps" tab on your iPad section of iTunes and uncheck it. This should stop syncing your apps. Do the same with the "Books" section.

As for the question of whether or not your apps and books are on iCloud, they are. Every song, album, music video, TV show, app, or book that you have downloaded is associated with your Apple ID and can be re-downloaded for no extra charge.

I hope that this solves your issue.


Calendar that's accessible from Mac OS X and Linux Does anyone know of any calendar software/approach, so that I can use my calendar from both Mac OS X and from Linux?

I use both Mac OS X and Linux regularly, and I'd like to be able to both view and edit my calendar from both platforms.  Does anyone know of any solutions?

I don't want to have to use a web browser to access my calendar.  Also, I'm trying to avoid Google/Gmail.  (Maybe there's a way to host a calendar in iCloud or MobileMe and use it from both Mac OS X and Linux?  Or maybe some open-source program that I can compile on both Mac OS X and Linux, and that hosts the data on a server I administer?  Or something?  Any ideas, anyone?)

The following solution is clumsy in that it uses discontinued software (Mozilla Sunbird), but works for dual boots, or any situation where both OSes have access to a common partition. The idea is to install Sunbird 0.9 (the last stable version) on both Mac OS X and Linux and have a common profile folder as is customary for Firefox and Thunderbird. The obvious thing to do would instead be to set up Thunderbird on both sides with a common profile folder and install Lightning. However, the Lightning plugin has a Mac and a Linux version, and is installed in the profile folder, so you would end up using the Mac version in Linux or vice versa, which doesn't work. There seem to be workarounds, but I haven't found any understandable one.

I think this solution is relatively safe: Sunbird is closely related to Lightning, so it should be easy to move to Lightning when it solves this issue or when you no longer need a shared profile folder.

In Mac OS X:

Install Sunbird 0.9, for example from this place.
Open and close Sunbird so that your computer realizes it's there and removes the application-downloaded-from-the-internet safety measure.
Open a terminal (Applications > Utilities > Terminal)
Type /Applications/Sunbird.app/Contents/MacOS/sunbird-bin -p. This opens the Sunbird profile manager.
Click "Create Profile...", then "Next" to get past the info screen.
Give the profile a name of your choice.
Click "Choose Folder..." and pick a folder that is accessible for both OSes, say SharedPartition/SunbirdProfileFolder
Click "Finish". Select the new profile, and click "Start Sunbird" to make sure the new profile is set to default. You can quit Sunbird right away.

In Linux
(Sunbird is probably no longer available from any software centers, so we will have to do it manually. I will follow this guide with a few tweaks based on my own experience):

Install the package libstdc++5, e.g. through a software center.
Change the name of the profile folder you created in OS X, say to SharedPartition/SunbirdProfileFolder_MovedAside. Create a new folder called SharedPartition/SunbirdProfileFolder
Download a tarball for Sunbird 0.9. Best search the web for "Download sunbird-0.9.en-US.linux-i686.tar.gz"

If you have a 64-bit processor, either look for a 64-bit tarball or install the package ia32-libs, e.g. through a software center.

Open a terminal. Every time, type the given command. When in doubt, use man theUsedCommand for more info on what you're doing.

sudo bash This gives you root permission (including the permission to mess up your system entirely).
cp -t /usr/lib ~/Downloads/sunbird-0.9.en-US.linux-i686.tar.gz (Replace ~/Downloads with the path to your download folder.) This copies the tarball to /usr/lib.
cd /usr/lib to go there yourself.
tar -xvf sunbird-0.9.en-US.linux-i686.tar.gz to unpack the tarball. A folder /usr/lib/sunbird is created.
chown -R root:root /usr/lib/sunbird/ to set the owner of this folder to root.
gedit /usr/bin/sunbird This opens a text editor showing an empty file. Paste

#!/bin/sh
cd /usr/lib/sunbird/
./sunbird

Save and close.
chmod +x /usr/bin/sunbird Make the file executable.
gedit /usr/share/applications/sunbird.desktop This opens another empty file in a text editor. Paste

[Desktop Entry]
Name=Sunbird
Comment=Calendar Application
Exec=sunbird
Icon=/usr/lib/sunbird/chrome/icons/default/default.xpm
Terminal=false
Type=Application
Categories=Application;Office;

Save and close.
exit Ends root permissions. Close and reopen the terminal.
which sunbird This tells you where Sunbird is located. It should answer /usr/bin/sunbird
/usr/lib/sunbird/sunbird -P This launches the Sunbird profile manager.

Click "Create Profile...", then "Next" to get past the info screen.
Give the profile a name of your choice.
Click "Choose Folder..." and pick the original SharedPartition/SunbirdProfileFolder, not the renamed one.
Click "Finish". Select the new profile, and click "Start Sunbird" to make sure the new profile is set to default. You can quit Sunbird right away.

Erase the folder SharedPartition/SunbirdProfileFolder which now contains a new profile; rename SharedPartition/SunbirdProfileFolder_MovedAside to SharedPartition/SunbirdProfileFolder. You now have Sunbird on Mac OS X and Linux, sharing the same profile, including calendars, settings etc.

If you're on Ubuntu, you can go to /usr/share/applicatons in the file browser and drag the Sunbird icon into the launcher.


Setting up iPhoto library on external HDD Is there any way to set iPhoto library on external HDD instead of main HDD. I have a lot of photos and am running out of space on my MBP.

I was thinking to achieve it by symlinks or something. It this possible at all?

If not, I'd be glad if anyone could recommend a iPhoto-like program which supports having photo library on external disk.

(I'm using Snow Leopard with iPhoto'09, but aby solution would be great as I'm about to upgrade to Lion)

You can simply copy the iPhoto Library to an external hard drive and access it form there. Of course you need to have the external HDD connected whenever you want to run iPhoto.

To copy the library: Quit iPhoto. In your Pictures folder there should be a file (actually a special folder called a package) called iPhoto Library. Copy this folder to the new location on the external HDD. Since you're using iPhoto '09 you can just double-click on the library in its new location and iPhoto will open it and use it as the default library from now on.

This Apple Support document also covers the copy process.

However, you need to be very careful if you have images that are not contained in the iPhoto Library (referenced images) as these won't be copied to the new location. If you have the "Copy Photos to Library" option checked in iPhoto preferences, and have always had it checked (it's the default), then you shouldn't have a problem.


Which purchasing option is best - Free+IAP or paid? I've noticed that several apps on the iOS App Store offer two purchasing options:

Free app, then an in-app purchase of $x to the full version
The full version of the app for an immediate purchase of $x

(Infuse is one such example)

Given that both purchasing methods get you exactly the same thing (that is, a working full version of the app) why would a developer go to the additional effort to make available both #1 and #2, rather than just have #1 in the App Store?

Please note

I'm looking for fact-based and not opinion-based answers. For example, a fact-based answer is that if you use Family Sharing then IAPs are not supported.

I followed up with a couple of developers of such apps that provide these two purchasing options.

It turns out that the sole reason that a second standalone purchasing option is offered (rather than just sticking with a single app with an IAP) is for those people who use Family Sharing.

As I alluded to in my question, IAPs don't work across Family Sharing so purchases that way wouldn't be reflected across all the devices you share.

If Apple didn't have this restriction, then a single free app with IAP would work for everybody - however because they do, then it doesn't.


macOS Sierra Missing App Icon in Dock and "Check for Updates..." Fails for Certain Apps After doing a clean install of macOS Sierra I occasionally get the 'missing app icon' (the original app icon with a question mark superimposed). When this happens clicking the app icon doesn't launch the app (and I need to go to /Applications and re-drag the icon to the dock). Anyone else experiencing this issue?

I also get the following warning for the apps this is happening with when trying to do an update:

  Sketch can't be updated when it is running from a read-only volume like disk image or an optical drive. Move Sketch to your Applications folder, relaunch it from there, and try again.

I've tried opening from the command line to verify I am indeed opening from the Applications folder with:

open /Applications/Sketch.app

Any thoughts?

Cause: Gatekeeper Path Randomization introduced by macOS Sierra.

Steps to Fix:

Run command: xattr -dr com.apple.quarantine /Applications/Your.app
Drag app back to Dock;
Restart Mac.

Consequence:

App icon stays at Dock after restart
Check for updates works


Textmate OSX Yosemite ruby 1.8 After upgrading to the OSX Yosemite, Textmate's duplicate line command
ctrl+shift D produces an error warning: -K is specified; it is for 1.8 compatibility and may cause odd behavior.

Previously, this was fixed by changing the PATH to /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin

But now this does not work.

How can I fix this issue?

You can install Ruby 1.8.7 via rbenv and add it to Textmate paths:

  PATH:
  /Users/YOUR_NAME/.rbenv/versions/1.8.7-p249/bin:/usr/bin:/bin:/usr/sbin:/sbin

  TM_RUBY: /Users/YOUR_NAME/.rbenv/versions/1.8.7-p249/bin/ruby

If you have problems with installing ruby 1.8.7 with errors such as:

  openssl_missing.h:68: error: conflicting types for 'HMAC_CTX_copy'

you can try to do brew unlink openssl. After successfully installing ruby you can link it back with brew link openssl --force

Good Luck!


Macbook early 2009: does it has a maximum SD memory allowed I have bought a couple of USB micro SD card readers. I have bought a couple of micro SD memories. None of them work well. The shop has told me that computers have a maximum memory allowed.

I have not found anything like that anywhere. Is there a maximum memory allowed? It depends upon the computer? It depends upon the reader? Maybe it is just that the three micro SD memories where corrupted?

By the way, I have formatted the micro sd memory with the following tool:https://www.sdcard.org/downloads/formatter_4/ (OSX seems to be problematic to format because the compatibility with other devices. This association - software promises to solve that issue).

There is an excellent Support Article on Apple's website that addresses this:  About the SD and SDXC card slot

Does the SD slot work with cards that exceed 32 GB?
Yes. However, most media manufactures preformat the media using common
block-and-cluster sizes that do not approach the theoretical limits of
a given file system. Most SD cards use the FAT32 file format.
Preformatted FAT32 SD media is commonly available up to a capacity of
32 GB. Media that exceeds 32GB usually uses the exFAT file system.
Some smaller capacity cards use the FAT16 file format. Preformatted
FAT16 media is generally available up to a capacity of 2 GB. To
determine which file system you are using with Mac OS X v10.6.5 or
later, insert the media into the SD card slot, go to the Apple menu,
select About this Mac..., click on More info..., click on Card Reader
in the hardware section, and locate the File System field.

Which SD card formats work in the SD card slot?
Cards that conform to the SD 1.x, 2.x, and 3.x standards should work.
The SD card slot can use cards that are Standard SD (Secure Digital) 4
MB to 2 GB, SDHC (Secure Digital High Capacity) 4 GB to 32 GB, and
SDXC  (Secure Digital Extended Capacity) 4G B to 2 TB. MMC can also be
used in this slot. MiniSD, MicroSD, and higher density formats like
MiniSDHC and MicroSDHC can also work with the use of "passive"
adapters that conform to the width and thickness specifications listed
above.

(Emphasis mine)
To format your SD card, you should use Disk Utility either using the GUI or via Terminal.
Using Terminal:
diskutil eraseDisk HFS+ DiskName GPT /dev/diskN
Where...

HFS+ = type of filesystem
DiskName = Name you want to give the SD card (i.e. "Stuff", "My Photos")
GPT = partition type
diskN = disk identifier (i.e disk4, disk7, etc.)

For more details, see man diskutil


Where is "Create disk image" function in El Capitan/Sierra? Updated today to Sierra from Yosemite. Can't find disk backup function in new Disk Utility...

In Disk Utility, you can use "New Image from Folder" accessible under File > New Image > Image from Folder or by Cmd ⌘Shift ⇧N.

Navigate to Computer or Volumes in the window and select your disk as the folder to create the image from. This should create an image of the disk.


How to leave or silence a group ichat? I keep company with night owls. Also, I have an iPhone 4s. Oftentimes, my friends include me in group ichats that start at a reasonable hour, but continue into the middle of the night. Every time I get a group ichat, or any text, my phone vibrates. I want to keep it this way -- except for late night group chats.

Is there any way to mute or leave group ichats?

Do not disturb is a feature that isn't supported in iOS 5.


Scroll down in Safari on iPhone/iPad? When using Safari from iPhone/iPad I can scroll back to the top of the page in one touch by touching the upper bar of the device. Is there any similar trick for scrolling to the bottom of the page? Is there any way of scrolling down fast?

There is no keypress or gesture to do this unfortunately.

But here is a quick way to achieve a similar thing.

Create a new bookmark in safari (of any web page)
Edit this bookmark (press edit in bookmark screen)
Rename the bookmark to End
In the address field cut and paste this text

javascript:scroll(0,document.getElementsByTagName( 'body')%5B0%5D.scrollHeight);

Once you save this bookmark, you will be able to hit the bookmark button, select End and it will take you to the bottom of the web page.  I know it's not as simple as the current scroll to top feature (this solution requires two taps), but its really the only option at the moment.


GPU-defect Macbook Pro 2011 does not accept csrutil disable anymore (10.13.6) I have a failing Macbook Pro and have deactivated the discrete GPU by doing something [editors note: help us help you by detailing what modifications you made to deactivate the GPU].

Now on this machine, once I updated to macOS 10.13.6
it does not accept the "csrutil disable" anymore which leads to the fact
that I am not able to go through this process:

GPU problem - Boot Hangs on Grey Screen

I already asked on several other platforms but nobody can explain me why it is not working anymore.
With the following Command (CMD-R-S) it seems that it does not go into the Recovery Single User mode and thus I have no sufficient rights to perform this action (csrutil disable).
Can somebody please help and tell me how to fix this?

Best regards

I had same issue but did not have to use another computer or usb drive.
Via: https://apple.stackexchange.com/a/336676/302408

I was having the same issue. This is how I fixed it.

As we are not able to get to single-user-recovery mode by holding Cmd+R+S at startup to run csrutil disable, it is not taking you to SingleUserRecoveryMode.

I run the nvram command here in SingleUserMode

nvram fa4ce28d-b62f-4c99-9cc3-6815686e30f9:gpu-power-prefs=%01%00%00%00

Then reboot

reboot

On reboot hold Cmd+R and it will take us to the GUI recovery mode. There click on Utility and open Terminal, here we can run the csrutil command.

csrutil disable

Then again make sure to run the nvram command then reboot

nvram fa4ce28d-b62f-4c99-9cc3-6815686e30f9:gpu-power-prefs=%01%00%00%00

reboot

Boot into SingleUserMode Cmd+S to continue with the kext moving procedure. once done, go back to GUI recovery to re-enable SIP csrutil enable, then reboot once morew.

Once the Mac fully boots run nvram one last time as sudo

sudo nvram fa4ce28d-b62f-4c99-9cc3-6815686e30f9:gpu-power-prefs=%01%00%00%00

Now do multiple reboots to test the machine boots back up properly. I have no issues now.


Find gateway address and netmask? I come from the land of windows, where the ipconfig command shows four important pieces of information: IP address, netmask, gateway address, and MAC address.

However, on a Mac, ifconfig only shows IP address and MAC address.

Where can I find the gateway address (e.g. 192.168.1.1) and the netmask (e.g. 255.255.255.0)?

With ifconfig on OS X you can find netmask :

inet 192.168.1.2 netmask 0xffffff00 broadcast 192.168.1.255

netmask 0xffffff00 means 255.255.255.0

And for finding gateway address use arp -a or as geekosaur said use netstat -nr | grep '^default'.


Fonts Choices Can Not be seen at Night The font choice are on the right side of the screen on Pages. At night I have to click on a font choice for it to be visible. In the day they are easily readable. This just started happening on my Macbook 2016 .

I removed the Night Shift Display but the font choices did not become visible. I have not changed anything on my computer.

How can I have it visible?

I'm assuming your Mac is running macOS Sierra or later and your Mac has Night Shift enabled (by default Night Shift will change the appearance of your screen at night).

To access Night Shift settings go to Apple > System Preferences > Displays and select the Night Shift tab (see screenshot below):

Depending on your version of macOS your Displays preference pane may look slightly different to the image above.

Now you have two options:

Totally disable Night Shift by selecting "Off" from the Schedule drop-down menu
Experiment with the Color Temperature slider (at night with Pages open) to see if you can get it so that your font choices are easier to read.

NOTE: You shouldn't have to reboot for the changes to take effect, but if they don't when you're expecting them to (e.g. you set a schedule from 7pm and nothing changes even though it's already after 7pm), you may need to reboot for the change to take effect.


External hard drive spinning up during sleep Every time I close the lid on my macbook air, my external hard drive seems to spin up for about 5 seconds every 30 seconds, and this will go on continuously, even for several hours. The noise itself isn't too loud, so I don't really have a problem with that, but I'm worried it might damage the hard drive.

Is this normal OS X behaviour (I'm on Mountain Lion, sleep mode 3), or is it specific to my model of hard drive (Samsung 1tb USB 3)? I read that Mountain Lion will supposedly check emails and perform updates during sleep, could that be the cause?

If it doesn't harm the hard drive, I'm not too worried, but if repeated spinning up will exert extra strain, I'd like to find a way to stop this happening.

Unfortunately, Mac OS doesn't eject hard drives when the machine enters sleep. And since your MacBook performs some "activity" during sleep, a writing/reading process might keep the hard disks awake.

There are at least three solutions to this problem:

A) You eject the hard disks each time before you enter sleep

B) You get the Jettison App for $4.95 (http://www.stclairsoft.com/Jettison/), which automatically ejects hard disks before the MacBook enters sleep, and mounts them when the MacBook awakes. There is a 15 days free trial if you like to check if it works for you.

C) Disable the Power Nap mode


How do I make Terminal/UNIX tools to start the week on Sunday? I can't quite make this happen.
Setting LC_TIME seems to work, but the locales are broken or whatever?
How do I force this onto my system?
$ for i in (locale -a); bash -c "LC_TIME=$i date -j -f '%Y-%m-%d' '2020-01-05' '+%W %a'" ; end
00 Sun
00 እሑድ
00 нд
00 א'
00 日
…

This should be 01 א' for some of them at least…
What gives?
Looking at /usr/share/locale/* I can't find anything resembling first_weekday keyword at all:
$ cat en_US.UTF-8/LC_TIME
Jan
Feb
Mar
Apr
May
Jun
Jul
Aug
Sep
Oct
Nov
Dec
January
February
March
April
May
June
July
August
September
October
November
December
Sun
Mon
Tue
Wed
Thu
Fri
Sat
Sunday
Monday
Tuesday
Wednesday
Thursday
Friday
Saturday
%H:%M:%S
%m/%d/%Y
%a %b %e %X %Y
AM
PM
%a %b %e %X %Z %Y
January
February
March
April
May
June
July
August
September
October
November
December
md
%I:%M:%S %p

macosx 10.12.6 (16G2136)

i know this seems like a locale problem -- i spent of bunch of time looking into that but it turns out this is actually a problem with the date command.
from the man page for date:
%U     week number of year, with Sunday as first day of week (00..53)
%W     week number of year, with Monday as first day of week (00..53)

so if i rewrite your command to use %U instead of %W:
for i in $(locale -a); do bash -c "LC_TIME=$i date -j -f '%Y-%m-%d' '2020-01-05' '+%U %a'" ; done
then i am getting all of the results showing week 01 instead of 00.
hope this helps!


Shortcut to switch off and on individual cellular network iPhone iOS13 w/ dual SIMS: T-Mobile (EU) & AT&T (US). I need help shortcut script:

IF I arrive home THEN

turn on airplane mode and WIFI
GO To Settings -- Cellular (Cellular Plans)
1 Cellular plan (T-Mobile) Turn ON / 2 Cellular Plan (AT&T) Turn ON

IF I leave home THEN

turn off airplane mode and
GO To Settings -- Cellular (Cellular Plans)and
1 Cellular plan (T-Mobile) Turn ON / 2 Cellular Plan (AT&T) Turn OFF

This allows the user access to WIFI calling only while at home location and local cellular plan use while outside of home.

[Turning off Network completely: Not just 'data' but the complete network mobile line. Ex: T-Mobile is 'active' and AT&T turns off.]

With iOS - you can automate enabling airplane mode with Siri. Have you tested if you can say ‘Hey Siri - turn off AirPlane Mode”

Automation options in general are:

Siri is the easiest if Apple has programmed that interface and operation
Next easiest if third party / first party automation like Shortcuts and Toolbox Pro apps.
Least easy is assistive touch and voice over. These have a learning curve and you may find it faster to perform a manual step - but they do automate powerfully by non-touch events or not traditional touch events.

As for the other part - how do you have Network Selection in your settings app and how do you accomplish the steps above manually? Putting down step by step might let someone who knows how to automate things help you without needing to see your phone or establish two service accounts.


Why doesn't Time Machine do scheduled backups after my Yosemite -> El Capitan upgrade? Summary

Since upgrading to El Capitan from Yosemite, Time Machine works manually, but automated backups and disk icons are no longer working as they should.

Detailed Problem Description

I have a brand-new system that came with Yosemite, and Time Machine was working fine. After a recent upgrade to El Capitan, I have the following issues:

The Time Machine disk (an external USB 3.0 device) no longer shows up on the desktop as a Time Machine device. It shows as a standard removable disk.

Even though Time Machine sees the device and schedules periodic backups, these backups never run. The only backups that run are the first one scheduled when the Time Machine disk is mounted, or when "Back Up Now" is selected. In this example, the manual backup I ran at 4:00pm completed, but the incremental scheduled for 4:59pm never ran.

Troubleshooting Steps

On my own, and with Apple technical support, I did all of the following in an attempt to debug:

Sensible things I tried on my own:

Perform First Aid on the Time Machine GUID table.
Perform First Aid on the Mac OS Extended (Journaled, Encrypted) filesystem on the disk.
Unmount and remount the Time Machine disk.
Deselect and reselect the Time Machine disk.
Disable Time Machine, reboot, and reselect the Time Machine Disk.

Things I did at the request of tech support:

PRAM reset.
SMC reset.
Boot in Safe Mode.
Configure Time Machine as a different Administrator account.
Boot to recovery partition and non-destructively reinstall OS X.

Other than performing a full erase and reinstall, I'm at a loss as to how to troubleshoot this issue further. This seems to be a bug in El Capitan, but of course there's always the possibility that some kernel extension or third-party extension like FUSE, VirtualBox, or VMWare Fusion is wrecking havoc, but I require those extensions for work.

Apple currently denies that there are any outstanding Time Machine bugs in El Capitan, but that may be due to its newness or the fact that not enough people have reported related issues yet. On the other hand, if it's really just my problem, what else can I do to debug this or work around this (e.g. a cronjob of some kind, perhaps?) short of hosing my entire system and starting from scratch?

I'm having a very similar problem after upgrading to El Capitan, except that I can not repair the disk, my attempt always gives me a repair failed error.  I don't have an answer, but I think I can verify that the issue probably isn't related to any third-party extensions as I'm operating without.  So at least I may be able to help rule out those as a source of the problem.


How can current versions of Adobe products continue to run on the new Macs with Apple Silicon? During its November 10, 2020 event, Apple has announced that Adobe is bringing its major apps to Apple Silicon, starting with the Lightroom photography software. They also said that all current versions will continue to run, but the new ones will take advantage of Apple Silicon directly. How can it be the current versions will run on the new ARM processor, since they were compiled for x86 Intel processors?

Apple is using Rosetta 2. Scroll down the page for this bit:

“With Big Sur and M1, Mac users can run a greater range of apps than ever before. All of Apple’s Mac software is now Universal and runs natively for M1 systems. Existing Mac apps that have not been updated to Universal will run seamlessly with Apple’s Rosetta 2 technology.”


How to reinstall from an USB stick on a MacBook or iMac? I made an OS X 10.6 USB stick and I used it to succesfully install OS X on several Mac, including a very old Mac Mini and a MacBook Pro.

However I've got a problem: on my girlfriend's Mac it simply doesn't work.

When I hold ALT when the system boots up, I can see the harddrive icon (so I take it that pressing ALT does indeed work) and hence decide to boot from the harddrive, but I don't see the "Recovery HD" nor the USB stick / "EFI boot" icons.  The only choice is get is "harddrive".

I tried again on my Mac Mini and surely enough: I can hold ALT and I see all the icons.

I also tried again on my MacBookPro (very old 17" MBP, the first 17" one if I remember correctly) and once again, I can hold ALT and I see the "EFI boot" icon.

Why doesn't my girlfriend's MacBook recognize the USB stick (and hence prevents my from reinstalling the system)?

The strange thing is that as far as I can tell my girlfriend's MacBook is more recent than both my MacMini and my MacBook Pro.

If her MacBook was shipped with Lion, you couldn't be able to boot with a Snow Leopard stick. Apple Knowledge Base states that you shouldn't use earlier versions of OS X:

  Note: You should not use a version of Mac OS X that is earlier
  ("older") than the version your Mac shipped with.

If this is the case, you have to create a bootable Lion stick.


After a while, the trackpad or mouse requires me to click twice to be able to register a single click I have two macbook pros, one summer 2009 model and a late summer 2011 model.  Both of these macbook pros seem to require me to click twice just to be able to register a single click.  It's almost like the app loses focus and I have to click twice.  I'm not running jiTouch and this happens with both the trackpad and the magic mouse.

This has been happening for months now and seems to be happening on both 10.6 and 10.7.

Any help would be greatly appreciated!

After some testing, I realized that this only seems to happen after I have opened the application "mumble" (a VOIP app). There's also a discussion about it on the sourceforge forums. Here's a link to the sourceforge discussion about this same issue: http://sourceforge.net/projects/mumble/forums/forum/492607/topic/4886530/index/page/1


What exactly does kernel_task do? I'd just like to know what it is that kernel_task is responsible for. Also, what's an acceptable maximum RAM and CPU use for it?

The kernel task is special since it's an entire operating system / micro kernel based on Mach 3.0. It abstracts most of the core hardware, timing, message passing and memory handling.

What most people notice in Activity Monitor is that kernel_task accumulates all the CPU time for input/output (i/o) processing delays and calculations as well as scheduling overhead of processes and threads. Similarly - it accumulates all memory allocations that are not in the user space. On the 2014 and newer Macs, this task exists to throttle the CPU - when the temperatures in the processor are too warm, kernel task is assigned "no work" and shows high CPU busy to let the processor idle and not overheat the computer. This is most noticeable on the portable line - especially the MacBook without any sort of fan or blower to cool the processor. Apple warns of this to potential kernel programmers in "Why you should stay away from programming in the Kernel" that disabling cooling will cause permanent irreparable hardware damage.

  To summarize, kernel programming is an immense responsibility. You must be exceptionally careful to ensure that your code does not cause the system to crash, does not provide any unauthorized user access to someone else’s files or memory, does not introduce remote or local root exploits, and does not cause inadvertent data loss or corruption.

If you watch it after a reboot you will see it starts with minimal RAM and CPU needs and instead grows only when other programs run and need the system services.

To slim it down, shut off unneeded ports (WiFi, bluetooth, etc... ) as well as idle / unused programs. If things don't settle down, consider rebooting to ensure no task is stuck or leaking memory.  If you have programs doing real work, they will cause the kernel to use both memory and processor time - just watch as you start things to see which other programs are causing this behavior. It's rarely an issue with the kernel - even with badly performing programs - that can't be solved by logging out and back in again. The kernel_task cleans up well and generally takes care to only use the resources needed by the workload.


Find my iPhone useless in case of stole? Possible Duplicate:
  Lost iPhone, what action to take?

Consider this scenario:

A thief stole my iPhone.
I disable my iphone on www.icloud.com
The thief in the meanwhile reinstall iOS

Does Find my iPhone is useful in this scenario?

If you wipe the phone, no.

If they wipe the phone, no.

I'm going to close this, but feel free to flag or edit it if you feel there is something missing from these answers.


Why is my iPhone unable to connect to an ad hoc wifi network? I'm trying to connect my iPhone 3G(iOS 4.0.2) to an ad hoc wifi network that I've created on my netbook(running Fedora 13).  When I attempt to connect, everything seems to go fine on both ends, however after the connection is established the 3G icon is never replaced by the wifi icon, even though there is a check next to the connection in the wifi selection screen.

I have also attempted to create an ad hoc wifi network on my PowerBook, and have exactly the same issues.  I have also tried putting the phone in Airplane mode, and then connecting to the network but the wifi bars never appear.  I've tested this with a friends iPhone 4 and the same thing happens.

I'm not attempting to share an internet connection over the ad hoc wifi network, my goal is to be able to control my netbook from my iPhone when I'm on the go and away from other wireless networks.

My guess is that the iPhone doesn't consider the connection valid because there's no DHCP service assigning it an IP or perhaps gateway allowing it access to the internet.

Try running a DHCP server on your laptop or enabling network sharing even if the laptop isn't on the net.


Zooming in or Out in Sketch App for Mac using command + space bar (Keyboard Combination) triggers spotlight! I use Sketch App for mac as my main designing software and I am already used to some familiar shortcuts for zooming in/out and moving the Art-board. The shortcuts are holding command and then scrolling up or down on using your magic mouse to zoom in or out and holding space then left click to scroll through the Art-board but sometimes I need to use both move and zoom shortcuts at once.

For Example:
I zoomed in to an Art-board using command + mouse scroll up/down and then immediately press space bar to centre align or go to the particular zoomed portion of the Art-board and this is when the problem occurs as soon as I press command and spacebar Spotlight get triggered and it becomes very annoying. I know that I can change the keyboard combination for Spotlight but that won't work cause I am used to command + spacebar keyboard combination to trigger Spotlight and on the other hand I also love this keyboard combination for Sketch so how can I stop spotlight from triggering when using command or space to zoom in/out or move the Art-board

I have actually came across a completely different solution. You must be knowing about hot corners in which if you point the cursor to any corner of the screen a particular process takes place so now I have turned it on for the launchpad and now I can happily zoom in or zoom out in Sketch!

Hot corners can be accessed either from the mission control screen under system preferences or from the screensaver screen also under the system preferences!


How to forward traffic from one machine to another with `pfctl`? I am trying to forward traffic like this:

Internal Network Computer (192.168.1.*) → Server (192.168.186:1234) → Internal Network Computer (192.168.1.198:80)

Server is plugged into the router via ethernet on interface en0
Internal Computer is connected to router via wifi
Server can access 192.168.1.198:80 with no problems

According to various other related questions, I have gotten the following rules

nat on en0 from any to en0 -> (en0)
rdr pass inet proto tcp from any to any port 1234 -> 192.168.1.198 port 80

However I get the following when telneting:

$ telnet 192.168.1.186 1234
Trying 192.168.1.186...
telnet: connect to address 192.168.1.186: Operation timed out
telnet: Unable to connect to remote host

Using Wireshark on the 192.168.1.198 I have confirmed that the telenet connection is received however it doesn't seem to connect.

Some more info:

rdr's from 127.0.0.1 to 127.0.0.1 work fine, for example:

rdr pass inet proto tcp from any to any port 1234 -> 127.0.0.1 port 80
I have confirmed that port 80 is open on 192.168.1.198, and that it is accessible from the server
Firewall (in System Preferences) is disabled on both computers
I have enabled cross interface traffic forwarding with

sudo sysctl -w net.inet.ip.forwarding=1
I think it may be something with NAT (see the below posts) but I am not sure

The same issue is discussed on GitHub. @ctgreybeard, @dandriana, @snimavat, and @sergeyzwezdin have all reported the same issue. Does anyone have a solution?

Please Note: I would like to use pfctl and not SSH or another service.

Here are some other related posts:

https://serverfault.com/questions/791181/redirecting-traffic-to-a-specific-address-and-port-using-pf-on-macos

How can I setup my mac (OS X Yosemite) as an internet gateway

This is how I got it to work.

My example uses three hosts on my network (10.10.0.0/16):

10.10.10.10 = Linux client
10.10.6.237 = Mac "real server" providing a service on port 3000
10.10.1.200 = Mac "server" performing pf redirection, listening on port 2004, interface vlan0

natrdr.pf

rdr on vlan0 inet proto tcp from 10.10.0.0/16 to 10.10.1.200 port 2004 -> 10.10.6.237 port 3000
nat on vlan0 inet proto tcp from 10.10.0.0/16 to 10.10.6.237 port 3000 -> 10.10.1.200

The specificity ensures your server isn't NATting traffic that it shouldn't.

For those doing this from scratch, after creating your natrdr.pf file above, run the following commands from the command line or a shell script, sudo or as root.  Integrating the pf rules with Apple's pf.conf files is an exercise left to the reader.

# Enable packet forwarding

sysctl -w net.inet.ip.forwarding=1

# Unless you have any rules you want to keep, let's flush existing NAT rules
pfctl -F nat

# Enable packet filtering
pfctl -e

# Load rules from our file
pfctl -f natrdr.pf

# Confirm rules are loaded
pfctl -s nat

# Check to see connections
pfctl -s states

I then used telnet 10.10.1.200 2004 and was immediately forwarded to the Node/express server running on port 3000 on 10.10.6.237.

Example output of pfctl -s states to verify it's working:

ALL tcp 10.10.6.237:3000 <- 10.10.1.200:2004 <- 10.10.10.10:40744       ESTABLISHED:ESTABLISHED
ALL tcp 10.10.10.10:40744 -> 10.10.1.200:35947 -> 10.10.6.237:3000       ESTABLISHED:ESTABLISHED

So, to make it match your setup:

rdr on en0 inet proto tcp from 192.168.1.0/24 to 192.168.1.186 port 1234 -> 192.168.1.198 port 80
nat on en0 inet proto tcp from 192.168.1.0/24 to 192.168.1.198 port 80 -> 192.168.1.186

The order of rules is important.

The redirect rule does what's expected: it forwards all traffic coming into the server to the real server.

The NAT rule changes the (now redirected) packets to have a source IP address of the redirecting server instead of the original client.

The combination of these rules ensures that a reverse path for the return packets to follow is automatically created.


How to access continuity through applescript or command line Goal:
I want to handoff my localhost site to my phone for testing. I can access my localhost by going to http://my.ip.add.ress/localhost on my iphone. Of course, on my computer the actual address is just http://localhost. Instead of typing that address I want to trigger a script that will "handoff" the concatenation of my computer's ip address + localhost/page.

My question is if I can trigger a "handoff" through applescript or command-line. Is there a handoff API?

I'm not asking about how to get my computer's ip address.

You can probably avoid all the hassle by just using one nice service - http://xip.io

Instead of browsing to http://localhost - look up your IP and browse to http://192.168.12.13.xip.io/

Of course, your actual IP address for the local host is needed unless your router was set up to assign your test Mac 192.168.12.13 - even though you aren't asking how to get your IP, that's the key to making this easy for safari to hand off the session from macOS to iOS.

  Does xip.io cost anything?

  Nope! xip.io is a free service from Basecamp, the
  creators of Pow. We were tired of jumping through hoops
  to test our apps on other devices and decided to solve
  the problem once and for all.


Is it possible to connect iPhone to Sound In port on PC running Windows 7? Is it possible through a male/male cable to route audio from my iPhone 6 to my computer through the Sound In port?

Yes, you can use the iPhone 6's headphone port to connect a male to male mini-stereo cable to a line-in/microphone port on a PC. Since you are going from digital to analog to analog to digital, you should expect the sound quality to be fairly poor.


How can I add a website to Notification Center after denying its initial request? For example, when visiting eBay.com or cnn.com, a dialogue box pops up asking if the site can send notifications to Notification Center.

If you initially choose deny, but change your mind later, how can you go about adding a site back to notifications (manually or otherwise)?

You can select the site and revert the changes on Safari → Preferences → Notifications.


Automating numbers, Exporting the file as an excel document I have recently acquired a Macbook Pro (OS X Yosemite 10.10.4). I find the Numbers application satisfactory to work with, but I save the file as an .xlsx file after I am done. I need to make changes to the file repeatedly and save it repeatedly as the file is used as input by a program that can only read excel files.

As a consequence, every time I make a change in the file I have to go to the Menu bar, pick export as Excel, choose to replace the pre-existing excel file. I have gone through some tutorials of applescript used for 'Numbers', but I cannot find out how to automate the process of exporting a file as Excel.

on run {input, parameters}

    tell application "Numbers"
        activate
        tell document 1
            export as xlsx
        end tell
    end tell
    return input
end run

This is the code as it stands. Please let me know how to automate the process of exporting a numbers file as an excel file.

I've written a script to export to CSV originally. I've included a commented out line in that script you can switch to, to export to Excel instead:

See the gist here: https://gist.github.com/idStar/61994506d69595da3d30

Additionally, the entire script is reproduced below:

#! /usr/bin/osascript

(*
---------------------------------------------------------------------------------

 Script: SpreadsheetExportToCSV

 Command-line tool to convert a spreadsheet document to CSV
 This AppleScript is tested with and compatible with Apple iWork Numbers 3.6,
 current as at October 23, 2015.

 Parameters:
 1. Full Path to the input file, including file extension
 2. Full Path to the output file, including file extension

 Example command-line invocation:

    osascript SpreadsheetExportToCSV.scpt "/Users/me/Documents/MySpreadsheet.xlsx" "/Users/me/Documents/Converted/OutputFile.csv"

 The spreadsheet to use as an input file can be an Excel file or a Numbers file.

 Sohail Ahmed
 Blog: http://sohail.io
 Twitter: @idStar

 Creation Date: October 23, 2015

---------------------------------------------------------------------------------
*)

global _inputFilePathAlias
global _outputFilePath
global _requestedOptions

(*
 run

 This is our entry point, our main function, where this script
 begins execution. We call out to helper functions, to modularize
 the design.
*)
on run argv
    -- Ensure our CSV files are encoding with UTF8:
    ensureUTF8Encoding()

    -- Parse and determine input/output paths:
    retrieveCommandLineArguments(argv)

    -- Perform the actual activation, file open, export and cleanup:
    processSpreadsheet()

end run

---------------------- SUPPORTING FUNCTIONS --------------------------

(*
 retrieveCommandLineArguments

 Handles parsing the command line arguments passed to us.
 We return a list, where the first element is the input file
 path as an alias. The second element is the output path,
 as text (as it may not yet exist).
*)
on retrieveCommandLineArguments(command_line_arguments)
    set _inputFilePathAlias to POSIX file (item 1 of command_line_arguments) as alias
    set _outputFilePath to (POSIX file (item 2 of command_line_arguments)) as text

    log "input file path is: " & _inputFilePathAlias
    log "output file path is: " & _outputFilePath

end retrieveCommandLineArguments

(*
 processSpreadsheet

 This function is the workhorse of this script. We open Numbers,
 have it load the source spreadsheet, and invoke the export command
 to ultimately write the output CSV to the specified path.
*)
on processSpreadsheet()
    tell application "Numbers"
        activate

        -- Before we open the file asked of us, close out every document
        -- that might have opened along with the application having activated:
        close every window saving no

        -- Retrieve information about the source file:
        set fileInfo to (info for (_inputFilePathAlias))
        set fileName to name of (fileInfo)
        set fileExtension to name extension of (fileInfo)
        log "Opening source document " & fileName & "..."

        tell (open _inputFilePathAlias)
            -- In this scope, we are now implicitly dealing with the document just opened
            -- as the current target, which means we access it through the "it" keyword,
            -- as per: https://developer.apple.com/library/mac/documentation/AppleScript/Conceptual/AppleScriptLangGuide/conceptual/ASLR_fundamentals.html#//apple_ref/doc/uid/TP40000983-CH218-SW4

            set activeDocument to it

            -- Note: We could have also gotten to the active document by walking the chain from the top,
            -- i.e. right from the Application object:
            --set activeDocument to document 1 of application "Numbers"

            say "Starting Export."
            with timeout of 600 seconds
                export activeDocument as CSV to file _outputFilePath
                -- Use this instead if you want to export to Excel:
                -- export activeDocument as Microsoft Excel to file _outputFilePath
            end timeout
            say "Completed Export."

            -- Since we closed out other windows that might have been open before
            -- opening the file we sought, we really should only have one document
            -- window open.
            close activeDocument
        end tell

        quit

    end tell
end processSpreadsheet

(*
 ensureUTF8Encoding

 Microsoft Excel on the Mac is not good with exporting special
 characters as is Apple Numbers. Part of this is in the ability for
 Numbers to correctly process UTF8 formatting when exporting.

 Setup default export encoding for CSV files to UTF8, so without
 specifying anything further for AppleScript, the right format will
 be applied automatically. Since we cannot specify the CSV export
 encoding via AppleScript, we will set it via the Defaults Database
 with a shell command.

 Here are the codes that apply: 4=UTF8, 12=windows latin, 30=MacRoman
 As such, we'll specify 4 for UTF8.

 This technique courtesy of: https://discussions.apple.com/thread/4018778?tstart=0
*)
on ensureUTF8Encoding()
    do shell script "/usr/bin/defaults write com.apple.iWork.Numbers CSVExportEncoding -int 4"
end ensureUTF8Encoding


What are the variables needed to access focus properties in split screen view? What are the names of the variables (in terms of Applescript variables or otherwise) that track the currently focused application, the layout of applications in spaces, the currently focused space, and whether two applications share a space in a split view rather than 2 applications appearing in a desktop?

How does one (given a variable identifying an application) assign focus to a particular window of that application if that window resides in a split screen view?

To make the reason for asking this question concrete: the goal is to write an Applescript (or other kind of script) that assigns a keyboard shortcut that rapidly allows swapping focus between two applications that share a split screen view?

The simplest algorithm I can think of for accomplishing this (since it appears to not be a built in setting) is to

get list of current spaces (including desktops, full screen applications, and split screen applications)
get currently focused space
if currently focused space is assigned to split-screen applications, get list of those applications and application windows (each should be length 2).
get currently focused application
assign focus to next element in the list of application windows in the currently focused split screen view (which should be the other application window in the currently focused split screen)

I'm not sure if this would work quite as well to solve the problem pointed out in Switch focus in split view regarding two windows of the same application, but at least this would be a start.

I've been searching for this answer for years, and I've become very good at tracking down hidden functionality... To no avail unfortunately. Apple has no mechanism for doing anything with spaces programmatically. The only facility I found is by running the defaults command and (under one of the defaults whose name I can't recall at the moment) there is an area that'll give you cryptic window numbers and the spaces they belong to. The issue is that list isn't updated live, so it isn't really that useful. I'm still searching, but I'm fairly certain there is no Apple-approved way to interact with spaces, or split screen, or any of its other manifestations.

EDIT: Oh yes, it's "com.apple.spaces". Run the command defaults read com.apple.spaces in the terminal to get to what I was talking about.

EDIT2: Also, there's a way to activate spaces with a little bit of C code:

CoreDockSendNotification(CFSTR("com.apple.expose.awake"));
CoreDockSendNotification(CFSTR("com.apple.expose.front.awake"));
CoreDockSendNotification(CFSTR("com.apple.showdesktop.awake"));

Each of these lines will make mission control do stuff, not that it's all that useful. There are other ways to do this...


Using SSH on an iMac running Lion I am trying to get SSH/SFTP working on my iMac running Lion so that one of my friends can connect to me remotely. I have managed to get it working using my local user account, but I need to understand how I can add an additional account that my friend could use to SSH into my machine. This is probably really simple, but if someone could point me in the right direction in would be appreciated.

Easiest way in this case is to just

create another user using the Preferences panel
log into this user locally
generate the appropriate SSH key pair
transfer the public key to your friend over a secure channel

In addition you may want to tighten up your system a bit by preventing SSH logins without keys. Open /etc/sshd_config in any text editor and set

PasswordAuthentication no
PermitEmptyPasswords no

Afterwards restart SSH by disabling and enabling remote login in Preferences.