arm 使用wpa_cli连接wifi

2023-11-15

公司使用的是IMX6的ARM板,板子已经带了8192cu的驱动,使用 lsmod 命令可以查看已经安装的mod

使用的USB为:树莓派 Raspberry Pi 无线USB网卡 EDUP EP-N8508GS 黄金版 免驱

lsmod
结果:
Module                  Size  Used by
8192cu                497965  0

 驱动文件在 /lib/modules/8192cu.ko

接上USBwifi后,先查看能否看到无线网卡,使用ifconfig命令或者iwconfig命令,我这边显示的名称为wlan0

wlan0     Link encap:Ethernet  HWaddr e8:4e:06:6f:87:dc  
          inet addr:192.168.1.103  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::ea4e:6ff:fe6f:87dc/64 Scope:Link
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:64 overruns:0 frame:0
          TX packets:0 errors:0 dropped:2 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:2870410 (2.7 MiB)  TX bytes:13714 (13.3 KiB)
# 启用网卡
ifconfig wlan0 up
# 禁用网卡
ifconfig wlan0 down

使用 iwlist wlan0 scan可以使用无线网卡wlan0扫描可见的wifi,会显示很多,使用 iwlist wlan0 scan | grep SSID只显示名称,不过一般使用wpa_cli命令搜索wifi

下面先说一下几个配置文件:

  • /etc/resolv.conf 域名解析的地址配置文件,通过命令udhcpc -iwlan0可以从DHCP服务器上获取IP地址和有效的DNS并自动写入这个文件
  • /etc/network/interfaces 网卡配置文件,下面是arm板上的interfaces文件内容:
# /etc/network/interfaces -- configuration file for ifup(8), ifdown(8)
 
# The loopback interface
auto lo
iface lo inet loopback

# Wireless interfaces
auto wlan0
iface wlan0 inet dhcp
#       address 192.168.1.62
#       netmask 255.255.255.0
#       gateway 192.168.1.1
#       wireless_mode managed
#       wireless_essid any
#       wpa-driver wext
#       wpa-conf /etc/wpa_supplicant.conf

#iface atml0 inet dhcp

# Wired or wireless interfaces
auto eth0
#iface eth0 inet dhcp
iface eth0 inet static
#       address 192.168.1.62
        address 192.168.100.20
        netmask 255.255.255.0
#       gateway 192.168.1.1
        gateway 192.168.100.10

# Ethernet/RNDIS gadget (g_ether)
# ... or on host side, usbnet and random hwaddr
#iface usb0 inet static
#       address 192.168.7.2
#       netmask 255.255.255.0
#       network 192.168.7.0
#       gateway 192.168.7.1

# Bluetooth networking
#iface bnep0 inet dhcp
  • /etc/wpa_supplicant.conf 无线网卡连接配置文件,下面是wpa_supplicant.conf配置文件内容:
ctrl_interface=/var/run/wpa_supplicant
# 如果要使用wpa_cli -i wlan0 save_config保存网络配置,那么update_config要设置为0
# 如果update_config设置为0,保存会失败,但是还没有提示为什么
update_config=1
device_type=0-00000000-0

# wifi配置例子
network={
        ssid="TP-LINK"
        psk="12345678"
        key_mgmt=WPA-PSK
}

完整的wpa_supplicant.conf配置说明可以看官方配置文件说明:http://w1.fi/cgit/hostap/plain/wpa_supplicant/wpa_supplicant.conf 

wpa_supplicant

通过pgrep -af wpa_supplicant查看服务是否启动

如果没有自动启动,可以自己手动启动,命令如下,如果配置问价有问题,会启动失败的

/usr/sbin/wpa_supplicant -B -i wlan0 -c /etc/wpa_supplicant.conf -Dwext

开始连接wifi

使用wpa_cli命令直接进入wpa的客户端命令行模式,显示如下: 

wpa_cli v0.8.x_rtw_r7475.20130812_beta
Copyright (c) 2004-2011, Jouni Malinen <j@w1.fi> and contributors

