2025年8月3日 星期日

在windows中用Visual Studio Code開啟Claude AI

在windows10/11中用Visual Studio Code開啟Claude AI,
可以直接用Claude寫code.


前置作業, 要先安裝好wsl在windows作業系統裡.

1. 到要給Claude操作的目錄下.


2025年5月25日 星期日

[Linux] User space 函式庫

●Delay 
#include <unistd.h>
usleep(100000); // 延遲 100,000 微秒 = 100 毫秒

●Delay 
#include <time.h>
struct timespec ts;
ts.tv_sec = 0;
ts.tv_nsec = 100 * 1000000L; // 100 毫秒
nanosleep(&ts, NULL);

2025年5月11日 星期日

[網路] 如何判斷Bandwidth


2.4G
HT Capabilities Bit 1(Supported Channel Width Set)
0: 20, 1: 20/40


如果Supported Channel Width Set,有可能是20或40
所以要再看Secondary Channel Offset


STA Channel Width   Secondary Channel Offset說明
0    0     使用 20 MHz
1    1(Above)     使用 40 MHz,副頻道在上面
1    3(Below)     使用 40 MHz,副頻道在下面

2024年12月14日 星期六

[Linux] hostapd create nelink socket和kernel driver溝通

1. static struct nl_sock * nl_create_handle(struct nl_cb *cb, const char *dbg)

2. struct nl_sock *nl_socket_alloc_cb(struct nl_cb *cb)
  a. calloc struct cb memory area
  b. 建立pid s_local.nl_pid = generate_local_port(); //取process id作為pid

3. 在此建立socket和bind
int genl_connect(struct nl_sock *sk)
  a. sk->s_fd = socket(AF_NETLINK, SOCK_RAW | flags, protocol);
  b. bind(sk->s_fd, (struct sockaddr*) &sk->s_local, sizeof(sk->s_local));

2024年10月22日 星期二

[網路] BSSID

BSSID: WiFi AP的MAC Address.

SSID: WiFi AP beacon發出來的名字,就是在wifi收尋選單看到的名字.

2024年8月19日 星期一

[網路] 如何判斷WPA3 SAE和WPA2 PSK/WPA3 SAE mix mode

主要是看beacon的RSN information tag


根據chatgpt解說

Identifying WPA2 vs. WPA3

  • WPA2: The AKM suite typically includes entries such as 00-0F-AC-1 (PSK) or 00-0F-AC-2 (802.1X).
  • WPA3: The AKM suite for WPA3 will include:
    • SAE (Simultaneous Authentication of Equals): 00-0F-AC-8, indicating WPA3-Personal.
    • Suite B: 00-0F-AC-9, indicating WPA3-Enterprise, often used with 192-bit cryptographic strength