Unable to format USB flash I am trying to format my USB flash in ExFAT format to make it work on both Mac and Win devices. But I am unable to format my USB flash because I am getting an error when trying to format it via diskutil.

1) Check our external device in disks list:

2) Format:

According to the internet answers, I have tried to boot in safe mode and format USB flash then - but also got 'could not open device' error.

Can somebody help me with this?

P.S. Result of execution command from the question comment:

Macs cannot format NTFS drives because they can only read NTFS formatted drives. But if you badly want to format it to Exfat you could use a windows computer to format it to Exfat or install a third party app to format you NTFS drive.


Keyboard shortcut for monospaced formatting in Notes app Is there any way to define a keyboard shortcut for monospaced formatting in Apples Notes app? Any alternative suggestion to quickly format a single line monospaced without using the mouse?

Yes. You can define you own keyboard shortcut.

You do this in System Preferences > Keyboard > Shortcuts > App Shortcuts > (plus button).


Find multi-line block using grep and/or automator with BBEdit I have an xml file output from WordPress.

I have BBEdit as my main search tool.

I am on a Mac running 10.7.4

I am trying to find a muli-line block of text that starts with <item> and end with </item>

In the block, there must be <wp:status>publish</wp:status> and <wp:post_type>post</wp:post_type>

Does anyone have any idea how I would find that using GREP or Automator?