This program is free software. You can distribute it and/or modify it
under the terms of the GNU General Public License version 2.

Alternatively, this software may be distributed under the terms of the
BSD license. See README and COPYING for more details.


Selected interface 'wlan0'

Interactive mode
>

 不过我不喜欢这种模式,特别是输入命令不能修改,一般我使用wpa_cli直接加指令

# 查看命令帮助
wpa_cli help
# 搜索可见wifi
wpa_cli -i wlan0 scan
# 获取搜索结果
wpa_cli -i wlan0 scan_result
# 获取已经配置的wifi设置
wpa_cli -i wlan0 list_networks
# 查看当前wifi状态
wpa_cli -i wlan0 status
# 新建wifi配置,会返回一个新的网络整数ID,比如:0
wpa_cli -i wlan0 add_network
# 假设新wifi的网络ID为0
# 设置wifi的ssid
# ssid需要添加双引号,双引号还要加斜杠或者单引号
wpa_cli -i wlan0 set_network 0 ssid '"TP-LINK"'
wpa_cli -i wlan0 set_network 0 ssid \"TP-LINK\"
# 设置加密方式,WPA-PSK代表:WPA-PSK/WPA2-PSK
wpa_cli -i wlan0 set_network 0 key_mgmt WPA-PSK
# 设置wifi密码,和账号一样需要双引号
wpa_cli -i wlan0 set_network 0 psk '"12345678"'
wpa_cli -i wlan0 set_network 0 psk \"12345678\"
# 新配置的wifi默认是禁用的,启用,启用后如果没有连接wifi,新增wifi可见就会自动连接的
wpa_cli -i wlan0 enable_network 0
# 如果有多个wifi,可以通过如下命令选择wifi
wpa_cli -i wlan0 select_network 0
# 再次查看状态,查看是否已经连接网络
# wpa_state=COMPLETED表示完成连接,但是如果signal_level比较小时表示实际没有连接
wpa_cli -i wlan0 status
# 保存wifi配置,最好在启用wifi后再保存,否则保存的wifi是默认禁用的
wpa_cli -i wlan0 save_config

按如上指令一般来说是可以正常连接的 

下面是其他常用命令

# 重新加载配置文件
wpa_cli -i wlan0 reconfigure
# 断开wifi连接
wpa_cli -i wlan0 disconnect
# 重新连接
wpa_cli -i wlan0 reconnect
# 移除wifi配置
wpa_cli -i wlan0 remove_network 0
# 终止wpa_supplicant后台服务程序
wpa_cli -i wlan0 terminate
# 也可以使用下面指令终止wpa_supplicant 
killall wpa_supplicant > /dev/null 2>&1
# 如果终止wpa_supplicant会造成使用的无线网卡被禁用,使用ifconfig wlan0 up重新启动网卡

 有时会出现网络没有自动从DHCP中获取IP地址的,可以自己手动获取:

udhcpc -iwlan0

wpa_cli -i wlan0 status命令显示的状态wpa_state变量有如下几种值:

enum WPA_States {
        /**
         * WPA_DISCONNECTED - Disconnected state
         *
         * This state indicates that client is not associated, but is likely to
         * start looking for an access point. This state is entered when a
         * connection is lost.
         */
        WPA_DISCONNECTED = 0,

        /**
         * WPA_INTERFACE_DISABLED - Interface disabled
         *
         * This state is entered if the network interface is disabled, e.g.,
         * due to rfkill. wpa_supplicant refuses any new operations that would
         * use the radio until the interface has been enabled.
         */
        WPA_INTERFACE_DISABLED,

        /**
         * WPA_INACTIVE - Inactive state (wpa_supplicant disabled)
         *
         * This state is entered if there are no enabled networks in the
         * configuration. wpa_supplicant is not trying to associate with a new
         * network and external interaction (e.g., ctrl_iface call to add or
         * enable a network) is needed to start association.
         */
        WPA_INACTIVE,

