Categories
Mac OS Exchange of Experience

Use a third-party mouse without a driver on macOS

All to known,macOS to third partiesmouseVery picky,If it is an ordinary office mouse,That almost works,At most, the fixed DPI requires adjusting the mouse speed.,But if it goes up to a gaming mouse with more buttons,There are many problems。

Not necessarily for playing games,For example, a mouse with forward and back buttons is very useful when writing code。

In General,The mouse of the famous manufacturer will support macOS better,Mainly because the big factory has the energy to make a mouse for macOSdrive,If a mouse is natively driven by Windows only,[……]

Click link to continue reading...

Categories
Mac OS

Use xcodebuild to archive and export app

I wrote an article beforemacOS app script to automate notarize,But there is no mention of using code to automatically compile and generate App scripts,After all, there are many tools to complete this step,For example, fastlane。

I didn’t think about automation before notarize,At the time of writing that article, fastlane did not support notarized upload,So I wrote it myself,The specific compilation command is like this:
[crayon-5f90323c4[……]

Click link to continue reading...

Categories
Mac OS

/usr/libexec/lsd occupied 100% CPU solution

Suddenly discovered a large number of writes on the disk recently,Open the task manager,Found a process called "lsd" continues to occupy 20% – 40% CPU,Very strange。

After some inquiries,Learned that this process is a system process on macOS and iOS,Full name is "Launch Service Daemon",Responsible for all App file type association and startup。But its database is sometimes damaged,This causes it to frequently read and verify certain data。

Once its database is damaged,You will encounter lsd[……]

Click link to continue reading...

Categories
Mac OS

Use xcode-install to manage Xcode versions

we all know,There is pyenv when using Python,If you use ruby, there is rbenv,Can easily control and manage the version of the programming language environment,Then,Is there any way,Can Xcode switch versions like this?

Every time Xcode releases an update,More or not has become a problem,Difficult to download,Can't resume,Can't use third-party tools to download,It's really terrible... not to mention the compatibility issue when multiple versions。

use xcode-install,One time[……]

Click link to continue reading...

Categories
Python

clang: warning: libstdc++ is deprecated; move to libc++ with a minimum deployment target of OS X 10.9

Normal,You will encounter this error when installing a Python package,This package must be a package containing C ++ code。

This is due to incompatibility after macOS update,In General,The maintainer of this package should already be compatible with this particular situation:

So that it can be successfully compiled on macOS。

But if you are using PyPy,Maybe even if the maintainer includes this sentence,You can't succeed[……]

Click link to continue reading...

Categories
Python

Python detects its own memory footprint in real time

Recently doing text statistics,Implemented in Python,Encountered an interesting problem-how to save statistical results。

Writing directly into memory is really impossible,Memory exhausted after ten hours,The program was forced to close。If you write directly to the database,Each write is too slow,It's been more than ten hours,If you go on like this, you will have to count on the week,Not a solution。

At last,I thought of a solution that combines both-using memory as a buffer,After reaching a certain amount, all the current data will be merged into the hard disk at one time。

But then there is a threshold,How to confirm[……]

Click link to continue reading...

Categories
Mac OS

Safari 13 Remove Google search results jump

In Safari 9 before,We just download a safariextz file and double click on it,So that Safari can load this plugin。The benefit is definitely very convenient,But it ’s also not very secure (plugins that can be downloaded everywhere,It is likely to have been tampered with)。

So later,Apple no longer allows users to directly download plug-ins to install on Safari,App must be downloaded from Mac Apple Store,Then the Safari plugin is provided in the form of a plugin in the app,With App[……]

Click link to continue reading...

Categories
Wordpress The internet

Avoid WordPress being used as a reflection amplification attack

Before I wrote an article,Use fail2ban Bind9 be used to prevent DNS amplification attacks,Never imagined,original Wordpress It can also be used for amplification attacks,The principle is its Pingback mechanism。

Pingback is a tool for notifying each other of a Wordpress website,For example, A blog refers to a link to a B blog post,Then Wordpress can automatically help you inform B blog,Tell the blogger that you quoted his article。

This[……]

Click link to continue reading...

Categories
Swift

iOS correctly set the status bar style color

When developing iOS apps,Many applications need to set the color of the iOS system status bar according to the current App content color,Black or white-especially on iOS 13 After the system supports the black mode。

Normal,Others will tell you to do this:

But this triggers a warning: Deprecated in iOS 9 。So is there any other way? Have,The official recommendation is[……]

Click link to continue reading...