安装中文语言包composer require “overtrue/laravel-lang:~6.0″后,在浏览器刷新页面报错Call to undefined method Illuminate\Translation\FileLoader::loadPath()

我的Laravel版本是10,报错原因是overtrue/laravel-lang:~6.0与Laravel 10不兼容,composer require “overtrue/laravel-lang”输出一条警告说:

Package overtrue/laravel-lang is abandoned, you should avoid using it.

在Laravel 10我们应该使用laravel-lang/lang语言包。因此这个报错的解决方法是,先移除overtrue/laravel-lang:~6.0包:

composer remove overtrue/laravel-lang

再安装laravel-lang/lang语言包:

composer require laravel-lang/lang

安装好了后,执行以下命令添加中文语言包到Laravel 10:

php artisan lang:add zh_CN

我们可以看到在resources/lang目录里增加了zh_CN.json文件和zh_CN文件夹。

然后修改config/app.php,找到’locale’ => ‘en’,改为’locale’ => ‘zh_CN’。

刷新浏览器看看。

更多laravel-lang/lang语言包的用法,例如如何添加多个语言包到Laravel、如何在“语言.json”文件里增加自定义的条目等,请查看laravel-lang/lang语言包的官方文档:Getting Started | Laravel Lang (laravel-lang.com)

参考

https://www.cnblogs.com/inkqx/p/13563856.html

VirtualBox Linux虚拟机与Windows宿主机的共享文件夹里面无法创建符号链接的解决方法

我的软件环境:

VirtualBox虚拟机:Ubuntu 22

宿主机:Windows 10

在Ubuntu 22虚拟机的共享文件夹中创建符号链接时,可能的报错有以下几种:

第一种,在运行npm install esbuild时报错:

Error: EPERM: operation not permitted, symlink '../esbuild/bin/esbuild' -> '/var/www/reverb.test/node_modules/.bin/esbuild'

第二种,执行PHP代码创建符号链接时报错:

symlink(): Operation not permitted

第三种,运行ln命令时报错:

ln: failed to create symbolic link 'xxx.so.0': Read-only file system

第四种,运行cp命令时报错:

cannot create symbolic link `xxxx':Read-only file system

第五种,运行cp命令时报错:

cannot create symbolic link `xxxx': Protocol error

……

原因是VirtualBox从安全角度出发,限制了软链接(符号链接)的创建。如果想正常使用符号链接,需要对虚拟机设置 VBoxInternal2/SharedFoldersEnableSymlinksCreate/<share_folder_name> 这个选项。这里顺带一提,对于 vagrant,这个选项只要你运行 vagrant up之后这个选项便会自动设置好。可以使用 VboxManage.exe设置这个选项 ,这个工具在 Windows 下是和 VirtualBox 图形界面程序在一个相同目录的。以下是详细步骤:

1 关闭 VirtualBox。

2 以管理员身份打开命令行窗口,cd到VirtualBox安装目录(例如cd C:\Programs\Oracle\VirtualBox),执行如下命令:

VBoxManage setextradata YOURVMNAME VBoxInternal2/SharedFoldersEnableSymlinksCreate/YOURSHAREFOLDERNAME 1

其中:

  • YOURVMNAME填写ubuntu 虚拟机系统的名称
  • YOURSHAREFOLDERNAME填写共享文件夹的名称,注意这个共享文件夹名称是你在 VirtualBox 中设置共享时对应的“共享文件夹名称”一栏的内容,不是共享文件夹的路径或者文件夹的名称。

例如:

VBoxManage setextradata Ubuntu22 VBoxInternal2/SharedFoldersEnableSymlinksCreate/share 1

3 以管理员身份运行VirtualBox

参考

https://blog.csdn.net/tekenuo/article/details/82386552

https://tty.moe/blog/virtualbox-symlink-windows

Why Multiple Elasticsearch Nodes Fail to Form a Cluster: master_not_discovered_exception or NotMasterException and How to Fix It

If you’ve encountered a situation where multiple Elasticsearch nodes fail to automatically form a cluster and the logs show the error: “master_not_discovered_exception”, you are not alone.

The Problem

The root cause is often related to system administrators cloning virtual machines to create multiple Elasticsearch servers. When this happens, every Elasticsearch node ends up with the same node ID, and as a result, the cluster cannot successfully elect a master node.

Verifying the Issue

You can verify this issue by listing all the node IDs with the following command:

GET /_cat/nodes?v&h=id,ip,name&full_id=true

However, since the Elasticsearch cluster hasn’t formed, you need to query each node individually, like this:

curl 192.168.110.111:9200/_cat/nodes?v&h=id,ip,name&full_id=true
curl 192.168.110.112:9200/_cat/nodes?v&h=id,ip,name&full_id=true

The Solution

Elasticsearch requires each node to have a unique node ID. To fix this issue, you need to delete the index data on each node. If Elasticsearch was installed using the RPM package, the index data is usually stored in /var/lib/elasticsearch by default. After deleting the data, restart Elasticsearch, and it will generate a new, unique node ID for each node.

Reference

For further details, check the full article here: https://www.656463.com/wenda/jdbhjrjqNotMasterExceptionqgddxc_359.

Windows 10 or Windows 11 Only Shows One Hard Drive After Reinstallation? Here’s the Fix

If you have two hard drives in your system but only see one in “This PC” after reinstalling Windows 10 or 11, follow these steps to resolve the issue:

  1. Right-click on This PC and select Manage.
  2. Go to Device Manager under System Tools and check Disk drives. If both drives are listed, it means the second drive is recognized and there is no issue with the hardware.
  3. Now, open Storage > Disk Management.
  4. Right-click on the second hard drive and select Change Drive Letter and Paths. Assign a drive letter to the second drive.

After doing this, the second drive should appear in This PC in File Explorer.