        /**
         * WPA_SCANNING - Scanning for a network
         *
         * This state is entered when wpa_supplicant starts scanning for a
         * network.
         */
        WPA_SCANNING,

        /**
         * WPA_AUTHENTICATING - Trying to authenticate with a BSS/SSID
         *
         * This state is entered when wpa_supplicant has found a suitable BSS
         * to authenticate with and the driver is configured to try to
         * authenticate with this BSS. This state is used only with drivers
         * that use wpa_supplicant as the SME.
         */
        WPA_AUTHENTICATING,

        /**
         * WPA_ASSOCIATING - Trying to associate with a BSS/SSID
         *
         * This state is entered when wpa_supplicant has found a suitable BSS
         * to associate with and the driver is configured to try to associate
         * with this BSS in ap_scan=1 mode. When using ap_scan=2 mode, this
         * state is entered when the driver is configured to try to associate
         * with a network using the configured SSID and security policy.
         */
        WPA_ASSOCIATING,

        /**
         * WPA_ASSOCIATED - Association completed
         *
         * This state is entered when the driver reports that association has
         * been successfully completed with an AP. If IEEE 802.1X is used
         * (with or without WPA/WPA2), wpa_supplicant remains in this state
         * until the IEEE 802.1X/EAPOL authentication has been completed.
         */
        WPA_ASSOCIATED,

        /**
         * WPA_4WAY_HANDSHAKE - WPA 4-Way Key Handshake in progress
         *
         * This state is entered when WPA/WPA2 4-Way Handshake is started. In
         * case of WPA-PSK, this happens when receiving the first EAPOL-Key
         * frame after association. In case of WPA-EAP, this state is entered
         * when the IEEE 802.1X/EAPOL authentication has been completed.
         */
        WPA_4WAY_HANDSHAKE,

        /**
         * WPA_GROUP_HANDSHAKE - WPA Group Key Handshake in progress
         *
         * This state is entered when 4-Way Key Handshake has been completed
         * (i.e., when the supplicant sends out message 4/4) and when Group
         * Key rekeying is started by the AP (i.e., when supplicant receives
         * message 1/2).
         */
        WPA_GROUP_HANDSHAKE,

        /**
         * WPA_COMPLETED - All authentication completed
         *
         * This state is entered when the full authentication process is
         * completed. In case of WPA2, this happens when the 4-Way Handshake is
         * successfully completed. With WPA, this state is entered after the
         * Group Key Handshake; with IEEE 802.1X (non-WPA) connection is
         * completed after dynamic keys are received (or if not used, after
         * the EAP authentication has been completed). With static WEP keys and
         * plaintext connections, this state is entered when an association
         * has been completed.
         *
         * This state indicates that the supplicant has completed its
         * processing for the association phase and that data connection is
         * fully configured.
         */
        WPA_COMPLETED
    };

下面是wpa_cli的命令帮助

