Monday, December 13, 2021

Recent Questions - Ask Different

Recent Questions - Ask Different


macOS check if file is available offline (gdrive, dropbox, one drive, nexcloud)

Posted: 13 Dec 2021 03:26 AM PST

When iterating over files I must check whether or not the file is available offline if the drive is a virtual drive, for example. When working with GDrive's "stream files" feature, files in the finder are either considered to be "available offline" or "online only". The very same feature exists for other cloud storage provider such as OneDrive, nextcloud, and dropbox. For my application, checking the state before accessing the file is super important to not trigger an unintentional download of the files through the virtual drive driver.

On windows, things are simple by checking the FILE_ATTRIBUTE_RECALL_ON_DATA_ACCESS and FILE_ATTRIBUTE_RECALL_ON_OPEN file attributes.

On Mac, I fail to find an equivalent but for iCloud. I am checking all kinds of attributes through the NSFileManager attributesOfItemAtPath dictionary as well as the NSURL resourceValues

On OneDrive, it seems to do the trick to simply check if NSURLFileAllocatedSizeKey is zero. GDrive however, seems to cache the data at some place and always reports NSURLFileAllocatedSizeKey to be zero, even though the file is made available offline.

Clearly, there must be a tag / flag / attribute to query from the file system, right?

Find Delta between two tables using sql query (showing value increased , what added/deleted)

Posted: 13 Dec 2021 03:12 AM PST

i have two table report1 and report2 , I need to find out the delta between these , can anyone help me with db query for this

report1 enter image description here

and report2 is like

enter image description here

in this I need delta for these in tabular format like in report2

like in report 2 , only available increased and from report1 , feaureID 2 ,3 deleted and in report2, new feature 4, 5 added

AppleScript find items in list

Posted: 13 Dec 2021 03:27 AM PST

I didn't use AppleScript for a while now and I can't seem to code a script I need

What I'm trying to do:

list1: working day {"Monday", "Friday", "Saturday", "Sunday"} item to find currentDay : set currentDay to weekday of (get current date) as text

