# 9:00~10:59

# ego: vat design

now it is 

vi与vim的区别以及常用命令

- [vi与vim的区别以及常用命令](https://cloud.tencent.com/developer/article/1604110)

Linux必会之SSH安装、配置、使用、进阶指北

请注意,本文编写于 1608 天前,最后修改于 914 天前,其中某些信息可能已经过时。

安装SSH服务,配置SSH服务,SSH免密登录,SCP传输文件,SSH的常见高级用法; 做开发,关于SSH服务,这一篇就够了。

## Linux安装配置SSH服务

#### ssh服务是什么?

> 传统的网络服务程序,如:`ftp`、`pop`和`telnet`在本质上都是不安全的,因为它们在网络上用明文传送口令和数据,别有用心的人非常容易就可以截获这些口令和数据。通过使用SSH,你可以把所有**传输的数据进行加密**,有效的**防止中间人攻击**,也能够**防止DNS欺骗和IP欺骗**。使用SSH,还有一个额外的好处就是传输的数据是经过压缩的,所以可以**加快传输的速度**。SSH有很多功能,它既可以代替`Telnet`,又可以为`FTP`、`PoP`、甚至为`PPP`提供一个安全的"通道"。

#### 1\. 安装SSH

##### 安装前检查`ssh`服务状态:

```sh
sudo ps -e |grep ssh
```

如果显示只有`s

2872. Maximum Number of K-Divisible Components

There is an undirected tree with n nodes labeled from 0 to n - 1. You are given the integer n and a 2D integer array edges of length n - 1, where edges[i] = [ai, bi] indicates that there is an edge between nodes ai and bi in the tree. You are also given a 0-indexed integer array values of length n, where values[i] is the value associated with the ith node, and an integer k. A valid split of the tree is obtained by removing any set of edges, possibly empty, from the tree such that the resulting components all have values that are divisible by k, where the value of a connected component is the sum of the values of its nodes. Return the maximum number of components in any valid split.
/**
 * @param {number} n
 * @param {number[][]} edges
 * @param {number[]} values
 * @param {number} k
 * @return {number}
 */
// Function to perform DFS and calculate subtree sums
function dfs(node, parent, adjList, values, k, dp) {
    // Start with the value of the current node
    let subtreeSum = values[node];

    // Visit all neighbors
    for (let neighbor of adjList[node]) {
        if (neighbor !== parent) {
            // Recursively calculate the sum for child subtrees
            su

linux 环境变量文件区别 & 加载顺序

> 本文由 [简悦 SimpRead](http://ksria.com/simpread/) 转码, 原文地址 [blog.csdn.net](https://blog.csdn.net/yifen4234/article/details/80691434)
> 
> 作者:Solomon1588  
> 原文链接: [https://blog.csdn.net/Solomon1558/article/details/51763751](https://blog.csdn.net/Solomon1558/article/details/51763751)
> 
> Shell 变量有局部变量、环境变量之分。局部变量就是指在某个 Shell 中生效的变量,只在此次登录中有效。环境变量通常又称 “全局变量”,虽然在 Shell 中变量默认就是全局的,但是为了让子 Shall 继承当前 Shell 的变量,需要使用 export 内建命令将其导出为环境变量。

## 一、Linux 的变量种类

按变量的生存周期划分:

*   永久的:需要修改配置文件,变量永久生效

Linux设置代理

> 本文由 [简悦 SimpRead](http://ksria.com/simpread/) 转码, 原文地址 [cloud.tencent.com](https://cloud.tencent.com/developer/article/2129796)


### 0x00 前言简述

Q: 操作系统的全局代理?

> 答:我们常常听说网络代理例如 Socket、Http 代理,全局代理即系统所有的流量都是通过该代理通道进行通信, 然而这个还不能说是全称走代理,只能说是 90% 的应用都可以使用这个设置来实现代理访问,但这个只是针对于个别软件由于他们更不都不走 http 协议,所有代理的方式不是绝对的,只有网关流量代理是完全代理的;

Q: 网上关于 Linux 中 http_proxy 的设置说明错误

> 答: Linux 操作系统全局代理配置主要在于环境变量的设置 http_proxy 该变量是支持 http 以及 socket 的; 比如 curl、git 软件默认使用 http_proxy 这个环境变量来设置代理[服务器](https://clou

CodeMirror editor for CREATE Mode


HEADER AREA:
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.5/codemirror.min.css" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.5/theme/monokai.min.css" />



CONTENT AREA:
<!--  POST CONTENT  -->
<div wire:ignore>
    <div id="editor" style="height: 500px; width: 100%;"></div>
</div>
<!-- Hidden textarea to bind with Livewire -->
<textarea id="content" name="content" style="display:none;" wire:model="post_content"></

Map an ACF userID field to the post's Author field

function my_acf_save_post( $post_id ) {
    // get new value
    $user_id = get_field('lead_designer');
  	if($user_id){
  		wp_update_post( array( 'ID'=>$post_id, 'post_author'=>$user_id) ); 
  	}
}
add_action('acf/save_post', 'my_acf_save_post', 20);

2415. Reverse Odd Levels of Binary Tree

Given the root of a perfect binary tree, reverse the node values at each odd level of the tree. For example, suppose the node values at level 3 are [2,1,3,4,7,11,29,18], then it should become [18,29,11,7,4,3,1,2]. Return the root of the reversed tree. A binary tree is perfect if all parent nodes have two children and all leaves are on the same level. The level of a node is the number of edges along the path between it and the root node.
/**
 * Definition for a binary tree node.
 * function TreeNode(val, left, right) {
 *     this.val = (val===undefined ? 0 : val)
 *     this.left = (left===undefined ? null : left)
 *     this.right = (right===undefined ? null : right)
 * }
 */
/**
 * @param {TreeNode} root
 * @return {TreeNode}
 */
var reverseOddLevels = function(root) {
    if (!root) return null;

    // Helper function to perform a BFS traversal and reverse node value at odd levels
    const bfs = (root) => {
        const q

2415. Reverse Odd Levels of Binary Tree

Given the root of a perfect binary tree, reverse the node values at each odd level of the tree. For example, suppose the node values at level 3 are [2,1,3,4,7,11,29,18], then it should become [18,29,11,7,4,3,1,2]. Return the root of the reversed tree. A binary tree is perfect if all parent nodes have two children and all leaves are on the same level. The level of a node is the number of edges along the path between it and the root node.
/**
 * Definition for a binary tree node.
 * function TreeNode(val, left, right) {
 *     this.val = (val===undefined ? 0 : val)
 *     this.left = (left===undefined ? null : left)
 *     this.right = (right===undefined ? null : right)
 * }
 */
/**
 * @param {TreeNode} root
 * @return {TreeNode}
 */
var reverseOddLevels = function(root) {
    if (!root) return null;

    // Helper function to perform a BFS traversal and reverse node value at odd levels
    const bfs = (root) => {
        const q

WSL配置

# WSL 配置

- ## wsl 如何设置 Linux 子系统默认用户为 root
  解决:
1. `WIN` + `R`,输入`cmd`打开命令行窗口
2. 输入命令: `cd %HOMEPATH%\AppData\Local\Microsoft\WindowsApps`,查看安装的子系统对应的应用名,比如:`ubuntu2404.exe`
3. 输入命令:`.\ubuntu2404.exe config --default-user root`
4. 再次打开子系统会发现已经默认登录用户为root了

- ## wsl 如何设置 Linux 子系统默认用户为 root
解决:
1. 输入命令:`wsl -l --all`查看所有版本
2. 命令格式:`wsl --setdefault wsl名称`,例如:`wsl --setdefault Ubuntu-24.04`将Ubuntu-24.04设置为默认子系统

visuallyHidden

視覚的に見えないが存在するようにする。 スクリーンリーダーで読み上げられるようにするためのCSS。 コードの引用元:[テキストを1文字ずつ抜き出して、アニメーションさせる](https://zenn.dev/spicato_blog/articles/f4ccc462fd637c#%E3%81%BE%E3%81%A8%E3%82%81)
.visuallyHidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  margin: -1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

Change files

const fs = require('fs')
const data = fs.readFileSync('./networks.json').toString();
const sourceData = JSON.parse(data);
const networks = fs.readFileSync('./networks-list.json').toString();
const sourceNetworks = JSON.parse(networks);
const networksMapping = Object.fromEntries(sourceNetworks.map(({ wallet, network }) => [wallet, network]))

const normalized = sourceData.map((item) => ({
  ...item,
  asset_identifier: item.asset_identifier || item.symbol,
  network: item.network || net

Counter Animation

![demo](https://p61.f2.n0.cdn.zight.com/items/8LuWwJ5z/c577e312-6dd5-4158-8cbe-2dcb946fd272.gif?source=viewer&v=32de331fea777691599a4c60f403239e) Counter Animation met JS voor RAB-Groep voegt een default value toe aan de inhoud in het grid op basis van de tekstinhoud +een animatie (Thomas)
observer.observe(document.body, {
    attributes: true,
    attributeFilter: ['class'],
  });
});

document.addEventListener('DOMContentLoaded', () => {
  const counters = document.querySelectorAll('.counter .el-title');

  const startCounter = (counter) => {
    // Set the data-target attribute based on the current content
    const targetValue = counter.innerText.trim().replace(/[,\.]/g, '');
    counter.setAttribute('data-target', targetValue);

    // Set the initial value to 0

Pet-project

PJxrGPMK5ZTF

Nuxt3 DOMをrefに格納する2つの方法

<template>
  <div ref="div1">useTemplateRefの場合</div>
  <div ref="div2">refの場合</div>
</template>

<script setup>
const div1 = useTemplateRef<HTMLDivElement>('div1')
const div2 = ref<HTMLDivElement | null>(null)
</script>