15AH, San Francisco

California, United States.

Send Your Mail At:

tianyingkejishe@sina.cn

Working Hours

Mon-Sat: 9.30am To 7.00pm

作者标题

Autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et dolore feugait.

Author Archive by stormwind

【光猫】中兴F607ZA查看超级管理员密码【光猫】

Telnet连接光猫,用户名root,密码Zte521,输入命令sendcmd 1 DB p DevAuthInfo即可查看所有的用户名密码,但是中兴F607ZA比较奇葩,普通用户和超级管理员登录的页面是不同的,超级管理员的登录页面是:

http://192.168.1.1/cu.html

移远4G Cat1 Open模块编译环境搭建

声明:此过程个人学习而已,非商业使用用途,试验成功了。请自行删除。

一、安装DS 5.26 软件安装。

  1. 下载DS500-BN-00022-r5p0-26rel0.zip 文件

链接:https://pan.baidu.com/s/1MKkdFj8j7HdbrqX7Q9W45w

提取码:1234

2、默认安装下一步

双击setup.exe文件进行自动化安装,根据提示一步一步直到完成。

一切提示都选择同意。

二、破解

1.拷贝破解文件到安装目录,我选择的全部是默认的。所以直接拷贝到“C:\Program Files\DS-5 v5.26.0”

2、管理员运行cmd窗口

进入DS5.26的安装目录下:

3.首先进行破解,指令如下:patcher.exe -a

看见上图,恭喜你成功破解了!

4.产生我们最终需要的目的license.dat文件,命令:patcher.exe –license

以上已经生成了我们需要的armcc 和license.dat 文件,剩下的就拷贝了!

三、拷贝license.dat文件到sdk相应位置

1、进入sdk目录,备份ARM_Compiler_5为bkARM_Compiler_5

2、拷贝DS 5.26安装目录下的ARMCompiler5.06u4 到上面的文件夹

3、修改“ARMCompiler5.06u4”改为“ARM_Compiler_5”

4、拷贝license.dat到sdk目录

四、测试是否成功

cmd窗口输入指令:build.bat kernel

祝你成功!

【YOLO11】yolov11基本环境安装

1、安装anaconda

进入官网:https://www.anaconda.com/download/success

下载后一路默认安装就可以

安装完以后,创建yolov11环境:

conda create -n yolov11 python=3.12

激活环境:

conda activate yolov11

2、安装GPU环境

Intel GPU ENV:https://anaconda.org/conda-forge/libopenvino-intel-gpu-plugin

To install this package run one of the following:
conda install conda-forge::libopenvino-intel-gpu-plugin
conda install conda-forge/label/openvino_dev::libopenvino-intel-gpu-plugin

管理员权限打开

NVIDA GPU ENV:

安装cuda及cudnn

3、安装Pytorch

进入pytorh官网:https://pytorch.org/get-started/locally/

选择版本:

4、安装ultralytics库

pip install ultralytics

5、更换源库

conda config –remove-key channels

conda config –add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/

conda config –add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/

conda config –add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/

conda config –set show_channel_urls yes

pip config set global.index-url https://mirrors.ustc.edu.cn/pypi/web/simple

【Linux】调度策略和优先级

一、背景

在Linux中,线程是一种轻量级的执行单元,可以在进程内独立运行。线程可以分为普通线程和实时线程,它们之间的区别在于其调度和优先级设置。

  SCHED_OTHER,普通的调度(非实时线程),应用层设置优先级0,调度器总会给此类线程分配一定的CPU资源,只不过是被分配到的频次和时间片长度较少。每1s中实时线程和普通线程的时间比例是95 :5。

  普通线程没有固定的响应时间要求,它们的优先级由系统动态调整。Linux使用CFS调度器来管理普通线程。CFS调度器采用一种称为红黑树的数据结构来维护线程的优先级。每个线程都有一个vruntime值,它表示线程在运行队列中消耗的虚拟时间。CFS调度器会根据线程的vruntime值来确定运行的顺序。优先级较高的线程vruntime值较小,因此能够更早地获得CPU的时间片。

  适用场景:实时性要求不高,但要求必须能被执行的线程。

  SCHED_FIFO,抢占式调度(实时线程),实时先行,应用层设置优先级1-99,同一优先级的多个线程中,一旦某个抢占式线程获取CPU,除非被更高优先级线程抢占(比如在非实时线程中创建一个更高优先级的实时线程),或该线程主动让出CPU资源,否则该线程将会一直占用CPU(但总会分配一点资源给SCHED_OTHER非实时线程)。

  适用场景:实时性要求高,不希望被频繁打断的任务。

  SCHED_RR,轮询式调度(实时线程),实时循环,设置优先级1-99,以循环方式运行,每个线程都有一个时间片来执行任务,时间片耗尽后,该线程将被放入队列的末尾,而较低优先级的线程有机会执行。

  适用场景:实时性要求高,允许被频繁打断的任务。

  在Linux中,可以使用sched_setscheduler函数。这个函数允许我们选择普通线程或实时线程。对于普通线程,可以使用nice函数来动态调整优先级。对于实时线程,可以使用sched_setscheduler函数来设置其类型和优先级。

  关于优先级高低和数值大小的关系,在应用层和内核中二者是相反的。

  设置线程的优先级需要谨慎,因为过高的优先级可能会导致系统资源的过度占用,从而影响其他线程和进程的正常运行。另外,需要注意的是,只有具有足够权限的用户才能设置较高的实时线程优先级。

  总结起来,Linux中的线程分为普通线程和实时线程。普通线程的优先级由系统动态调整,而实时线程的优先级由用户显式设置。通过合理地设置线程的优先级,可以提高系统的性能和响应时间。然而,设置线程的优先级需要慎重考虑,以避免影响其他线程和进程的正常运行。

