R0uter's Blog AWS on the cloud in mind

R0uter's Blog was first run on the virtual host,Can only be operated from the panel,no authority,Very awkward to use。In addition, anyway, I got the server to run over the wall proxy service,Then simply moved the blog to the VPS。So I started my vps tossing journey。In a blink of an eye, ten years have passed,I also ran on Vultr's VPS later. 4 year。of course,A lot has happened in between,I did cnswift, did drop boxed input method,There is also a macOS version of the drop-off input method... So this is $20 a month[……]

Click link to continue reading...

Package xxx has no installation candidate on Raspberry Pi

When the newly flashed Raspberry Pi image is enabled,Chances are you're getting weird apt errors:

of course,more than this,Installing any package would be Package xxx has no installation candidate

Solution

Check out your first /etc/apt/sources.list ,See if the source address inside is commented out,Here mine is normal。[……]

Click link to continue reading...

Run a static website with AWS S3 Enable https

Website Speed ​​Test from docs.logcg.com

The instruction manual of drop-off input method is a static site compiled with Gitbook,Has been deployed on netlify before,It's a pity that his house is gradually being walled... I had to move this static station to the server of R0uter's Blog。Now I plan to migrate the whole,So after thinking,Simply throw this static site into the aws container alone.,I just recently used aws for work and study,I'm more familiar with it。

To run a static site in aws,First let's plan the topology,probably so:

GitHub → S3 Containers[……]

Click link to continue reading...

M1 macOS Install Windows 11 virtual machine VMWare

Initializing configuration

waited a long time,Finally wait until the VMWare preview release supports the Arm version of Win 11. Now let's try it out on macOS 12.5 Upload a Windows virtual machine。

Download resources

First of all,You have to have a VMWare account,This will allow you to download the technical preview version of Fusion from the VMWare website。 https://customerconnect.vmware.com/downloads/get-download?download[……]

Click link to continue reading...

What is the life cycle of a third-party input method on the iOS platform?

we just discussed What is the life cycle of third-party input methods on the macOS platform?,Now let's talk about third-party keyboards for the iOS platform while it's hotThe life cycle

On Apple's official website,only this:

It seems easy to understand,The life cycle of the keyboard is managed by the system,Every time the user calls out the keyboard,just it starts,User puts away the keyboard,After a while it's wiped out。

But with the previous macOS input methodFramework life cycle experience,Let's look at iOS again,Is it really? in appledeveloper documentation[……]

Click link to continue reading...

What is the life cycle of third-party input methods on the macOS platform?

A blink of an eyeR0uter Input ToolIt's already the third generation,Surprisingly, I never seem to have seriously thought about the question in the title。I have always assumed that macOS and iOS The same is to create an input method instance for each input box,And the Controller of the third-party input method,only one globally,The system is responsible for XPC calls。

Later though I found out that the Controller doesn't destroy as soon as the input box loses focus,But I still think the system will generate a new Cont for each input box when it gets focus[……]

Click link to continue reading...

How to split the full pinyin of drop-off input method

5 years ago,I have written aBased on Dynamic Programming sentence input methodArticles,The problem of pinyin splitting is mentioned at the end of the article,Because the drop-off input method was mainly aimed at Shuangpin,Splitting is not actually required,Just take it apart in two。(This is another reason why I admire Shuangpin,After all, there is one less technical difficulty)

Later, drop-off input method supported the full spell,And start to optimize the whole spell,Only found the original Pinyin participle,Even more difficult than Chinese word segmentation。

Many people mention Pinyin participles,First of all, I thought of making an analogy with English word segmentation.,Not really accurate,Although they are[……]

Click link to continue reading...

macOS M1 Pro install h5py

Failed to install h5py

installation TensorFlow hour,encounter a dependency h5py,This package could not be successfully installed anyway,Error no information available:

it's hard to do,Check the log and find that there is no binary package for m1,compiled automatically。But the compiler reported that the header file could not be found:

So use brew to install the missing library,under search,Really have[……]

Click link to continue reading...

Remove unsupported System Extension macOS M1

Directly use the system information tool to view the plug-ins in the current system

There have been pop-up windows when installing the driver recently,Said that the XX system plug-in is not supported,Unable to load。But I have been suffering from not finding the specific plugin path and unable to delete it,Actually, I don’t use these plugins anymore.,Even the app that installed the plug-in has already been deleted。I can't stand it anymore today,More than ten warning pop-ups come out at once,Decided to deal with it。

Apple has updated the plug-in development structure in several recent systems,New app now,Such as firewall software,Will build system plugins in the .app package,So that when you install and start the app,The system will automatically[……]

