darwin – Mounting a loop device on macOS in C

How do you mount a loop device (similar to hdiutil attach) on XNU / Darwin in C?

Specifically I’m looking for functionality that would be in linux/loop.h, but on XNU. ( I’m going to be doing this on iOS, don’t ask 😉 )

I’ve looked on Google for a while and haven’t found much.

Thanks!

macos – Issues compiling and installing GnuPG via Terminal

I wanted to install GnuPG by compiling the binaries but I’m stuck on the second dependancy, libgpg-error. I’ll check the obvious tomorrow and shasum the tarball, re-download it (etc) but I’m hoping I can find a little insight into what’s going on here. I’m on macOS Catalina.

Here’s what I’m doing in Terminal (as sudo) as is the usual process and documented in the README:

./configure
make
make install
make clean

But the ./configure cannot be found. There is a configure in the root directory but I cannot run it. I installed ntph just fine with the above process. So now I have a few questions.

  1. I’m wondering if anybody has experienced the same issue and why, is this expected?
  2. Should I expect more issues compiling GnuPG from the binaries?
  3. Any suggestions on alternative PGP command line tools?

I am not interested in the GPGTools installer out there. I don’t want all the bels and whistles. I’m just looking for a command line PGP utility.

macbook pro – Is there any macOS snipping app can take picture with lower resolution

The native snipping tool in macOS takes an image with the full original pixel.
when I paste it to use, the resolution is a little too big to web blog or in Microsoft-word, I need to resize it smaller by hand every time, is there any other snipping tool that can take a lower resolution image in clipboard?

Migrate SSD to another mac…should I reinstall macOS?

I’d like to get opinions on this situation:

A customer buys a 2012 iMac to replace his old 2010 iMac. The 2010 iMac has an SSD with macOS 10.13 and would like to replace the mechanical HDD in the new Mac with the SSD he’s got in his 2010 iMac that he recently replaced.

Which of these two is the most reasonable option?

  1. I just migrate the SSD from the old iMac to the new iMac. Then upgrade macOS from 10.13 to a newer macOS. This will account for any driver incompatibilities as the hardware on the new mac is different.

  2. I migrate the SSD likewise, but then reformat and reinstall a newer version of macOS, so as to avoid any driver incompatibilities.

Option 1 is certainly faster and will avoid having to reinstall apps etc. Is it a good option?

Any help much appreciated.

macos – ssh: Passphrase not loaded at startup

I have configured a host in my ~/.ssh/config like this

Host pptest
IdentityFile ~/.ssh/id_rsa_test_2048_pp
UseKeychain yes
AddKeysToAgent yes

As was my understanding, UseKeychain and AddKeysToAgent should automatically load the keys passphrase on reboot, however I have not found this to be the case. To get a git-fetch (or any remote action) working, I still need to run an

ssh-add

beforehand.

Why is this happening?

My system is 10.15.5 (19F96)

Install an older version of MacOS onto an external drive without USB installer?

I want to install Mojave onto an external drive, using a Mac that has Catalina as its current OS. The Mac is old enough to run Mojave.

A specific form of this question has been asked before, to which the answer is “create a USB installer disk”.

I’m wondering if it might be possible without this workaround. Firstly, it requires the purchase of a USB stick. Catalina now requires just slightly more than 8GB, so I need a 16 GB stick at least. Admittedly, these are cheap and plentiful.

But I already have loads of 8GB sticks and the alternative to buying another bit of hardware is to sacrifice a 500 GB USB drive, which I already have, to become an installer medium.

However, creating an installer disk involves the createinstallmedia command line tool inside the MacOS installer app bundle. There are also several other tools, including: startosinstall, which yields the following info:

Usage: startosinstall

Arguments
--license, prints the user license agreement only.
--agreetolicense, agree to the license you printed with --license.
--rebootdelay, how long to delay the reboot at the end of preparing. This delay is in seconds and has a maximum of 300 (5 minutes).
--pidtosignal, Specify a PID to which to send SIGUSR1 upon completion of the prepare phase. To bypass "rebootdelay" send SIGUSR1 back to startosinstall.
--installpackage, the path of a package (built with productbuild(1)) to install after the OS installation is complete; this option can be specified multiple times.
--eraseinstall, (Requires APFS) Erase all volumes and install to a new one. Optionally specify the name of the new volume with --newvolumename.
--newvolumename, the name of the volume to be created with --eraseinstall.
--preservecontainer, preserves other volumes in your APFS container when using --eraseinstall.
--usage, prints this message.

The internals of the tool suggests that there’s also a --volume flag to set the target drive, but using that option just flags a usage error.

While there’s nothing entirely helpful here, and I can’t find any other usage options for the several other tools in the app bundle, I’m still hopeful that there’s a way of doing this via the command line.

So I thought I’d ask, even if it’s just to get a confirmatory “No; duplicate”, because the benefits to the community of getting a method would be large.

terminal – What are the reasons behing Apple deprecating scripting languages on macOS?

It has been announced for some time that UNIX scripting languages will be deprecated.
That being said, it’s true that versions that ship with macOS Catalina are indeed old (python 2 is not supported anymore, for example).

However I don’t quite understand why these run times are not simply updated, instead?

mojave – Is it a MacOS normal behavior to switch between desktops slower while in Mission Control mode?

I’m having an issue regard MacOS (Mojave 10.14.6) for some time now:

If I’m not in Mission Control mode I can instantly change between the desktops using the keyboard (ctrl+direction, left or right).

However if I’m in Mission Control mode and try to change desktops with the same approach I have a delay of like 1 or 2 seconds.

Someone else having the same issue? There’s some type of fix for that?

macOS + malware + root password

I entered my macOS admin details (root password) into an application I think was malicious. Suspicious, I checked the keychain and my tokens had modified passwords.

What else could have this software done? Where would I look? More importantly what can I do to check / protect myself?

I deleted all keychain entries and changed all passwords…

mac – MacOS Dock disappears and background black when connecting monitor

My dock disappears as soon as I connect my display. The Dock process is killed. When I disconnect, the Dock process becomes available.

➜  ~ killall Dock
No matching processes belonging to you were found

Looks similar problem to this question, although for them it is happening with their main display. My OS is latest – Catalina 10.15.5 (updated May 26, 2020)

I am also unable to change the background. The settings all work fine, just the background doesn’t show. Before you answer about showing/hiding dock settings, or changing background, this question is something else entirely:

  • my monitor is 4k 60Hz, works fine with my wife’s Macbook (exactly same model), with same usb-c cable, same settings. I just plug the USB-C cable to mine and don’t do anything different
  • there are other monitors I have tested that have the same problem with my mac. Although, it’s random (sometimes they work with no problem). My monitor just always has this problem since last month’s update
  • I have tried deleting the finder plist and dock plist and restarting. But probably those have nothing to do with the problem
  • I tried resetting NVRAM and PRAM. This problem seems to be something screwed in OS settings

I am suspecting this may be a problem in the settings of how my mac handles a display, and I was wondering if there’s a way to reset the detection of monitors or display settings/configurations altogether. Also, how can I force-start the dock with the monitor?

enter image description here

enter image description here