Skip to content

Instantly share code, notes, and snippets.

View codethereforam's full-sized avatar
:octocat:
Focusing

ZanyZoe codethereforam

:octocat:
Focusing
View GitHub Profile
开启WSL2后WMware无法启用vt-x
原因:
Only one software component can use this hardware at a time
参考:
https://learn.microsoft.com/en-us/troubleshoot/windows-client/application-management/virtualization-apps-not-work-with-hyper-v
解决:
bcdedit /set hypervisorlaunchtype off
@codethereforam
codethereforam / BeanHelper.java
Created August 26, 2024 06:26
use spring BeanCopier copy beans
/**
* BeanHelper
*
* @author yanganyu
*/
@UtilityClass
public class BeanHelper {
public static <S, T> T copy(BeanCopier beanCopier, S source, Supplier<T> targetConstructor) {
T target = targetConstructor.get();
@codethereforam
codethereforam / delete_specific_string.md
Created August 19, 2024 02:22
text editor delete from a text file, all lines that contain a specific string

replace ^.*XXX.*$\n with empty

@codethereforam
codethereforam / Lubuntu_initramfs_boot_error.md
Created August 17, 2024 07:33
无法启动Lubuntu,报错和initramfs相关

启动报错

initramfs: couldn't load /libahci.ko: exec format error
initramfs: timeout while waiting for devices / filesystem to appear(did you specify the correct ones?)

解决思路

  1. 启动Live USB
  2. 挂载根文件系统到 /mnt
  3. 挂载必要的文件系统 (/dev, /proc, /sys, /run)
@codethereforam
codethereforam / textSelect.js
Created June 19, 2024 03:31
网页文字不能选中解决
document.querySelectorAll('*').forEach(e => e.style.userSelect = 'text');
@codethereforam
codethereforam / windows_find_port.md
Created June 12, 2024 08:02
Windows查找占用3306端口的应用

在Windows系统中,你可以使用 netstat 命令和 findstr 命令来查找哪个进程正在使用特定的端口。以下是如何查找哪个进程正在使用3306端口:

打开命令提示符(cmd),然后输入以下命令:

netstat -ano | findstr 3306

这将显示使用3306端口的所有连接,以及这些连接的进程ID(PID)。输出将类似于以下内容:

@codethereforam
codethereforam / idea-copilot.md
Created April 24, 2024 05:33
IDEA中Github Copilot设置代理
@codethereforam
codethereforam / SuppliersTest.java
Created March 25, 2024 02:26
使用Guava实现延迟调用并且缓存第一次调用的值
@Test
void t3() {
Supplier<Long> s = Suppliers.memoize(this::tt);
System.out.println("---------1");
System.out.println(s.get());
System.out.println("---------2");
System.out.println(s.get());
System.out.println("---------3");
System.out.println(s.get());
System.out.println("---------4");
@codethereforam
codethereforam / ConcatList.java
Created March 15, 2024 02:17
Java合并两个集合
Lists.newArrayList(Iterables.concat(list1, list2));
@codethereforam
codethereforam / Windows任务的使用场景.md
Created March 12, 2024 13:55
Windows任务的使用场景
  1. 每天定时执行一个签到脚本
  2. 每当电脑从睡眠中唤醒时执行一个脚本