(basically I want to check if I'm working today or not in order to run a another script)

set currentDay to weekday of (get current date) as text  set workingdays to {"Monday", "Friday", "Saturday", "Sunday"}  set imworking to false    repeat with a from 1 to length of workingdays      set theCurrentListItem to item a of workingdays      if theCurrentListItem = workingdays then          set imworking to true      else          set imworking to false      end if  end repeat  

theCurrentListItem and currentDay = "Monday" so why if theCurrentListItem = workingdays is not true

minimum bluetooth headset volume is too high in Teams calls on macOS

Posted: 13 Dec 2021 01:40 AM PST

I've got a pair of Epos Adapt 660s connected to macOS Monterey and, whenever I'm in a Teams call, the volume level is near uncomfortable (depending on the others' individual volumes).

Problem is: The volume slider is already at the minimum.

Volume level outside of calls seems fine (Teams' own ringer for example) but macOS seems to switch to a different volume setup when in a Teams call.

How can I get Teams calls volume to a comfortable level?

I don't remember this happening on macOS Big Sur or at least not to this degree.

Is there any way to revive a dead on arrival new old stock MacBook battery?

Posted: 13 Dec 2021 02:11 AM PST

I recently bought a boxed old stock genuine Apple A1185 battery for my MacBook. The battery appeared new but had clearly been in storage for many years and was not detected properly by my MacBook when installed and appears to be dead. The seller has already refunded but before I take it to recycling, is there anything I can try to revive it so it will take a charge?

iPhone - How to turn off the music widget (on the lock screen)?

Posted: 13 Dec 2021 01:17 AM PST

How to close the music widget thing (see screenshot below) on the lock screen?

So:

  • make it stop playing music (and wasting battery*)
  • make it disappear from the lock screen

It can not be swiped to the left (or right) as other objects on the lock screen.

* once it got activated somehow, played music for an hour or two (I did not hear it as I have volume set to zero most of the time) and the the battery died (was empty)

This old question looks like a duplicate, but it is very concise, also the answers don't look very useful: How can I disable the music player on an iPhone 4S lock screen

enter image description here

PS: I know that stopping it from playing can be done with the play/pause button. I listed this requirement to avoid answers that make the widget go away, but the music continues to play.

Where are the new passkeys in the keychain?

Posted: 13 Dec 2021 12:24 AM PST

I have been playing around with the passkeys and I was expecting to see them in my keychain but no luck? Are they not visible to the user or are they in some menu that I cannot spot.

Is it possible to make Office 365 on mac textbox navigation keys consistent with macOS?

Posted: 13 Dec 2021 12:22 AM PST

I have to use MS office 365 (ex: Outlook 16.55) tools for mac. MS being MS, they have different text navigation shortcuts on mac. Is it possible to make them the same as rest of the macOS? Particularly:

Control D & H    Delete / Backspace  Control A & E     ⇇ ⇉  Control F & B     ←→  Control P & N    ↑↓  

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

How can I select from an open dialog an ".app" that is part of the contents of another ".app"?

Posted: 13 Dec 2021 12:21 AM PST

I have an open dialog where I have to select an .app. But the application that I look for is packaged / part of the Content of another .app:

Application / MyParent.app / Contents / MyChild.app

How can I trigger the Show Package Contents (that I see in Finder) from the Open dialog. Or is there another way to change the standard Open dialog to take a path or to navigate on the real file system paths?

Disable color cursor outline in grayscale mode

Posted: 12 Dec 2021 09:57 PM PST

When the grayscale color filter is applied, there's an outline on the cursor and it's color is the color of what the cursor is hovering on. Is there a way to disable this?

The reason why I want to do this is that when I have the screen set to a low color temperature there is an obvious white around the cursor that stands out from the yellow-white background.

Updated MacPorts curl implementation behaves differently from previous version and macOS curl

Posted: 12 Dec 2021 10:39 PM PST

I am having an issue with the mac ports implementation of curl.

mbp2016:~ pgee$ which curl  /opt/local/bin/curl    mbp2016:~ pgee$ curl --version  curl 7.80.0 (x86_64-apple-darwin21.1.0) libcurl/7.80.0 OpenSSL/3.0.0 zlib/1.2.11 zstd/1.5.0 libidn2/2.3.2 libpsl/0.21.1 (+libidn2/2.3.2)  Release-Date: 2021-11-10  Protocols: dict file ftp ftps gopher gophers http https imap imaps mqtt pop3 pop3s rtsp smb smbs smtp smtps telnet tftp  Features: alt-svc AsynchDNS HSTS HTTPS-proxy IDN IPv6 Largefile libz NTLM NTLM_WB PSL SSL TLS-SRP UnixSockets zstd    mbp2016:~ pgee$ curl --head https://www.ahpra.gov.au  curl: (35) error:0A000152:SSL routines::unsafe legacy renegotiation disabled    mbp2016:~ pgee$ /usr/bin/curl --version  curl 7.77.0 (x86_64-apple-darwin21.0) libcurl/7.77.0 (SecureTransport) LibreSSL/2.8.3 zlib/1.2.11 nghttp2/1.42.0  Release-Date: 2021-05-26  Protocols: dict file ftp ftps gopher gophers http https imap imaps ldap ldaps mqtt pop3 pop3s rtsp smb smbs smtp smtps telnet tftp  Features: alt-svc AsynchDNS GSS-API HSTS HTTP2 HTTPS-proxy IPv6 Kerberos Largefile libz MultiSSL NTLM NTLM_WB SPNEGO SSL UnixSockets    mbp2016:~ pgee$ /usr/bin/curl --head https://www.ahpra.gov.au  HTTP/1.1 200 OK  Cache-Control: no-cache, no-store  Pragma: no-cache  Content-Length: 160133  Content-Type: text/html; charset=utf-8  Expires: -1  Set-Cookie: AhpraWeb=1piaikc5vpec3wnhon03ab1b; path=/; secure; HttpOnly; SameSite=None  Content-Security-Policy: frame-ancestors 'self'  X-Frame-Options: SAMEORIGIN  P3P: CP="CAO CURa ADMa PSAa PSDa IVAa IVDa HISa OTPa DELa STP COM NAV INT STA"  Date: Sun, 12 Dec 2021 09:47:21 GMT  Set-Cookie: TS018b815b=0159a15e4f400ce883fd78f837a346d5a62bb71ed32f3cd47fb00b7b3e1515b7af8c96c9498324e287a318da5bbaac588926bd3ce4134eced00319de6fd856439860ec84e7; Path=/  

So - this shows that the mac-ports installed version (7.80.0) isn't able to connect to a specific server (it can connect with other servers). But the system installed version of curl (7.77.0) does connect to that server.

I did try to force-rebuild curl with :sudo port upgrade -s -n --force curl but that had no effect.

This error causes an issue for my development copy of apache/php and in particular the guzzle library. This was working before the update - any ideas how to fix?

Safari 15 on macOS not connecting to unsecured http sites

Posted: 13 Dec 2021 01:19 AM PST

This is a weird issue that has been going on since the release of Safary 15.

It does not connect to any website over http, even if the site redirects to https. It simply times out and says "couldn't connect."

I've tried:

  • deleting cooking and site data.
  • clearing history.
  • disabling extensions.
  • resetting HSTS, and deleting safari folder.
  • macOS safe mode.

I haven't tried reinstalling OS or creating a new user yet, because I cannot do that at the moment due to time constraints.

EDIT 1: Problem persists with newly created user.

Safari 15 has been doing that since its release on BigSur and still on Monterey.

It doesn't matter if I open website from address bar or click a link in a page.

I think it has to do with the new HTTPS redirection.

It's really frustrating, any suggestions?

P.S.

  • I don't have a proxy, it's a home network, and I do not use VPN.
  • I does not work no matter what network i'm connected to, and the same websites open fine in firefox.
  • Some sites are not operating over https, some have both and redirects http to https, but if I click a link or attempt to open URL with http, it does not open. I have to copy the link and open in another browser.
  • Some websites—especially academic—do not have SSL, so it's really important for me to have it working over unsecured HTTP.
  • I do not have Adguard or any other safe guard apps that might be manipulating my connection routing the traffic elsewhere.

How to reclaim free space for APFS after freeing it on Bootcamp?

Posted: 12 Dec 2021 09:50 PM PST

I have a fairly old macbook (2016) with a 256Gb hard drive running Catalina 10.15.7 on which I've set up Bootcamp splitting the disk roughly in half at the time.

Recently, I've decided to upgrade to BigSur and found out that I'm out of disk space to do so, the update says that about 25Gb is needed and since I had enough space on Bootcamp for my needs I've partitioned its size to be less, sure enough running into jinxing my APFS partition which is happily answered here on this helpful website :)

That freed up about 35Gb space on the disk, enough for my update, but I now cannot find a way to merge it with the original MacOS container:

SSDpartition

I would like to keep both Bootcamp and the existing MacOS intact, just add the free space to the existing 'Macintosh HD' as on the picture above and then proceed with my system upgrade. After browsing some further helpful answers here and here I now realize that this might just be harder than it looks because I don't have free space to clone any of the 2 partitions I want to keep if I go that way, and the sudo diskutil apfs resizeContainer disk0s3 0 does not work for me since the Free Space precedes the MacOS container (there is also a FAT32 container likely related to Bootcamp right at the beginning of the disk) and returns the following error:

Error: -69519: The target disk is too small for this operation, or a gap is required in your partition map which is missing or too small, which is often caused by an attempt to grow a partition beyond the beginning of another partition or beyond the end of partition map usable space  

Free Space is disk0s2 then followed by the MacOS space disk0s3 and finally the Bootcamp space disk0s4 and all together it looks like one big ugly this:

DiskOverall DiskStructure

So is it even possible? Will I have to use an external hard drive to clone any of the 2 existing systems out, format, and then clone them back in? Or is there an easier way with some helpful diskutil or gpt commands that I'm not aware of?

Output of diskutil list internal as requested by Jean_JD:

/dev/disk0 (internal, physical):     #:                       TYPE NAME                    SIZE       IDENTIFIER     0:      GUID_partition_scheme                        *251.0 GB   disk0     1:                        EFI EFI                     314.6 MB   disk0s1     2:                  Apple_HFS                         36.7 GB    disk0s2     3:                 Apple_APFS Container disk2         111.0 GB   disk0s3     4:       Microsoft Basic Data BOOTCAMP                102.3 GB   disk0s4     5:           Windows Recovery                         513.8 MB   disk0s5    /dev/disk1 (synthesized):     #:                       TYPE NAME                    SIZE       IDENTIFIER     0:      APFS Container Scheme -                      +36.8 GB    disk1                                   Physical Store disk0s2    /dev/disk2 (synthesized):     #:                       TYPE NAME                    SIZE       IDENTIFIER     0:      APFS Container Scheme -                      +111.0 GB   disk2                                   Physical Store disk0s3     1:                APFS Volume Macintosh HD - Data     86.9 GB    disk2s1     2:                APFS Volume Preboot                 81.6 MB    disk2s2     3:                APFS Volume Recovery                529.0 MB   disk2s3     4:                APFS Volume VM                      1.1 GB     disk2s4     5:                APFS Volume Macintosh HD            11.3 GB    disk2s5  

Using Big SUr 10.6.3 with external seagate 5tb HD

Posted: 12 Dec 2021 10:06 PM PST

So im using the mentioned HD as my second travelling drive. Everythings been working fine, no drops of the device, no sudden disconnects in general until one night, after some work, off to sleep, accidently dislodged the power of my lappy with hard drive still connected. When awaking, lappy was drained with th emessage, 'One Touch' has been removed. Since then, its been a problem. In disk utility, Seagate shows up with 'One Touch' volume greyed out. After about 8 hours, after messing around with terminal commands, not really knowing what im doing... it magically appeared back in my finder. This was after trying commands and nothing seemed to work. Unless of course it was working yet needed some time to show. So the next day all is working fine again, until now, has decided to not show up.....again. So im back where i started, trying some terminal commands.. nothing working yet when entering diskutil list now this shows with the difference of /dev/disk2s2 being labelled FFFFFFFF-FFFF-FFFF-FFFF-FFFFFFFFFFFF instead of what it had previously shown - One Touch. Im clearly a novice novice, so any help would be greatly appreciated. In the meantime ive got a recovery scan going on, contacted seagate with them offering to send me a new drive. Im confident i can recover all my data, just in the meantime, if i can get it to mount again, then ill be able to continue the work i need to do.

diskutil list  /dev/disk0 (internal, physical):     #:                       TYPE NAME                    SIZE       IDENTIFIER     0:      GUID_partition_scheme                        *251.0 GB   disk0     1:                        EFI ⁨EFI⁩                     209.7 MB   disk0s1     2:                 Apple_APFS ⁨Container disk1⁩         250.8 GB   disk0s2    /dev/disk1 (synthesized):     #:                       TYPE NAME                    SIZE       IDENTIFIER     0:      APFS Container Scheme -                      +250.8 GB   disk1                                   Physical Store disk0s2     1:                APFS Volume ⁨HD — Data⁩               200.1 GB   disk1s1     2:                APFS Volume ⁨Preboot⁩                 282.6 MB   disk1s2     3:                APFS Volume ⁨Recovery⁩                622.9 MB   disk1s3     4:                APFS Volume ⁨VM⁩                      2.1 GB     disk1s4     5:                APFS Volume ⁨Macintosh HD⁩            15.3 GB    disk1s5     6:              APFS Snapshot ⁨com.apple.os.update-...⁩ 15.3 GB    disk1s5s1    /dev/disk2 (external, physical):     #:                       TYPE NAME                    SIZE       IDENTIFIER     0:      GUID_partition_scheme                        *5.0 TB     disk2     1:                        EFI ⁨EFI⁩                     209.7 MB   disk2s1     2: FFFFFFFF-FFFF-FFFF-FFFF-FFFFFFFFFFFF ⁨⁩              5.0 TB     disk2s2  

Result of sudo gpt command (it's better in initial question) :

start        size index contents   0               1       PMBR   1               1       Pri GPT header   2              32       Pri GPT table   34              6   40         409600    1  GPT part - C12A7328-F81F-11D2-BA4B-00A0C93EC93B   409640       2008   411648 9767129088    2  GPT part - FFFFFFFF-FFFF-FFFF-FFFF-FFFFFFFFFFFF   9767540736    398   9767541134     32       Sec GPT table   9767541166      1       Sec GPT header   DemoDc@Heartheartrecords-MacBook-Pro ~ %  

Stuck on login for one user after migration assistant

Posted: 13 Dec 2021 02:08 AM PST

I recently got my MacBook Air 2018 fixed after having some cryptographic error.

I backed up all my data with time machine and I was able to transfer my data using migration assistant. I now have 3 users and I am only able to log in to two out of the 3. The third user is actually the only one I use and has everything on it. When I log in, (I know it's the right password), I'm stuck on the loading page. I've been waiting for almost two hours.

I know there are threads that have a similar problem but the solutions offered didn't really fit the criteria of my situation (meaning I was able to log in to other users except one). Please help I am so grateful it's my university's spring break I think I'd be having a panic attack if it wasn't. Id really really appreciate simple and detailed instructions because I'm not knowledgeable on operating systems, etc. Thank you so much.

**I don't know if this info is related to my problem but before I got my MacBook Air fixed, it couldn't update the OS due to that cryptographic error I mentioned before. So when I backed up my data it was on mojave. I didn't realize my OS wasn't updating until I needed to download XCode for class and it required the latest OS. I ended up wiping the whole disk after backing up my data and then going to a distribution center. Now I have the latest OS (Big Sur) and that is the backstory to my current problem after transferring my data back.

Here is the link to the spindump.txt file : https://drive.google.com/file/d/1Hscr19_0gnp_4TxW3XxtFgeirxVTIOy5/view?usp=sharing

Mac won’t connect to internet

Posted: 13 Dec 2021 12:05 AM PST

I have an interesting problem and I believe I may be halfway to understanding it but don't know how to fix it. My home network has two routers. One is the main one and is in a cabinet so I do not have wifi enabled as the cabinet limits the range of the wifi. I have a second router placed elsewhere which runs my wifi. Currently Ethernet shows connected but no access To the internet. My guess is there is an issue with the iP address as the internet works on wifi with the Ethernet cable disconnected and slowly with it connected. With wifi off the Ethernet still doesn't connect to internet even though shows green. I guess there is a conflict and would appreciate some advice. Thanks in advance

When scanning a url/phone number qr code, is there anyway to force the iPhone to show 'Copy' menu only instead of asking opening browser?

Posted: 13 Dec 2021 02:29 AM PST

For example, when scan a url qr code with iPhone, the iPhone usually asks you to open browser with Safari (or ask you to dial a call if the qr code is a phone number), which is different from plain text that just ask you to search the context or copy the context.

My question is, is there anyway to force the iPhone to ask you to search the context or copy the context only, even if a url or phone number qr code is scanned?

Network Diagnostics Replacement

Posted: 13 Dec 2021 03:04 AM PST

Network Diagnostics was removed from Mojave. The replacement does not tell you if the failure to connect issue is with the Internet, or your own WiFi. The program could often fix connections where the replacement can only give a report.

Is there a (3rd party) replacement for Network Diagnostics?

Different colour for new tabs in iTerm2

Posted: 13 Dec 2021 02:48 AM PST

Is there any way to change tab colour for new tabs in iTerm2 (automatically, random colour)?

How do I completely uninstall Setapp and it's helpers manually?

Posted: 13 Dec 2021 01:43 AM PST

The Setapp.app helper missed my first attempt to Trash the app (maybe an earlier version?). So I need to clean out it's various helpers and plugins manually.

Here's what I've found so far:

/Applications/Setapp.app  /Applications/Setapp/ <- if you have installed anything    ~/Library/Application Support/Setapp/...  ~/Library/Application Scripts/com.setapp.*  ~/Library/Containers/com.setapp.*  ~/Library/LaunchAgents/com.setapp.*  ~/Library/QuickLook/SetappQL.qlgenerator  

If I delete all the above will that completely remove Setapp? If not, what else do I need to do?

How to fix failing Open Directory (database "cn=authdata" cannot be opened, err 12) after hang

Posted: 13 Dec 2021 02:47 AM PST

A Mac OS X Lion 10.7.5 server running Open Directory hung. SSH was still possible but the sudo reboot command didn't restart the server within 15 minutes. That is why a power cycle was issued. After the power cycle Open Directory would no longer start and the System log is filled with a new message every 10 seconds:

com.apple.launchd[1] (org.openldap.slapd[1153]): Exited with code: 1  com.apple.launchd[1] (org.openldap.slapd): Throttling respawn: Will start in 10 seconds  

Repairing disk permission, neither another reboot doesn't solve the issue.

Slapd in Tool mode outputs:

$ sudo /usr/libexec/slapd -Tt  bdb(dc=nl2,dc=probackup,dc=nl): unable to allocate memory for mutex; resize mutex region  bdb_db_open: database "dc=nl2,dc=probackup,dc=nl" cannot be opened, err 12. Restore from backup!  backend_startup_one (type=bdb, suffix="dc=nl2,dc=probackup,dc=nl"): bi_db_open failed! (12)  slap_startup failed (test would succeed using the -u switch)  

How to fix this?

No comments:

Post a Comment