commands:
  status [verbose] = get current WPA/EAPOL/EAP status
  ping = pings wpa_supplicant
  relog = re-open log-file (allow rolling logs)
  note <text> = add a note to wpa_supplicant debug log
  mib = get MIB variables (dot1x, dot11)
  help = show this usage help
  interface [ifname] = show interfaces/select interface
  level <debug level> = change debug level
  license = show full wpa_cli license
  quit = exit wpa_cli
  set = set variables (shows list of variables when run without arguments)
  get <name> = get information
  logon = IEEE 802.1X EAPOL state machine logon
  logoff = IEEE 802.1X EAPOL state machine logoff
  pmksa = show PMKSA cache
  reassociate = force reassociation
  preauthenticate <BSSID> = force preauthentication
  identity <network id> <identity> = configure identity for an SSID
  password <network id> <password> = configure password for an SSID
  new_password <network id> <password> = change password for an SSID
  pin <network id> <pin> = configure pin for an SSID
  otp <network id> <password> = configure one-time-password for an SSID
  passphrase <network id> <passphrase> = configure private key passphrase for an SSID
  bssid <network id> <BSSID> = set preferred BSSID for an SSID
  list_networks = list configured networks
  select_network <network id> = select a network (disable others)
  enable_network <network id> = enable a network
  disable_network <network id> = disable a network
  add_network = add a network
  remove_network <network id> = remove a network
  set_network <network id> <variable> <value> = set network variables (shows list of variables when run without arguments)
  get_network <network id> <variable> = get network variables
  save_config = save the current configuration
  disconnect = disconnect and wait for reassociate/reconnect command before connecting
  reconnect = like reassociate, but only takes effect if already disconnected
  scan = request new BSS scan
  scan_results = get latest scan results
  bss <<idx> | <bssid>> = get detailed scan result info
  get_capability <eap/pairwise/group/key_mgmt/proto/auth_alg> = get capabilies
  reconfigure = force wpa_supplicant to re-read its configuration file
  terminate = terminate wpa_supplicant
  interface_add <ifname> <confname> <driver> <ctrl_interface> <driver_param> <bridge_name> = adds new interface, all parameters but <ifname> are optional
  interface_remove <ifname> = removes the interface
  interface_list = list available interfaces
  ap_scan <value> = set ap_scan parameter
  scan_interval <value> = set scan_interval parameter (in seconds)
  bss_expire_age <value> = set BSS expiration age parameter
  bss_expire_count <value> = set BSS expiration scan count parameter
  stkstart <addr> = request STK negotiation with <addr>
  ft_ds <addr> = request over-the-DS FT with <addr>
  wps_pbc [BSSID] = start Wi-Fi Protected Setup: Push Button Configuration
  wps_pin <BSSID> [PIN] = start WPS PIN method (returns PIN, if not hardcoded)
  wps_check_pin <PIN> = verify PIN checksum
  wps_cancel Cancels the pending WPS operation
  wps_reg <BSSID> <AP PIN> = start WPS Registrar to configure an AP
  wps_ap_pin [params..] = enable/disable AP PIN
  wps_er_start [IP address] = start Wi-Fi Protected Setup External Registrar
  wps_er_stop = stop Wi-Fi Protected Setup External Registrar
  wps_er_pin <UUID> <PIN> = add an Enrollee PIN to External Registrar
  wps_er_pbc <UUID> = accept an Enrollee PBC using External Registrar
  wps_er_learn <UUID> <PIN> = learn AP configuration
  wps_er_set_config <UUID> <network id> = set AP configuration for enrolling
  wps_er_config <UUID> <PIN> <SSID> <auth> <encr> <key> = configure AP
  ibss_rsn <addr> = request RSN authentication with <addr> in IBSS
  suspend = notification of suspend/hibernate
  resume = notification of resume/thaw
  drop_sa = drop SA without deauth/disassoc (test command)
  roam <addr> = roam to the specified BSS
  sta_autoconnect <0/1> = disable/enable automatic reconnection
  tdls_discover <addr> = request TDLS discovery with <addr>
  tdls_setup <addr> = request TDLS setup with <addr>
  tdls_teardown <addr> = tear down TDLS with <addr>
  signal_poll = get signal parameters

 

 

 

 

 

 

 

参考:

http://www.forlinx.com/zixun/49.htm

https://blog.csdn.net/jack_a8/article/details/43062895

https://www.cnblogs.com/little-ant/p/3730148.html

http://shumeipai.nxez.com/2013/09/30/use-wpa-cli-command-line-to-configure-wi-fi-wireless-lan.html

https://segmentfault.com/a/1190000011579147

http://w1.fi/

 

 

 

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