二、方法

    pthread_t pis_task;
    pthread_attr_t attr;
    struct sched_param sched_param;
// 初始化线程属性
    pthread_attr_init(&attr);

    // 设置线程为实时线程
    pthread_attr_setinheritsched(&attr, PTHREAD_EXPLICIT_SCHED);
    pthread_attr_setschedpolicy(&attr, SCHED_FIFO);

    // 设置线程优先级
    sched_param.sched_priority = THREAD_PRIORITY;
    pthread_attr_setschedparam(&attr, &sched_param);

    pthread_create(&pis_task, &attr, PrtMgr_Decode_Task, (void *)&PrintMgr_Init_colorId);
    pthread_setname_np(pis_task, "name");

【python】python爬取新闻资讯

# 导入爬虫库
import requests
# 导入pyquery(数据提取)
from pyquery import PyQuery as pq
# 用于延时请求
import  time


# 请求头
headers ={'User-Agent':'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.9 Safari/537.36',
          'Cookie':'aliyungf_tc=AQAAACrtMHyGHA4ARxkbZ27Kgw3kCofh; route=ac205598b1fccbab08a64956374e0f11; JSESSIONID=5B42F8C6E712092B9A963E3F0532AD21; uuid=9065c880-0293-4758-86a8-0a228c6cfb2c; SERVERID=srv-omp-ali-portal10_80; Hm_lvt_94a1e06bbce219d29285cee2e37d1d26=1587280903; Hm_lpvt_94a1e06bbce219d29285cee2e37d1d26=1587280903; UM_distinctid=17191507d62338-03d1defec13f5f-721f3a40-144000-17191507d63400; CNZZDATA1261102524=262517629-1587279306-null%7C1587279306; __ads_session=6NY9VLMBdgmIzmsFHgA=',
          'Accept':'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9',
          'Host':'www.thepaper.cn'}

# 封装一个获取新闻内容的函数
def get_news(href,title):
    # 对新闻内容网址发送请求
    response = requests.get(href,headers=headers).text
    # 数据初始化
    doc =pq(response)
    # 通过类选择器news_txt提取新闻内容
    news = doc(".index_cententWrap__Jv8jK").items()
    # 遍历数据
    for x in news:
        # 取出数据中的文本数据,获取到新闻信息
        new = x.text()
        print(new)

# 封装一个获取新闻内容网址和新闻标题的函数
def get_news_title():
    # 新闻网首页的链接
    url = 'https://www.thepaper.cn/channel_25951'
    # 对首页发送请求,并返回文本数据
    respoonse = requests.get(url, headers=headers,).text
    time.sleep(1)
    # 数据初始化
    doc = pq(respoonse)
    # 通过类选择器news_li 下级标签 h2 a 定位数据
    # .itens把数据变成可遍历的数据
    a = doc(".small_toplink__GmZhY a").items()
    print(a)
    # 遍历数据
    for x in a:
        # 通过属性href提取出新闻网址
        href = "https://www.thepaper.cn/" + x.attr("href")
        print(href)
        # 提取数据中的文本 获取新闻标题
        title = x.text()
        print(title)
        get_news(href,title)

if __name__ == '__main__':
    get_news_title()

【Linux】打印机环境安装二

前言

传统USB打印机如何实现网络打印机转变,发挥打印机余热。目前好多不用的机顶盒,我们刷成Linux系统。把打印机的USB线插到机顶盒上,机顶盒通过网线或者wifi连接到路由器上,实现USB到网络转换。那路由器Linux到底需要做哪些操作呢,接下来咱们一起聊聊。

一、安装打印机驱动环境

CUPS是开源的打印机服务开源框架,已集成成千上万的各式打印机驱动,我们不用重复造轮子。

1、安装cups

登陆机顶盒调试,会Linux开发的大家都明白。

apt install cups

2、修改 CUPS 配置文件 /etc/cups/cupsd.conf

将 Listen 修改为 0.0.0.0:631

将 Browsing 修改为 Yes

对应位置加上 Allow all

# Only listen for connections from the local machine.
Listen localhost:631 // [!code --]
Listen 0.0.0.0:631 // [!code ++]
Listen /run/cups/cups.sock 
​
# Show shared printers on the local network.
Browsing Off // [!code --]
Browsing Yes // [!code ++]
BrowseLocalProtocols dnssd
​
# Restrict access to the server...

  Order allow,deny
  Allow all // [!code ++]