Windows 10或Windows 11有两个硬盘,但重装系统后在“此电脑”里只显示一个的问题及解决方法

右键点“此电脑”->系统工具->设备管理->磁盘驱动器,看看里面是否有两个硬盘驱动,如果是,说明第二块磁盘驱动没有问题,再打开存储->磁盘管理,右键点击第二块磁盘->更改驱动器号和路径,设置一下驱动器号,就可以在资源管理器的“此电脑”路径下出现了。

How to Restore Files Deleted by Windows Defender on Windows 10 and Windows 11?

For Windows 10:
1.Open Windows Security Center
2.Go to Virus & threat protection
3.Navigate to Threat history
4.Check the Detected threats
5.Select Restore

For Windows 11:
1.Open Windows Security Center
2.Go to Virus & threat protection
3.Navigate to Protection history
4.Check the Quarantined threats
5.Select Restore

Important Note
Restoring quarantined files requires administrative privileges on your Windows system.

Windows10和Windows11如何还原被Windows Defender删除的文件?

对于Windows10:

打开Windows安全中心->病毒和威胁防护->威胁历史记录->检查出的威胁->还原

对于Windows11:

打开Windows安全中心->病毒和威胁防护->保护历史记录->已隔离威胁->还原

注意事项

在还原被隔离的文件时,需要你有Windows系统的管理员权限。

Windows11更新后闪屏问题的解决方法

今天我更新Windows11系统并重启后,电脑屏幕出现了闪烁问题。

我检查显卡驱动,无论是Nvidia显卡驱动还是Intel显卡驱动都是最新的。那么问题出在哪里?

我猜测是因为我的操作系统是从Windows10升级而来,之前Windows10下某些Intel显卡驱动的隐藏设置(配置)在Windows11下与新版本的显卡驱动不兼容所致。

因此,我使用Display Driver Uninstaller (DDU)彻底卸载Intel显卡驱动后,再重装最新版本的Intel显卡驱动,就解决了电脑屏幕闪烁问题!

注意,安装最新版本的Intel显卡驱动程序时需要以管理员身份运行安装程序。

最新版Intel显卡驱动官网下载地址:

https://www.intel.com/content/www/us/en/download/19344/intel-graphics-windows-dch-drivers.html

最新版DDU官网下载地址:

https://www.wagnardsoft.com/display-driver-uninstaller-ddu-

参考

https://bbs.pcbeta.com/viewthread-1944975-1-1.html

How to Fix Screen Flickering Issue After Windows 11 Update

Today, after updating my Windows 11 system and rebooting, I encountered a screen flickering problem.

I checked both my Nvidia and Intel graphics drivers, and they were up to date. So where was the issue?

I suspected that the problem arose because my system had been upgraded from Windows 10 to Windows 11. Some hidden settings or configurations from the older Intel graphics drivers on Windows 10 might have been incompatible with the newer drivers on Windows 11.

To resolve the issue, I used Display Driver Uninstaller (DDU) to completely remove the Intel graphics driver. Afterward, I reinstalled the latest version of the Intel graphics driver, and the screen flickering problem was fixed!

Note: When installing the latest Intel graphics driver, make sure to run the installer as an administrator.

Download the latest Intel graphics driver here: https://www.intel.com/content/www/us/en/download/19344/intel-graphics-windows-dch-drivers.html

Download the latest DDU here: https://www.wagnardsoft.com/display-driver-uninstaller-ddu-

Reference
https://bbs.pcbeta.com/viewthread-1944975-1-1.html

VirtualBox Linux虚拟机与Windows宿主机的共享文件夹里面无法创建符号链接的解决方法

我的软件环境:

VirtualBox虚拟机:Ubuntu 22

宿主机:Windows 10

在Ubuntu 22虚拟机中创建符号链接时,可能的报错有以下几种:

第一种,在运行npm install esbuild时报错:

Error: EPERM: operation not permitted, symlink '../esbuild/bin/esbuild' -> '/var/www/reverb.test/node_modules/.bin/esbuild'

第二种,执行PHP代码创建符号链接时报错:

symlink(): Operation not permitted

第三种,运行ln命令时报错:

ln: failed to create symbolic link 'xxx.so.0': Read-only file system

第四种,运行cp命令时报错:

cannot create symbolic link `xxxx':Read-only file system

第五种,运行cp命令时报错:

cannot create symbolic link `xxxx': Protocol error

原因是VirtualBox从安全角度出发,限制了软链接(符号链接)的创建。如果想正常使用符号链接,需要对虚拟机设置 VBoxInternal2/SharedFoldersEnableSymlinksCreate/<share_folder_name> 这个 extradata。这里顺带一提,对于 vagrant,这个选项只要你运行 vagrant up之后这个选项便会自动设置好。可以使用 VboxManage设置这个 extradata ,这个工具在 Windows 下是和 VirtualBox 图形界面在一个相同目录的。以下是详细步骤:

1 关闭 VirtualBox。

2 以管理员身份打开命令行窗口,cd到VirtualBox安装目录(例如cd C:\Programs\Oracle\VirtualBox),执行如下命令:

VBoxManage setextradata YOURVMNAME VBoxInternal2/SharedFoldersEnableSymlinksCreate/YOURSHAREFOLDERNAME 1

其中:

YOURVMNAME填写ubuntu 虚拟机系统的名称

YOURSHAREFOLDERNAME填写共享文件夹的名称,注意这个共享文件夹名称是你在 VirtualBox 中设置共享时对应的“共享文件夹名称”一栏的内容,不是共享文件夹的路径或者文件夹名称。

3 以管理员身份运行VirtualBox

参考

https://blog.csdn.net/tekenuo/article/details/82386552

https://tty.moe/blog/virtualbox-symlink-windows