arm 使用wpa_cli连接wifi 的相关文章

  • 为什么无符号类型在arm cpu中效率更高?

    我正在阅读手臂手册并提出这个建议 但没有提到原因 为什么无符号类型更快 在 ARMv4 之前 ARM 没有对加载半字和有符号字节的本机支持 要加载有符号的字节 你必须LDRB然后对值进行符号扩展 LSL那就起来吧ASR它回落 这很痛苦所以c
  • ARM NEON:如何实现 256 字节查找表

    我正在使用内联汇编将我编写的一些代码移植到 NEON 我需要的一件事是将范围 0 128 的字节值转换为表中采用完整范围 0 255 的其他字节值 该表很短 但其背后的数学并不容易 因此我认为不值得每次 即时 计算它 所以我想尝试查找表 我
  • 如何创建具有自定义外设和内存映射的 QEMU ARM 机器?

    我正在为 Cortex M3 cpu 编写代码 并且正在使用以下命令执行单元测试qemu arm二进制 现在一切都很好 但我想知道我是否能够使用测试整个系统qemu system arm 我的意思是 我想为 qemu 编写自定义 机器 我将
  • 将ELF文件加载到内存中

    我正在尝试将 elf 文件放入内存然后执行它 步骤如下 1 要放入内存的文件 int main printf Hello world n return 0 2 编译它gcc o hello hello c static ELF Header
  • 嵌入式 C++ (ARM9) 单元测试

    我来自 Java 和 JUnit 的世界 我演示了 Hudson 以及我使用 JUnit 取得的所有成果 我想在嵌入式设备上对 C 代码执行相同的操作 但找不到从哪里开始 该项目使用 iccarm exe IAR 编译器 进行编译 现在使用
  • 使用 ARM NEON 内在函数添加 alpha 和排列

    我正在开发一个 iOS 应用程序 需要相当快地将图像从 RGB gt BGRA 转换 如果可能的话 我想使用 NEON 内在函数 有没有比简单分配组件更快的方法 void neonPermuteRGBtoBGRA unsigned char
  • 小型 ARM 微控制器的 RTOS 内核之间的可量化差异 [关闭]

    Closed 这个问题是基于意见的 help closed questions 目前不接受答案 有许多不同的 RTOS 可用于微控制器 我专门寻找支持 ARM Cortex M 处理器的 RTOS 另外 我对闭源解决方案不感兴趣 试图从网站
  • 用于 RHEL 的 gdb-multiarch

    我正在尝试寻找方法来运行gdb 多架构RHEL 中的命令 我已经安装了用于 ARM 处理的 QEMU 模拟器 我想安装GDB进行调试 我能够安装GDB 多体系结构在 Ubuntu 中运行命令成功 sudo apt get GDB multi
  • 在嵌入式设备上使用new或malloc引起的段错误[关闭]

    这个问题不太可能对任何未来的访客有帮助 它只与一个较小的地理区域 一个特定的时间点或一个非常狭窄的情况相关 通常不适用于全世界的互联网受众 为了帮助使这个问题更广泛地适用 访问帮助中心 help reopen questions 我正在尝试
  • 源和目标具有不同的 EABI 版本

    我正在尝试使用 ARM 工具链编译 so 文件 但是我不断收到这个错误 错误 源对象的 EABI 版本为 0 但目标对象的 EABI 版本为 5 我无法更改工具链中的任何内容 因为我必须使用给定的工具链 我以前从未见过这个错误 我使用了这个
  • 尝试使用 qemu-arm 运行arm二进制文件时如何解决“加载共享库时出错”?

    我正在运行 Linux Mint 14 并安装了 qemu qemu user 和 gnueabi 工具链 我编译了 test carm linux gnueabi gcc test c o test 当我尝试跑步时qemu arm usr
  • M1 MacBook Pro 上的 Android Studio 无法使用 ABI armeabi-v7a 模拟系统映像

    我的 M1 Macbook Pro 上的 Android Studio 可以很好地模拟 ABI arm64 v8a 的所有系统映像 API 24 29 30 31 但是 它无法使用 ABI armeabi v7a 运行所有映像 例如 API
  • arm-thumb指令集的blx指令如何支持4MB范围

    读自https www keil com support man docs armasm armasm dom1361289866046 htm https www keil com support man docs armasm arma
  • 使用 Android NDK 使用 -fsigned-char 进行构建安全吗?

    为了与其他平台保持一致 我需要使用signed char在我正在处理的一些本机代码中 但默认情况下在Android NDK上char类型是unsigned 我尝试明确使用signed char类型 但它生成太多警告differ in sig
  • 在linux x86平台上学习ARM所需的工具[关闭]

    Closed 此问题正在寻求书籍 工具 软件库等的推荐 不满足堆栈溢出指南 help closed questions 目前不接受答案 我有一个 x86 linux 机器 在阅读一些关于 ARM 的各种信息时 我很好奇 现在我想花一些时间学
  • ARM 系统调用的接口是什么?它在 Linux 内核中的何处定义?

    我读过有关 Linux 中的系统调用的内容 并且到处都给出了有关 x86 架构的描述 0x80中断和SYSENTER 但我无法追踪 ARM 架构中系统调用的文件和进程 任何人都可以帮忙吗 我知道的几个相关文件是 arch arm kerne
  • 为什么 GCC 交叉编译不构建“crti.o”?

    在尝试为arm构建gcc 4 x x交叉编译器时 我陷入了缺失的困境crti o文件在 BUILD DIR gcc子目录 An strace在顶层Makefile表明编译后的xgcc正在调用交联器ld with crti o 作为一个论点
  • 什么是遗留中断?

    我正在开发一个项目 试图弄清楚 ARM 架构的全局中断控制器中如何处理中断 我正在使用 pl390 中断控制器 我看到有一条线被称为传统中断 它绕过了分配器逻辑 假设有 2 个中断可以被编程为传统中断 任何人都可以帮助解释一下什么是遗留中断
  • GCC C++ (ARM) 和指向结构体字段的 const 指针

    假设有一个简单的测试代码 typedef struct int first int second int third type t define ADDRESS 0x12345678 define REGISTER type t ADDRE
  • 架构armv7的重复符号

    尝试在我现有的应用程序中使用 Layar SDK 时出现以下错误 我该如何解决这个问题 Ld Users pnawale Library Developer Xcode DerivedData hub afxxzaqisdfliwbzxbi