​
# Restrict access to the admin pages...

  Order allow,deny
  Allow all // [!code ++]

​
# Restrict access to configuration files...

  AuthType Default
  Require user @SYSTEM
  Order allow,deny
  Allow all // [!code ++]

​
# Restrict access to log files...

  AuthType Default
  Require user @SYSTEM
  Order allow,deny
  Allow all // [!code ++]

3、重启cups服务

systemctl restart cups

4、登陆服务器web,进行打印机添加

访问 https://ip:631 进入 CUPS 的 Web UI,点击添加 Add Printer

5、windows添加网络打印机

【git】git 头指针分离于 xxxx解决方法

通常,我们工作在某一个分支上,比如 master 分支。这个时候 master 指针和 HEAD 指针是一起前进的,每做一次提交,这两个指针就会一起向前挪一步。但是在某种情况下(例如 checkout 了某个具体的 commit),master 指针 和 HEAD 指针这种「绑定」的状态就被打破了,变成了分离头指针状态。我那天遇到的情况是,master 和 HEAD 指针看上去指在同一个 commit 上,但其实已经处在分离头指针状态。当我在此时又做了一次新的提交时,HEAD 指针跑到 master 指针前面去了。如果我直接检出 master 分支,HEAD 指针就会回退一格到 master 指针的位置,而最新的那次提交就变成了孤立的提交,没有任何分支能追踪到它,刚才的活白干了。

# 强制将 master 分支指向当前头指针的位置
$ git branch -f master HEAD
# 检出 master 分支
$ git checkout master

【Linux】打印机环境安装一

一、环境配置

 sudo apt-get update
 sudo apt-get upgrade
 sudo apt install cups  #公共UNIX打印系统

二、驱动安装

sudo apt-get install hplip

三、打印机安装

hp-setup -i #第一个选0,第二个按p
xiaobao@armbian:~/software/shareprint$ hp-setup -i

HP Linux Imaging and Printing System (ver. 3.23.12)
Printer/Fax Setup Utility ver. 9.0

Copyright (c) 2001-18 HP Development Company, LP
This software comes with ABSOLUTELY NO WARRANTY.
This is free software, and you are welcome to distribute it
under certain conditions. See COPYING file for more details.

(Note: Defaults for each question are maked with a '*'. Press <enter> to accept the default.)


--------------------------------
| SELECT CONNECTION (I/O) TYPE |
--------------------------------

  Num       Connection  Description
            Type
  --------  ----------  ----------------------------------------------------------
  0*        usb         Universal Serial Bus (USB)
  1         net         Network/Ethernet/Wireless (direct connection or JetDirect)

Enter number 0...1 for connection type (q=quit, enter=usb*) ? 0

Using connection type: usb

Setting up device: hp:/usb/DeskJet_1110_series?serial=CN75J28090069Z



---------------------
| PRINT QUEUE SETUP |
---------------------


Please enter a name for this print queue (m=use model name:'DeskJet_1110'*, q=quit) ?
Using queue name: DeskJet_1110
Locating PPD file... Please wait.

Found PPD file: hplip:0/ppd/hplip/HP/hp-deskjet_1110_series.ppd
Description:

Note: The model number may vary slightly from the actual model number on the device.

Does this PPD file appear to be the correct one (y=yes*, n=no, q=quit) ?
Enter a location description for this printer (q=quit) ?
Enter additonal information or notes for this printer (q=quit) ?

Adding print queue to CUPS:
Device URI: hp:/usb/DeskJet_1110_series?serial=CN75J28090069Z
Queue name: DeskJet_1110
PPD file: hplip:0/ppd/hplip/HP/hp-deskjet_1110_series.ppd
Location:
Information:


You do not have permission to add a printer. You need authentication.
Username: root
Password:


---------------------
| PRINTER TEST PAGE |
---------------------


Would you like to print a test page (y=yes*, n=no, q=quit) ? y

HP Linux Imaging and Printing System (ver. 3.23.12)
Testpage Print Utility ver. 6.0

Copyright (c) 2001-18 HP Development Company, LP
This software comes with ABSOLUTELY NO WARRANTY.
This is free software, and you are welcome to distribute it
under certain conditions. See COPYING file for more details.


HP Linux Imaging and Printing System (ver. 3.23.12)
System Tray Status Service ver. 2.0

Copyright (c) 2001-18 HP Development Company, LP
This software comes with ABSOLUTELY NO WARRANTY.
This is free software, and you are welcome to distribute it
under certain conditions. See COPYING file for more details.

warning: No display found.
error: hp-systray requires Qt4 GUI and DBus support. Exiting.
warning: Unable to connect to dbus. Is hp-systray running?
Printing test page to printer DeskJet_1110...
请求 ID 为 DeskJet_1110-1 (1 个文件)
Test page has been sent to printer.

note: If an error occured, or the test page failed to print, refer to the HPLIP website
note: at: http://hplip.sourceforge.net for troubleshooting and support.


Done.

Done.