macos

Get device filesystem path from dev_t on macOS

♀尐吖头ヾ 提交于 2021-02-20 04:03:03
问题 If I have a 32-bit integer BSD device number dev_t (e.g. 0x1000004) on macOS (Darwin), how can I get the corresponding filesystem path for this device (e.g. "/dev/disk1s4")? 回答1: You have to enumerate the mounted file systems and look for one who's device ID matches. You can use getfsstat() for the enumeration. That fills in struct statfs structures. Compare the field f_fsid.val[0] of each structure to the dev_t you're looking for. If they match, then that struct statfs is the one for the

Docker takes a very long time to start MacOS

怎甘沉沦 提交于 2021-02-20 04:00:46
问题 Sometimes on my Mac the Docker takes a very long time to start. I tried to reboot the machine than restart docker one more time and for the first couple times it helped, now even reboot can't help to start docker 回答1: Here is the cure, just press enter after this command screen ~/Library/Containers/com.docker.docker/Data/vms/0/tty 回答2: Change memory allocation for docker desktop Click on >> Docker desktop icon >> Preferences [ Add CPU 2 and memory 2.0 GB] 来源: https://stackoverflow.com

how to clear user data while delete mac electron app from application directly?

為{幸葍}努か 提交于 2021-02-20 02:52:27
问题 how to delete user data while deleting the macos electron app? It seems we need to write a daemon to listen to the folders change, but how to do? do you have more clear or easier methods to handle it? packaging used electron-builder. 回答1: I use electron-localstorage to set one flag into app, while everytime you start app, which will check if the flag can get from app, if not, this was new installed and opend first time, so it will clear the old userdata. const userDataPath = app.getPath(

Why does loading tensorflow on Mac lead to “Process finished with exit code 132 (interrupted by signal 4: SIGILL)”?

岁酱吖の 提交于 2021-02-20 02:25:40
问题 I am using a MacBook Pro with M1 processor, macOS version 11.0.1, Python 3.8 in PyCharm, Tensorflow version 2.4.0rc4 (also tried 2.3.0, 2.3.1, 2.4.0rc0). I am trying to run the following code: import tensorflow This causes the error message: Process finished with exit code 132 (interrupted by signal 4: SIGILL) The code runs fine on my Windows and Linux machines. What does the error message mean and how can I fix it? 回答1: Seems that this problem happens when you have multiple python

Electron tray app position on Mac OS

一曲冷凌霜 提交于 2021-02-19 07:56:09
问题 I am building an electron tray app for Mac OS. Everything seems okay, but if I run the app on one desktop and then switch to another, when I click on app icon, app returns me back to place where it was launched. How can I fix it to be open on every desktop? Thanks in advance // Sets variables (const) const {app, BrowserWindow, ipcMain, Tray} = require('electron') const path = require('path') const assetsDirectory = path.join(__dirname, 'img') let tray = undefined let window = undefined // Don

Xcode Build failed,fatal error: module 'firebase_auth' not found @import firebase_auth;

≡放荡痞女 提交于 2021-02-19 07:47:32
问题 Doctor summary (to see all details, run flutter doctor -v): [✓] Flutter (Channel stable, v1.17.4, on Mac OS X 10.15.5 19F101, locale en-US) [✓] Android toolchain - develop for Android devices (Android SDK version 29.0.3) [✓] Xcode - develop for iOS and macOS (Xcode 11.5) [✓] Android Studio (version 4.0) [✓] VS Code (version 1.46.1) [!] Connected device ! No devices available ! Doctor found issues in 1 category. \\\Error Message ** BUILD FAILED ** Xcode's output: ↳ /Users/Razi/Desktop/projects

Disallow egress from Docker containers on Docker for Mac

青春壹個敷衍的年華 提交于 2021-02-19 06:27:25
问题 I want to disable all outgoing connections that are initiated by docker containers to the outside world. I can do this in linux by adding a rule to the FORWARD chain in linux. How do I do this in Docker for Mac? I found out that Docker for Mac uses an xhyve vm and that’s where docker0 interface lives. What interface in the host does this connect to? I used nettop on Mac and I see that Docker uses my en0 wireless interface. But, I’m not sure if Docker and xhyve are using the same interface.

Cannot launch a JavaFX Application on MacOS (using Java 8)

怎甘沉沦 提交于 2021-02-19 05:25:05
问题 First time using JavaFX, I'm trying to test it with an Hello World! window. I'm using Java 8 (update 211) with Eclipse on a MacOS with Mojave 10.14.5. I'm working on this project: I put all the JavaFX jar I think I need into the build path (maybe I'm missing some jars?). I'm trying to open a window with JavaFX using this code: import javafx.application.Application; import javafx.event.ActionEvent; import javafx.event.EventHandler; import javafx.scene.Scene; import javafx.scene.control.Button;

Cannot launch a JavaFX Application on MacOS (using Java 8)

雨燕双飞 提交于 2021-02-19 05:24:31
问题 First time using JavaFX, I'm trying to test it with an Hello World! window. I'm using Java 8 (update 211) with Eclipse on a MacOS with Mojave 10.14.5. I'm working on this project: I put all the JavaFX jar I think I need into the build path (maybe I'm missing some jars?). I'm trying to open a window with JavaFX using this code: import javafx.application.Application; import javafx.event.ActionEvent; import javafx.event.EventHandler; import javafx.scene.Scene; import javafx.scene.control.Button;

OS X: open e-mail client, create new mail and add file as attachment

天大地大妈咪最大 提交于 2021-02-19 05:13:08
问题 We want to make it for users of our (Java) application as easy as possible to send bug-logs to us. First, we imagined to open a bug-report page of our website and prefill an up-load-input field with the path of the file to upload, but this does not work for security reasons. Is it possible on OS X (command line call, Apple Script, what ever) to open a new e-mail in the default e-mail client and add a certain file as attachment? 回答1: Unfortunately there's no standard way to attach a file; you