随机推荐

  • CVPR2017-目标检测相关

    1 Speed accuracy trade offs for modern convolutional object detectors 其主要考虑三种检测器 Faster RCNN R FCN SSD 作为元结构 三种CNN网络 VGG
  • Python 处理 ini 文件 的模块

    Python 处理 ini 文件 的模块 1 ini 文件 2 configparser 模块 2 1 语法介绍 2 2 操作示例 1 ini 文件 ini 文件是 Initialization File 的缩写 即初始化文件 ini 文件
  • 面向安全数据包分析

    网络安全是一个十分重要的话题 但是它同时也是一个十分复杂的问题 各种针对网络的攻击手段层出不穷 对于网络的守护者来说 将这些手段进行分类是一个十分棘手的工作 网络安全是一个非常复杂的问题 所以我们按照TCP IP分层的方式 对网络中的常见攻
  • 浅谈测试开发岗位

    一 测试开发的概念与需求 测试开发 通常也被称为自动化测试 是一个涵盖了从测试设计 开发 执行和结果分析等一系列活动的职位 在软件开发的生命周期中 测试开发起着至关重要的作用 其主要目标是确保软件的质量和性能达到预期的标准 测试开发工程师通
  • MySQL查看当前数据库视图-SQL语句

    引言 查询语句为 show full tables where table type 可查询当前数据库表 一 创建一个视图 创建视图 create view v stu as 视图内容 连接的一个表 select name from t s
  • Stm32待机模式的进入与唤醒

    1 基础介绍 1 1 单片机的 低功耗模式 像是手机的待机模式 不同于正常运行模式 处于一种省电省资源的状态 1 2 在运行情况下 HCLK为cpu提供时钟 cortex m3内核执行程序的代码 如果处于中断事件的等待时 可以进入低功耗模式
  • 基于R语言分析身高与体重的相关性分析

    本博文源于暨南大学的 多元数据统计分析及R语言建模 旨在讲述身高与体重相关性分析 在概率论与数理统计课程中 两个变量之间协方差的标准化 因此先要熟悉并回忆公式 套用在R语言即可 例子 分析身高 kg 与体重 cm 的相关性 gt x1 c
  • 小心情

    好久没写博客了 总结下现在的自己 还是依旧那么的 情绪控 变化那么快 有时 都受不了自己的 坏脾气 学习再也没像原来的那么卖力 有那么点的小颓废 实验室布置的任务有那么点的小懈怠 一切都没有进展 生活依旧那么平淡 却也没有自己想要的那种安逸
  • linux内核对于指令异常的处理

    1 处理流程 以arm64来介绍一下流程 如果在用户层发生指令异常时 首先进入入口el0 undef arch arm64 kernel entry s el0 undef Undefined instruction enable inte
  • Jina 3.14 版本发布!支持独立部署Executor

    Jina 是一个 MLOps 框架 赋能开发者在云上构建多模态 跨模态的应用程序 Jina 能够将 PoC 提升为生产就绪服务 基础设施的复杂性交给 Jina 开发者能够直接轻松使用高级解决方案和云原生技术 GitHub https git
  • mysql免安装版的下载与安装

    下载 打开 https www mysql com downloads 1 点击该项 2 进去后点击 3 到了真正的下载页面 选择平台 选择版本 安装版和免安装版 下载 4 我现在下载免安装版的 Windows x86 64 bit ZIP
  • Python基础-将变量的值作为变量名

    使用场景 linux unix磁盘文件系统实时使用情况动态收集 每一台机器挂载的文件系统名字有可能都不相同 就算同一台机器不同时间段挂载的文件系统也会不同 我们需要动态收集文件系统名 将变量的值作为变量 定义为文件系统的名 语法基础 gt
  • java如何将字符串存入到数组中

    方法一 public static void main String args 定义一个字符串 String str browser 定义一个字符数组 char array new char 100 for int i 0 i lt str
  • liberity 添加信赖的https证书到key.jks

    业务场景 定时任务批量推送数据到第三方接口 请求地址为https 域名 测试环境测试之后 出现证书认证问题 不能正常推送数据 定时任务部署在 websphere liberty中 出现问题之后在java的Java jdk 1 8 jre l
  • webpack 压缩图片

    问题描述 vue正常打包之后一些图片文件很大 使打包体积很大 通过image webpack loader插件可将大的图片进行压缩从而缩小打包体积 参考 点这里 解决方法 一定要用cnpm安装 cnpm i image webpack lo
  • 数据结构Java实现05----栈:顺序栈和链式堆栈

    本文转载至 http www cnblogs com smyhvae p 4789699 html 一 堆栈的基本概念 堆栈 也简称作栈 是一种特殊的线性表 堆栈的数据元素以及数据元素间的逻辑关系和线性表完全相同 其差别是线性表允许在任意位
  • 数据库的优化方案

    1 优化索引 SQL语句 分析慢查询 2 设计表的时候严格根据数据库的设计凡事来设计数据库 3 使用缓存 把经常访问到的数据且不经常变化的数据放在缓存中 节约磁盘IO 4 优化硬盘 采用SSD 使用磁盘队列技术 5 采用MySQL内部自带的
  • 软件体系结构-KWIC索引系统

    引言 KWIC作为一个早年间在ACM的Paper提出的一个问题 被全世界各个大学的软件设计课程奉为课堂讲义或者作业的经典 From Wiki FYI D L Parnas uses a KWIC Index as an example on
  • Scala递归删除某个文件夹

    check the result is already exists or not val outFilePath D doc spark out t2 val outFile new File outFilePath recursion
  • arm 使用wpa_cli连接wifi

    公司使用的是IMX6的ARM板 板子已经带了8192cu的驱动 使用 lsmod 命令可以查看已经安装的mod 使用的USB为 树莓派 Raspberry Pi 无线USB网卡 EDUP EP N8508GS 黄金版 免驱 lsmod 结果