(Sorry I don't have enough rep to make better tags)

You can do multiline greps in TextWrangler using various pattern modifiers (i, m, s, and/or x)

e.g.

searching for

<item>(?s).*?<\/item>

will match across lines.

After that, you can modify your regex to be more elaborate.


How to maximize Macbook pro retina's battery life when working with AC power? I'm working 95% of my time with AC power and Thunderbolt Display. Since macbook pro retina's battery are no longer easily switchable I'm concerned about it's life and would like to maximize it. Before macbook retina I used to charge the battery to 50%, then after removing it I used the macbook without battery on AC power. But it's no longer possible.

I googled a little but didn't find a clear guidance about how to use your macbook mainly connected to AC power and not doing damage to your battery.

From what I know :

Full discharges should be avoided.
Keeping you battery charged to its maximum for too long time is also bad.
Try to keep charging cycles as low as possible. It's battery life (macbook pro retina battery is expected to keep 80% of its charge after 1000 charging cycles).

I try to disconnect AC power once a week until battery indicator goes down to approximatively 75% and then I connect back the AC to charge it to 100%. I don't know if it's the best steps to maximize the battery life but I think it's much better then to keep it all the time connected to the AC power.

What do you think. How to preserve battery life working on AC power ?

It's best to follow the guidance of Apple: http://www.apple.com/batteries/notebooks.html

  Standard Maintenance

  For proper maintenance of a lithium-based battery, it’s important to
  keep the electrons in it moving occasionally. Apple does not recommend
  leaving your portable plugged in all the time. An ideal use would be a
  commuter who uses her notebook on the train, then plugs it in at the
  office to charge. This keeps the battery juices flowing. If on the
  other hand, you use a desktop computer at work, and save a notebook
  for infrequent travel, Apple recommends charging and discharging its
  battery at least once per month. Need a reminder? Add an event to your
  desktop’s iCal. When your battery no longer holds sufficient charge to
  meet your needs, you may choose to replace it. If your notebook came
  with a built-in battery, you should have the battery replaced only by
  an Apple Authorized Service Provider.

  Long-Term Storage

  If you don’t plan on using your notebook for more than six months,
  Apple recommends that you store the battery with a 50% charge. If you
  store a battery when it’s fully discharged, it could fall into a deep
  discharge state, which renders it incapable of holding any charge.
  Conversely, if you store it fully charged for an extended period of
  time, the battery may experience some loss of battery capacity,
  meaning it will have a shorter life. Be sure to store your notebook
  and battery at the proper temperature. (See “Notebook Temperate
  Zone.”)

Basically what it says is use your Macbook in whichever way is comfortable to you. If you prefer to use it plugged into AC at all times, just make sure to disconnect it at least once per month and let it discharge to make sure the electrons moving around inside it.

Cycles are based on a cumulative basis. If you choose to let it go down to 50% twice, that's one cycle. If you chose to let it go down to 75% four times, that's still one cycle. The cycles will go with normal usage and you'll be much happier if you don't worry about it too much. The hardware is designed to last much of the life of the unit since the switch from Li-on batteries.

Contrary to your post, Apple DOES NOT recommend running laptops with removable batteries on AC without the battery: http://support.apple.com/kb/HT2332

Please check out this link from a less official, but still helpful source: http://forums.macrumors.com/showpost.php?p=9875442&postcount=23


Volume on Mac increases automatically when earphones plugged in I have a MacBook Pro running El-Capitan v10.11.5. Whenever I plug in my earphones, the volume gradually increases (one bar every couple of minutes), automatically. This problem has been going on for at least some months, fairly sure this happened also in earlier OS versions.

I didn't find anything about that online, is that a familiar issue? How can I solve it?

Sounds like you have headphones with volume controls and either they volume up bottom is jammed/broken, or they're not compatible with macs... The first one is my guess. The second one is rare.


Are there any DIY remedies for a iPhone 4 home button that doesn't always register? The home button on my iPhone seems to work on and off.

It does take me back to the home screen but it feels like there is a loose connection and does not trigger on every press.

Is there a fix to this besides Apple support?

You could take it apart and fix it yourself, however it will void any warranty on the phone. You can view the iFixIt Repair Guide for steps for removing and replacing the Home button. Note that you will have to take apart the majority of the phone to get to the button.

Your best bet would be to go to Apple for a repair or find an authorized repair service shop to do it for you.


Run AirPort Utility 5.6.1 in High Sierra I would like to install the Airport version 5.6.1 on MacBook with High Sierra.

It already has the Airport Version 6.3.8 installed.

Can I have both installed and without removing the 6.3.8 and use the 5.6.1 instead.

You can do this without modifying your system.

Use something like Pacifier to extract the AirPort Utility.app and Apple80211.framework from the installer.

Then, run these two commands in Terminal whenever you want to use it (substituting the correct paths obviously):

$ export DYLD_INSERT_LIBRARIES=<path-to-older-Apple80211.framework/Versions/A/Apple80211>
$ /path-to/AirPort\ Utility\ 5.6.1.app/Contents/MacOS/AirPort\ Utility

I keep that older framework and older app in the same folder, save the following AppleScript as an app (it expects to be in the same folder too), and just double-click it to launch:

tell application "Finder"
    set base_folder to (container of (path to me) as alias)
    set base_path to POSIX path of base_folder
    set library_path to base_path & "Apple80211.framework/Versions/A/Apple80211"
    set library_exists to exists (library_path as POSIX file)
end tell

if library_exists then

    do shell script "export DYLD_INSERT_LIBRARIES=" & quoted form of library_path & "
" & quoted form of (base_path & "AirPort Utility 5.6.1.app/Contents/MacOS/AirPort Utility")

else

    display alert "Apple80211.framework could not be found" message "The library was not found in " & base_path & "."

end if

This works all the way up to Mojave.


Send an email as an attachment from iPhone This may be the most easy question to answer but I have struggled for few days now to get a proper view on how to achieve attaching an email on another email in iPhone 7.

I am a new iPhone user and would like to achieve

Attach existing email onto new email
Attach existing email to a reply/forward email

Is this at all possible?

While you still can't attach emails from the Mail app in iOS 11 on iPhones, you can now drag and drop emails onto an email draft that you're editing on iPads that are running iOS 11 (so far I've tested on an iPad Pro 10.5 and an iPad 5th Gen running 11.2.1).

Create a new email (or forward or reply to an existing email)
Swipe down on the email title bar (where it says "New Message" or the subject line) - you should now be able to interact with Mail again
Tap and hold on the email in your inbox list that you want to attach (it will appear to pop up)
Drag that email to the title bar of the draft email at the bottom of the screen until the edit window pops back open
Continue to drag that email to the body section of the email draft and a green circle with a plus sign will appear on the email that you're dragging
Drop/release into the body of the email you're editing - you should now see a .eml file attached

Hopefully this means there's hope this will come to iPhones in the future!


Unable to partition SSD I am trying to partition my HD to install Ubuntu. I have reviewed other questions with similar issues but haven't been able to find a problem with the same symptoms.

Machine is is a Mid 2012 13-inch MacBook Air, El Capitan 10.11.4, with 70GB free space. I am using Disk Utility to create a 50GB partition.

This is the Disk Utility intent:

And this is the log when the operation fails:

Any assistance would be greatly appreciated.

Answering my own question: this worked.

Reboot the Mac into Single User Mode by holding Command+S during boot
At command prompt type /sbin/fsck -fy
When fsck is complete, type “exit” or “reboot” to reboot
Boot the Mac as usual, verify the disk again in Disk Utility, and partition as usual


How to make a .dmg file? I know how to make a .dmg file but I do not know how developers (Mostly games) create a window where there is the software file and sometimes theres a readme file. When I create, It shows just a normal finder window not like with custom background or where you can drag the folder anywhere on the finder window. How am I suppose to make that? I making a game and I really want to make it.

DropDMG

I use and recommend DropDMG since it has many features that make it useful for sharing software such as scripting the building of a DMG file directly from my CI server when I promote a build using the included CLI tool dropdmg.

Above: Many options for configuring a DMG file, including layouts and showing a license when opening the DMG.


iCloud Music Library and multi-CD audiobooks: Duplicate error So I've imported an audiobook into my iTunes library.
It consists of 4 CDs with about 11 tracks each. I've given them the proper author info and album info. I also gave each CD the proper number before import, and then iTunes did the rest by importing the tracks as Track 01, Track 02, etc... And giving them track number data in the info. There's 44 tracks total between the 4 CDs. They started importing to iCloud, and everything goes fine until just one track (Track 03, disc 4) decides it doesn't want to upload. It has the duplicate icon. When I click it, it says "This song is already in your iCloud Music Library." The problem is that there really isn't a duplicate. That file hasn't uploaded to iCloud, as I can see every track but that one from my iPod Touch with iCloud music. I think it may be thinking it's a duplicate with one of the other Track 03's in the album, even though the Get Info data differs in CD number.

Could this be what's going on? Is there any way I can fix this?

Here's basically what it looks like

I have right clicked that one track and clicked Add to iCloud Library, and it begins to try but then it goes back to the Duplicate icon and error.

First what I did was create a backup of the media folder (containing the imported files) under Music/iTunes/iTunes Media/Music/ARTIST/ALBUM

Then, I just deleted the entire collection on iTunes (Choosing delete songs instead of remove downloads). This deletes the copy store in iTunes folder, but not the backup I created.

Last, I just refreshed iTunes by going to File > Add to Library > (backup folder), and it copied the files back in, add uploaded them all at once, which solved the problem.


Hidden character Shift-Arrow Up-Backspace Sometimes when I want to delete a line of text very quickly I do this:

I hold the shift key and press the arrow up key to select the line above and then I press backspace. But occasionally I press all three keys at the same time which deletes the line too but creates a hidden control character with the value 08: the value for the backspace control character.

This can be pretty annoying e.g. if you are writing code and you can't figure out what causes the parse error.

Am I the only one who struggles with this from time to time? Is it possible to change this behavior?

I can't reproduce this either. However, I suggest that you hold down Command and then press Delete, as an alternative to your method. This will delete everything on the line that's left of the cursor, and will hopefully solve your problem. (You can hold down Option to delete single words. Experiment with holding down the Option or Command key, and pressing either Delete or the arrow keys. If you hold down Shift with either Option or Command and then press the arrow keys, you will be able to select text word by word, or line by line.)


Reducing Lion OS Footprint by removing unnecessary files/folders I am trying to downsize my iMac 640Gb disk to make it fit onto a 120Gb (113Gb usable) SSD.  The total size of use files is currently approximately 340Gb, of which my home folder accounts for 265Gb (which I intend to not put on the SSD, or at least not all of it).  Very rough calculations suggest that my OS and application files are taking up roughly 75Gb, which puts me approximately 2/3rds full - not bad.

But, I would like to reduce this a little further if possible, to ensure that as and when I continue to use the computer (and I have a number of large apps that do not currently have installed including music production apps with a lot of data) I am not worried about running out of space on the boot drive.

To this end I already own XSlimmer which I will use periodically to remove PowerPC and language variants from my apps, but I was wondering if there are any areas of the Base OS that I can safely remove to save further space?  I am thinking about things like OS localisation, the location of the included screensavers and wallpapers, the voice files that are used for text-to-speech etc.

Is there a significant amount of such data that can be easily removed to save a few extra Gb on the boot disk?

We get a lot of questions about this topic here. You can search for earlier similar questions and answers.

Backup first

Make a full backup of everything, a complete disk image, before you go on a spree to delete resources from your Mac.

Deleting More Unused Human Language Resources

Monolingual, which is free, can delete unwanted language support files in the /System/Library/ and /Library/ folders itself, whereas XSlimmer (which I also use) is only set up to delete language support files in the Applications folder.

iPhoto

You can "thin out" iPhoto by removing its voluminous printing templates, but if you delete them, you won't be able to print anything from iPhoto at all.

Right-click on iPhoto in /Applications/iPhoto/ and select "Show Package Contents". You'll discover several hundreds of megabytes of files in /iPhoto/Contents/Resources/Themes/. You can actually delete these (authentication required) but it will change the behavior of the iPhoto app.

Speech synthesis voices

Removing system support files from the /System/Library/ folder is dangerous. The only files I know of that you can safely delete are the speech synthesis voices in /System/Library/Speech/Voices/. You should leave one voice in there should you ever need that feature.

Fonts

You can save several dozen megabytes by deleting certain Asian fonts if you don't need them. Don't delete system fonts directly in the Finder. Rather, do it through the Apple Font Book application, which will prevent you from deleting the "reserved" system fonts that Mac OS X expects to see when it boots up, but permit you to delete "non-essential" fonts.

Screen savers and desktop pictures

Screen savers are in /System/Library/Screen Savers/.

/Library/Desktop Pictures/ has a couple of hundreds of megabytes of files you don't need.

Dictionaries

Mac OS X has a Japanese dictionary and thesaurus, several hundred megabytes in size,  in /Library/Dictionaries/. You can safely delete these if you will never need them.

GarageBand and iDVD files

If you do not use GarageBand or the older iLife program iDVD, you can save many tens of gigabytes by deleting their applications but especially their support files in the /Library/ directory.

With regard to GarageBand, depending on your installation, several gigabytes of data can be removed from two places:

/Library/Application Support/GarageBand/

/Library/Audio/Apple Loops/Apple/Apple Loops for GarageBand/

Printer drivers

Depending on your installation, you may have several gigabytes of printer drivers for printers that you have never actually used. If you are willing to take the trouble, you can delete everything in /Library/Printers/. The next time you turn on one of your printers and try to print to it, Mac OS X Lion will prompt you to download and install the driver needed for that printer alone.

Utilities to help you find files to delete

There are several utilities to list all the files on your hard drive and sort them by file size in various types of charts and graphs. These include: OmniDiskSweeper, which is free; WhatSize, a commercial app; and DaisyDisk. All these are useful not only for looking at system files but also for examining your Documents and user data. You'll find old files that you don't need and can archive or delete, saving further disk space.

Just remember

Just remember that if you do not know what you are doing, you might damage your system and then the only remedy would be to do a complete re-installation of your OS, which would put you right back where you started.


make it easier to call often used terminal commands I have a java tool that I use quite often from the command line but to use it I have to type java -jar dsim.jar. I want to make it so that I can call it just by typing dsim regardless of what directory I am in, but I can't quite work out how to accomplish this.

I have created a file at ~/.bash_profile and put into it:

alias dsim='java -jar dsim.jar'

And I have placed the dsim.jar file into /usr/local/bin as I read this is where user created command line tools should be kept. This location is in my $PATH.

I think the alias works well but location of the file doesn't seem to be accessible from anywhere. If I call dsim from within /usr/local/bin it works fine but if I am in any other directory I get:

Error: Unable to access jar file dsim.jar

How can I get this to work from any directory?

Use absolute paths for the jar file:

alias dsim='java -jar /path/to/dsim.jar'


Install CouchDB via Home Brew I'm trying to install CouchDB using Homebrew but it gives me the following error:

Error: couchdb dependency spidermonkey was built with the following
C++ standard library: libstdc++ (from clang)

This is incompatible with the standard library being used
to build couchdb: libc++ (from clang)

Please reinstall spidermonkey using a compatible compiler.
hint: Check https://github.com/mxcl/homebrew/wiki/C++-Standard-Libraries

I went to the given URL and yes: I am on Mavericks GM.
I tried a complete reinstall of homebrew but that still gives me the same error.

But how can I reinstall Spidermonkey with libc++?

I have filed a bug report on the homebrew project. The problem is fixed now.


Automatic capitalization when typing terminal commands Recently when I use the terminal and I type a command, I hear a click and whatever I had typed becomes capitalized. If I'm typing ls -lrt I'll hear a loud click and when I look at my command it has changed to Ls -lrt. The same with pwd or any command I type. The capital letter will work on some commands but not all. Does anyone know how to turn this off? I went to System Preferences/keyboard/text but the selection there to use automatic capitalization is not checked. I may have inadvertently done this with Better Touch Tool but I can't find anything about it in the app. Any help would be greatly appreciated.

Well I found the solution with help from @Allen. I tried restarting my computer in Safe Mode. The problem with capitalization went away. Based on this result it was probably due to something I loaded onto my machine. While I was in Safe Mode I started by looking at the Startup items found in the System Preferences/User and Groups. I hadn't carefully checked the Login Items in quite a while and I found out I had many. Some of these were suspicious in that the kind of item was unknown. I show this in the images below:

I had several that fit that description. Using the minus symbol shown in the bottom left of the window I deleted the suspicious login items and rebooted my computer back to regular user mode. To my joy the auto capitalization was gone. I deduce it must have been connected to one of the login items I removed. Had I removed them one-at-a-time I might have beem able to determine which one was the culpit. As it is I can only narrow it down to the ones I removed. None of these were new additions so I must have changed settings in one of these to suddenly cause my troubles. Due either to old age or the fact that auto capitalization was driving me crazy, I can't recall what changes were made recently. I may go back and try to determine which specific one was causing this but that is left for a future date.


Simplest way to capture "keystroke representation" to clipboard I'm trying to create a cheatsheet for an application I use frequently. the cheat sheet will contain the shortcut keys so I can know what to type.

Is there a simple way to capture keystrokes using Mac keyboard symbols into word or pages. Directly copying the combination to clipboard would be even more convenient, or a way to automate this entirely would be the best.

Eg: when I press "OPTION + COMMAND + P" it should save ⌥ + ⌘ + P to the clipboard or to the document.

Can I automate this documentation effort?

I wrote a tiny program for you. It'll type out any key combination you type, so after you start it, switch to Word with your mouse. You can exit it at any time with the escape key. I can share the source code if you want, there's not much of it: keystroke_grabber

If you want to make it easy to start, you'll have to drag it into the bottom right of the Dock where the trash can is, because it's not "Appy" enough to earn a space with the big boys (other apps).


Trouble transferring photos from PC to iPad I am trying to download photos from my Windows PC onto my iPad. I don't want to use iTunes. I am trying to download wirelessly. I used VLC app. I dragged my pictures into the designated area in the app. Each picture downloads and says 100% complete. A thumbnail of the picture never comes up it just says 100% in the spot the thumbnail should be. I can not find my photos anywhere on my iPad even after several attempts. I was only able to get 3 pictures to download onto my iPad. I waited a week and tried again this time nothing downloaded. I have also used several different transfer apps and nothing seems to work.

On a Windows PC the iOS device may show up as a mountable volume. If you open Windows Explorer is your iPad there?

If so open it and look for a folder called Pictures (or similar, sorry it's been a while). If so you can just drag your pictures into that folder.

Granted iTunes is a beast but it makes transferring things between a computer and an iOS device so much easier. Is there a specific problem you are having with iTunes or do you just hate it because it's a bloated pile of inefficient code?


Messages with three dashes get cut off My wife sent me a video of my son saying something, to which I responded:

What's he saying? Mommy read --- book?

A few seconds after I sent the message, the text "book?" (and possibly the last dash) disappeared from my sent message. My wife says that she originally saw the word "book", but when she went back and looked, it had been removed for her too.

Does this happen for anyone else? Is this intended, or a bug?

This is a known bug with Apple's Smart Punctuation, as explained here. To avoid this issue in the future, go to Settings -> General -> Keyboard -> switch off Smart Punctuation. This will also remove the "press space twice to make a period" functionality, unfortunately.

From using the iOS 11.1 beta, it appears that this issue will be fixed in the 11.1 update.


Is there a way to recover missing or corrupt parts of a mov-file? I did a screen recording for 30 minutes, but the file only consists of 4 minutes. The thing is, the file is 935 MB, so I expect that the rest of the movie is in there, but something went wrong in the file recording. Could that be? Is there a way to investigate this? The purpose would be to recover the missing part of the recording?
I'm running macOS Catalina.

ffmpeg has -err_detect ignore_err which might find more of the video.
Install ffmpeg (install Homebrew then brew install ffmpeg), then transcode the video:
ffmpeg -err_detect ignore_err -i path/to/input.mov -c copy path/to/output.mov


What has changed Finder list view in Lion to make "Calculate all sizes" exponentially faster? Since way before Mac OS X came on the scene, we have been able to ask the Finder to Calculate all sizes in order to determine the sum total of readable file size space contained in each folder for the Finder window in question.

I have tested List view sizing of folders on several Macs where it doesn't matter if an SSD is present or not, but Lion is so fast at calculating sizes I am curious if there is some new caching data structure or if Finder is using the metadata information from Spotlight or a similar database to speed up this calculation immensely.

Before Lion, the File Size column in Finder.app would display the size each file requires on the hard disk, not the exact file size. For example, 1 byte files were displayed as 4 KB because they do in fact take up 4 KB of space on a HFS-formatted system. There was no easy way to see the actual file size of 1 byte, other than opening File › Get Info (or using a different app, like Terminal.app and then using ls -lsa, or a Finder.app replacement like TotalFinder.app).

(Back in the day, I reported this as bug 8926275 on bugreport.apple.com.)

As of Lion, this behavior has been corrected, and the File Size column will now show the exact file size for each file rather than the size it allocates on the hard disk (which depends on the file system anyway).

Since these sizes are the same numbers you’d get from the ls binary in Terminal, they’re much more efficient to calculate.


Can I use iMovie to edit a .mov file without altering the aspect ratio? I created a screencast using Snapz Pro X that gets saved in .mov format (H.264, AAC). I want to just cut a few seconds off the end of that file. The only video editor I know of that's installed on my Lion machine is iMovie '11. Can I use iMovie to remove part of the end of the video, but maintain the same dimensions (1146x1057)?

I tried to import the movie, create a project with just the parts I wanted, and then export via "Share -> Export Movie", but this:

makes the resolution worse
alters the aspect ratio
increases the file size

Open the video file in Quicktime player and then go edit > Trim or command + T and you can trim the video in the editor.

Save the video and you're good to go.


Does closing the lid put a MacBook Pro to sleep? Would it hurt the computer if I carry it around without shutting it down? When I first got my MacBook Pro, it took less than 30 seconds to start up. Now, after several months, it takes about two minutes to startup and I can tell that it is not as responsive when using some applications (it was fast before).

I am wondering if it is because I'm not shutting it down that causes the lag during startup.

MacBooks are designed for close and go operation and you're not doing the system or hardware any harm by following the practice. That being said, there have been past issues with MacBooks not going to sleep properly when the lid is closed—the indicator being that the Mac is hot to the touch and the battery level is lower than you would expect when you remove it from your bag. There are some reports of wake from sleep issues, generally caused by a "stuck" process.

Assuming you have adequate RAM, the slowdown in your startup process is most likely caused by applications and processes being loaded at startup. The startup on my own MacBook Pro (Mid 2007 model) is measured in minutes as various mission critical utilities—QuickSilver, TextExpander, Growl, etc.—load and populate the menubar If you login to an alternate (preferably clean, stock) user account is the startup process faster?

To get a better idea about what you're loading at startup, navigate to System Preferences and open the Users and Groups pane. (Note: Users and Groups is titled Accounts on some systems.) Select your user account from the panel on the left, then open the Login Items tab.

This screen grab is from a MacBook Air that runs only a subset of the login items of my personal MacBook Pro.

If Applications that you don't need are running, you can remove them. Do this with caution, because sometimes there are login items necessary for other software to run as expected.

Beyond that, you might want use Activity Monitor to discover what's running on your Mac. Run it right after a system startup. If you amend your question to include a screenshot of your login items and/or the running processes, we may be able to help you further.


Is there a way to "throttle" MacPorts? I have an unusual request.

I'd like to slow down MacPorts. It sometimes uses a ton of CPU resources, and rather than having it run at full speed, I'd like it to run slowly and in the background.

So, instead of it compiling things in parallel (e.g. four instances of clang, each at >80% CPU usage according to top), I'd like it to use at most N cores, or perhaps some maximum total percentage of the CPU.

Obviously running in serial and/or throttled means it would take longer to complete. I'm okay with that. I'm looking for some extra control for special circumstances.

The benefits of this behavior include more computer resources devoted to whatever else I'm doing and not heating up my old laptop too much. :-)

You can set the number of cores used by updating buildmakejobs in the macports.conf file.  By default all cores are used.

  buildmakejobs

  Number of simultaneous make jobs (commands) to use when building ports. Using “0” will cause a runtime autodetection to use all available processor cores.

  Default: 0

This file is in ${prefix}/etc/macports where ${prefix} default is /opt/local


What should I do when "An error has occurred" when downloading Lion? I'm trying to download the new Mac OS. When click install, the icon pops onto the dock and says Waiting...

After about 5 minutes, it disappears and in the purchased category of the Mac App Store, next to install it says:

  An error has occurred

Why is this happening?

Edit:
Originally I could not even get the download bar in the purchased section until I reconfigured my router slightly(I'm using a BT Business Hub). I am now able to get the download bar. However, I still get "Waiting..." on the icon and after about 3 minutes, I receive the same error message:

  An error has occurred

I still believe that it is a router problem and not the app stores' servers. Has another been able to fix this yet?

Here is a screenshot when I click the install button:

And here is a screenshot after about 2 minutes:

I have sorted the issue. I just had to use a different router. The BT Business hub that I previously been using had a problem on it which prevented anything above 2GB do loose connection. This would explain other problems as well.


Applescript Access Variables Through Run Script Let's say I have a script:

set hi to 7
run script "display dialog hi"

When I run it, it says that hi is undefined.

Is there a way to make hi accessible from the run script command? If not, what else can I do? The real application for this is to change a variable name. What I do now is:

    repeat (random number from 0 to 5) times
    set rand2 to (random number from 0 to 7) + 97
    set rand to (random number from 0 to 7) + 97
    set switch to rand2
    run script ("set " & (ASCII character rand) & "1 to " & (ASCII character rand2) & "1")
    run script ("set " & (ASCII character rand2) & "1 to " & (ASCII character switch) & "1")
    run script ("set " & (ASCII character rand) & "2 to " & (ASCII character rand2) & "2")
    run script ("set " & (ASCII character rand2) & "2 to " & (ASCII character switch) & "2")
end repeat

But that doesn't work. Is these I workaround for this?

Thanks

For the variables to persist in the same scope, you have to run your whole variable switcharoos in the same run script command.

This demonstrates how to add variable to the text of the run script. It would return a list of results from the variables. However, this/your script doesn't work because you're assigning rand+1 to rand2+1, before the variable rand2+1 has been assigned. I do not know what it is you're trying to accomplish, so can't fix more of your script.
But, this answers your specific original question, syntax for adding variables into the text of a run script string.

repeat (random number from 0 to 5) times
    set rand2 to (ASCII character ((random number from 0 to 7) + 97))
    set rand to (ASCII character ((random number from 0 to 7) + 97))
    set switch to rand2

    set scriptText to ("set " & rand & "1 to " & rand2 & "1" & return & ¬
        "set " & rand2 & "1 to " & switch & "1" & return & ¬
        "set " & rand & "2 to " & rand2 & "2" & return & ¬
        "set " & rand2 & "2 to " & switch & "2" & return & ¬
        "return {" & rand & "1, " & rand2 & "1, " & rand & "2, " & rand2 & "2}")
    set theResult to run script scriptText
end repeat


Why is my ~/Library/Safari/Bookmarks.plist "damaged"? I'm trying to edit my Safari bookmarks programmatically. When I try to open the file ~/Library/Safari/Bookmarks.plist, I get an pop-up with the error:

  “Bookmarks.plist” is damaged and can’t be opened. You should move it to the Trash.

If I try to preview it by pressing space, it shows thousands of lines of this kind of nonsensical content:

Despite of this my Safari bookmarks are working normally though.

I am using FileVault, but shouldn't all the files be unencrypted when the computer is open?

Mine bookmarks preview looks the same as yours; in finder or from terminal you do not have the rights to do something with. However, with Safari | Bookmarks | Edit Bookmarks you can do anything you need with it - deleting an item, renaming, modifying the address. If you need to export it, you can do it from File | Export Bookmarks... - and will be exported as .html (while you are in Edit page).


EFI Partition seems to have been replaced, can still boot with rEFInd but need to repair EFI Partition Somehow in the process of installing Ubuntu on an external drive I seem to have overwritten my EFI partition to an HFS+ format named "Ubuntu". With rEFInd installed I don't have any problems booting into macOS, so I'm wondering if there is a non-destructive way of rebuilding my EFI partition.

diskutil list

gives me:

where /dev/disk0s1 should be the EFI partition that is missing. Does anybody have any tips on how to non-destructively rebuild the EFI partition?

In case anybody has the same problem in the future, I solved it by following these instructions
How to fix broken EFI partition?


Are there any downsides to installing Lion Server on my laptop rather than Lion? I'm trying to decide whether to get Lion or Lion Server. I'm not too worried about the $20 premium or the extra disk space used, but I'd rather not make things more complex to work with and manage, nor do I want my laptop to run slower as a result of having the Server version.

I'm not sure if I will use any of the Server specific apps in the long run, but I'm certainly curious to try them out. I just want to make sure that I can disable those services/features I don't use and that in other respects Lion Server really is just Lion + extra features.

Actually you have to have Lion to get Lion server which means that the cost is really $30 + $50. Server configures your computer to host wikis and mail server. It really isn't meant for day to day consumer uses. I wouldn't recommend it.

If you want to try Lion server I recommend installing it in a Virtual Machine (VMWare, Parallels, VirtualBox) and playing with it that way.


How can I access my scanner directly without going through System Preferences? Since my printer has scanning capabilities, the Printers & Scanners pane in System Preferences has the "Scan" tab available.
This is the only known place to start and scan one's document.

I am looking for a quicker way to access my printer scanning window.
searches for AppleScript and Automator solutions did not helped me.

Am I that bad a searching? The smallest hint will be appreciated.

The Image Capture application can do this for you. Just connect your printer and launch the application. It comes with OS X.

Image borrowed from: http://support.apple.com/kb/HT4505. You can also find instructions there under the heading How to scan.


combine two audio inputs (microphones) for Zoom I am trying to combine two microphones (usb & bluetooth, so no hardware option exists probably) to feed the combined audio to Zoom. I tried this with the Audio MIDI app (creating 1 aggregate device with the two inputs) of macOS and judging from the input level in system preferences it seems to work. Now I wanted to use this as the audio input in Zoom, however this did not work. It seems that Zoom somehow only took some of those channels effectively discarding one of the two microphones. Hence my question: is there some way to combine two inputs (ideally adjust their levels) and feed that to zoom?
I have read a couple of similar questions (just without zoom reference) such as here, but they mostly to point to Audio Hijack which looks great, but I find it ridiculously expensive for such a little task.

The problem with aggregate devices in macOS is, I think, that the different input microphones will be assigned to different channels. Zoom might pick up only the first channel of the aggregate device rather than mixing all the channels together.
Using a virtual audio device and a mixer software, one could mix the different microphones together into one channel of the virtual device and then select the virtual device as microphone in Zoom. Originally, I was thinking of soundflower (brew install soundflower) or vb-cable (brew install vb-cable), maybe in addition to obs (brew install obs) for mixing. But as BlackHole has been mentioned in the comments, let's try this one:

BlackHole is a modern MacOS virtual audio driver that allows applications to pass audio to other applications with zero additional latency.

Install the homebrew package manager
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

Install the BlackHole virtual audio device
brew install blackhole-2ch

Install a mixer software that will be used to combine the microphone sources. You can use Apple Logic Pro if you have it, or you can use obs (free). Unfortunately, I didn't manage to get it working with Apple GarageBand, because this couldn't handle both microphones simultaneously. Here, I'm using obs.
brew install obs

In obs, in the "sources" section, add the first microphone as "Audio Input Capture".

Then add the second microphone the same way in obs.

In the obs settings (Cmd+,), under "Audio", under "Advanced", select the BlackHole audio device as "Monitoring Device".

In obs, for both microphones, you need to activate "Audio Monitoring". This will route the signal to the BlackHole device.
You find it in "Advanced Audio Properties" for the microphones.

Finally, in the Zoom settings, select the BlackHole audio device as microphone.

The volume levels of the two microphones can be mixed in obs. Zoom used this mix as input.


Text shortcuts reset to older settings in System Preferences I use the Text shortcuts replace function provided by Mac OS X's System Preferences' Keyboard panel quite often. It helps me type things faster in most applications, such as my phone number, my full address, etc.

Lately, I've noticed that the text fields that I have recently updated got deleted/replaced by older values (maybe it's synchronized with a Cloud backup?). It's not the first time it does that.

This is what I have in situation 1 (correct information):

And after a few days when I'll use one of these shortcuts, I'll find that they have been replaced to previous info. Situation 2 presents old info as such:

So I have to go back to Keyboard preferences, and re-type my current information where needed each time.

Where is this old info coming from? Another Cloud-linked device? Since this happens on a computer connected to the internet, why won't the info update on all devices when I edit it?

Yes, they cross-pollinate from other devices. Mine come from my phone.

I'm really not certain why they don't correctly sync both ways. If I add one to the Mac it appears on the phone, but ones deleted from the Mac don't necessarily delete from the phone & may later re-appear on the Mac.

I've found the best solution is to just make sure you've also deleted them from any other device.
Settings > General > Keyboards > Text Replacement


List connected USB device record Basically the other day I left my macbook unattended at a coffee shop while I stepped out for a smoke. I feel as if I had something exfiltrated from it while I was outside. To cure my paranoia, I am making this question on due part. Can anyone tell me how I can view some kind of history or log file under OSX El capitan (if there is any) that can show me all USB devices that were connected to my macbook during a certain time or date?

Mounting and unmounting a USB disk should be logged in the log files. You can use the Console app to search through the logs.

Also, teach yourself to always lock your screen with a password when leaving the keyboard.


Per user proxy - OS X 10.10 On 10.9 and previous we used MCX to manage proxy settings on a per user basis. (User level MCX).

This no longer works on 10.10 as MCX has been depreciated for some time now and I am surprised how much it still works in 10.10. So I have looked down the configuration profiles route but I can't see an option for it there either.

Any ideas?

OS X Yosemite (10.10.1)

I have found a solution (possibly temporarily), as part of our loginhook shell script I have entered the following:

UserName="$1"
UserGroup="$(sudo -u $UserName id)"
if [[ $UserGroup == *teachers* ]] ; then networksetup -setwebproxy Ethernet <hostname> <port> off ; else networksetup -setwebproxy Ethernet <hostname> <port> off ; fi
if [[ $UserGroup == *teachers* ]] ; then networksetup -setsecurewebproxy Ethernet <hostname> <port> off ; else networksetup -setsecurewebproxy Ethernet <hostname> <port> off ; fi

Essentially it sets the proxy to a specific hostname and port with no authentication if they are part of a particular group. If they are not then they go to a standard proxy port.


How can I reset a device with broken lock button and touchscreen? I have an iPhone 4s on iOS 7. My lock (sleep/wake) button has been broken for months now and I've been using the assisted touch service to lock my phone screen ever since.

However, just over an hour ago my touch screen has decided to pack in also. I can bring up the menus from swiping up and down but anything else will not work, at all. So obviously I can't restart my phone by holding the power button and home button at the same time since the lock button doesn't work and I also can't turn it off as you must swipe the screen to select "power off". Has anyone got any ideas on how I can try to fix this?

You can go into your settings and turn on Assistive touch to turn your phone off.. The only way to turn it back on though is by using your charger.. If your phone decides it doesn't want to turn on anymore or charge like mine does then your stuck with a phone that wont turn on..


How to download public photostream album from icloud.com? My friend shared an album on icloud.com/photostream, by making it public and provided me its url. Now I can download individual photos in the album, but there are over 200 pics. Is there an option to download the whole album at once? I am using chrome on Macbook.

There is no such function in iCloud, but you can install this here in chrome and use it: Chrome Webstore Link, I have used it for iCloud before and it just works perfect.


Can I flash a PC Radeon 5870 for use in a Mac Pro? I have a Mid-2010 Mac Pro, Single CPU, MC560LL/A. It's equipped with the Apple-provided Radeon 5770.

However, I have a Radeon 5870 from my old PC lying around. I know I can't directly use it, but I wonder if there's a way to flash it to work with the Mac?

Yes you can. Netkas has a ROM at that link that works for 5870s.

You might also get by without flashing by going the Hackintosh route and adding some kexts


Downgrade Safari Browser I have a MacBook Pro with OS X 10.8.5 and I have downloaded the wrong Safari browser, for OS X 10.10.

It says "You can't use this version of the application "Safari" with this version of OS X".

How to downgrade the incorrect version for OS X 10.10 and replace with the newest Safari for OS X 10.8.5?

From: Get the latest version of Safari for your Mac

  You can keep Safari up to date by keeping macOS up to date.

  Safari is included with your Mac. To get the latest version of Safari, install the latest macOS.

  To keep Safari up to date for an earlier macOS, install the latest
  updates for that macOS.

Note: Updated to reflect changes in Apple Support HT204416 as of: Jun 15, 2017


is python accepted in the mac app store? I know Objective-C is the recommended language for mac app store apps. What if I would like to write a mac app with python? Will my app be rejected when published?

The App Store will accept any binary as long as it doesn't require anything that isn't included with the system or in the binary. Because Mac OS X includes Python, it should be acceptable. There are a variety of libraries and helpful tools for writing Mac apps in Python such as Py2app and PyObjC. Some developers have successfully used them to write apps and get them on the app store.

Relevant guidelines from Apple:

  2.14 Apps must be packaged and submitted using Apple's packaging technologies included in Xcode - no third party installers allowed
  2.15 Apps must be self-contained, single application installation bundles, and cannot install code or resources in shared locations
  2.16 Apps that download or install additional code or resources to add functionality or change their primary purpose will be rejected


Finding and disabling unnecessary open ports on High Sierra I know open ports let applications communicate with devices or applications on network or internetwork, however I have been using my MacBook for 5 years and I have installed and removed lot of things over time.

I will highly appreciate it if someone can please tell me how to list all open ports, and which ports are being open/used, and by which applications on my MacBook.

The command you're looking for is sudo lsof -i -n -P | grep LISTEN.

lsof by default lists all open files (where an open file may be "a regular file, a directory, a block special file, a character special file, an executing text reference, a library, a stream or a network file (Internet socket, NFS file or  UNIX  domain socket.)" (source: lsof man page).

-i lists all Internet and x.25 network files.

-n tells it not to resolve hostnames but use IPs instead, resolving hostnames potentially takes a long time

-P tells it not to convert port numbers to port names (i.e. 80 -> http).

Piping this output to grep LISTEN shows only the open ports which are listening for incoming connections, if you need to see all open internet connections, omit this pipe.

The list shows all listening ports, their processes, pids and users, so you can easily trace the programs from there.


MacBookPro wont boot Transcend SSD320 I have been having trouble booting my macbook pro. I have a backup of everything on the cloud so I tried reinstalling the system from my usb mountain lion stick. Unfortunately the disk utility did not want to reformat my HD and I ended up removing the HD placing it in a hard drive enclosure and proceeding to reformat/reinstall the system. This boots fine from the usb but when I put it internal I get stuck on the boot screen with the apple logo and the spinning lines below.

I tried booting in safe mode and this is the output I got this:

Anyone understand that output?

Strange indeed!

It runs from USB but not when you put the hard drive back in the computer?

In any case check your disk for problems.

  Start up your computer in single-user mode to reach the command line.
  Note: If necessary, perform a forced restart as described in the
  Emergency Troubleshooting Handbook that came with your computer.

  On desktop computers, you can do this by pressing the reset/interrupt
  button (if there is one) or holding down the power button for several
  seconds. On portable computers, simultaneously press the
  Command-Control-power keys. If your portable computer doesn't restart
  with this method, you may need to reset the Power Manager.
      At the command-line prompt type:

/sbin/fsck -fy

Press Return. fsck will go through five "phases" and then return information about your disk's use and fragmentation. Once it finishes,

  it'll display this message if no issue is found:

    ** The volume (name_of_volume) appears to be OK

If fsck found issues and has altered, repaired, or fixed anything, it will display this message:

    ***** FILE SYSTEM WAS MODIFIED *****

Important: If this message appears, repeat the fsck command you typed in step 2 until fsck tells you that your volume appears to be OK

  (first-pass repairs may uncover additional issues, so this is a normal
  thing to do).

When fsck reports that your volume is OK, type reboot at the prompt and then press Return.

But it could be just the flat cable connecting the hard drive to motherboard !


Mac OS X Lion and sshpass I've upgraded from Mac OS X Snow Leopard to Lion. I used several scripts with sshpass but after I upgraded to Lion the following error appears:

Permission denied, please try again.
debug1: read_passphrase: can't open /dev/tty: Device not configured
debug1: permanently_drop_suid: 502
ssh_askpass: exec(/usr/libexec/ssh-askpass): No such file or directory

I can only connect with sshpass (or type the password manually). No public/private key way. I've reinstalled MacPorts and sshpass.

How can I get ssh-askpass? How can I configure /dev/tty ?

Greets!

You should first file a complaint with the server's administration, observing that public key authentication is vastly more secure than simply a password, but I'll assume you've already done so, and your admins are simply idiots.

Apple sadly removed ssh-askpass when they integrated its functionality into ssh, scp, and ssh-add.  There is however an SSHKeychain package that provides an ssh-askpass with an Apple-like Cocoa password prompt for macports' openssh package.  It should fix your problems the way you want, perhaps even setting the SSH_ASKPASS variable for you.

Just fyi, I'd usually recommend against installing the openssh macports package itself because it break your Apple password prompt, but once you've installed SSHKeychain macports usually offers a more recent openssh than Apple.

There is nothing wrong imho with embedding passwords in scripts when the server disables public key authentication, i.e. if they cared about security, they should reenable public keys.  There are even servers that intentionally break sshpass.  You could access such machines using the following expect script :

#!/usr/bin/expect -f
set timeout -1
set send_human {.05 0.1 1 .07 1.5}
eval spawn $argv
match_max 100000
expect {
   -re "USERNAME@(\[0-9A-Za-z_\\-\\.\]+)'s password: "
     { sleep 0.1 ; send -- "PASSWORD\r" ; sleep 0.3 }
}
interact

You may speed up this script by reducing the sleeps and send_human delays.


Can I restore an iPhone backup taken from a previous iOS version, or is there a better way to retain my data? I just put orders in for a few new iPhone 4S upgrades for the wife and I but I'm not sure how to keep her data (app data mainly, the other essentials are synced with outlook).

She has an iPhone 3G, so can't upgrade to iOS 5 then backup where my 3GS phone can.  Can an iTunes backup of her 4.2.1 (latest she can get) iOS be restored to a newer iOS 5 phone, or will it only work on an equivalent 4.2.1 iOS-running device?  Or...is there another series of steps to make that possible?

If not, is there a completely different way to get her app data off the phone and onto her new one?

Aside: I realize I can test this as soon as the phones actually arrive...but we're sending the current ones off for resale as soon as possible after getting the long-awaited upgrades.  For that, I'm trying to get anything I may need to order for the transfer, etc. taken care of ahead of time.

Yes, this is possible.  The backups themselves contain application data and other information that isn't particularly version-specific (with the exception of going from 4.3 backwards, as pointed out by hobs above).

In fact, I had to do this exact process recently, going from 4.2.1 to an iOS 5.0 gold master on an iPhone using a backup, and it went off without a hitch.  Developers who want to install a prerelease OS version must put their devices in recovery mode, clean install the OS, then restore application data and settings from a backup.  I did this for my iPhone, which I hadn't upgraded to the latest 4.x OS, and everything came across cleanly to iOS 5.0.

The one thing to watch out for is that if you don't encrypt your backups (by selecting the "Encrypt iPhone backup" option in iTunes), your device's keychain will not be transferred to the new device. For non-encrypted backups, the keychain is only preserved when restoring onto the same device you backed up from.


Can AppleScript get folder contents with file extension exclusion? Looking for a way in AppleScript to get the contents of a directory with an exclusion to parse through. I know how to do this using find in a for loop with the command:

find . -not -name "*.bat"

but I'm curious to know if there is an AppleScript only approach to getting a folder's contents without the file extension .bat.

I've built a dummy directory on my desktop, added several files and tried:

tell application "Finder"
    set theFiles to get every item of (entire contents of folder (choose folder)) whose kind ≠ ".bat"
    reveal theFiles
end tell

the .bat files are highlighted. Using does not contain compiles but errors out to:

Error:

  Can’t get every item of true.

Code:

tell application "Finder"
    set theFiles to get every item of (entire contents of folder (choose folder) does not contain ".bat")
    reveal theFiles
end tell

Trying another approach I get an error of:

Error:

  Finder got an error: Unknown object type.

Code:

tell application "Finder"
    set theFiles to get every item of (entire contents of folder (choose folder)) whose type ≠ {"public.bat"}
    reveal theFiles
end tell

If I try to modify the approach I can only get a solid result if I narrow down the name of a bat file using:

Code:

tell application "Finder"
    set theFiles to get (every file of folder (choose folder) whose name is not in {"foobar.bat"})
    reveal theFiles
end tell

In pure AppleScript is there a way to get contents of a directory with an exclusion for file type? I would possibly like to chain the exclusion for multiple file types.

Try this :

tell application "Finder"
    set theFiles to files in folder (choose folder) whose name does not end with ".bat"
    reveal theFiles
end tell


Suggestions for an iPhone app for contacts I am looking for an iPhone app for our sales team that would allow them to do the following:

Group contacts into custom groups
Add meeting notes against a contact
Locate contacts on a map (optional provide directions from current location)
Store extra images such as business card against a contact
Doesn't screw up Outlook contacts

Here's one that appears to do what you want, and happens to be free:

http://itunes.apple.com/us/app/ycontacts/id340140852?mt=8


How do you set a rule to move sent items in Mail? I've got a rule set in my Apple Mail app to move email older than 90 days out of my inbox to a separate local mailbox (to free up some space on my server – I use imap).

My inbox rule is

If [all] of the following conditions are met:

Account [My Main Account]

Date Received / Is Greater Than / 90 days

Perform the following action

Move Message to mailbox: [My Local Backup Mailbox]

That works well, but I want to do the same for sent items.

I can't see any rule options that affect the Sent items folder (or any other specific mailbox for that matter)

Any idea?

I'm on El Capitan 10.11.6


Purchase iTunes Match in countries that do not have it? Can I change to the US store in iTunes and purchase iTunes Match and then after the sync switch back to Swedish store in iTunes and still have access to iTunes Match?

Nope, you can’t. Also, you have to have a US credit card to use iTunes Match in Sweden. Even if you do find a way to sign up for iTunes Match, there will be problems.

Once you switch to the Swedish Store, you will lose access to iTunes Match.


I deleted the update file for iOS 9.3. Is it possible to reinstall it? I was having trouble installing the new iOS 9.3 on my iPhone 5 and I got the advice that I should delete the update file and try to reinstall it. The problem is now that I have deleted the file I can't find the update file for iOS 9.3 again. I have restarted the phone but it didn't help, it says I have the latest update (9.2.1). Is it possible to install iOS 9.3 now?

Update: I got the new update today randomly. The installation of 9.3 went successfull.

Apple has pulled the iOS 9.3 update for some (older) devices because of a bug that could prevent using your device. Apple is not signing iOS 9.3 for your iPhone (5s and older), so it is not possible to update by official means at this time. According to the link below, 9.3 could potentially brick an older phone under certain conditions.

Source: http://9to5mac.com/2016/03/24/bricked-iphone-5s-5-ipad-2-ios-9-3-fix/


macos screenshot without opening preview application Is there any way to take a screenshot without opening preview application on macOS Catelina ver. 10.15.5?
I was trying to find some information, but all I could find was about disabling Screenshot Preview Thumbnails when record a screen.
The problem what I'm facing is that the preview application is automatically opened when I take a screenshot image of screen, that I've never seen in previous version.
Could you tell me to solve this issue? Thanks in advance.

To take a screenshot on macOS Catalina, you have 3+ options. The first is pressing Command + Shift + 3 which will screenshot the whole screen. The second Command + Shift + 4 which will allow you to select an area to screenshot. The third is pressing Command + Shift + 5 or typing "Screenshot" into Spotlight search. These will by default not open Preview. I did find a way that might help though. Open Screenshot or Command + Shift + 5 and then click options and save it to another location besides Preview or whatever is selected.


Chrome 69 on Mac fullscreen. Toolbar pushes page content down After recent update, chrome started pushing page content down, when cursor pointer is triggering OS X's toolbar to show up. I'm pretty sure that wasn't happening before and this effect is quite annoying. Is there way to turn it off so content wouldn't be twitching all the time?

Go to chrome://flags/#views-browser-windows and select Disabled on the dropdown for the "Use Views browser windows instead of Cocoa" flag. Relaunch Chrome.

This should bring the old behavior back, with one caveat: it will bring the old design back too.

This flag has been removed in chrome 71 so there is no way to change the behavior from 71 onwards


Stop Safari 12.1 from auto-submitting forms Since the recent macOS 10.14.4 update which includes Safari 12.1 (14607.1.40.1.4), last started to automatically submit web forms with login & password fields once a value for password or login is selected from auto-fill options.
This seems to be related to the new 10.14.4 feature where Touch ID got an option to confirm auto-fill in Safari. However I have it switched off but Safari still does this crap.
I'm curious if anyone else have the same problem and how to solve it.

UPD Starting Safari 13.0 (14608.1.49) auto-submitting is disabled!

I have this issue too, and I've just spent a long time with an Apple Support chat agent.

This is a "feature" introduced in Safari 12.1.

What's new in the updates for macOS Mojave

  Streamlines website login when filling credentials with Password AutoFill.

There is currently no way to turn this off. This is the solution the agent proposed. Submit a feedback to Apple:

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

  ...submit your feedback on the feature and your experience so far.

Maybe if we kick up enough of a fuss? It is a pain, and it also screws with captchas quite impressively...


Install High Sierra using Screen Sharing I have a headless Mac mini that currently runs macOS Sierra. I typically control this machine using Screen Sharing, which works fine even when rebooting a machine.

I'd like to upgrade the machine to macOS High Sierra, but am not sure if a complete OS install will work using Screen Sharing. Perhaps it will disable Screen Sharing for security reasons upon install, perhaps there are dialog boxes which have to be answered before Screen Sharing is enabled, etc.

Does anyone have experience doing this?

I've tested this by screen sharing a VM and it seems to work great!

Using macOS screen sharing app, connect as an administrator and be the only user logged in to the machine at the moment. If, on connecting, you get a message that another user is logged in and whether you want to share session or create a new session, cancel and log in as the correct user. The update will proceed correctly regardless of whether you do this, however you won't be able to see the progress of the update, as other sessions are disconnected immediately.

I'm not aware of any macOS update which has ever required input outside a user account. The setup assistant (‘Sign in to iCloud’, etc) happens after you log in to your user account again, which is usual screen sharing.

Upon starting the update, the user is logged out but the progress bar is still a standard macOS application. Screen sharing continues to work fine at this point.

Once the ‘progress bar’ stage of the installation is complete, the machine reboots, and screen sharing is disconnected. macOS screen sharing app shows ‘reconnecting’ and eventually the connection is resumed. If your Mac takes a while to reboot, screen sharing may time out, so wait a while and manually reconnect.

If you have Little Snitch installed, it should be fine, but might also be worth choosing ‘Silent Mode — Allow Connections’ just in case for the duration of the update.


Use Mac connected to cable router (no WAN) as the Gateway of the LAN A mac computer (OSX Mavericks) is connected to a TP-Link router via WiFi, as well as a number of other devices. The TP-Link cable router (no ADSL modem), is not connected to a WAN. The mac computer has access to the internet via USB 3G modem. I would like, if possible, to offer my mac's internet connection to the LAN and have the mac act as the gateway of the LAN.

In short, replace Internet access of the router through WAN with mac's access to internet through USB 3G modem.

USB3G -- Mac -- Router -- Device1, Device2, etc

i.e. give internet access to Device1, through Mac's internet access of USB3G. It has to pass through the router, therefore using OSX's internet sharing is not an option.

Thanks

Internet Sharing

Open System Preferences, under the Sharing pane, you can configure Internet Sharing:

Share your connection from: select your 3G USB modem
To computers using: Select the interface that your router is attached to (I assume ethernet0)

With that set, you will need to configure your router to use the iMac as the gateway (by plugging it into the WAN port or somehow configuring that in the router's UI).


Can I change the startup sound on macOS Big Sur? I wanted to find the audio file with the startup chime and either switch it with another one of mine or edit it but i can't locate the file.
Does anyone know of a way of finding this file or to get the same wanted result in another way?

On an Intel Mac, the startup chime is part of the Mac's firmware. You can't just replace it, like you could a normal audio file.
Think about this logically—the startup chime plays as soon as you turn on your computer, before it loads the operating system. And if you wipe your hard drive, the sound will still play. How would that be possible, if the chime was stored on your drive?


How to wake the screen from terminal? I often have my MacBook Pro in clamshell mode attached to the second monitor. On my first monitor I have Windows machine and I use Synergy-Foss software to share only one mouse+keyboard between them.

Problem is, sometimes I forget to turn on Caffeine (that prevents screen from sleeping) when I don't use Mac for a bit longer and the screen goes to sleep.

Unfortunately mouse/keyboard activity through Synergy-Foss software isn't waking the screen. Is there a terminal command which would wake the screen?

That sounds like your Mac is actually sleeping (suspend-to-ram) and not just turning it's screen off. If the screen was just turned off, simulated mouse/keyboard input from Synergy should wake it back up. If it's sleeping it won't, because your Mac isn't listening for Synergy network traffic when asleep.

You can either adjust the power save settings to only turn the screen off, but not actually go to sleep (but then you're sort of already doing that via Caffeine when you remember to) or wake the Mac via a Wake-on-LAN magic packet that will awaken it even from sleep mode, which can be sent from a command-line utility on the Windows machine.

If that doesn't work to your satisfaction you can also wake the Mac up in scheduled intervals via pmset (see man pmset for more information). For example, to wake up every Monday to Friday at 8:30am:

 pmset repeat wake MTWRF 08:30:00


iMac freezing with graphical artifacts, what to do? My iMac 27" from 2011 has recently been experiencing random freezes. It either restarts or I am forced to reboot (holding power button several seconds). When frozen the iMac does not respond to pings and nothing at all is written to the system logs.

Symptoms are graphics issues which happens just before it freezes. Tearing, flickering and random graphical artifacts. When it freezes, it usually shows a screen with striped patterns, a grey or black screen. I have checked CPU and GPU temperature and there are no problems with overheating.

Once it hangs and I reboot, the computer usually fails to boot and hangs during boot with a gray screen. At this point I cannot get it to boot at all, except into single (console) mode. Checking disks reveals nothing and running apples hardware tests tells me everything is ok.

If I leave the computer turned off for a while (say over the night) and then try to boot it, everything works.

Someone suggested it may be power-related somehow, but I have no idea how to check that.

Any ideas how to diagnose this?

Turned out to be a faulty graphics card. I replaced it with a new, and problems went away.


Cannot send iMessage from MacBook Pro I have been using my MacBook Pro for nearly 2 years. I have no problem using iMessages both on my iPhone and Mac. However, today, I can't seem to be able to send any messages out from my Mac. There is no problem on my phone. Also, I cannot use FaceTime on my Mac.

I reviewed through the internet for some solutions, but nothing seems to work, such as deleting files, changing setting on the Flash Player.

How can I resolve this issue?

It has something to do with not having a serial number on your Mac (after motherboard repair or so). You need to go to an Apple Store to have it “flashed” back. iMessage and FaceTime won't work without the serial.


Does the iPad 3rd generation output 1080p video using the HDMI adaptor? I can play 1080p videos I've loaded onto the iPad using the video player on the iPad itself.  Before I invest in the HDMI adaptor, I'd like to know if the HDMI output actually displays 1080p on the external display, and shows the video at full resolution?

I'm worried that either the output will be something lower (1080i, 720p) or that it may be 1080p output, but the video will be resolution reduced to 720p or 480p even though displayed on a 1080p device.

It works at 1080p. As stated on the Apple web site:

AirPlay video streaming to Apple TV (3rd generation) at up to 1080p and Apple TV (2nd generation) at up to 720p
Video mirroring and video out support: Up to 1080p with Apple Digital AV Adapter or Apple VGA Adapter (adapters sold separately)

Enjoy your new iPad!


How to disable auto load of applications on restart/turn on over OS X Catalina? Every time when I turn on my mac it immediately opens previous applications...

For example - Safari and Video editor were opened before to turn off my laptop I closed all applications and then shut down the laptop. Next time when I turn my mac on it immediately opens again last closed applications (Safari and Video editor for example).

I found this answer on SO

https://superuser.com/questions/327460/how-to-disable-auto-load-of-applications-on-restart-over-os-x-lion

it did not help

Also, I checked auto-loading applications

There are not any applications listed as auto-loading.

So, question is - how to disable these recent auto-loadings?

I know this isn't a permanent solution, but from what you are describing it only happens when you recently close an app and then restart your computer. Here is a screenshot from a support article on the Apple Support website  Along with this solution instead of closing the application, make sure that it is totally closed (the little white dot below the application is gone).

For example:
Application still open:
Application totally closed:

Let me know if any of this helps!


Can't write on external HDD after upgrading to OS X El Capitan I am using a LaCie external hard disk in my MacBookPro for 3 years. After having updated to OS X El Capitan, I am no longer able to write on the HDD and I have read-only privileges. Info shows that the HDD is formatted in NTFS but, before upgrading, I was able to both read and write on the hard disk without any problem and without any external app.
Any suggestions to solve this issue?

[Update]: I have installed Tuxera NTFS and now everything works fine. Before I had other applications that are no longer valid for El Capitan.

You have to install Tuxera NTFS or Paragon NTFS, OS X is not able to write on NTFS.

http://www.tuxera.com

https://www.paragon-software.com/home/ntfs-mac/

Edit :

A free solution : http://sourceforge.net/projects/ntfsfree/


Why files created by Kaleidoscope App are in quarantine? I like to use Kaleidoscope (v 2.1.0 - build 133.01 under Mac OS X 10.8.5) to compare 2 directories.

But, when I create files by copying them from a directory to another using Kaleidoscope, (e.g., when a file is missing in one of the two directories), the file is always created with an extended attribute com.apple.quarantine!

An exemple:

creation of 2 directories to compare, with a file in the first:

$ mkdir rep1
$ mkdir rep2
$ echo test > rep1/test.txt

checking attributes:

$ ls -lah rep1
total 8
drwxr-xr-x  3 user staff   102B 26 jui 20:52 .
drwxr-xr-x  7 user staff   238B 26 jui 20:51 ..
-rw-r--r--  1 user staff     5B 26 jui 20:52 test.txt
$ ls -lah rep2
total 0
drwxr-xr-x  2 user staff    68B 26 jui 20:52 .
drwxr-xr-x  7 user staff   238B 26 jui 20:51 ..

Selection of the file to copy it with Kaleidoscope:

Copy operation:

result of the operation on the attributes:

$ ls -lah rep1
total 8
drwxr-xr-x  3 user staff   102B 26 jui 20:52 .
drwxr-xr-x  7 user staff   238B 26 jui 20:51 ..
-rw-r--r--  1 user staff     5B 26 jui 20:52 test.txt
$ ls -lah rep2
total 8
drwxr-xr-x  3 user staff   102B 26 jui 20:55 .
drwxr-xr-x  7 user staff   238B 26 jui 20:51 ..
-rw-r--r--@ 1 user staff     5B 26 jui 20:52 test.txt

As you can see, an @ was added to the attributes of test.txt in rep2, and with more investigation, it's easy to see that it's a com.apple.quarantine created because of Kaleidoscope:

$ xattr rep2/test.txt
com.apple.quarantine
$ xattr -p com.apple.quarantine rep2/test.txt
0002;53ac6c96;Kaleidoscope;

I now it's easy to get rid of it with xattr -r com.apple.quarantine [file] on a file or xattr -dr com.apple.quarantine [directory] on a directory, but I find this very annoying!

Here are my questions:

Why, an extended attribute is added on my files each times they are created through Kaleidoscope (new Mac OS security for non-sandboxed apps, or anything else…)?
Is it possible to avoid this comportment, and to create files with Kaleidoscope without having a quarantine on each files?

Thanks a lot for your help and your time!

[EDIT]

Tanks to konqui, I've now a solution to completely disable the files quarantined, but I'm looking for a more specific solution, only for Kaleidoscope… Is this possible?

And is there any proof about our theories about thoses quarantine, or are they due by something else that the new security for non-sandbexed app?

Thanks a lot for your help, and thank you konqui for what you've already done.

The system's quarantine feature is a good security measure so I would not recommend this to everyone, but if you are confident in the files you download and run on your system then one option is to disable quarantining altogether. To do this, open the Terminal and run the following command, then reboot the system:

defaults write com.apple.LaunchServices LSQuarantine -bool NO

source: http://www.cnet.com/news/workarounds-for-quarantine-bug-in-os-x-lion/


View images on CompactFlash on iPadPro using Lightning to USB 3 adapter? With my Canon WiFi-enabled DSLR, while on location I'm able to wirelessly copy stills to my iPad Pro and view the shots on the iPad Pro.

I'm trying to do same with my WiFi-less Canon DSLR.

Is this possible by inserting the CF card in a card reader connected to "Apple Lightning to USB 3" accessory which is then plugged into the iPad Pro.

a) What is your experience with this setup?
and
b) What is another alternative?

Apple says:

  Add even greater capability and versatility to your iPad Pro by powering the Lightning to USB 3 Camera Adapter with a USB Power Adapter. Then you can connect USB peripherals like hubs, Ethernet adapters, audio/MIDI interfaces, and card readers for CompactFlash, SD, microSD, and more.

It sounds like using a USB card reader is supported. However, you may need to plug a USB-C power adapter in to your Lightning->USB3 adapter to get it to work. Thankfully there are USB-C battery packs if you want to stay mobile.


If you've enabled Messages in iCloud on iOS, are the messages still on the device and backed up when the device is backed up? On my iOS 11.x device I've enabled iMessages in iCloud.  When I back up my device locally via iTunes, are my iMessages still included in that backup?

Your messages will be backed up if stored on the device you are backing up. For example, if you are backing up A and the messages are stored on B, it won't back it up.

A backup is recommended as if you loose your messages on all devices they will be lost.

  Messages in iCloud are updated automatically, so you always have the same view everywhere you use iMessage. When you delete a message, photo, or conversation on one device, it’s removed from all of your devices. And since all of your attachments are stored in iCloud, you can save space on your device.

(Source)


What are some Weather Widgets I can use? I really need some Weather Widgets to use on Dashboard. Please give me your best widgets I can use.

Living earth is quite cool. Don't know if it's a widget. Works on ipad, iphone and mac.

  Enjoy a stunning live 3D simulation of our planet with global weather, forecasts and world clock for cities around the world. View live global cloud patterns, hurricanes and tropical storms. Explore and experience amazing weather dynamics on our planet with real-time 3D weather maps and typhoon and hurricane tracking. Living Earth is the best and most beautiful World Clock, Weather and Alarm available for your iPhone and iPad!


Can't turn on FileVault after restore from Time Machine I have bought myself a SSD and replaced the internal disk with it.
I was running Lion before (latest patch level).
I'm using Time Machine to back my laptop up.

When I was done replacing my HDD I booted up a Lion installation USB stick.
I created one partition on my SSD and told it to restore from my Time Machine backup.

This worked great,
however I also want to again turn on FileVault and I'm getting the error:

  FileVault can’t be turned on for the disk “Macintosh HD”.
  Some disk formats don’t support the recovery partition required by encryption.
  To use encryption, reinstall this version of Mac OS X on a reformatted disk.

I've read that this is because I'm now missing the recovery partition (Didn't even know I had that).

What are my options here?
Can I create this partition manually?

Do I need to reinstall Lion again (cleanly), patch it, and then restore from Time Machine?

From http://support.apple.com/kb/HT4790

FileVault 2 requirements
FileVault 2 requires OS X Lion and Recovery HD installed on your startup drive, which the OS X Lion installer will attempt to create at installation. If you receive an alert that no Recovery HD could be created and continued to install OS X Lion, you will be unable to use FileVault 2. See this article for more information. Please note that Recovery HD must be present on your computer's startup volume to use FileVault 2 (not an external Recovery HD).

Also, if you partitioned the new SSD yourself, ensure that you used the GUID partition table scheme.
Re-installing lion over the top of your existing install will recreate it for you.


Solving bootcamp error message to erase windows partition I have a Windows partition created with Bootcamp that I would like to delete but when I launch the Boot Camp Assistant I get the following error message:

I have a looked at several threads/articles surrounding this issue and I am uncertain if the proposed fixes from articles like this one are applicable in my situation and would like some advice on how I should precede. Running diskutil list gives the output below and diskutil cs list only returns No CoreStorage logical volume groups found if that is of any help.

/dev/disk0 (internal):
#:                       TYPE NAME                    SIZE
IDENTIFIER
0:      GUID_partition_scheme                         251.0 GB   disk0
1:                        EFI EFI                     314.6 MB   disk0s1
2:                 Apple_APFS Container disk1         180.0 GB   disk0s2
3:       Microsoft Basic Data BOOTCAMP                70.2 GB    disk0s3
4:           Windows Recovery                         489.7 MB   disk0s4

/dev/disk1 (synthesized):
#:                       TYPE NAME                    SIZE
IDENTIFIER
0:      APFS Container Scheme -                      +180.0 GB   disk1
                             Physical Store disk0s2
1:                APFS Volume Macintosh HD            99.3 GB    disk1s1
2:                APFS Volume Preboot                 45.7 MB    disk1s2
3:                APFS Volume Recovery                517.0 MB   disk1s3
4:                APFS Volume VM                      1.1 GB     disk1s4

..

This is a very common question. Again, here is the commands you need to enter in a Terminal application window.

The next two commands will remove the disk0s4 partition and the disk0s3 partition labeled BOOTCAMP

sudo diskutil eraseVolume free none disk0s4
sudo diskutil eraseVolume free none disk0s3

The next command return the free space back to the disk0s2 APFS container partition.

sudo diskutil apfs resizeContainer disk0s2 0

There may still be Windows boot files stored in the hidden EFI partition (disk0s1). These files can be removed by entering the commands given below.

sudo diskutil mount disk0s1
cd /Volumes/EFI/EFI
rm -r Boot
rm -r Microsoft
cd ~
diskutil unmount disk0s1


iTunes says I have 8k photos but I only have 6k on my iPhone? I synced some photos from iPhoto to my iPhone. iTunes says that the photos were synced and there's 8000 photos in my phone.

But when I checked my photo the photos I synced weren't there.

Can someone please help me with this?

Photos you sync from iTunes don't go into your Camera Roll — they go into separate albums. Look further down the albums list to find synced photos.


How to read MS SQL backup file on Mac I am an IT guy in an all Mac school and our SIS has provided a backup of our data but it is a MS SQL backup file.  All I want to do is read it.  Are there any good apps for reading MS SQL backup files on mac?  Thanks!

You can see that I selected the correct answer below, but for the future reader, it was this step by step article that walked me through it and made the whole things easy:

https://docs.microsoft.com/en-us/sql/linux/tutorial-restore-backup-in-sql-server-container?view=sql-server-ver15

If you have or install Docker on your Mac, you can install Microsoft SQL Server in Docker from:

https://hub.docker.com/_/microsoft-mssql-server

When you have the server running locally, you can install the free Azure Data Studio for macOS from here:

https://docs.microsoft.com/en-us/sql/azure-data-studio/download-azure-data-studio?view=sql-server-ver15

That is a graphical tool that will let you for example restore the backup file you have received. You can then export the data in the format you need to continue working with it with other tools.


Can't save AppleScript file when created by touch I'm used to create file using touch before opening them with open. But I came to this following problem :

When I do this with AppleScript files AppleScript Editor is able to open the file but unable to save the file. I get The document "xxx.scpt" could not be saved.

Any idea why ?


Screen sharing with absolutely no chance of control? I'd like to give a presentation to other people who happen to be in the same room. I'll be running various programs and would like my screen to be visible as I work. Instead of a projector, I am wondering if I can use screen sharing. It's not clear to me if there is a way I can start such that I can be absolutely sure there is no chance of others having any control over my computer, cursor, command-line, etc. I only want to broadcast my screen to other computers' screens instead of using a big monitor or projector.

How exactly can I set up screen sharing to be sure? Are there good alternatives within OSX? (I don't want to have to download or install 3rd party software).

There is nothing built into OS X that allows you to share your screen with multiple people at once.

One-to-One : Screen Sharing

OS X's built-in Screen Sharing is limited to a one-to-one connection. Screen Sharing is based on VNC and can be limited to observation only.

One-to-Many : Google Hangout / Skype

Consider using a Google Hangout to share your screen. While it does require third party software, the use of the Chrome browser is free. This approach also ensures no-one can control your shared screen.

Alternatively, Skype group calls allow for multiple people to observe your screen.


How to type backslash and pipe? (Czech layout, USB keyboard) I use an USB keyboard with my Macbook Pro - no choice here, some of the keys of internal keyboard are damaged. The Keyboard is from Genius, type LuxeMate i200. I use Czech QWERTY layout.

Everything pretty much works, although I can't seem to find a way how to type backslash \ and pipe | characters.

Above the right Enter, I have a mysterious key with following characters:

first row: | ) ;
second row: \ ň ¨ (and "circle in front of x" i can't even type)

I've tried the following:

key: ¨
left SHIFT + key: `
right SHIFT + key: `
left ALT + key: ¨
right ALT + key: ¨
left SHIFT + key: "
right SHIFT + key: "
FN + key: ¨

I would really like to avoid switching between keyboards OR copying the characters from Google, as I use them a lot. Can someone help me please?

EDIT: Here is a photo of the keyboard, if that helps.

EDIT 2: Thanks @krnk, the keyboard viewer helped with the backslash character! I still have a problem with the pipe character though.

What the viewer shows is not consistent with the keyboard (there is no key between left shift and Z key, for example, which would solve my problem with the pipe). Is that maybe another symptom of misconfiguration?

Is there anything else I could try besides "changing keyboard type" (which I already did)?

I just bought a Genius keyboard in the Czech Republic and have the same problem, however I've found the following works for me:

Right alt + \
Shift + Right alt + |


Is it possible to record Voice Memos on Apple Watch while on an iPhone call? Is it possible to be on a speakerphone call with my iPhone and then use the Voice Memos app on the Apple Watch to record the conversation? I'm not thinking that the Apple Watch would have access to the iPhone's mic or anything sophisticated like that… just record the audio coming from the iPhone's speaker and the audio coming from my mouth.
I tried to launch Voice Memos on my iPhone during a call. Unsurprisingly, the mic was blocked while the call was active. It feels like an Appley thing to also block Voice Memos on the Apple Watch during a call. I don't have an Apple Watch… otherwise I'd be testing this on my own.
And yes, I know there are other methods of recording calls (via apps that intercept calls and other similar services, jailbreaking, and even just getting a pocket recorder thing), but I'm already interested in an Apple Watch, and this functionality would be icing on the cake.

The backstory, if you're interested: I'm rearranging some personal finance stuff and much of the phone conversations I have with financial advisors goes right over my head (i.e. rapid-fire jargon, acronyms, and calculations). My hand written notes can't keep up! It would be great if I could just record the call so that I can research terminology and go over the calculations later. Not trying to do anything nefarious here… I would, of course, inform the person on the other line that I would be recording.

Just to close the loop here, yes, you can record audio on your Apple Watch while your iPhone is on an active call (on speaker phone). I do this all the time to supplement my notes from an important phone call with an audio recording… with the permission of the person on the other line, of course.


Can no longer email myself a .epub file and open in iBooks? (used to be able to) I used to email myself some .epub files (using Gmail), and then on the iPad, in the email program, click on the .epub file and then choose to open in iBooks, and read, highlight, and add notes to the ebook.  What is amazing is that all the highlighting and added notes will sync across my iPad and iPhone whenever I have the same .epub file on that device.

However, recently, I tried doing the same for the new iPad (3rd Gen), but it can download the .epub file alright, showing it as 5.5MB, but when I click on that file after the download, it won't ask me to open in iBooks any more (and won't open anything or ask what application to open it).

Is there a way to solve this (or is this a bug).  Can Dropbox or Box.net solve this? Although, it is best if email can be used, because then not additional app is needed besides email which is always there.  (I label the email as "ebooks" using Gmail's label function, so that all the files can be easily listed out of thousands of emails).

This feature hasn't been changed in iOS, so either the mail transport or client isn't faithfully preserving the file or you iOS device has issues and needs to go through troubleshooting.

If you have a second device, you could test setting up your mail account and see if it's a temporary (or permanent) mail issue.

Otherwise, you'll need to work on narrowing down why your device isn't working as expected.


Apple iPad Air - No screen rotation control I'm running iOS 12.1 on an iPad Air.

Regardless of the switch setting (mute or rotatation) the side switch does not control screen rotation. There is no rotation control icon available to select under control centre. There is NO rotation control.

What do I need to do in order to control screen rotation on my iPad?

Have you tried turning it on and off in control centre. Access it by sliding up from the top-right on iPad:

Rotation lock off:

Rotation lock on:


Why does pidof from homebrew returns always zero? I've installed pidof via homebrew

brew install pidof

And think about two cases:

$ pidof bash > /dev/null; echo $?
$ pidof asdf > /dev/null; echo $?

The results are:

0
0

Why does it happen? Other linux throw 1 when pidof couldn't find process.

If you look at the Homebrew formula of pidof, you will see that the Homebrew version is built from : http://www.nightproductions.net/downloads/pidof_source.tar.gz

If you look at the source code pidof.c used by Homebrew, you will see that each occurrence of the return statement in the main function, is in the form:

return 0

except one time, when the usage of the command is printed:

printf("USAGE: %s [-klvh] [PID name]\n",ProgName);
                return 1;
                break;

On the other hand, in Linux distributions, such as Debian, the pidof command is coming  from the System V style init programs. If you download the source code and look at killall5.c (which is then linked to pidof), you have at the last line of the main function:

return retval;

where retvalcan be non-null.

So the main reson why the Homebrew version of pidof and the Linux version of pidof return different values is because they use different codebase.


iPhone 4 locked out while on holiday, how can I unlock it? I arrived in Greece yesterday and suddenly this morning my phone turned off, then on again and now it says Activation Required. When I unlock it to try and do it, I get the message:

  This device is no registered as part of the iPhone Developer Program.##br####br##If you are a member of the Program, please register your device in the @@url@@

It is registered with the developer program. Is there any way I can fix this remotely? I don't have my computer.

Update

I updated my phone via the new non beta iTunes to the new iOS5 as far as I'm aware. I'm pretty sure it just said 5.0. That was a couple of days ago.

Also, I will be able to get to a computer with iTunes, but it won't be mine.

I assume you, as a developer, have iOS5 installed? Try recovering from iCloud?
That is if you have backed up your iPhone using iCloud before of course.

EDIT: Use a random computer to back-up your iPhone


Is there a good command-line ID3 tool for OS X? Anyone know of a command-line* ID3 tool, with support for ID3v2, that you can get working on Mac OS X with reasonable effort? It should support both reading and writing tags.

(* I want to be able to call it e.g. from some Python scripts, so a GUI tool won't do.)

The id3tool utility is otherwise good, but doesn't support ID3v2 (and thus doesn't play that well with iTunes). I had to compile it from source, but that was pretty straightforward on a Mac with Xcode & developer tools (including, notably, a C compiler). Anyway, I'd especially like something with similar command-line options as id3tool. Here's an example of tagging one file:

id3tool -t "Song Title" -r Artist -a "Album Name" -c 2 track-02.mp3

If you have Homebrew installed (highly recommended), you can just do:

brew install id3lib

This installs several id3 command-line tools, including id3tag, id3convert, id3cp and id3info.  No need for python or perl scripting; just use regular shell commands.

Usage: id3tag [OPTIONS]... [FILES]...
   -h         --help            Print help and exit
   -V         --version         Print version and exit
   -1         --v1tag           Render only the id3v1 tag (default=off)
   -2         --v2tag           Render only the id3v2 tag (default=off)
   -aSTRING   --artist=STRING   Set the artist information
   -ASTRING   --album=STRING    Set the album title information
   -sSTRING   --song=STRING     Set the title information
   -cSTRING   --comment=STRING  Set the comment information
   -CSTRING   --desc=STRING     Set the comment description
   -ySTRING   --year=STRING     Set the year
   -tSTRING   --track=STRING    Set the track number
   -TSTRING   --total=STRING    Set the total number of tracks
   -gSHORT    --genre=SHORT     Set the genre
   -w         --warning         Turn on warnings (for debugging) (default=off)
   -n         --notice          Turn on notices (for debugging) (default=off)


Why repeat a try statement in AppleScript before returning an error? I’m trying to learn AppleScript and have seen the following example for the Photos app:

try
    set thisId to id of item 1 of sel
on error errText number errNum
    display dialog "Error: cannot get the image ID" & errNum & return & errText & "Trying again"

    try
        delay 2
        set thisId to id of item 1 of sel
    on error errTexttwo number errNumtwo
        display dialog "Skipping image due to repeated error: " & errNumtwo & return & errTexttwo
        error "giving up"
        return
    end try --second attempt
end try

Why is there a second try statement doing the same thing after a short delay before giving up? The same is done in several places in this example script.

Is this a normal way of handling errors in AppleScript or is this specific for Photos and if so why?

Applescript is seems to suffer with timing issues that usually are solved be using a delay. Often this delay needs to be tuned to match the speed of a particular model Mac. In other words, the delay hard coded in the the AppleScript may work on a newer faster Mac, but need to be increased when run on a slower Mac.


ios backbutton at top of the screen In many apps like safari or youtube the backbutton is at the top of the screen. That makes it basically impossible to use my ipad pro 9.7 comfortably in bed, I would have to sit up and use both hands to access the back button. Is there any way to get a back button at the bottom of the screen?

I'm not aware of any way of doing this within iOS proper (although there may be a way to implement such a feature on a jailbroken device).

However, you could just double tap the home button to then select the previous app from the screen.

Also, using your iPad in landscape (I.e. Sideways) may help with accessing the default 'back' button.


Script to check to see if certain applications were installed I am very new to Macs however I did hear that there was a Bash script that can be utilized to check to see if certain applications were installed on a machine

There are several ways via the command line to look to see if an Application is installed:
View the Applications Directory

To list all Applications installed system wide:
  $ ls /Applications

To list Applications installed by/for a specific user:
  $ ls /Users/<username>/Applications

Query system_profiler
The following command will list every single Application installed on the system that's in the Applications database:
$ system_profiler SPApplicationsDataType

It lists everything including obscure apps/utilities installed by Apple (or 3rd parties) that was included with the macOS installation.  Using grep we can limit it to a particular application.
$ system_profiler SPApplicationsDataType | grep -i Excel
    Microsoft Excel:
      Location: /Applications/Microsoft Excel.app

The caveat with these is that it must have been "properly" installed and registered with the system.  If you happen to download a binary directly from a website (ffmpeg is an excellent example), it won't show up using any of these methods.
Use which or type
For binaries that weren't installed, but rather just downloaded or copied onto a system and assuming they are in the path, you can use the command which or type
$ which ffmpeg
/usr/local/bin/ffmpeg

$ type ffmpeg
ffmpeg is /usr/local/bin/ffmpeg


Installing Octave with Brew in Lion my first question on AskDifferent! (let me know if I'm doing it wrong.) Anyway, I'm trying to install octave using brew and am getting the following error but unsure how to proceed:

   ~/ brew install octave
  ==> Installing octave dependency: cmake
  ==> Downloading https://downloads.sf.net/project/machomebrew/Bottles/cmake-2.8.7

  ################################################################## 100.0%

  Error: SHA1 mismatch
  Expected: f218ed64ce6e7a5d3670acdd6a18e5ed95421d1f
  Got: 3a57f6f44186e0dba34ef8b8fb4a9047e9e5d8a3
  Archive: /Users/Billy/Library/Caches/Homebrew/cmake-2.8.7.bottle.tar.gz
  (To retry an incomplete download, remove the file above.)

   ~/

Any help would be greatly appreciated.

Best,
B

You seemingly have a bad download in the cache. Do this:

rm /Users/Billy/Library/Caches/Homebrew/cmake-2.8.7.bottle.tar.gz

And then try again. Make sure you're up-to-date first: brew update.