Click link to continue reading...

Make a new installation startup disk for macOS

prior to Mac startup key combination recovery mode recovery mode The problem of network recovery is mentioned in,In fact, in the end, I couldn't successfully use the network recovery,The reason is that my hard drive is NVMe,But I don’t have an original hard drive to use,So I cannot update the motherboard firmware by downgrading and then upgrading,This makes the latest recovery mode unusable,The old recovery mode does not recognize the hard drive。

to this end,I need to make a just not so new,But it is new enough to support the NVMe installation disk,after all,To install the system,Always get in first[……]

Click link to continue reading...

Mac startup key combination recovery mode recovery mode

Recently upgraded the new MacBook Pro,Already using m1 pro chip。 but,Old style 2015 I don’t plan to sell my old notebook,After all, when I bought it, it was second-hand,Now the battery has also been replaced by two,The hard disk has also been changed to NVMe by adding a conversion head. 。It’s also very good to install it as Windows and play a dozen games.。

But encountered a problem when entering recovery mode,M1 chip equipment has greatly simplified this operation requirement,Just keep pressing the power button,All startup options will pop up,No longer needed[……]

Click link to continue reading...

Three operating modes of macOS application

Normal,You won't encounter this problem,Until you need to write a background program...

We all know that macOS has a global Dock,All running programs will be displayed on this thing,But if your program is a menu bar applet,Or a...input method,Then you definitely don’t want the icon of this app to be displayed on the Dock,Because this kind of app needs to run continuously in the background。

At this time we can write in Info.plist [crayon-6907ab3be2df327[……]

Click link to continue reading...

After upgrading macOS Monterey, the device wakes up frequently in the middle of the night after sleeping

Recently updated to macOS Monterey, Waking up by the screen in the middle of the nightclub,It feels weird,Have been before,But the screen will only light up when there is a notification,Now I light it up without any reason,The hardware is still that hardware,Then it should be the software's pot。

Checked it online,First I found Apple's official tutorial:https://support.apple.com/zh-cn/guide/mac-help/mchlp2995/mac

Very detailed,But obviously there is no[……]

Click link to continue reading...

Gem install can't find binary after updating Ruby

I always use rbenv,Until this time after updating cocoapods,Execution error,of course,Visual inspection should be caused by my ruby ​​environment being too old,So I tried rbenv install 3.0.2 ,But unfortunately,Reported an error,Go to the official warehouse of rbenv to take a look,The last version is still 2019...Okay,Give it up,After deleting all the versions,I found that I have been using brew to install the latest version of ruby,Just use it directly。[……]

Click link to continue reading...

Avoid website hijacking by malicious domain names

The server of R0uter's blog rejected the embedding of the site

I accidentally found a batch of websites today,Such as http://b6x.net/ Now when you click on this website, it will display "www.logcg.com refused to connect.”,When I clicked on it for the first time, I was stunned...he actually copied my entire website? !

This is a series of three-digit domain name websites,Are similar operations。

and many more,I found something wrong,First of all, there is a white box on the outside of this website that my blog does not have... that is,This may be an anti-generation (reverse proxy)。

If you still[……]

Click link to continue reading...

zsh enable bash * Asterisk wildcard function

Recently I found that the server is very slow every time apt upgrade,The reason,There are still a lot of unused kernels that have to be regenerated every time,Encountered a problem while cleaning up,*Number matching does not take effect,You must manually enter the full kernel name each time to uninstall it。

Found after stepping on the pit,It turned out to be because I used zsh,and zsh The default is not supported * No. wildcard! It’s easy to turn on this feature,Find your zsh configuration file we ~/.zshrc [……]

Click link to continue reading...

Open Xcode Live Preview for UIKit

One of the big benefits of using SwiftUI is that you can hot update the App like Flutter,UI code changed,Will be directly reflected in the simulator or the real machine,Greatly improve the efficiency of writing user interfaces,No need to change 1px,run,Various clicks,Then check the loop of effects。But it's too early to use SwiftUI,After all, there is still a lot of iOS 12 Equipment is running,Want to do popular software,That still needs to be supported。

Then,Is there any way to make UIKit The software written can also be used in real-time[……]

Click link to continue reading...

Run and train Moses on macOS

Moses official website actually has macOS Binary packageof,You don't need to compile them from source。But short,Since Moses developers no longer use Macs,So he can't update,This leads to a bug in the code of the latest version (4.0),Make the binary file can not be used directly,The author said, "It's not difficult to compile from source anyway..." But in short,It is almost impossible to compile Moses from BigSur,Various strange errors,Headache。

In fact,We can directly modify the binary file[……]

Click link to continue reading...